iclient-mapboxgl.js 4.0 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043610446104561046610476104861049610506105161052610536105461055610566105761058610596106061061610626106361064610656106661067610686106961070610716107261073610746107561076610776107861079610806108161082610836108461085610866108761088610896109061091610926109361094610956109661097610986109961100611016110261103611046110561106611076110861109611106111161112611136111461115611166111761118611196112061121611226112361124611256112661127611286112961130611316113261133611346113561136611376113861139611406114161142611436114461145611466114761148611496115061151611526115361154611556115661157611586115961160611616116261163611646116561166611676116861169611706117161172611736117461175611766117761178611796118061181611826118361184611856118661187611886118961190611916119261193611946119561196611976119861199612006120161202612036120461205612066120761208612096121061211612126121361214612156121661217612186121961220612216122261223612246122561226612276122861229612306123161232612336123461235612366123761238612396124061241612426124361244612456124661247612486124961250612516125261253612546125561256612576125861259612606126161262612636126461265612666126761268612696127061271612726127361274612756127661277612786127961280612816128261283612846128561286612876128861289612906129161292612936129461295612966129761298612996130061301613026130361304613056130661307613086130961310613116131261313613146131561316613176131861319613206132161322613236132461325613266132761328613296133061331613326133361334613356133661337613386133961340613416134261343613446134561346613476134861349613506135161352613536135461355613566135761358613596136061361613626136361364613656136661367613686136961370613716137261373613746137561376613776137861379613806138161382613836138461385613866138761388613896139061391613926139361394613956139661397613986139961400614016140261403614046140561406614076140861409614106141161412614136141461415614166141761418614196142061421614226142361424614256142661427614286142961430614316143261433614346143561436614376143861439614406144161442614436144461445614466144761448614496145061451614526145361454614556145661457614586145961460614616146261463614646146561466614676146861469614706147161472614736147461475614766147761478614796148061481614826148361484614856148661487614886148961490614916149261493614946149561496614976149861499615006150161502615036150461505615066150761508615096151061511615126151361514615156151661517615186151961520615216152261523615246152561526615276152861529615306153161532615336153461535615366153761538615396154061541615426154361544615456154661547615486154961550615516155261553615546155561556615576155861559615606156161562615636156461565615666156761568615696157061571615726157361574615756157661577615786157961580615816158261583615846158561586615876158861589615906159161592615936159461595615966159761598615996160061601616026160361604616056160661607616086160961610616116161261613616146161561616616176161861619616206162161622616236162461625616266162761628616296163061631616326163361634616356163661637616386163961640616416164261643616446164561646616476164861649616506165161652616536165461655616566165761658616596166061661616626166361664616656166661667616686166961670616716167261673616746167561676616776167861679616806168161682616836168461685616866168761688616896169061691616926169361694616956169661697616986169961700617016170261703617046170561706617076170861709617106171161712617136171461715617166171761718617196172061721617226172361724617256172661727617286172961730617316173261733617346173561736617376173861739617406174161742617436174461745617466174761748617496175061751617526175361754617556175661757617586175961760617616176261763617646176561766617676176861769617706177161772617736177461775617766177761778617796178061781617826178361784617856178661787617886178961790617916179261793617946179561796617976179861799618006180161802618036180461805618066180761808618096181061811618126181361814618156181661817618186181961820618216182261823618246182561826618276182861829618306183161832618336183461835618366183761838618396184061841618426184361844618456184661847618486184961850618516185261853618546185561856618576185861859618606186161862618636186461865618666186761868618696187061871618726187361874618756187661877618786187961880618816188261883618846188561886618876188861889618906189161892618936189461895618966189761898618996190061901619026190361904619056190661907619086190961910619116191261913619146191561916619176191861919619206192161922619236192461925619266192761928619296193061931619326193361934619356193661937619386193961940619416194261943619446194561946619476194861949619506195161952619536195461955619566195761958619596196061961619626196361964619656196661967619686196961970619716197261973619746197561976619776197861979619806198161982619836198461985619866198761988619896199061991619926199361994619956199661997619986199962000620016200262003620046200562006620076200862009620106201162012620136201462015620166201762018620196202062021620226202362024620256202662027620286202962030620316203262033620346203562036620376203862039620406204162042620436204462045620466204762048620496205062051620526205362054620556205662057620586205962060620616206262063620646206562066620676206862069620706207162072620736207462075620766207762078620796208062081620826208362084620856208662087620886208962090620916209262093620946209562096620976209862099621006210162102621036210462105621066210762108621096211062111621126211362114621156211662117621186211962120621216212262123621246212562126621276212862129621306213162132621336213462135621366213762138621396214062141621426214362144621456214662147621486214962150621516215262153621546215562156621576215862159621606216162162621636216462165621666216762168621696217062171621726217362174621756217662177621786217962180621816218262183621846218562186621876218862189621906219162192621936219462195621966219762198621996220062201622026220362204622056220662207622086220962210622116221262213622146221562216622176221862219622206222162222622236222462225622266222762228622296223062231622326223362234622356223662237622386223962240622416224262243622446224562246622476224862249622506225162252622536225462255622566225762258622596226062261622626226362264622656226662267622686226962270622716227262273622746227562276622776227862279622806228162282622836228462285622866228762288622896229062291622926229362294622956229662297622986229962300623016230262303623046230562306623076230862309623106231162312623136231462315623166231762318623196232062321623226232362324623256232662327623286232962330623316233262333623346233562336623376233862339623406234162342623436234462345623466234762348623496235062351623526235362354623556235662357623586235962360623616236262363623646236562366623676236862369623706237162372623736237462375623766237762378623796238062381623826238362384623856238662387623886238962390623916239262393623946239562396623976239862399624006240162402624036240462405624066240762408624096241062411624126241362414624156241662417624186241962420624216242262423624246242562426624276242862429624306243162432624336243462435624366243762438624396244062441624426244362444624456244662447624486244962450624516245262453624546245562456624576245862459624606246162462624636246462465624666246762468624696247062471624726247362474624756247662477624786247962480624816248262483624846248562486624876248862489624906249162492624936249462495624966249762498624996250062501625026250362504625056250662507625086250962510625116251262513625146251562516625176251862519625206252162522625236252462525625266252762528625296253062531625326253362534625356253662537625386253962540625416254262543625446254562546625476254862549625506255162552625536255462555625566255762558625596256062561625626256362564625656256662567625686256962570625716257262573625746257562576625776257862579625806258162582625836258462585625866258762588625896259062591625926259362594625956259662597625986259962600626016260262603626046260562606626076260862609626106261162612626136261462615626166261762618626196262062621626226262362624626256262662627626286262962630626316263262633626346263562636626376263862639626406264162642626436264462645626466264762648626496265062651626526265362654626556265662657626586265962660626616266262663626646266562666626676266862669626706267162672626736267462675626766267762678626796268062681626826268362684626856268662687626886268962690626916269262693626946269562696626976269862699627006270162702627036270462705627066270762708627096271062711627126271362714627156271662717627186271962720627216272262723627246272562726627276272862729627306273162732627336273462735627366273762738627396274062741627426274362744627456274662747627486274962750627516275262753627546275562756627576275862759627606276162762627636276462765627666276762768627696277062771627726277362774627756277662777627786277962780627816278262783627846278562786627876278862789627906279162792627936279462795627966279762798627996280062801628026280362804628056280662807628086280962810628116281262813628146281562816628176281862819628206282162822628236282462825628266282762828628296283062831628326283362834628356283662837628386283962840628416284262843628446284562846628476284862849628506285162852628536285462855628566285762858628596286062861628626286362864628656286662867628686286962870628716287262873628746287562876628776287862879628806288162882628836288462885628866288762888628896289062891628926289362894628956289662897628986289962900629016290262903629046290562906629076290862909629106291162912629136291462915629166291762918629196292062921629226292362924629256292662927629286292962930629316293262933629346293562936629376293862939629406294162942629436294462945629466294762948629496295062951629526295362954629556295662957629586295962960629616296262963629646296562966629676296862969629706297162972629736297462975629766297762978629796298062981629826298362984629856298662987629886298962990629916299262993629946299562996629976299862999630006300163002630036300463005630066300763008630096301063011630126301363014630156301663017630186301963020630216302263023630246302563026630276302863029630306303163032630336303463035630366303763038630396304063041630426304363044630456304663047630486304963050630516305263053630546305563056630576305863059630606306163062630636306463065630666306763068630696307063071630726307363074630756307663077630786307963080630816308263083630846308563086630876308863089630906309163092630936309463095630966309763098630996310063101631026310363104631056310663107631086310963110631116311263113631146311563116631176311863119631206312163122631236312463125631266312763128631296313063131631326313363134631356313663137631386313963140631416314263143631446314563146631476314863149631506315163152631536315463155631566315763158631596316063161631626316363164631656316663167631686316963170631716317263173631746317563176631776317863179631806318163182631836318463185631866318763188631896319063191631926319363194631956319663197631986319963200632016320263203632046320563206632076320863209632106321163212632136321463215632166321763218632196322063221632226322363224632256322663227632286322963230632316323263233632346323563236632376323863239632406324163242632436324463245632466324763248632496325063251632526325363254632556325663257632586325963260632616326263263632646326563266632676326863269632706327163272632736327463275632766327763278632796328063281632826328363284632856328663287632886328963290632916329263293632946329563296632976329863299633006330163302633036330463305633066330763308633096331063311633126331363314633156331663317633186331963320633216332263323633246332563326633276332863329633306333163332633336333463335633366333763338633396334063341633426334363344633456334663347633486334963350633516335263353633546335563356633576335863359633606336163362633636336463365633666336763368633696337063371633726337363374633756337663377633786337963380633816338263383633846338563386633876338863389633906339163392633936339463395633966339763398633996340063401634026340363404634056340663407634086340963410634116341263413634146341563416634176341863419634206342163422634236342463425634266342763428634296343063431634326343363434634356343663437634386343963440634416344263443634446344563446634476344863449634506345163452634536345463455634566345763458634596346063461634626346363464634656346663467634686346963470634716347263473634746347563476634776347863479634806348163482634836348463485634866348763488634896349063491634926349363494634956349663497634986349963500635016350263503635046350563506635076350863509635106351163512635136351463515635166351763518635196352063521635226352363524635256352663527635286352963530635316353263533635346353563536635376353863539635406354163542635436354463545635466354763548635496355063551635526355363554635556355663557635586355963560635616356263563635646356563566635676356863569635706357163572635736357463575635766357763578635796358063581635826358363584635856358663587635886358963590635916359263593635946359563596635976359863599636006360163602636036360463605636066360763608636096361063611636126361363614636156361663617636186361963620636216362263623636246362563626636276362863629636306363163632636336363463635636366363763638636396364063641636426364363644636456364663647636486364963650636516365263653636546365563656636576365863659636606366163662636636366463665636666366763668636696367063671636726367363674636756367663677636786367963680636816368263683636846368563686636876368863689636906369163692636936369463695636966369763698636996370063701637026370363704637056370663707637086370963710637116371263713637146371563716637176371863719637206372163722637236372463725637266372763728637296373063731637326373363734637356373663737637386373963740637416374263743637446374563746637476374863749637506375163752637536375463755637566375763758637596376063761637626376363764637656376663767637686376963770637716377263773637746377563776637776377863779637806378163782637836378463785637866378763788637896379063791637926379363794637956379663797637986379963800638016380263803638046380563806638076380863809638106381163812638136381463815638166381763818638196382063821638226382363824638256382663827638286382963830638316383263833638346383563836638376383863839638406384163842638436384463845638466384763848638496385063851638526385363854638556385663857638586385963860638616386263863638646386563866638676386863869638706387163872638736387463875638766387763878638796388063881638826388363884638856388663887638886388963890638916389263893638946389563896638976389863899639006390163902639036390463905639066390763908639096391063911639126391363914639156391663917639186391963920639216392263923639246392563926639276392863929639306393163932639336393463935639366393763938639396394063941639426394363944639456394663947639486394963950639516395263953639546395563956639576395863959639606396163962639636396463965639666396763968639696397063971639726397363974639756397663977639786397963980639816398263983639846398563986639876398863989639906399163992639936399463995639966399763998639996400064001640026400364004640056400664007640086400964010640116401264013640146401564016640176401864019640206402164022640236402464025640266402764028640296403064031640326403364034640356403664037640386403964040640416404264043640446404564046640476404864049640506405164052640536405464055640566405764058640596406064061640626406364064640656406664067640686406964070640716407264073640746407564076640776407864079640806408164082640836408464085640866408764088640896409064091640926409364094640956409664097640986409964100641016410264103641046410564106641076410864109641106411164112641136411464115641166411764118641196412064121641226412364124641256412664127641286412964130641316413264133641346413564136641376413864139641406414164142641436414464145641466414764148641496415064151641526415364154641556415664157641586415964160641616416264163641646416564166641676416864169641706417164172641736417464175641766417764178641796418064181641826418364184641856418664187641886418964190641916419264193641946419564196641976419864199642006420164202642036420464205642066420764208642096421064211642126421364214642156421664217642186421964220642216422264223642246422564226642276422864229642306423164232642336423464235642366423764238642396424064241642426424364244642456424664247642486424964250642516425264253642546425564256642576425864259642606426164262642636426464265642666426764268642696427064271642726427364274642756427664277642786427964280642816428264283642846428564286642876428864289642906429164292642936429464295642966429764298642996430064301643026430364304643056430664307643086430964310643116431264313643146431564316643176431864319643206432164322643236432464325643266432764328643296433064331643326433364334643356433664337643386433964340643416434264343643446434564346643476434864349643506435164352643536435464355643566435764358643596436064361643626436364364643656436664367643686436964370643716437264373643746437564376643776437864379643806438164382643836438464385643866438764388643896439064391643926439364394643956439664397643986439964400644016440264403644046440564406644076440864409644106441164412644136441464415644166441764418644196442064421644226442364424644256442664427644286442964430644316443264433644346443564436644376443864439644406444164442644436444464445644466444764448644496445064451644526445364454644556445664457644586445964460644616446264463644646446564466644676446864469644706447164472644736447464475644766447764478644796448064481644826448364484644856448664487644886448964490644916449264493644946449564496644976449864499645006450164502645036450464505645066450764508645096451064511645126451364514645156451664517645186451964520645216452264523645246452564526645276452864529645306453164532645336453464535645366453764538645396454064541645426454364544645456454664547645486454964550645516455264553645546455564556645576455864559645606456164562645636456464565645666456764568645696457064571645726457364574645756457664577645786457964580645816458264583645846458564586645876458864589645906459164592645936459464595645966459764598645996460064601646026460364604646056460664607646086460964610646116461264613646146461564616646176461864619646206462164622646236462464625646266462764628646296463064631646326463364634646356463664637646386463964640646416464264643646446464564646646476464864649646506465164652646536465464655646566465764658646596466064661646626466364664646656466664667646686466964670646716467264673646746467564676646776467864679646806468164682646836468464685646866468764688646896469064691646926469364694646956469664697646986469964700647016470264703647046470564706647076470864709647106471164712647136471464715647166471764718647196472064721647226472364724647256472664727647286472964730647316473264733647346473564736647376473864739647406474164742647436474464745647466474764748647496475064751647526475364754647556475664757647586475964760647616476264763647646476564766647676476864769647706477164772647736477464775647766477764778647796478064781647826478364784647856478664787647886478964790647916479264793647946479564796647976479864799648006480164802648036480464805648066480764808648096481064811648126481364814648156481664817648186481964820648216482264823648246482564826648276482864829648306483164832648336483464835648366483764838648396484064841648426484364844648456484664847648486484964850648516485264853648546485564856648576485864859648606486164862648636486464865648666486764868648696487064871648726487364874648756487664877648786487964880648816488264883648846488564886648876488864889648906489164892648936489464895648966489764898648996490064901649026490364904649056490664907649086490964910649116491264913649146491564916649176491864919649206492164922649236492464925649266492764928649296493064931649326493364934649356493664937649386493964940649416494264943649446494564946649476494864949649506495164952649536495464955649566495764958649596496064961649626496364964649656496664967649686496964970649716497264973649746497564976649776497864979649806498164982649836498464985649866498764988649896499064991649926499364994649956499664997649986499965000650016500265003650046500565006650076500865009650106501165012650136501465015650166501765018650196502065021650226502365024650256502665027650286502965030650316503265033650346503565036650376503865039650406504165042650436504465045650466504765048650496505065051650526505365054650556505665057650586505965060650616506265063650646506565066650676506865069650706507165072650736507465075650766507765078650796508065081650826508365084650856508665087650886508965090650916509265093650946509565096650976509865099651006510165102651036510465105651066510765108651096511065111651126511365114651156511665117651186511965120651216512265123651246512565126651276512865129651306513165132651336513465135651366513765138651396514065141651426514365144651456514665147651486514965150651516515265153651546515565156651576515865159651606516165162651636516465165651666516765168651696517065171651726517365174651756517665177651786517965180651816518265183651846518565186651876518865189651906519165192651936519465195651966519765198651996520065201652026520365204652056520665207652086520965210652116521265213652146521565216652176521865219652206522165222652236522465225652266522765228652296523065231652326523365234652356523665237652386523965240652416524265243652446524565246652476524865249652506525165252652536525465255652566525765258652596526065261652626526365264652656526665267652686526965270652716527265273652746527565276652776527865279652806528165282652836528465285652866528765288652896529065291652926529365294652956529665297652986529965300653016530265303653046530565306653076530865309653106531165312653136531465315653166531765318653196532065321653226532365324653256532665327653286532965330653316533265333653346533565336653376533865339653406534165342653436534465345653466534765348653496535065351653526535365354653556535665357653586535965360653616536265363653646536565366653676536865369653706537165372653736537465375653766537765378653796538065381653826538365384653856538665387653886538965390653916539265393653946539565396653976539865399654006540165402654036540465405654066540765408654096541065411654126541365414654156541665417654186541965420654216542265423654246542565426654276542865429654306543165432654336543465435654366543765438654396544065441654426544365444654456544665447654486544965450654516545265453654546545565456654576545865459654606546165462654636546465465654666546765468654696547065471654726547365474654756547665477654786547965480654816548265483654846548565486654876548865489654906549165492654936549465495654966549765498654996550065501655026550365504655056550665507655086550965510655116551265513655146551565516655176551865519655206552165522655236552465525655266552765528655296553065531655326553365534655356553665537655386553965540655416554265543655446554565546655476554865549655506555165552655536555465555655566555765558655596556065561655626556365564655656556665567655686556965570655716557265573655746557565576655776557865579655806558165582655836558465585655866558765588655896559065591655926559365594655956559665597655986559965600656016560265603656046560565606656076560865609656106561165612656136561465615656166561765618656196562065621656226562365624656256562665627656286562965630656316563265633656346563565636656376563865639656406564165642656436564465645656466564765648656496565065651656526565365654656556565665657656586565965660656616566265663656646566565666656676566865669656706567165672656736567465675656766567765678656796568065681656826568365684656856568665687656886568965690656916569265693656946569565696656976569865699657006570165702657036570465705657066570765708657096571065711657126571365714657156571665717657186571965720657216572265723657246572565726657276572865729657306573165732657336573465735657366573765738657396574065741657426574365744657456574665747657486574965750657516575265753657546575565756657576575865759657606576165762657636576465765657666576765768657696577065771657726577365774657756577665777657786577965780657816578265783657846578565786657876578865789657906579165792657936579465795657966579765798657996580065801658026580365804658056580665807658086580965810658116581265813658146581565816658176581865819658206582165822658236582465825658266582765828658296583065831658326583365834658356583665837658386583965840658416584265843658446584565846658476584865849658506585165852658536585465855658566585765858658596586065861658626586365864658656586665867658686586965870658716587265873658746587565876658776587865879658806588165882658836588465885658866588765888658896589065891658926589365894658956589665897658986589965900659016590265903659046590565906659076590865909659106591165912659136591465915659166591765918659196592065921659226592365924659256592665927659286592965930659316593265933659346593565936659376593865939659406594165942659436594465945659466594765948659496595065951659526595365954659556595665957659586595965960659616596265963659646596565966659676596865969659706597165972659736597465975659766597765978659796598065981659826598365984659856598665987659886598965990659916599265993659946599565996659976599865999660006600166002660036600466005660066600766008660096601066011660126601366014660156601666017660186601966020660216602266023660246602566026660276602866029660306603166032660336603466035660366603766038660396604066041660426604366044660456604666047660486604966050660516605266053660546605566056660576605866059660606606166062660636606466065660666606766068660696607066071660726607366074660756607666077660786607966080660816608266083660846608566086660876608866089660906609166092660936609466095660966609766098660996610066101661026610366104661056610666107661086610966110661116611266113661146611566116661176611866119661206612166122661236612466125661266612766128661296613066131661326613366134661356613666137661386613966140661416614266143661446614566146661476614866149661506615166152661536615466155661566615766158661596616066161661626616366164661656616666167661686616966170661716617266173661746617566176661776617866179661806618166182661836618466185661866618766188661896619066191661926619366194661956619666197661986619966200662016620266203662046620566206662076620866209662106621166212662136621466215662166621766218662196622066221662226622366224662256622666227662286622966230662316623266233662346623566236662376623866239662406624166242662436624466245662466624766248662496625066251662526625366254662556625666257662586625966260662616626266263662646626566266662676626866269662706627166272662736627466275662766627766278662796628066281662826628366284662856628666287662886628966290662916629266293662946629566296662976629866299663006630166302663036630466305663066630766308663096631066311663126631366314663156631666317663186631966320663216632266323663246632566326663276632866329663306633166332663336633466335663366633766338663396634066341663426634366344663456634666347663486634966350663516635266353663546635566356663576635866359663606636166362663636636466365663666636766368663696637066371663726637366374663756637666377663786637966380663816638266383663846638566386663876638866389663906639166392663936639466395663966639766398663996640066401664026640366404664056640666407664086640966410664116641266413664146641566416664176641866419664206642166422664236642466425664266642766428664296643066431664326643366434664356643666437664386643966440664416644266443664446644566446664476644866449664506645166452664536645466455664566645766458664596646066461664626646366464664656646666467664686646966470664716647266473664746647566476664776647866479664806648166482664836648466485664866648766488664896649066491664926649366494664956649666497664986649966500665016650266503665046650566506665076650866509665106651166512665136651466515665166651766518665196652066521665226652366524665256652666527665286652966530665316653266533665346653566536665376653866539665406654166542665436654466545665466654766548665496655066551665526655366554665556655666557665586655966560665616656266563665646656566566665676656866569665706657166572665736657466575665766657766578665796658066581665826658366584665856658666587665886658966590665916659266593665946659566596665976659866599666006660166602666036660466605666066660766608666096661066611666126661366614666156661666617666186661966620666216662266623666246662566626666276662866629666306663166632666336663466635666366663766638666396664066641666426664366644666456664666647666486664966650666516665266653666546665566656666576665866659666606666166662666636666466665666666666766668666696667066671666726667366674666756667666677666786667966680666816668266683666846668566686666876668866689666906669166692666936669466695666966669766698666996670066701667026670366704667056670666707667086670966710667116671266713667146671566716667176671866719667206672166722667236672466725667266672766728667296673066731667326673366734667356673666737667386673966740667416674266743667446674566746667476674866749667506675166752667536675466755667566675766758667596676066761667626676366764667656676666767667686676966770667716677266773667746677566776667776677866779667806678166782667836678466785667866678766788667896679066791667926679366794667956679666797667986679966800668016680266803668046680566806668076680866809668106681166812668136681466815668166681766818668196682066821668226682366824668256682666827668286682966830668316683266833668346683566836668376683866839668406684166842668436684466845668466684766848668496685066851668526685366854668556685666857668586685966860668616686266863668646686566866668676686866869668706687166872668736687466875668766687766878668796688066881668826688366884668856688666887668886688966890668916689266893668946689566896668976689866899669006690166902669036690466905669066690766908669096691066911669126691366914669156691666917669186691966920669216692266923669246692566926669276692866929669306693166932669336693466935669366693766938669396694066941669426694366944669456694666947669486694966950669516695266953669546695566956669576695866959669606696166962669636696466965669666696766968669696697066971669726697366974669756697666977669786697966980669816698266983669846698566986669876698866989669906699166992669936699466995669966699766998669996700067001670026700367004670056700667007670086700967010670116701267013670146701567016670176701867019670206702167022670236702467025670266702767028670296703067031670326703367034670356703667037670386703967040670416704267043670446704567046670476704867049670506705167052670536705467055670566705767058670596706067061670626706367064670656706667067670686706967070670716707267073670746707567076670776707867079670806708167082670836708467085670866708767088670896709067091670926709367094670956709667097670986709967100671016710267103671046710567106671076710867109671106711167112671136711467115671166711767118671196712067121671226712367124671256712667127671286712967130671316713267133671346713567136671376713867139671406714167142671436714467145671466714767148671496715067151671526715367154671556715667157671586715967160671616716267163671646716567166671676716867169671706717167172671736717467175671766717767178671796718067181671826718367184671856718667187671886718967190671916719267193671946719567196671976719867199672006720167202672036720467205672066720767208672096721067211672126721367214672156721667217672186721967220672216722267223672246722567226672276722867229672306723167232672336723467235672366723767238672396724067241672426724367244672456724667247672486724967250672516725267253672546725567256672576725867259672606726167262672636726467265672666726767268672696727067271672726727367274672756727667277672786727967280672816728267283672846728567286672876728867289672906729167292672936729467295672966729767298672996730067301673026730367304673056730667307673086730967310673116731267313673146731567316673176731867319673206732167322673236732467325673266732767328673296733067331673326733367334673356733667337673386733967340673416734267343673446734567346673476734867349673506735167352673536735467355673566735767358673596736067361673626736367364673656736667367673686736967370673716737267373673746737567376673776737867379673806738167382673836738467385673866738767388673896739067391673926739367394673956739667397673986739967400674016740267403674046740567406674076740867409674106741167412674136741467415674166741767418674196742067421674226742367424674256742667427674286742967430674316743267433674346743567436674376743867439674406744167442674436744467445674466744767448674496745067451674526745367454674556745667457674586745967460674616746267463674646746567466674676746867469674706747167472674736747467475674766747767478674796748067481674826748367484674856748667487674886748967490674916749267493674946749567496674976749867499675006750167502675036750467505675066750767508675096751067511675126751367514675156751667517675186751967520675216752267523675246752567526675276752867529675306753167532675336753467535675366753767538675396754067541675426754367544675456754667547675486754967550675516755267553675546755567556675576755867559675606756167562675636756467565675666756767568675696757067571675726757367574675756757667577675786757967580675816758267583675846758567586675876758867589675906759167592675936759467595675966759767598675996760067601676026760367604676056760667607676086760967610676116761267613676146761567616676176761867619676206762167622676236762467625676266762767628676296763067631676326763367634676356763667637676386763967640676416764267643676446764567646676476764867649676506765167652676536765467655676566765767658676596766067661676626766367664676656766667667676686766967670676716767267673676746767567676676776767867679676806768167682676836768467685676866768767688676896769067691676926769367694676956769667697676986769967700677016770267703677046770567706677076770867709677106771167712677136771467715677166771767718677196772067721677226772367724677256772667727677286772967730677316773267733677346773567736677376773867739677406774167742677436774467745677466774767748677496775067751677526775367754677556775667757677586775967760677616776267763677646776567766677676776867769677706777167772677736777467775677766777767778677796778067781677826778367784677856778667787677886778967790677916779267793677946779567796677976779867799678006780167802678036780467805678066780767808678096781067811678126781367814678156781667817678186781967820678216782267823678246782567826678276782867829678306783167832678336783467835678366783767838678396784067841678426784367844678456784667847678486784967850678516785267853678546785567856678576785867859678606786167862678636786467865678666786767868678696787067871678726787367874678756787667877678786787967880678816788267883678846788567886678876788867889678906789167892678936789467895678966789767898678996790067901679026790367904679056790667907679086790967910679116791267913679146791567916679176791867919679206792167922679236792467925679266792767928679296793067931679326793367934679356793667937679386793967940679416794267943679446794567946679476794867949679506795167952679536795467955679566795767958679596796067961679626796367964679656796667967679686796967970679716797267973679746797567976679776797867979679806798167982679836798467985679866798767988679896799067991679926799367994679956799667997679986799968000680016800268003680046800568006680076800868009680106801168012680136801468015680166801768018680196802068021680226802368024680256802668027680286802968030680316803268033680346803568036680376803868039680406804168042680436804468045680466804768048680496805068051680526805368054680556805668057680586805968060680616806268063680646806568066680676806868069680706807168072680736807468075680766807768078680796808068081680826808368084680856808668087680886808968090680916809268093680946809568096680976809868099681006810168102681036810468105681066810768108681096811068111681126811368114681156811668117681186811968120681216812268123681246812568126681276812868129681306813168132681336813468135681366813768138681396814068141681426814368144681456814668147681486814968150681516815268153681546815568156681576815868159681606816168162681636816468165681666816768168681696817068171681726817368174681756817668177681786817968180681816818268183681846818568186681876818868189681906819168192681936819468195681966819768198681996820068201682026820368204682056820668207682086820968210682116821268213682146821568216682176821868219682206822168222682236822468225682266822768228682296823068231682326823368234682356823668237682386823968240682416824268243682446824568246682476824868249682506825168252682536825468255682566825768258682596826068261682626826368264682656826668267682686826968270682716827268273682746827568276682776827868279682806828168282682836828468285682866828768288682896829068291682926829368294682956829668297682986829968300683016830268303683046830568306683076830868309683106831168312683136831468315683166831768318683196832068321683226832368324683256832668327683286832968330683316833268333683346833568336683376833868339683406834168342683436834468345683466834768348683496835068351683526835368354683556835668357683586835968360683616836268363683646836568366683676836868369683706837168372683736837468375683766837768378683796838068381683826838368384683856838668387683886838968390683916839268393683946839568396683976839868399684006840168402684036840468405684066840768408684096841068411684126841368414684156841668417684186841968420684216842268423684246842568426684276842868429684306843168432684336843468435684366843768438684396844068441684426844368444684456844668447684486844968450684516845268453684546845568456684576845868459684606846168462684636846468465684666846768468684696847068471684726847368474684756847668477684786847968480684816848268483684846848568486684876848868489684906849168492684936849468495684966849768498684996850068501685026850368504685056850668507685086850968510685116851268513685146851568516685176851868519685206852168522685236852468525685266852768528685296853068531685326853368534685356853668537685386853968540685416854268543685446854568546685476854868549685506855168552685536855468555685566855768558685596856068561685626856368564685656856668567685686856968570685716857268573685746857568576685776857868579685806858168582685836858468585685866858768588685896859068591685926859368594685956859668597685986859968600686016860268603686046860568606686076860868609686106861168612686136861468615686166861768618686196862068621686226862368624686256862668627686286862968630686316863268633686346863568636686376863868639686406864168642686436864468645686466864768648686496865068651686526865368654686556865668657686586865968660686616866268663686646866568666686676866868669686706867168672686736867468675686766867768678686796868068681686826868368684686856868668687686886868968690686916869268693686946869568696686976869868699687006870168702687036870468705687066870768708687096871068711687126871368714687156871668717687186871968720687216872268723687246872568726687276872868729687306873168732687336873468735687366873768738687396874068741687426874368744687456874668747687486874968750687516875268753687546875568756687576875868759687606876168762687636876468765687666876768768687696877068771687726877368774687756877668777687786877968780687816878268783687846878568786687876878868789687906879168792687936879468795687966879768798687996880068801688026880368804688056880668807688086880968810688116881268813688146881568816688176881868819688206882168822688236882468825688266882768828688296883068831688326883368834688356883668837688386883968840688416884268843688446884568846688476884868849688506885168852688536885468855688566885768858688596886068861688626886368864688656886668867688686886968870688716887268873688746887568876688776887868879688806888168882688836888468885688866888768888688896889068891688926889368894688956889668897688986889968900689016890268903689046890568906689076890868909689106891168912689136891468915689166891768918689196892068921689226892368924689256892668927689286892968930689316893268933689346893568936689376893868939689406894168942689436894468945689466894768948689496895068951689526895368954689556895668957689586895968960689616896268963689646896568966689676896868969689706897168972689736897468975689766897768978689796898068981689826898368984689856898668987689886898968990689916899268993689946899568996689976899868999690006900169002690036900469005690066900769008690096901069011690126901369014690156901669017690186901969020690216902269023690246902569026690276902869029690306903169032690336903469035690366903769038690396904069041690426904369044690456904669047690486904969050690516905269053690546905569056690576905869059690606906169062690636906469065690666906769068690696907069071690726907369074690756907669077690786907969080690816908269083690846908569086690876908869089690906909169092690936909469095690966909769098690996910069101691026910369104691056910669107691086910969110691116911269113691146911569116691176911869119691206912169122691236912469125691266912769128691296913069131691326913369134691356913669137691386913969140691416914269143691446914569146691476914869149691506915169152691536915469155691566915769158691596916069161691626916369164691656916669167691686916969170691716917269173691746917569176691776917869179691806918169182691836918469185691866918769188691896919069191691926919369194691956919669197691986919969200692016920269203692046920569206692076920869209692106921169212692136921469215692166921769218692196922069221692226922369224692256922669227692286922969230692316923269233692346923569236692376923869239692406924169242692436924469245692466924769248692496925069251692526925369254692556925669257692586925969260692616926269263692646926569266692676926869269692706927169272692736927469275692766927769278692796928069281692826928369284692856928669287692886928969290692916929269293692946929569296692976929869299693006930169302693036930469305693066930769308693096931069311693126931369314693156931669317693186931969320693216932269323693246932569326693276932869329693306933169332693336933469335693366933769338693396934069341693426934369344693456934669347693486934969350693516935269353693546935569356693576935869359693606936169362693636936469365693666936769368693696937069371693726937369374693756937669377693786937969380693816938269383693846938569386693876938869389693906939169392693936939469395693966939769398693996940069401694026940369404694056940669407694086940969410694116941269413694146941569416694176941869419694206942169422694236942469425694266942769428694296943069431694326943369434694356943669437694386943969440694416944269443694446944569446694476944869449694506945169452694536945469455694566945769458694596946069461694626946369464694656946669467694686946969470694716947269473694746947569476694776947869479694806948169482694836948469485694866948769488694896949069491694926949369494694956949669497694986949969500695016950269503695046950569506695076950869509695106951169512695136951469515695166951769518695196952069521695226952369524695256952669527695286952969530695316953269533695346953569536695376953869539695406954169542695436954469545695466954769548695496955069551695526955369554695556955669557695586955969560695616956269563695646956569566695676956869569695706957169572695736957469575695766957769578695796958069581695826958369584695856958669587695886958969590695916959269593695946959569596695976959869599696006960169602696036960469605696066960769608696096961069611696126961369614696156961669617696186961969620696216962269623696246962569626696276962869629696306963169632696336963469635696366963769638696396964069641696426964369644696456964669647696486964969650696516965269653696546965569656696576965869659696606966169662696636966469665696666966769668696696967069671696726967369674696756967669677696786967969680696816968269683696846968569686696876968869689696906969169692696936969469695696966969769698696996970069701697026970369704697056970669707697086970969710697116971269713697146971569716697176971869719697206972169722697236972469725697266972769728697296973069731697326973369734697356973669737697386973969740697416974269743697446974569746697476974869749697506975169752697536975469755697566975769758697596976069761697626976369764697656976669767697686976969770697716977269773697746977569776697776977869779697806978169782697836978469785697866978769788697896979069791697926979369794697956979669797697986979969800698016980269803698046980569806698076980869809698106981169812698136981469815698166981769818698196982069821698226982369824698256982669827698286982969830698316983269833698346983569836698376983869839698406984169842698436984469845698466984769848698496985069851698526985369854698556985669857698586985969860698616986269863698646986569866698676986869869698706987169872698736987469875698766987769878698796988069881698826988369884698856988669887698886988969890698916989269893698946989569896698976989869899699006990169902699036990469905699066990769908699096991069911699126991369914699156991669917699186991969920699216992269923699246992569926699276992869929699306993169932699336993469935699366993769938699396994069941699426994369944699456994669947699486994969950699516995269953699546995569956699576995869959699606996169962699636996469965699666996769968699696997069971699726997369974699756997669977699786997969980699816998269983699846998569986699876998869989699906999169992699936999469995699966999769998699997000070001700027000370004700057000670007700087000970010700117001270013700147001570016700177001870019700207002170022700237002470025700267002770028700297003070031700327003370034700357003670037700387003970040700417004270043700447004570046700477004870049700507005170052700537005470055700567005770058700597006070061700627006370064700657006670067700687006970070700717007270073700747007570076700777007870079700807008170082700837008470085700867008770088700897009070091700927009370094700957009670097700987009970100701017010270103701047010570106701077010870109701107011170112701137011470115701167011770118701197012070121701227012370124701257012670127701287012970130701317013270133701347013570136701377013870139701407014170142701437014470145701467014770148701497015070151701527015370154701557015670157701587015970160701617016270163701647016570166701677016870169701707017170172701737017470175701767017770178701797018070181701827018370184701857018670187701887018970190701917019270193701947019570196701977019870199702007020170202702037020470205702067020770208702097021070211702127021370214702157021670217702187021970220702217022270223702247022570226702277022870229702307023170232702337023470235702367023770238702397024070241702427024370244702457024670247702487024970250702517025270253702547025570256702577025870259702607026170262702637026470265702667026770268702697027070271702727027370274702757027670277702787027970280702817028270283702847028570286702877028870289702907029170292702937029470295702967029770298702997030070301703027030370304703057030670307703087030970310703117031270313703147031570316703177031870319703207032170322703237032470325703267032770328703297033070331703327033370334703357033670337703387033970340703417034270343703447034570346703477034870349703507035170352703537035470355703567035770358703597036070361703627036370364703657036670367703687036970370703717037270373703747037570376703777037870379703807038170382703837038470385703867038770388703897039070391703927039370394703957039670397703987039970400704017040270403704047040570406704077040870409704107041170412704137041470415704167041770418704197042070421704227042370424704257042670427704287042970430704317043270433704347043570436704377043870439704407044170442704437044470445704467044770448704497045070451704527045370454704557045670457704587045970460704617046270463704647046570466704677046870469704707047170472704737047470475704767047770478704797048070481704827048370484704857048670487704887048970490704917049270493704947049570496704977049870499705007050170502705037050470505705067050770508705097051070511705127051370514705157051670517705187051970520705217052270523705247052570526705277052870529705307053170532705337053470535705367053770538705397054070541705427054370544705457054670547705487054970550705517055270553705547055570556705577055870559705607056170562705637056470565705667056770568705697057070571705727057370574705757057670577705787057970580705817058270583705847058570586705877058870589705907059170592705937059470595705967059770598705997060070601706027060370604706057060670607706087060970610706117061270613706147061570616706177061870619706207062170622706237062470625706267062770628706297063070631706327063370634706357063670637706387063970640706417064270643706447064570646706477064870649706507065170652706537065470655706567065770658706597066070661706627066370664706657066670667706687066970670706717067270673706747067570676706777067870679706807068170682706837068470685706867068770688706897069070691706927069370694706957069670697706987069970700707017070270703707047070570706707077070870709707107071170712707137071470715707167071770718707197072070721707227072370724707257072670727707287072970730707317073270733707347073570736707377073870739707407074170742707437074470745707467074770748707497075070751707527075370754707557075670757707587075970760707617076270763707647076570766707677076870769707707077170772707737077470775707767077770778707797078070781707827078370784707857078670787707887078970790707917079270793707947079570796707977079870799708007080170802708037080470805708067080770808708097081070811708127081370814708157081670817708187081970820708217082270823708247082570826708277082870829708307083170832708337083470835708367083770838708397084070841708427084370844708457084670847708487084970850708517085270853708547085570856708577085870859708607086170862708637086470865708667086770868708697087070871708727087370874708757087670877708787087970880708817088270883708847088570886708877088870889708907089170892708937089470895708967089770898708997090070901709027090370904709057090670907709087090970910709117091270913709147091570916709177091870919709207092170922709237092470925709267092770928709297093070931709327093370934709357093670937709387093970940709417094270943709447094570946709477094870949709507095170952709537095470955709567095770958709597096070961709627096370964709657096670967709687096970970709717097270973709747097570976709777097870979709807098170982709837098470985709867098770988709897099070991709927099370994709957099670997709987099971000710017100271003710047100571006710077100871009710107101171012710137101471015710167101771018710197102071021710227102371024710257102671027710287102971030710317103271033710347103571036710377103871039710407104171042710437104471045710467104771048710497105071051710527105371054710557105671057710587105971060710617106271063710647106571066710677106871069710707107171072710737107471075710767107771078710797108071081710827108371084710857108671087710887108971090710917109271093710947109571096710977109871099711007110171102711037110471105711067110771108711097111071111711127111371114711157111671117711187111971120711217112271123711247112571126711277112871129711307113171132711337113471135711367113771138711397114071141711427114371144711457114671147711487114971150711517115271153711547115571156711577115871159711607116171162711637116471165711667116771168711697117071171711727117371174711757117671177711787117971180711817118271183711847118571186711877118871189711907119171192711937119471195711967119771198711997120071201712027120371204712057120671207712087120971210712117121271213712147121571216712177121871219712207122171222712237122471225712267122771228712297123071231712327123371234712357123671237712387123971240712417124271243712447124571246712477124871249712507125171252712537125471255712567125771258712597126071261712627126371264712657126671267712687126971270712717127271273712747127571276712777127871279712807128171282712837128471285712867128771288712897129071291712927129371294712957129671297712987129971300713017130271303713047130571306713077130871309713107131171312713137131471315713167131771318713197132071321713227132371324713257132671327713287132971330713317133271333713347133571336713377133871339713407134171342713437134471345713467134771348713497135071351713527135371354713557135671357713587135971360713617136271363713647136571366713677136871369713707137171372713737137471375713767137771378713797138071381713827138371384713857138671387713887138971390713917139271393713947139571396713977139871399714007140171402714037140471405714067140771408714097141071411714127141371414714157141671417714187141971420714217142271423714247142571426714277142871429714307143171432714337143471435714367143771438714397144071441714427144371444714457144671447714487144971450714517145271453714547145571456714577145871459714607146171462714637146471465714667146771468714697147071471714727147371474714757147671477714787147971480714817148271483714847148571486714877148871489714907149171492714937149471495714967149771498714997150071501715027150371504715057150671507715087150971510715117151271513715147151571516715177151871519715207152171522715237152471525715267152771528715297153071531715327153371534715357153671537715387153971540715417154271543715447154571546715477154871549715507155171552715537155471555715567155771558715597156071561715627156371564715657156671567715687156971570715717157271573715747157571576715777157871579715807158171582715837158471585715867158771588715897159071591715927159371594715957159671597715987159971600716017160271603716047160571606716077160871609716107161171612716137161471615716167161771618716197162071621716227162371624716257162671627716287162971630716317163271633716347163571636716377163871639716407164171642716437164471645716467164771648716497165071651716527165371654716557165671657716587165971660716617166271663716647166571666716677166871669716707167171672716737167471675716767167771678716797168071681716827168371684716857168671687716887168971690716917169271693716947169571696716977169871699717007170171702717037170471705717067170771708717097171071711717127171371714717157171671717717187171971720717217172271723717247172571726717277172871729717307173171732717337173471735717367173771738717397174071741717427174371744717457174671747717487174971750717517175271753717547175571756717577175871759717607176171762717637176471765717667176771768717697177071771717727177371774717757177671777717787177971780717817178271783717847178571786717877178871789717907179171792717937179471795717967179771798717997180071801718027180371804718057180671807718087180971810718117181271813718147181571816718177181871819718207182171822718237182471825718267182771828718297183071831718327183371834718357183671837718387183971840718417184271843718447184571846718477184871849718507185171852718537185471855718567185771858718597186071861718627186371864718657186671867718687186971870718717187271873718747187571876718777187871879718807188171882718837188471885718867188771888718897189071891718927189371894718957189671897718987189971900719017190271903719047190571906719077190871909719107191171912719137191471915719167191771918719197192071921719227192371924719257192671927719287192971930719317193271933719347193571936719377193871939719407194171942719437194471945719467194771948719497195071951719527195371954719557195671957719587195971960719617196271963719647196571966719677196871969719707197171972719737197471975719767197771978719797198071981719827198371984719857198671987719887198971990719917199271993719947199571996719977199871999720007200172002720037200472005720067200772008720097201072011720127201372014720157201672017720187201972020720217202272023720247202572026720277202872029720307203172032720337203472035720367203772038720397204072041720427204372044720457204672047720487204972050720517205272053720547205572056720577205872059720607206172062720637206472065720667206772068720697207072071720727207372074720757207672077720787207972080720817208272083720847208572086720877208872089720907209172092720937209472095720967209772098720997210072101721027210372104721057210672107721087210972110721117211272113721147211572116721177211872119721207212172122721237212472125721267212772128721297213072131721327213372134721357213672137721387213972140721417214272143721447214572146721477214872149721507215172152721537215472155721567215772158721597216072161721627216372164721657216672167721687216972170721717217272173721747217572176721777217872179721807218172182721837218472185721867218772188721897219072191721927219372194721957219672197721987219972200722017220272203722047220572206722077220872209722107221172212722137221472215722167221772218722197222072221722227222372224722257222672227722287222972230722317223272233722347223572236722377223872239722407224172242722437224472245722467224772248722497225072251722527225372254722557225672257722587225972260722617226272263722647226572266722677226872269722707227172272722737227472275722767227772278722797228072281722827228372284722857228672287722887228972290722917229272293722947229572296722977229872299723007230172302723037230472305723067230772308723097231072311723127231372314723157231672317723187231972320723217232272323723247232572326723277232872329723307233172332723337233472335723367233772338723397234072341723427234372344723457234672347723487234972350723517235272353723547235572356723577235872359723607236172362723637236472365723667236772368723697237072371723727237372374723757237672377723787237972380723817238272383723847238572386723877238872389723907239172392723937239472395723967239772398723997240072401724027240372404724057240672407724087240972410724117241272413724147241572416724177241872419724207242172422724237242472425724267242772428724297243072431724327243372434724357243672437724387243972440724417244272443724447244572446724477244872449724507245172452724537245472455724567245772458724597246072461724627246372464724657246672467724687246972470724717247272473724747247572476724777247872479724807248172482724837248472485724867248772488724897249072491724927249372494724957249672497724987249972500725017250272503725047250572506725077250872509725107251172512725137251472515725167251772518725197252072521725227252372524725257252672527725287252972530725317253272533725347253572536725377253872539725407254172542725437254472545725467254772548725497255072551725527255372554725557255672557725587255972560725617256272563725647256572566725677256872569725707257172572725737257472575725767257772578725797258072581725827258372584725857258672587725887258972590725917259272593725947259572596725977259872599726007260172602726037260472605726067260772608726097261072611726127261372614726157261672617726187261972620726217262272623726247262572626726277262872629726307263172632726337263472635726367263772638726397264072641726427264372644726457264672647726487264972650726517265272653726547265572656726577265872659726607266172662726637266472665726667266772668726697267072671726727267372674726757267672677726787267972680726817268272683726847268572686726877268872689726907269172692726937269472695726967269772698726997270072701727027270372704727057270672707727087270972710727117271272713727147271572716727177271872719727207272172722727237272472725727267272772728727297273072731727327273372734727357273672737727387273972740727417274272743727447274572746727477274872749727507275172752727537275472755727567275772758727597276072761727627276372764727657276672767727687276972770727717277272773727747277572776727777277872779727807278172782727837278472785727867278772788727897279072791727927279372794727957279672797727987279972800728017280272803728047280572806728077280872809728107281172812728137281472815728167281772818728197282072821728227282372824728257282672827728287282972830728317283272833728347283572836728377283872839728407284172842728437284472845728467284772848728497285072851728527285372854728557285672857728587285972860728617286272863728647286572866728677286872869728707287172872728737287472875728767287772878728797288072881728827288372884728857288672887728887288972890728917289272893728947289572896728977289872899729007290172902729037290472905729067290772908729097291072911729127291372914729157291672917729187291972920729217292272923729247292572926729277292872929729307293172932729337293472935729367293772938729397294072941729427294372944729457294672947729487294972950729517295272953729547295572956729577295872959729607296172962729637296472965729667296772968729697297072971729727297372974729757297672977729787297972980729817298272983729847298572986729877298872989729907299172992729937299472995729967299772998729997300073001730027300373004730057300673007730087300973010730117301273013730147301573016730177301873019730207302173022730237302473025730267302773028730297303073031730327303373034730357303673037730387303973040730417304273043730447304573046730477304873049730507305173052730537305473055730567305773058730597306073061730627306373064730657306673067730687306973070730717307273073730747307573076730777307873079730807308173082730837308473085730867308773088730897309073091730927309373094730957309673097730987309973100731017310273103731047310573106731077310873109731107311173112731137311473115731167311773118731197312073121731227312373124731257312673127731287312973130731317313273133731347313573136731377313873139731407314173142731437314473145731467314773148731497315073151731527315373154731557315673157731587315973160731617316273163731647316573166731677316873169731707317173172731737317473175731767317773178731797318073181731827318373184731857318673187731887318973190731917319273193731947319573196731977319873199732007320173202732037320473205732067320773208732097321073211732127321373214732157321673217732187321973220732217322273223732247322573226732277322873229732307323173232732337323473235732367323773238732397324073241732427324373244732457324673247732487324973250732517325273253732547325573256732577325873259732607326173262732637326473265732667326773268732697327073271732727327373274732757327673277732787327973280732817328273283732847328573286732877328873289732907329173292732937329473295732967329773298732997330073301733027330373304733057330673307733087330973310733117331273313733147331573316733177331873319733207332173322733237332473325733267332773328733297333073331733327333373334733357333673337733387333973340733417334273343733447334573346733477334873349733507335173352733537335473355733567335773358733597336073361733627336373364733657336673367733687336973370733717337273373733747337573376733777337873379733807338173382733837338473385733867338773388733897339073391733927339373394733957339673397733987339973400734017340273403734047340573406734077340873409734107341173412734137341473415734167341773418734197342073421734227342373424734257342673427734287342973430734317343273433734347343573436734377343873439734407344173442734437344473445734467344773448734497345073451734527345373454734557345673457734587345973460734617346273463734647346573466734677346873469734707347173472734737347473475734767347773478734797348073481734827348373484734857348673487734887348973490734917349273493734947349573496734977349873499735007350173502735037350473505735067350773508735097351073511735127351373514735157351673517735187351973520735217352273523735247352573526735277352873529735307353173532735337353473535735367353773538735397354073541735427354373544735457354673547735487354973550735517355273553735547355573556735577355873559735607356173562735637356473565735667356773568735697357073571735727357373574735757357673577735787357973580735817358273583735847358573586735877358873589735907359173592735937359473595735967359773598735997360073601736027360373604736057360673607736087360973610736117361273613736147361573616736177361873619736207362173622736237362473625736267362773628736297363073631736327363373634736357363673637736387363973640736417364273643736447364573646736477364873649736507365173652736537365473655736567365773658736597366073661736627366373664736657366673667736687366973670736717367273673736747367573676736777367873679736807368173682736837368473685736867368773688736897369073691736927369373694736957369673697736987369973700737017370273703737047370573706737077370873709737107371173712737137371473715737167371773718737197372073721737227372373724737257372673727737287372973730737317373273733737347373573736737377373873739737407374173742737437374473745737467374773748737497375073751737527375373754737557375673757737587375973760737617376273763737647376573766737677376873769737707377173772737737377473775737767377773778737797378073781737827378373784737857378673787737887378973790737917379273793737947379573796737977379873799738007380173802738037380473805738067380773808738097381073811738127381373814738157381673817738187381973820738217382273823738247382573826738277382873829738307383173832738337383473835738367383773838738397384073841738427384373844738457384673847738487384973850738517385273853738547385573856738577385873859738607386173862738637386473865738667386773868738697387073871738727387373874738757387673877738787387973880738817388273883738847388573886738877388873889738907389173892738937389473895738967389773898738997390073901739027390373904739057390673907739087390973910739117391273913739147391573916739177391873919739207392173922739237392473925739267392773928739297393073931739327393373934739357393673937739387393973940739417394273943739447394573946739477394873949739507395173952739537395473955739567395773958739597396073961739627396373964739657396673967739687396973970739717397273973739747397573976739777397873979739807398173982739837398473985739867398773988739897399073991739927399373994739957399673997739987399974000740017400274003740047400574006740077400874009740107401174012740137401474015740167401774018740197402074021740227402374024740257402674027740287402974030740317403274033740347403574036740377403874039740407404174042740437404474045740467404774048740497405074051740527405374054740557405674057740587405974060740617406274063740647406574066740677406874069740707407174072740737407474075740767407774078740797408074081740827408374084740857408674087740887408974090740917409274093740947409574096740977409874099741007410174102741037410474105741067410774108741097411074111741127411374114741157411674117741187411974120741217412274123741247412574126741277412874129741307413174132741337413474135741367413774138741397414074141741427414374144741457414674147741487414974150741517415274153741547415574156741577415874159741607416174162741637416474165741667416774168741697417074171741727417374174741757417674177741787417974180741817418274183741847418574186741877418874189741907419174192741937419474195741967419774198741997420074201742027420374204742057420674207742087420974210742117421274213742147421574216742177421874219742207422174222742237422474225742267422774228742297423074231742327423374234742357423674237742387423974240742417424274243742447424574246742477424874249742507425174252742537425474255742567425774258742597426074261742627426374264742657426674267742687426974270742717427274273742747427574276742777427874279742807428174282742837428474285742867428774288742897429074291742927429374294742957429674297742987429974300743017430274303743047430574306743077430874309743107431174312743137431474315743167431774318743197432074321743227432374324743257432674327743287432974330743317433274333743347433574336743377433874339743407434174342743437434474345743467434774348743497435074351743527435374354743557435674357743587435974360743617436274363743647436574366743677436874369743707437174372743737437474375743767437774378743797438074381743827438374384743857438674387743887438974390743917439274393743947439574396743977439874399744007440174402744037440474405744067440774408744097441074411744127441374414744157441674417744187441974420744217442274423744247442574426744277442874429744307443174432744337443474435744367443774438744397444074441744427444374444744457444674447744487444974450744517445274453744547445574456744577445874459744607446174462744637446474465744667446774468744697447074471744727447374474744757447674477744787447974480744817448274483744847448574486744877448874489744907449174492744937449474495744967449774498744997450074501745027450374504745057450674507745087450974510745117451274513745147451574516745177451874519745207452174522745237452474525745267452774528745297453074531745327453374534745357453674537745387453974540745417454274543745447454574546745477454874549745507455174552745537455474555745567455774558745597456074561745627456374564745657456674567745687456974570745717457274573745747457574576745777457874579745807458174582745837458474585745867458774588745897459074591745927459374594745957459674597745987459974600746017460274603746047460574606746077460874609746107461174612746137461474615746167461774618746197462074621746227462374624746257462674627746287462974630746317463274633746347463574636746377463874639746407464174642746437464474645746467464774648746497465074651746527465374654746557465674657746587465974660746617466274663746647466574666746677466874669746707467174672746737467474675746767467774678746797468074681746827468374684746857468674687746887468974690746917469274693746947469574696746977469874699747007470174702747037470474705747067470774708747097471074711747127471374714747157471674717747187471974720747217472274723747247472574726747277472874729747307473174732747337473474735747367473774738747397474074741747427474374744747457474674747747487474974750747517475274753747547475574756747577475874759747607476174762747637476474765747667476774768747697477074771747727477374774747757477674777747787477974780747817478274783747847478574786747877478874789747907479174792747937479474795747967479774798747997480074801748027480374804748057480674807748087480974810748117481274813748147481574816748177481874819748207482174822748237482474825748267482774828748297483074831748327483374834748357483674837748387483974840748417484274843748447484574846748477484874849748507485174852748537485474855748567485774858748597486074861748627486374864748657486674867748687486974870748717487274873748747487574876748777487874879748807488174882748837488474885748867488774888748897489074891748927489374894748957489674897748987489974900749017490274903749047490574906749077490874909749107491174912749137491474915749167491774918749197492074921749227492374924749257492674927749287492974930749317493274933749347493574936749377493874939749407494174942749437494474945749467494774948749497495074951749527495374954749557495674957749587495974960749617496274963749647496574966749677496874969749707497174972749737497474975749767497774978749797498074981749827498374984749857498674987749887498974990749917499274993749947499574996749977499874999750007500175002750037500475005750067500775008750097501075011750127501375014750157501675017750187501975020750217502275023750247502575026750277502875029750307503175032750337503475035750367503775038750397504075041750427504375044750457504675047750487504975050750517505275053750547505575056750577505875059750607506175062750637506475065750667506775068750697507075071750727507375074750757507675077750787507975080750817508275083750847508575086750877508875089750907509175092750937509475095750967509775098750997510075101751027510375104751057510675107751087510975110751117511275113751147511575116751177511875119751207512175122751237512475125751267512775128751297513075131751327513375134751357513675137751387513975140751417514275143751447514575146751477514875149751507515175152751537515475155751567515775158751597516075161751627516375164751657516675167751687516975170751717517275173751747517575176751777517875179751807518175182751837518475185751867518775188751897519075191751927519375194751957519675197751987519975200752017520275203752047520575206752077520875209752107521175212752137521475215752167521775218752197522075221752227522375224752257522675227752287522975230752317523275233752347523575236752377523875239752407524175242752437524475245752467524775248752497525075251752527525375254752557525675257752587525975260752617526275263752647526575266752677526875269752707527175272752737527475275752767527775278752797528075281752827528375284752857528675287752887528975290752917529275293752947529575296752977529875299753007530175302753037530475305753067530775308753097531075311753127531375314753157531675317753187531975320753217532275323753247532575326753277532875329753307533175332753337533475335753367533775338753397534075341753427534375344753457534675347753487534975350753517535275353753547535575356753577535875359753607536175362753637536475365753667536775368753697537075371753727537375374753757537675377753787537975380753817538275383753847538575386753877538875389753907539175392753937539475395753967539775398753997540075401754027540375404754057540675407754087540975410754117541275413754147541575416754177541875419754207542175422754237542475425754267542775428754297543075431754327543375434754357543675437754387543975440754417544275443754447544575446754477544875449754507545175452754537545475455754567545775458754597546075461754627546375464754657546675467754687546975470754717547275473754747547575476754777547875479754807548175482754837548475485754867548775488754897549075491754927549375494754957549675497754987549975500755017550275503755047550575506755077550875509755107551175512755137551475515755167551775518755197552075521755227552375524755257552675527755287552975530755317553275533755347553575536755377553875539755407554175542755437554475545755467554775548755497555075551755527555375554755557555675557755587555975560755617556275563755647556575566755677556875569755707557175572755737557475575755767557775578755797558075581755827558375584755857558675587755887558975590755917559275593755947559575596755977559875599756007560175602756037560475605756067560775608756097561075611756127561375614756157561675617756187561975620756217562275623756247562575626756277562875629756307563175632756337563475635756367563775638756397564075641756427564375644756457564675647756487564975650756517565275653756547565575656756577565875659756607566175662756637566475665756667566775668756697567075671756727567375674756757567675677756787567975680756817568275683756847568575686756877568875689756907569175692756937569475695756967569775698756997570075701757027570375704757057570675707757087570975710757117571275713757147571575716757177571875719757207572175722757237572475725757267572775728757297573075731757327573375734757357573675737757387573975740757417574275743757447574575746757477574875749757507575175752757537575475755757567575775758757597576075761757627576375764757657576675767757687576975770757717577275773757747577575776757777577875779757807578175782757837578475785757867578775788757897579075791757927579375794757957579675797757987579975800758017580275803758047580575806758077580875809758107581175812758137581475815758167581775818758197582075821758227582375824758257582675827758287582975830758317583275833758347583575836758377583875839758407584175842758437584475845758467584775848758497585075851758527585375854758557585675857758587585975860758617586275863758647586575866758677586875869758707587175872758737587475875758767587775878758797588075881758827588375884758857588675887758887588975890758917589275893758947589575896758977589875899759007590175902759037590475905759067590775908759097591075911759127591375914759157591675917759187591975920759217592275923759247592575926759277592875929759307593175932759337593475935759367593775938759397594075941759427594375944759457594675947759487594975950759517595275953759547595575956759577595875959759607596175962759637596475965759667596775968759697597075971759727597375974759757597675977759787597975980759817598275983759847598575986759877598875989759907599175992759937599475995759967599775998759997600076001760027600376004760057600676007760087600976010760117601276013760147601576016760177601876019760207602176022760237602476025760267602776028760297603076031760327603376034760357603676037760387603976040760417604276043760447604576046760477604876049760507605176052760537605476055760567605776058760597606076061760627606376064760657606676067760687606976070760717607276073760747607576076760777607876079760807608176082760837608476085760867608776088760897609076091760927609376094760957609676097760987609976100761017610276103761047610576106761077610876109761107611176112761137611476115761167611776118761197612076121761227612376124761257612676127761287612976130761317613276133761347613576136761377613876139761407614176142761437614476145761467614776148761497615076151761527615376154761557615676157761587615976160761617616276163761647616576166761677616876169761707617176172761737617476175761767617776178761797618076181761827618376184761857618676187761887618976190761917619276193761947619576196761977619876199762007620176202762037620476205762067620776208762097621076211762127621376214762157621676217762187621976220762217622276223762247622576226762277622876229762307623176232762337623476235762367623776238762397624076241762427624376244762457624676247762487624976250762517625276253762547625576256762577625876259762607626176262762637626476265762667626776268762697627076271762727627376274762757627676277762787627976280762817628276283762847628576286762877628876289762907629176292762937629476295762967629776298762997630076301763027630376304763057630676307763087630976310763117631276313763147631576316763177631876319763207632176322763237632476325763267632776328763297633076331763327633376334763357633676337763387633976340763417634276343763447634576346763477634876349763507635176352763537635476355763567635776358763597636076361763627636376364763657636676367763687636976370763717637276373763747637576376763777637876379763807638176382763837638476385763867638776388763897639076391763927639376394763957639676397763987639976400764017640276403764047640576406764077640876409764107641176412764137641476415764167641776418764197642076421764227642376424764257642676427764287642976430764317643276433764347643576436764377643876439764407644176442764437644476445764467644776448764497645076451764527645376454764557645676457764587645976460764617646276463764647646576466764677646876469764707647176472764737647476475764767647776478764797648076481764827648376484764857648676487764887648976490764917649276493764947649576496764977649876499765007650176502765037650476505765067650776508765097651076511765127651376514765157651676517765187651976520765217652276523765247652576526765277652876529765307653176532765337653476535765367653776538765397654076541765427654376544765457654676547765487654976550765517655276553765547655576556765577655876559765607656176562765637656476565765667656776568765697657076571765727657376574765757657676577765787657976580765817658276583765847658576586765877658876589765907659176592765937659476595765967659776598765997660076601766027660376604766057660676607766087660976610766117661276613766147661576616766177661876619766207662176622766237662476625766267662776628766297663076631766327663376634766357663676637766387663976640766417664276643766447664576646766477664876649766507665176652766537665476655766567665776658766597666076661766627666376664766657666676667766687666976670766717667276673766747667576676766777667876679766807668176682766837668476685766867668776688766897669076691766927669376694766957669676697766987669976700767017670276703767047670576706767077670876709767107671176712767137671476715767167671776718767197672076721767227672376724767257672676727767287672976730767317673276733767347673576736767377673876739767407674176742767437674476745767467674776748767497675076751767527675376754767557675676757767587675976760767617676276763767647676576766767677676876769767707677176772767737677476775767767677776778767797678076781767827678376784767857678676787767887678976790767917679276793767947679576796767977679876799768007680176802768037680476805768067680776808768097681076811768127681376814768157681676817768187681976820768217682276823768247682576826768277682876829768307683176832768337683476835768367683776838768397684076841768427684376844768457684676847768487684976850768517685276853768547685576856768577685876859768607686176862768637686476865768667686776868768697687076871768727687376874768757687676877768787687976880768817688276883768847688576886768877688876889768907689176892768937689476895768967689776898768997690076901769027690376904769057690676907769087690976910769117691276913769147691576916769177691876919769207692176922769237692476925769267692776928769297693076931769327693376934769357693676937769387693976940769417694276943769447694576946769477694876949769507695176952769537695476955769567695776958769597696076961769627696376964769657696676967769687696976970769717697276973769747697576976769777697876979769807698176982769837698476985769867698776988769897699076991769927699376994769957699676997769987699977000770017700277003770047700577006770077700877009770107701177012770137701477015770167701777018770197702077021770227702377024770257702677027770287702977030770317703277033770347703577036770377703877039770407704177042770437704477045770467704777048770497705077051770527705377054770557705677057770587705977060770617706277063770647706577066770677706877069770707707177072770737707477075770767707777078770797708077081770827708377084770857708677087770887708977090770917709277093770947709577096770977709877099771007710177102771037710477105771067710777108771097711077111771127711377114771157711677117771187711977120771217712277123771247712577126771277712877129771307713177132771337713477135771367713777138771397714077141771427714377144771457714677147771487714977150771517715277153771547715577156771577715877159771607716177162771637716477165771667716777168771697717077171771727717377174771757717677177771787717977180771817718277183771847718577186771877718877189771907719177192771937719477195771967719777198771997720077201772027720377204772057720677207772087720977210772117721277213772147721577216772177721877219772207722177222772237722477225772267722777228772297723077231772327723377234772357723677237772387723977240772417724277243772447724577246772477724877249772507725177252772537725477255772567725777258772597726077261772627726377264772657726677267772687726977270772717727277273772747727577276772777727877279772807728177282772837728477285772867728777288772897729077291772927729377294772957729677297772987729977300773017730277303773047730577306773077730877309773107731177312773137731477315773167731777318773197732077321773227732377324773257732677327773287732977330773317733277333773347733577336773377733877339773407734177342773437734477345773467734777348773497735077351773527735377354773557735677357773587735977360773617736277363773647736577366773677736877369773707737177372773737737477375773767737777378773797738077381773827738377384773857738677387773887738977390773917739277393773947739577396773977739877399774007740177402774037740477405774067740777408774097741077411774127741377414774157741677417774187741977420774217742277423774247742577426774277742877429774307743177432774337743477435774367743777438774397744077441774427744377444774457744677447774487744977450774517745277453774547745577456774577745877459774607746177462774637746477465774667746777468774697747077471774727747377474774757747677477774787747977480774817748277483774847748577486774877748877489774907749177492774937749477495774967749777498774997750077501775027750377504775057750677507775087750977510775117751277513775147751577516775177751877519775207752177522775237752477525775267752777528775297753077531775327753377534775357753677537775387753977540775417754277543775447754577546775477754877549775507755177552775537755477555775567755777558775597756077561775627756377564775657756677567775687756977570775717757277573775747757577576775777757877579775807758177582775837758477585775867758777588775897759077591775927759377594775957759677597775987759977600776017760277603776047760577606776077760877609776107761177612776137761477615776167761777618776197762077621776227762377624776257762677627776287762977630776317763277633776347763577636776377763877639776407764177642776437764477645776467764777648776497765077651776527765377654776557765677657776587765977660776617766277663776647766577666776677766877669776707767177672776737767477675776767767777678776797768077681776827768377684776857768677687776887768977690776917769277693776947769577696776977769877699777007770177702777037770477705777067770777708777097771077711777127771377714777157771677717777187771977720777217772277723777247772577726777277772877729777307773177732777337773477735777367773777738777397774077741777427774377744777457774677747777487774977750777517775277753777547775577756777577775877759777607776177762777637776477765777667776777768777697777077771777727777377774777757777677777777787777977780777817778277783777847778577786777877778877789777907779177792777937779477795777967779777798777997780077801778027780377804778057780677807778087780977810778117781277813778147781577816778177781877819778207782177822778237782477825778267782777828778297783077831778327783377834778357783677837778387783977840778417784277843778447784577846778477784877849778507785177852778537785477855778567785777858778597786077861778627786377864778657786677867778687786977870778717787277873778747787577876778777787877879778807788177882778837788477885778867788777888778897789077891778927789377894778957789677897778987789977900779017790277903779047790577906779077790877909779107791177912779137791477915779167791777918779197792077921779227792377924779257792677927779287792977930779317793277933779347793577936779377793877939779407794177942779437794477945779467794777948779497795077951779527795377954779557795677957779587795977960779617796277963779647796577966779677796877969779707797177972779737797477975779767797777978779797798077981779827798377984779857798677987779887798977990779917799277993779947799577996779977799877999780007800178002780037800478005780067800778008780097801078011780127801378014780157801678017780187801978020780217802278023780247802578026780277802878029780307803178032780337803478035780367803778038780397804078041780427804378044780457804678047780487804978050780517805278053780547805578056780577805878059780607806178062780637806478065780667806778068780697807078071780727807378074780757807678077780787807978080780817808278083780847808578086780877808878089780907809178092780937809478095780967809778098780997810078101781027810378104781057810678107781087810978110781117811278113781147811578116781177811878119781207812178122781237812478125781267812778128781297813078131781327813378134781357813678137781387813978140781417814278143781447814578146781477814878149781507815178152781537815478155781567815778158781597816078161781627816378164781657816678167781687816978170781717817278173781747817578176781777817878179781807818178182781837818478185781867818778188781897819078191781927819378194781957819678197781987819978200782017820278203782047820578206782077820878209782107821178212782137821478215782167821778218782197822078221782227822378224782257822678227782287822978230782317823278233782347823578236782377823878239782407824178242782437824478245782467824778248782497825078251782527825378254782557825678257782587825978260782617826278263782647826578266782677826878269782707827178272782737827478275782767827778278782797828078281782827828378284782857828678287782887828978290782917829278293782947829578296782977829878299783007830178302783037830478305783067830778308783097831078311783127831378314783157831678317783187831978320783217832278323783247832578326783277832878329783307833178332783337833478335783367833778338783397834078341783427834378344783457834678347783487834978350783517835278353783547835578356783577835878359783607836178362783637836478365783667836778368783697837078371783727837378374783757837678377783787837978380783817838278383783847838578386783877838878389783907839178392783937839478395783967839778398783997840078401784027840378404784057840678407784087840978410784117841278413784147841578416784177841878419784207842178422784237842478425784267842778428784297843078431784327843378434784357843678437784387843978440784417844278443784447844578446784477844878449784507845178452784537845478455784567845778458784597846078461784627846378464784657846678467784687846978470784717847278473784747847578476784777847878479784807848178482784837848478485784867848778488784897849078491784927849378494784957849678497784987849978500785017850278503785047850578506785077850878509785107851178512785137851478515785167851778518785197852078521785227852378524785257852678527785287852978530785317853278533785347853578536785377853878539785407854178542785437854478545785467854778548785497855078551785527855378554785557855678557785587855978560785617856278563785647856578566785677856878569785707857178572785737857478575785767857778578785797858078581785827858378584785857858678587785887858978590785917859278593785947859578596785977859878599786007860178602786037860478605786067860778608786097861078611786127861378614786157861678617786187861978620786217862278623786247862578626786277862878629786307863178632786337863478635786367863778638786397864078641786427864378644786457864678647786487864978650786517865278653786547865578656786577865878659786607866178662786637866478665786667866778668786697867078671786727867378674786757867678677786787867978680786817868278683786847868578686786877868878689786907869178692786937869478695786967869778698786997870078701787027870378704787057870678707787087870978710787117871278713787147871578716787177871878719787207872178722787237872478725787267872778728787297873078731787327873378734787357873678737787387873978740787417874278743787447874578746787477874878749787507875178752787537875478755787567875778758787597876078761787627876378764787657876678767787687876978770787717877278773787747877578776787777877878779787807878178782787837878478785787867878778788787897879078791787927879378794787957879678797787987879978800788017880278803788047880578806788077880878809788107881178812788137881478815788167881778818788197882078821788227882378824788257882678827788287882978830788317883278833788347883578836788377883878839788407884178842788437884478845788467884778848788497885078851788527885378854788557885678857788587885978860788617886278863788647886578866788677886878869788707887178872788737887478875788767887778878788797888078881788827888378884788857888678887788887888978890788917889278893788947889578896788977889878899789007890178902789037890478905789067890778908789097891078911789127891378914789157891678917789187891978920789217892278923789247892578926789277892878929789307893178932789337893478935789367893778938789397894078941789427894378944789457894678947789487894978950789517895278953789547895578956789577895878959789607896178962789637896478965789667896778968789697897078971789727897378974789757897678977789787897978980789817898278983789847898578986789877898878989789907899178992789937899478995789967899778998789997900079001790027900379004790057900679007790087900979010790117901279013790147901579016790177901879019790207902179022790237902479025790267902779028790297903079031790327903379034790357903679037790387903979040790417904279043790447904579046790477904879049790507905179052790537905479055790567905779058790597906079061790627906379064790657906679067790687906979070790717907279073790747907579076790777907879079790807908179082790837908479085790867908779088790897909079091790927909379094790957909679097790987909979100791017910279103791047910579106791077910879109791107911179112791137911479115791167911779118791197912079121791227912379124791257912679127791287912979130791317913279133791347913579136791377913879139791407914179142791437914479145791467914779148791497915079151791527915379154791557915679157791587915979160791617916279163791647916579166791677916879169791707917179172791737917479175791767917779178791797918079181791827918379184791857918679187791887918979190791917919279193791947919579196791977919879199792007920179202792037920479205792067920779208792097921079211792127921379214792157921679217792187921979220792217922279223792247922579226792277922879229792307923179232792337923479235792367923779238792397924079241792427924379244792457924679247792487924979250792517925279253792547925579256792577925879259792607926179262792637926479265792667926779268792697927079271792727927379274792757927679277792787927979280792817928279283792847928579286792877928879289792907929179292792937929479295792967929779298792997930079301793027930379304793057930679307793087930979310793117931279313793147931579316793177931879319793207932179322793237932479325793267932779328793297933079331793327933379334793357933679337793387933979340793417934279343793447934579346793477934879349793507935179352793537935479355793567935779358793597936079361793627936379364793657936679367793687936979370793717937279373793747937579376793777937879379793807938179382793837938479385793867938779388793897939079391793927939379394793957939679397793987939979400794017940279403794047940579406794077940879409794107941179412794137941479415794167941779418794197942079421794227942379424794257942679427794287942979430794317943279433794347943579436794377943879439794407944179442794437944479445794467944779448794497945079451794527945379454794557945679457794587945979460794617946279463794647946579466794677946879469794707947179472794737947479475794767947779478794797948079481794827948379484794857948679487794887948979490794917949279493794947949579496794977949879499795007950179502795037950479505795067950779508795097951079511795127951379514795157951679517795187951979520795217952279523795247952579526795277952879529795307953179532795337953479535795367953779538795397954079541795427954379544795457954679547795487954979550795517955279553795547955579556795577955879559795607956179562795637956479565795667956779568795697957079571795727957379574795757957679577795787957979580795817958279583795847958579586795877958879589795907959179592795937959479595795967959779598795997960079601796027960379604796057960679607796087960979610796117961279613796147961579616796177961879619796207962179622796237962479625796267962779628796297963079631796327963379634796357963679637796387963979640796417964279643796447964579646796477964879649796507965179652796537965479655796567965779658796597966079661796627966379664796657966679667796687966979670796717967279673796747967579676796777967879679796807968179682796837968479685796867968779688796897969079691796927969379694796957969679697796987969979700797017970279703797047970579706797077970879709797107971179712797137971479715797167971779718797197972079721797227972379724797257972679727797287972979730797317973279733797347973579736797377973879739797407974179742797437974479745797467974779748797497975079751797527975379754797557975679757797587975979760797617976279763797647976579766797677976879769797707977179772797737977479775797767977779778797797978079781797827978379784797857978679787797887978979790797917979279793797947979579796797977979879799798007980179802798037980479805798067980779808798097981079811798127981379814798157981679817798187981979820798217982279823798247982579826798277982879829798307983179832798337983479835798367983779838798397984079841798427984379844798457984679847798487984979850798517985279853798547985579856798577985879859798607986179862798637986479865798667986779868798697987079871798727987379874798757987679877798787987979880798817988279883798847988579886798877988879889798907989179892798937989479895798967989779898798997990079901799027990379904799057990679907799087990979910799117991279913799147991579916799177991879919799207992179922799237992479925799267992779928799297993079931799327993379934799357993679937799387993979940799417994279943799447994579946799477994879949799507995179952799537995479955799567995779958799597996079961799627996379964799657996679967799687996979970799717997279973799747997579976799777997879979799807998179982799837998479985799867998779988799897999079991799927999379994799957999679997799987999980000800018000280003800048000580006800078000880009800108001180012800138001480015800168001780018800198002080021800228002380024800258002680027800288002980030800318003280033800348003580036800378003880039800408004180042800438004480045800468004780048800498005080051800528005380054800558005680057800588005980060800618006280063800648006580066800678006880069800708007180072800738007480075800768007780078800798008080081800828008380084800858008680087800888008980090800918009280093800948009580096800978009880099801008010180102801038010480105801068010780108801098011080111801128011380114801158011680117801188011980120801218012280123801248012580126801278012880129801308013180132801338013480135801368013780138801398014080141801428014380144801458014680147801488014980150801518015280153801548015580156801578015880159801608016180162801638016480165801668016780168801698017080171801728017380174801758017680177801788017980180801818018280183801848018580186801878018880189801908019180192801938019480195801968019780198801998020080201802028020380204802058020680207802088020980210802118021280213802148021580216802178021880219802208022180222802238022480225802268022780228802298023080231802328023380234802358023680237802388023980240802418024280243802448024580246802478024880249802508025180252802538025480255802568025780258802598026080261802628026380264802658026680267802688026980270802718027280273802748027580276802778027880279802808028180282802838028480285802868028780288802898029080291802928029380294802958029680297802988029980300803018030280303803048030580306803078030880309803108031180312803138031480315803168031780318803198032080321803228032380324803258032680327803288032980330803318033280333803348033580336803378033880339803408034180342803438034480345803468034780348803498035080351803528035380354803558035680357803588035980360803618036280363803648036580366803678036880369803708037180372803738037480375803768037780378803798038080381803828038380384803858038680387803888038980390803918039280393803948039580396803978039880399804008040180402804038040480405804068040780408804098041080411804128041380414804158041680417804188041980420804218042280423804248042580426804278042880429804308043180432804338043480435804368043780438804398044080441804428044380444804458044680447804488044980450804518045280453804548045580456804578045880459804608046180462804638046480465804668046780468804698047080471804728047380474804758047680477804788047980480804818048280483804848048580486804878048880489804908049180492804938049480495804968049780498804998050080501805028050380504805058050680507805088050980510805118051280513805148051580516805178051880519805208052180522805238052480525805268052780528805298053080531805328053380534805358053680537805388053980540805418054280543805448054580546805478054880549805508055180552805538055480555805568055780558805598056080561805628056380564805658056680567805688056980570805718057280573805748057580576805778057880579805808058180582805838058480585805868058780588805898059080591805928059380594805958059680597805988059980600806018060280603806048060580606806078060880609806108061180612806138061480615806168061780618806198062080621806228062380624806258062680627806288062980630806318063280633806348063580636806378063880639806408064180642806438064480645806468064780648806498065080651806528065380654806558065680657806588065980660806618066280663806648066580666806678066880669806708067180672806738067480675806768067780678806798068080681806828068380684806858068680687806888068980690806918069280693806948069580696806978069880699807008070180702807038070480705807068070780708807098071080711807128071380714807158071680717807188071980720807218072280723807248072580726807278072880729807308073180732807338073480735807368073780738807398074080741807428074380744807458074680747807488074980750807518075280753807548075580756807578075880759807608076180762807638076480765807668076780768807698077080771807728077380774807758077680777807788077980780807818078280783807848078580786807878078880789807908079180792807938079480795807968079780798807998080080801808028080380804808058080680807808088080980810808118081280813808148081580816808178081880819808208082180822808238082480825808268082780828808298083080831808328083380834808358083680837808388083980840808418084280843808448084580846808478084880849808508085180852808538085480855808568085780858808598086080861808628086380864808658086680867808688086980870808718087280873808748087580876808778087880879808808088180882808838088480885808868088780888808898089080891808928089380894808958089680897808988089980900809018090280903809048090580906809078090880909809108091180912809138091480915809168091780918809198092080921809228092380924809258092680927809288092980930809318093280933809348093580936809378093880939809408094180942809438094480945809468094780948809498095080951809528095380954809558095680957809588095980960809618096280963809648096580966809678096880969809708097180972809738097480975809768097780978809798098080981809828098380984809858098680987809888098980990809918099280993809948099580996809978099880999810008100181002810038100481005810068100781008810098101081011810128101381014810158101681017810188101981020810218102281023810248102581026810278102881029810308103181032810338103481035810368103781038810398104081041810428104381044810458104681047810488104981050810518105281053810548105581056810578105881059810608106181062810638106481065810668106781068810698107081071810728107381074810758107681077810788107981080810818108281083810848108581086810878108881089810908109181092810938109481095810968109781098810998110081101811028110381104811058110681107811088110981110811118111281113811148111581116811178111881119811208112181122811238112481125811268112781128811298113081131811328113381134811358113681137811388113981140811418114281143811448114581146811478114881149811508115181152811538115481155811568115781158811598116081161811628116381164811658116681167811688116981170811718117281173811748117581176811778117881179811808118181182811838118481185811868118781188811898119081191811928119381194811958119681197811988119981200812018120281203812048120581206812078120881209812108121181212812138121481215812168121781218812198122081221812228122381224812258122681227812288122981230812318123281233812348123581236812378123881239812408124181242812438124481245812468124781248812498125081251812528125381254812558125681257812588125981260812618126281263812648126581266812678126881269812708127181272812738127481275812768127781278812798128081281812828128381284812858128681287812888128981290812918129281293812948129581296812978129881299813008130181302813038130481305813068130781308813098131081311813128131381314813158131681317813188131981320813218132281323813248132581326813278132881329813308133181332813338133481335813368133781338813398134081341813428134381344813458134681347813488134981350813518135281353813548135581356813578135881359813608136181362813638136481365813668136781368813698137081371813728137381374813758137681377813788137981380813818138281383813848138581386813878138881389813908139181392813938139481395813968139781398813998140081401814028140381404814058140681407814088140981410814118141281413814148141581416814178141881419814208142181422814238142481425814268142781428814298143081431814328143381434814358143681437814388143981440814418144281443814448144581446814478144881449814508145181452814538145481455814568145781458814598146081461814628146381464814658146681467814688146981470814718147281473814748147581476814778147881479814808148181482814838148481485814868148781488814898149081491814928149381494814958149681497814988149981500815018150281503815048150581506815078150881509815108151181512815138151481515815168151781518815198152081521815228152381524815258152681527815288152981530815318153281533815348153581536815378153881539815408154181542815438154481545815468154781548815498155081551815528155381554815558155681557815588155981560815618156281563815648156581566815678156881569815708157181572815738157481575815768157781578815798158081581815828158381584815858158681587815888158981590815918159281593815948159581596815978159881599816008160181602816038160481605816068160781608816098161081611816128161381614816158161681617816188161981620816218162281623816248162581626816278162881629816308163181632816338163481635816368163781638816398164081641816428164381644816458164681647816488164981650816518165281653816548165581656816578165881659816608166181662816638166481665816668166781668816698167081671816728167381674816758167681677816788167981680816818168281683816848168581686816878168881689816908169181692816938169481695816968169781698816998170081701817028170381704817058170681707817088170981710817118171281713817148171581716817178171881719817208172181722817238172481725817268172781728817298173081731817328173381734817358173681737817388173981740817418174281743817448174581746817478174881749817508175181752817538175481755817568175781758817598176081761817628176381764817658176681767817688176981770817718177281773817748177581776817778177881779817808178181782817838178481785817868178781788817898179081791817928179381794817958179681797817988179981800818018180281803818048180581806818078180881809818108181181812818138181481815818168181781818818198182081821818228182381824818258182681827818288182981830818318183281833818348183581836818378183881839818408184181842818438184481845818468184781848818498185081851818528185381854818558185681857818588185981860818618186281863818648186581866818678186881869818708187181872818738187481875818768187781878818798188081881818828188381884818858188681887818888188981890818918189281893818948189581896818978189881899819008190181902819038190481905819068190781908819098191081911819128191381914819158191681917819188191981920819218192281923819248192581926819278192881929819308193181932819338193481935819368193781938819398194081941819428194381944819458194681947819488194981950819518195281953819548195581956819578195881959819608196181962819638196481965819668196781968819698197081971819728197381974819758197681977819788197981980819818198281983819848198581986819878198881989819908199181992819938199481995819968199781998819998200082001820028200382004820058200682007820088200982010820118201282013820148201582016820178201882019820208202182022820238202482025820268202782028820298203082031820328203382034820358203682037820388203982040820418204282043820448204582046820478204882049820508205182052820538205482055820568205782058820598206082061820628206382064820658206682067820688206982070820718207282073820748207582076820778207882079820808208182082820838208482085820868208782088820898209082091820928209382094820958209682097820988209982100821018210282103821048210582106821078210882109821108211182112821138211482115821168211782118821198212082121821228212382124821258212682127821288212982130821318213282133821348213582136821378213882139821408214182142821438214482145821468214782148821498215082151821528215382154821558215682157821588215982160821618216282163821648216582166821678216882169821708217182172821738217482175821768217782178821798218082181821828218382184821858218682187821888218982190821918219282193821948219582196821978219882199822008220182202822038220482205822068220782208822098221082211822128221382214822158221682217822188221982220822218222282223822248222582226822278222882229822308223182232822338223482235822368223782238822398224082241822428224382244822458224682247822488224982250822518225282253822548225582256822578225882259822608226182262822638226482265822668226782268822698227082271822728227382274822758227682277822788227982280822818228282283822848228582286822878228882289822908229182292822938229482295822968229782298822998230082301823028230382304823058230682307823088230982310823118231282313823148231582316823178231882319823208232182322823238232482325823268232782328823298233082331823328233382334823358233682337823388233982340823418234282343823448234582346823478234882349823508235182352823538235482355823568235782358823598236082361823628236382364823658236682367823688236982370823718237282373823748237582376823778237882379823808238182382823838238482385823868238782388823898239082391823928239382394823958239682397823988239982400824018240282403824048240582406824078240882409824108241182412824138241482415824168241782418824198242082421824228242382424824258242682427824288242982430824318243282433824348243582436824378243882439824408244182442824438244482445824468244782448824498245082451824528245382454824558245682457824588245982460824618246282463824648246582466824678246882469824708247182472824738247482475824768247782478824798248082481824828248382484824858248682487824888248982490824918249282493824948249582496824978249882499825008250182502825038250482505825068250782508825098251082511825128251382514825158251682517825188251982520825218252282523825248252582526825278252882529825308253182532825338253482535825368253782538825398254082541825428254382544825458254682547825488254982550825518255282553825548255582556825578255882559825608256182562825638256482565825668256782568825698257082571825728257382574825758257682577825788257982580825818258282583825848258582586825878258882589825908259182592825938259482595825968259782598825998260082601826028260382604826058260682607826088260982610826118261282613826148261582616826178261882619826208262182622826238262482625826268262782628826298263082631826328263382634826358263682637826388263982640826418264282643826448264582646826478264882649826508265182652826538265482655826568265782658826598266082661826628266382664826658266682667826688266982670826718267282673826748267582676826778267882679826808268182682826838268482685826868268782688826898269082691826928269382694826958269682697826988269982700827018270282703827048270582706827078270882709827108271182712827138271482715827168271782718827198272082721827228272382724827258272682727827288272982730827318273282733827348273582736827378273882739827408274182742827438274482745827468274782748827498275082751827528275382754827558275682757827588275982760827618276282763827648276582766827678276882769827708277182772827738277482775827768277782778827798278082781827828278382784827858278682787827888278982790827918279282793827948279582796827978279882799828008280182802828038280482805828068280782808828098281082811828128281382814828158281682817828188281982820828218282282823828248282582826828278282882829828308283182832828338283482835828368283782838828398284082841828428284382844828458284682847828488284982850828518285282853828548285582856828578285882859828608286182862828638286482865828668286782868828698287082871828728287382874828758287682877828788287982880828818288282883828848288582886828878288882889828908289182892828938289482895828968289782898828998290082901829028290382904829058290682907829088290982910829118291282913829148291582916829178291882919829208292182922829238292482925829268292782928829298293082931829328293382934829358293682937829388293982940829418294282943829448294582946829478294882949829508295182952829538295482955829568295782958829598296082961829628296382964829658296682967829688296982970829718297282973829748297582976829778297882979829808298182982829838298482985829868298782988829898299082991829928299382994829958299682997829988299983000830018300283003830048300583006830078300883009830108301183012830138301483015830168301783018830198302083021830228302383024830258302683027830288302983030830318303283033830348303583036830378303883039830408304183042830438304483045830468304783048830498305083051830528305383054830558305683057830588305983060830618306283063830648306583066830678306883069830708307183072830738307483075830768307783078830798308083081830828308383084830858308683087830888308983090830918309283093830948309583096830978309883099831008310183102831038310483105831068310783108831098311083111831128311383114831158311683117831188311983120831218312283123831248312583126831278312883129831308313183132831338313483135831368313783138831398314083141831428314383144831458314683147831488314983150831518315283153831548315583156831578315883159831608316183162831638316483165831668316783168831698317083171831728317383174831758317683177831788317983180831818318283183831848318583186831878318883189831908319183192831938319483195831968319783198831998320083201832028320383204832058320683207832088320983210832118321283213832148321583216832178321883219832208322183222832238322483225832268322783228832298323083231832328323383234832358323683237832388323983240832418324283243832448324583246832478324883249832508325183252832538325483255832568325783258832598326083261832628326383264832658326683267832688326983270832718327283273832748327583276832778327883279832808328183282832838328483285832868328783288832898329083291832928329383294832958329683297832988329983300833018330283303833048330583306833078330883309833108331183312833138331483315833168331783318833198332083321833228332383324833258332683327833288332983330833318333283333833348333583336833378333883339833408334183342833438334483345833468334783348833498335083351833528335383354833558335683357833588335983360833618336283363833648336583366833678336883369833708337183372833738337483375833768337783378833798338083381833828338383384833858338683387833888338983390833918339283393833948339583396833978339883399834008340183402834038340483405834068340783408834098341083411834128341383414834158341683417834188341983420834218342283423834248342583426834278342883429834308343183432834338343483435834368343783438834398344083441834428344383444834458344683447834488344983450834518345283453834548345583456834578345883459834608346183462834638346483465834668346783468834698347083471834728347383474834758347683477834788347983480834818348283483834848348583486834878348883489834908349183492834938349483495834968349783498834998350083501835028350383504835058350683507835088350983510835118351283513835148351583516835178351883519835208352183522835238352483525835268352783528835298353083531835328353383534835358353683537835388353983540835418354283543835448354583546835478354883549835508355183552835538355483555835568355783558835598356083561835628356383564835658356683567835688356983570835718357283573835748357583576835778357883579835808358183582835838358483585835868358783588835898359083591835928359383594835958359683597835988359983600836018360283603836048360583606836078360883609836108361183612836138361483615836168361783618836198362083621836228362383624836258362683627836288362983630836318363283633836348363583636836378363883639836408364183642836438364483645836468364783648836498365083651836528365383654836558365683657836588365983660836618366283663836648366583666836678366883669836708367183672836738367483675836768367783678836798368083681836828368383684836858368683687836888368983690836918369283693836948369583696836978369883699837008370183702837038370483705837068370783708837098371083711837128371383714837158371683717837188371983720837218372283723837248372583726837278372883729837308373183732837338373483735837368373783738837398374083741837428374383744837458374683747837488374983750837518375283753837548375583756837578375883759837608376183762837638376483765837668376783768837698377083771837728377383774837758377683777837788377983780837818378283783837848378583786837878378883789837908379183792837938379483795837968379783798837998380083801838028380383804838058380683807838088380983810838118381283813838148381583816838178381883819838208382183822838238382483825838268382783828838298383083831838328383383834838358383683837838388383983840838418384283843838448384583846838478384883849838508385183852838538385483855838568385783858838598386083861838628386383864838658386683867838688386983870838718387283873838748387583876838778387883879838808388183882838838388483885838868388783888838898389083891838928389383894838958389683897838988389983900839018390283903839048390583906839078390883909839108391183912839138391483915839168391783918839198392083921839228392383924839258392683927839288392983930839318393283933839348393583936839378393883939839408394183942839438394483945839468394783948839498395083951839528395383954839558395683957839588395983960839618396283963839648396583966839678396883969839708397183972839738397483975839768397783978839798398083981839828398383984839858398683987839888398983990839918399283993839948399583996839978399883999840008400184002840038400484005840068400784008840098401084011840128401384014840158401684017840188401984020840218402284023840248402584026840278402884029840308403184032840338403484035840368403784038840398404084041840428404384044840458404684047840488404984050840518405284053840548405584056840578405884059840608406184062840638406484065840668406784068840698407084071840728407384074840758407684077840788407984080840818408284083840848408584086840878408884089840908409184092840938409484095840968409784098840998410084101841028410384104841058410684107841088410984110841118411284113841148411584116841178411884119841208412184122841238412484125841268412784128841298413084131841328413384134841358413684137841388413984140841418414284143841448414584146841478414884149841508415184152841538415484155841568415784158841598416084161841628416384164841658416684167841688416984170841718417284173841748417584176841778417884179841808418184182841838418484185841868418784188841898419084191841928419384194841958419684197841988419984200842018420284203842048420584206842078420884209842108421184212842138421484215842168421784218842198422084221842228422384224842258422684227842288422984230842318423284233842348423584236842378423884239842408424184242842438424484245842468424784248842498425084251842528425384254842558425684257842588425984260842618426284263842648426584266842678426884269842708427184272842738427484275842768427784278842798428084281842828428384284842858428684287842888428984290842918429284293842948429584296842978429884299843008430184302843038430484305843068430784308843098431084311843128431384314843158431684317843188431984320843218432284323843248432584326843278432884329843308433184332843338433484335843368433784338843398434084341843428434384344843458434684347843488434984350843518435284353843548435584356843578435884359843608436184362843638436484365843668436784368843698437084371843728437384374843758437684377843788437984380843818438284383843848438584386843878438884389843908439184392843938439484395843968439784398843998440084401844028440384404844058440684407844088440984410844118441284413844148441584416844178441884419844208442184422844238442484425844268442784428844298443084431844328443384434844358443684437844388443984440844418444284443844448444584446844478444884449844508445184452844538445484455844568445784458844598446084461844628446384464844658446684467844688446984470844718447284473844748447584476844778447884479844808448184482844838448484485844868448784488844898449084491844928449384494844958449684497844988449984500845018450284503845048450584506845078450884509845108451184512845138451484515845168451784518845198452084521845228452384524845258452684527845288452984530845318453284533845348453584536845378453884539845408454184542845438454484545845468454784548845498455084551845528455384554845558455684557845588455984560845618456284563845648456584566845678456884569845708457184572845738457484575845768457784578845798458084581845828458384584845858458684587845888458984590845918459284593845948459584596845978459884599846008460184602846038460484605846068460784608846098461084611846128461384614846158461684617846188461984620846218462284623846248462584626846278462884629846308463184632846338463484635846368463784638846398464084641846428464384644846458464684647846488464984650846518465284653846548465584656846578465884659846608466184662846638466484665846668466784668846698467084671846728467384674846758467684677846788467984680846818468284683846848468584686846878468884689846908469184692846938469484695846968469784698846998470084701847028470384704847058470684707847088470984710847118471284713847148471584716847178471884719847208472184722847238472484725847268472784728847298473084731847328473384734847358473684737847388473984740847418474284743847448474584746847478474884749847508475184752847538475484755847568475784758847598476084761847628476384764847658476684767847688476984770847718477284773847748477584776847778477884779847808478184782847838478484785847868478784788847898479084791847928479384794847958479684797847988479984800848018480284803848048480584806848078480884809848108481184812848138481484815848168481784818848198482084821848228482384824848258482684827848288482984830848318483284833848348483584836848378483884839848408484184842848438484484845848468484784848848498485084851848528485384854848558485684857848588485984860848618486284863848648486584866848678486884869848708487184872848738487484875848768487784878848798488084881848828488384884848858488684887848888488984890848918489284893848948489584896848978489884899849008490184902849038490484905849068490784908849098491084911849128491384914849158491684917849188491984920849218492284923849248492584926849278492884929849308493184932849338493484935849368493784938849398494084941849428494384944849458494684947849488494984950849518495284953849548495584956849578495884959849608496184962849638496484965849668496784968849698497084971849728497384974849758497684977849788497984980849818498284983849848498584986849878498884989849908499184992849938499484995849968499784998849998500085001850028500385004850058500685007850088500985010850118501285013850148501585016850178501885019850208502185022850238502485025850268502785028850298503085031850328503385034850358503685037850388503985040850418504285043850448504585046850478504885049850508505185052850538505485055850568505785058850598506085061850628506385064850658506685067850688506985070850718507285073850748507585076850778507885079850808508185082850838508485085850868508785088850898509085091850928509385094850958509685097850988509985100851018510285103851048510585106851078510885109851108511185112851138511485115851168511785118851198512085121851228512385124851258512685127851288512985130851318513285133851348513585136851378513885139851408514185142851438514485145851468514785148851498515085151851528515385154851558515685157851588515985160851618516285163851648516585166851678516885169851708517185172851738517485175851768517785178851798518085181851828518385184851858518685187851888518985190851918519285193851948519585196851978519885199852008520185202852038520485205852068520785208852098521085211852128521385214852158521685217852188521985220852218522285223852248522585226852278522885229852308523185232852338523485235852368523785238852398524085241852428524385244852458524685247852488524985250852518525285253852548525585256852578525885259852608526185262852638526485265852668526785268852698527085271852728527385274852758527685277852788527985280852818528285283852848528585286852878528885289852908529185292852938529485295852968529785298852998530085301853028530385304853058530685307853088530985310853118531285313853148531585316853178531885319853208532185322853238532485325853268532785328853298533085331853328533385334853358533685337853388533985340853418534285343853448534585346853478534885349853508535185352853538535485355853568535785358853598536085361853628536385364853658536685367853688536985370853718537285373853748537585376853778537885379853808538185382853838538485385853868538785388853898539085391853928539385394853958539685397853988539985400854018540285403854048540585406854078540885409854108541185412854138541485415854168541785418854198542085421854228542385424854258542685427854288542985430854318543285433854348543585436854378543885439854408544185442854438544485445854468544785448854498545085451854528545385454854558545685457854588545985460854618546285463854648546585466854678546885469854708547185472854738547485475854768547785478854798548085481854828548385484854858548685487854888548985490854918549285493854948549585496854978549885499855008550185502855038550485505855068550785508855098551085511855128551385514855158551685517855188551985520855218552285523855248552585526855278552885529855308553185532855338553485535855368553785538855398554085541855428554385544855458554685547855488554985550855518555285553855548555585556855578555885559855608556185562855638556485565855668556785568855698557085571855728557385574855758557685577855788557985580855818558285583855848558585586855878558885589855908559185592855938559485595855968559785598855998560085601856028560385604856058560685607856088560985610856118561285613856148561585616856178561885619856208562185622856238562485625856268562785628856298563085631856328563385634856358563685637856388563985640856418564285643856448564585646856478564885649856508565185652856538565485655856568565785658856598566085661856628566385664856658566685667856688566985670856718567285673856748567585676856778567885679856808568185682856838568485685856868568785688856898569085691856928569385694856958569685697856988569985700857018570285703857048570585706857078570885709857108571185712857138571485715857168571785718857198572085721857228572385724857258572685727857288572985730857318573285733857348573585736857378573885739857408574185742857438574485745857468574785748857498575085751857528575385754857558575685757857588575985760857618576285763857648576585766857678576885769857708577185772857738577485775857768577785778857798578085781857828578385784857858578685787857888578985790857918579285793857948579585796857978579885799858008580185802858038580485805858068580785808858098581085811858128581385814858158581685817858188581985820858218582285823858248582585826858278582885829858308583185832858338583485835858368583785838858398584085841858428584385844858458584685847858488584985850858518585285853858548585585856858578585885859858608586185862858638586485865858668586785868858698587085871858728587385874858758587685877858788587985880858818588285883858848588585886858878588885889858908589185892858938589485895858968589785898858998590085901859028590385904859058590685907859088590985910859118591285913859148591585916859178591885919859208592185922859238592485925859268592785928859298593085931859328593385934859358593685937859388593985940859418594285943859448594585946859478594885949859508595185952859538595485955859568595785958859598596085961859628596385964859658596685967859688596985970859718597285973859748597585976859778597885979859808598185982859838598485985859868598785988859898599085991859928599385994859958599685997859988599986000860018600286003860048600586006860078600886009860108601186012860138601486015860168601786018860198602086021860228602386024860258602686027860288602986030860318603286033860348603586036860378603886039860408604186042860438604486045860468604786048860498605086051860528605386054860558605686057860588605986060860618606286063860648606586066860678606886069860708607186072860738607486075860768607786078860798608086081860828608386084860858608686087860888608986090860918609286093860948609586096860978609886099861008610186102861038610486105861068610786108861098611086111861128611386114861158611686117861188611986120861218612286123861248612586126861278612886129861308613186132861338613486135861368613786138861398614086141861428614386144861458614686147861488614986150861518615286153861548615586156861578615886159861608616186162861638616486165861668616786168861698617086171861728617386174861758617686177861788617986180861818618286183861848618586186861878618886189861908619186192861938619486195861968619786198861998620086201862028620386204862058620686207862088620986210862118621286213862148621586216862178621886219862208622186222862238622486225862268622786228862298623086231862328623386234862358623686237862388623986240862418624286243862448624586246862478624886249862508625186252862538625486255862568625786258862598626086261862628626386264862658626686267862688626986270862718627286273862748627586276862778627886279862808628186282862838628486285862868628786288862898629086291862928629386294862958629686297862988629986300863018630286303863048630586306863078630886309863108631186312863138631486315863168631786318863198632086321863228632386324863258632686327863288632986330863318633286333863348633586336863378633886339863408634186342863438634486345863468634786348863498635086351863528635386354863558635686357863588635986360863618636286363863648636586366863678636886369863708637186372863738637486375863768637786378863798638086381863828638386384863858638686387863888638986390863918639286393863948639586396863978639886399864008640186402864038640486405864068640786408864098641086411864128641386414864158641686417864188641986420864218642286423864248642586426864278642886429864308643186432864338643486435864368643786438864398644086441864428644386444864458644686447864488644986450864518645286453864548645586456864578645886459864608646186462864638646486465864668646786468864698647086471864728647386474864758647686477864788647986480864818648286483864848648586486864878648886489864908649186492864938649486495864968649786498864998650086501865028650386504865058650686507865088650986510865118651286513865148651586516865178651886519865208652186522865238652486525865268652786528865298653086531865328653386534865358653686537865388653986540865418654286543865448654586546865478654886549865508655186552865538655486555865568655786558865598656086561865628656386564865658656686567865688656986570865718657286573865748657586576865778657886579865808658186582865838658486585865868658786588865898659086591865928659386594865958659686597865988659986600866018660286603866048660586606866078660886609866108661186612866138661486615866168661786618866198662086621866228662386624866258662686627866288662986630866318663286633866348663586636866378663886639866408664186642866438664486645866468664786648866498665086651866528665386654866558665686657866588665986660866618666286663866648666586666866678666886669866708667186672866738667486675866768667786678866798668086681866828668386684866858668686687866888668986690866918669286693866948669586696866978669886699867008670186702867038670486705867068670786708867098671086711867128671386714867158671686717867188671986720867218672286723867248672586726867278672886729867308673186732867338673486735867368673786738867398674086741867428674386744867458674686747867488674986750867518675286753867548675586756867578675886759867608676186762867638676486765867668676786768867698677086771867728677386774867758677686777867788677986780867818678286783867848678586786867878678886789867908679186792867938679486795867968679786798867998680086801868028680386804868058680686807868088680986810868118681286813868148681586816868178681886819868208682186822868238682486825868268682786828868298683086831868328683386834868358683686837868388683986840868418684286843868448684586846868478684886849868508685186852868538685486855868568685786858868598686086861868628686386864868658686686867868688686986870868718687286873868748687586876868778687886879868808688186882868838688486885868868688786888868898689086891868928689386894868958689686897868988689986900869018690286903869048690586906869078690886909869108691186912869138691486915869168691786918869198692086921869228692386924869258692686927869288692986930869318693286933869348693586936869378693886939869408694186942869438694486945869468694786948869498695086951869528695386954869558695686957869588695986960869618696286963869648696586966869678696886969869708697186972869738697486975869768697786978869798698086981869828698386984869858698686987869888698986990869918699286993869948699586996869978699886999870008700187002870038700487005870068700787008870098701087011870128701387014870158701687017870188701987020870218702287023870248702587026870278702887029870308703187032870338703487035870368703787038870398704087041870428704387044870458704687047870488704987050870518705287053870548705587056870578705887059870608706187062870638706487065870668706787068870698707087071870728707387074870758707687077870788707987080870818708287083870848708587086870878708887089870908709187092870938709487095870968709787098870998710087101871028710387104871058710687107871088710987110871118711287113871148711587116871178711887119871208712187122871238712487125871268712787128871298713087131871328713387134871358713687137871388713987140871418714287143871448714587146871478714887149871508715187152871538715487155871568715787158871598716087161871628716387164871658716687167871688716987170871718717287173871748717587176871778717887179871808718187182871838718487185871868718787188871898719087191871928719387194871958719687197871988719987200872018720287203872048720587206872078720887209872108721187212872138721487215872168721787218872198722087221872228722387224872258722687227872288722987230872318723287233872348723587236872378723887239872408724187242872438724487245872468724787248872498725087251872528725387254872558725687257872588725987260872618726287263872648726587266872678726887269872708727187272872738727487275872768727787278872798728087281872828728387284872858728687287872888728987290872918729287293872948729587296872978729887299873008730187302873038730487305873068730787308873098731087311873128731387314873158731687317873188731987320873218732287323873248732587326873278732887329873308733187332873338733487335873368733787338873398734087341873428734387344873458734687347873488734987350873518735287353873548735587356873578735887359873608736187362873638736487365873668736787368873698737087371873728737387374873758737687377873788737987380873818738287383873848738587386873878738887389873908739187392873938739487395873968739787398873998740087401874028740387404874058740687407874088740987410874118741287413874148741587416874178741887419874208742187422874238742487425874268742787428874298743087431874328743387434874358743687437874388743987440874418744287443874448744587446874478744887449874508745187452874538745487455874568745787458874598746087461874628746387464874658746687467874688746987470874718747287473874748747587476874778747887479874808748187482874838748487485874868748787488874898749087491874928749387494874958749687497874988749987500875018750287503875048750587506875078750887509875108751187512875138751487515875168751787518875198752087521875228752387524875258752687527875288752987530875318753287533875348753587536875378753887539875408754187542875438754487545875468754787548875498755087551875528755387554875558755687557875588755987560875618756287563875648756587566875678756887569875708757187572875738757487575875768757787578875798758087581875828758387584875858758687587875888758987590875918759287593875948759587596875978759887599876008760187602876038760487605876068760787608876098761087611876128761387614876158761687617876188761987620876218762287623876248762587626876278762887629876308763187632876338763487635876368763787638876398764087641876428764387644876458764687647876488764987650876518765287653876548765587656876578765887659876608766187662876638766487665876668766787668876698767087671876728767387674876758767687677876788767987680876818768287683876848768587686876878768887689876908769187692876938769487695876968769787698876998770087701877028770387704877058770687707877088770987710877118771287713877148771587716877178771887719877208772187722877238772487725877268772787728877298773087731877328773387734877358773687737877388773987740877418774287743877448774587746877478774887749877508775187752877538775487755877568775787758877598776087761877628776387764877658776687767877688776987770877718777287773877748777587776877778777887779877808778187782877838778487785877868778787788877898779087791877928779387794877958779687797877988779987800878018780287803878048780587806878078780887809878108781187812878138781487815878168781787818878198782087821878228782387824878258782687827878288782987830878318783287833878348783587836878378783887839878408784187842878438784487845878468784787848878498785087851878528785387854878558785687857878588785987860878618786287863878648786587866878678786887869878708787187872878738787487875878768787787878878798788087881878828788387884878858788687887878888788987890878918789287893878948789587896878978789887899879008790187902879038790487905879068790787908879098791087911879128791387914879158791687917879188791987920879218792287923879248792587926879278792887929879308793187932879338793487935879368793787938879398794087941879428794387944879458794687947879488794987950879518795287953879548795587956879578795887959879608796187962879638796487965879668796787968879698797087971879728797387974879758797687977879788797987980879818798287983879848798587986879878798887989879908799187992879938799487995879968799787998879998800088001880028800388004880058800688007880088800988010880118801288013880148801588016880178801888019880208802188022880238802488025880268802788028880298803088031880328803388034880358803688037880388803988040880418804288043880448804588046880478804888049880508805188052880538805488055880568805788058880598806088061880628806388064880658806688067880688806988070880718807288073880748807588076880778807888079880808808188082880838808488085880868808788088880898809088091880928809388094880958809688097880988809988100881018810288103881048810588106881078810888109881108811188112881138811488115881168811788118881198812088121881228812388124881258812688127881288812988130881318813288133881348813588136881378813888139881408814188142881438814488145881468814788148881498815088151881528815388154881558815688157881588815988160881618816288163881648816588166881678816888169881708817188172881738817488175881768817788178881798818088181881828818388184881858818688187881888818988190881918819288193881948819588196881978819888199882008820188202882038820488205882068820788208882098821088211882128821388214882158821688217882188821988220882218822288223882248822588226882278822888229882308823188232882338823488235882368823788238882398824088241882428824388244882458824688247882488824988250882518825288253882548825588256882578825888259882608826188262882638826488265882668826788268882698827088271882728827388274882758827688277882788827988280882818828288283882848828588286882878828888289882908829188292882938829488295882968829788298882998830088301883028830388304883058830688307883088830988310883118831288313883148831588316883178831888319883208832188322883238832488325883268832788328883298833088331883328833388334883358833688337883388833988340883418834288343883448834588346883478834888349883508835188352883538835488355883568835788358883598836088361883628836388364883658836688367883688836988370883718837288373883748837588376883778837888379883808838188382883838838488385883868838788388883898839088391883928839388394883958839688397883988839988400884018840288403884048840588406884078840888409884108841188412884138841488415884168841788418884198842088421884228842388424884258842688427884288842988430884318843288433884348843588436884378843888439884408844188442884438844488445884468844788448884498845088451884528845388454884558845688457884588845988460884618846288463884648846588466884678846888469884708847188472884738847488475884768847788478884798848088481884828848388484884858848688487884888848988490884918849288493884948849588496884978849888499885008850188502885038850488505885068850788508885098851088511885128851388514885158851688517885188851988520885218852288523885248852588526885278852888529885308853188532885338853488535885368853788538885398854088541885428854388544885458854688547885488854988550885518855288553885548855588556885578855888559885608856188562885638856488565885668856788568885698857088571885728857388574885758857688577885788857988580885818858288583885848858588586885878858888589885908859188592885938859488595885968859788598885998860088601886028860388604886058860688607886088860988610886118861288613886148861588616886178861888619886208862188622886238862488625886268862788628886298863088631886328863388634886358863688637886388863988640886418864288643886448864588646886478864888649886508865188652886538865488655886568865788658886598866088661886628866388664886658866688667886688866988670886718867288673886748867588676886778867888679886808868188682886838868488685886868868788688886898869088691886928869388694886958869688697886988869988700887018870288703887048870588706887078870888709887108871188712887138871488715887168871788718887198872088721887228872388724887258872688727887288872988730887318873288733887348873588736887378873888739887408874188742887438874488745887468874788748887498875088751887528875388754887558875688757887588875988760887618876288763887648876588766887678876888769887708877188772887738877488775887768877788778887798878088781887828878388784887858878688787887888878988790887918879288793887948879588796887978879888799888008880188802888038880488805888068880788808888098881088811888128881388814888158881688817888188881988820888218882288823888248882588826888278882888829888308883188832888338883488835888368883788838888398884088841888428884388844888458884688847888488884988850888518885288853888548885588856888578885888859888608886188862888638886488865888668886788868888698887088871888728887388874888758887688877888788887988880888818888288883888848888588886888878888888889888908889188892888938889488895888968889788898888998890088901889028890388904889058890688907889088890988910889118891288913889148891588916889178891888919889208892188922889238892488925889268892788928889298893088931889328893388934889358893688937889388893988940889418894288943889448894588946889478894888949889508895188952889538895488955889568895788958889598896088961889628896388964889658896688967889688896988970889718897288973889748897588976889778897888979889808898188982889838898488985889868898788988889898899088991889928899388994889958899688997889988899989000890018900289003890048900589006890078900889009890108901189012890138901489015890168901789018890198902089021890228902389024890258902689027890288902989030890318903289033890348903589036890378903889039890408904189042890438904489045890468904789048890498905089051890528905389054890558905689057890588905989060890618906289063890648906589066890678906889069890708907189072890738907489075890768907789078890798908089081890828908389084890858908689087890888908989090890918909289093890948909589096890978909889099891008910189102891038910489105891068910789108891098911089111891128911389114891158911689117891188911989120891218912289123891248912589126891278912889129891308913189132891338913489135891368913789138891398914089141891428914389144891458914689147891488914989150891518915289153891548915589156891578915889159891608916189162891638916489165891668916789168891698917089171891728917389174891758917689177891788917989180891818918289183891848918589186891878918889189891908919189192891938919489195891968919789198891998920089201892028920389204892058920689207892088920989210892118921289213892148921589216892178921889219892208922189222892238922489225892268922789228892298923089231892328923389234892358923689237892388923989240892418924289243892448924589246892478924889249892508925189252892538925489255892568925789258892598926089261892628926389264892658926689267892688926989270892718927289273892748927589276892778927889279892808928189282892838928489285892868928789288892898929089291892928929389294892958929689297892988929989300893018930289303893048930589306893078930889309893108931189312893138931489315893168931789318893198932089321893228932389324893258932689327893288932989330893318933289333893348933589336893378933889339893408934189342893438934489345893468934789348893498935089351893528935389354893558935689357893588935989360893618936289363893648936589366893678936889369893708937189372893738937489375893768937789378893798938089381893828938389384893858938689387893888938989390893918939289393893948939589396893978939889399894008940189402894038940489405894068940789408894098941089411894128941389414894158941689417894188941989420894218942289423894248942589426894278942889429894308943189432894338943489435894368943789438894398944089441894428944389444894458944689447894488944989450894518945289453894548945589456894578945889459894608946189462894638946489465894668946789468894698947089471894728947389474894758947689477894788947989480894818948289483894848948589486894878948889489894908949189492894938949489495894968949789498894998950089501895028950389504895058950689507895088950989510895118951289513895148951589516895178951889519895208952189522895238952489525895268952789528895298953089531895328953389534895358953689537895388953989540895418954289543895448954589546895478954889549895508955189552895538955489555895568955789558895598956089561895628956389564895658956689567895688956989570895718957289573895748957589576895778957889579895808958189582895838958489585895868958789588895898959089591895928959389594895958959689597895988959989600896018960289603896048960589606896078960889609896108961189612896138961489615896168961789618896198962089621896228962389624896258962689627896288962989630896318963289633896348963589636896378963889639896408964189642896438964489645896468964789648896498965089651896528965389654896558965689657896588965989660896618966289663896648966589666896678966889669896708967189672896738967489675896768967789678896798968089681896828968389684896858968689687896888968989690896918969289693896948969589696896978969889699897008970189702897038970489705897068970789708897098971089711897128971389714897158971689717897188971989720897218972289723897248972589726897278972889729897308973189732897338973489735897368973789738897398974089741897428974389744897458974689747897488974989750897518975289753897548975589756897578975889759897608976189762897638976489765897668976789768897698977089771897728977389774897758977689777897788977989780897818978289783897848978589786897878978889789897908979189792897938979489795897968979789798897998980089801898028980389804898058980689807898088980989810898118981289813898148981589816898178981889819898208982189822898238982489825898268982789828898298983089831898328983389834898358983689837898388983989840898418984289843898448984589846898478984889849898508985189852898538985489855898568985789858898598986089861898628986389864898658986689867898688986989870898718987289873898748987589876898778987889879898808988189882898838988489885898868988789888898898989089891898928989389894898958989689897898988989989900899018990289903899048990589906899078990889909899108991189912899138991489915899168991789918899198992089921899228992389924899258992689927899288992989930899318993289933899348993589936899378993889939899408994189942899438994489945899468994789948899498995089951899528995389954899558995689957899588995989960899618996289963899648996589966899678996889969899708997189972899738997489975899768997789978899798998089981899828998389984899858998689987899888998989990899918999289993899948999589996899978999889999900009000190002900039000490005900069000790008900099001090011900129001390014900159001690017900189001990020900219002290023900249002590026900279002890029900309003190032900339003490035900369003790038900399004090041900429004390044900459004690047900489004990050900519005290053900549005590056900579005890059900609006190062900639006490065900669006790068900699007090071900729007390074900759007690077900789007990080900819008290083900849008590086900879008890089900909009190092900939009490095900969009790098900999010090101901029010390104901059010690107901089010990110901119011290113901149011590116901179011890119901209012190122901239012490125901269012790128901299013090131901329013390134901359013690137901389013990140901419014290143901449014590146901479014890149901509015190152901539015490155901569015790158901599016090161901629016390164901659016690167901689016990170901719017290173901749017590176901779017890179901809018190182901839018490185901869018790188901899019090191901929019390194901959019690197901989019990200902019020290203902049020590206902079020890209902109021190212902139021490215902169021790218902199022090221902229022390224902259022690227902289022990230902319023290233902349023590236902379023890239902409024190242902439024490245902469024790248902499025090251902529025390254902559025690257902589025990260902619026290263902649026590266902679026890269902709027190272902739027490275902769027790278902799028090281902829028390284902859028690287902889028990290902919029290293902949029590296902979029890299903009030190302903039030490305903069030790308903099031090311903129031390314903159031690317903189031990320903219032290323903249032590326903279032890329903309033190332903339033490335903369033790338903399034090341903429034390344903459034690347903489034990350903519035290353903549035590356903579035890359903609036190362903639036490365903669036790368903699037090371903729037390374903759037690377903789037990380903819038290383903849038590386903879038890389903909039190392903939039490395903969039790398903999040090401904029040390404904059040690407904089040990410904119041290413904149041590416904179041890419904209042190422904239042490425904269042790428904299043090431904329043390434904359043690437904389043990440904419044290443904449044590446904479044890449904509045190452904539045490455904569045790458904599046090461904629046390464904659046690467904689046990470904719047290473904749047590476904779047890479904809048190482904839048490485904869048790488904899049090491904929049390494904959049690497904989049990500905019050290503905049050590506905079050890509905109051190512905139051490515905169051790518905199052090521905229052390524905259052690527905289052990530905319053290533905349053590536905379053890539905409054190542905439054490545905469054790548905499055090551905529055390554905559055690557905589055990560905619056290563905649056590566905679056890569905709057190572905739057490575905769057790578905799058090581905829058390584905859058690587905889058990590905919059290593905949059590596905979059890599906009060190602906039060490605906069060790608906099061090611906129061390614906159061690617906189061990620906219062290623906249062590626906279062890629906309063190632906339063490635906369063790638906399064090641906429064390644906459064690647906489064990650906519065290653906549065590656906579065890659906609066190662906639066490665906669066790668906699067090671906729067390674906759067690677906789067990680906819068290683906849068590686906879068890689906909069190692906939069490695906969069790698906999070090701907029070390704907059070690707907089070990710907119071290713907149071590716907179071890719907209072190722907239072490725907269072790728907299073090731907329073390734907359073690737907389073990740907419074290743907449074590746907479074890749907509075190752907539075490755907569075790758907599076090761907629076390764907659076690767907689076990770907719077290773907749077590776907779077890779907809078190782907839078490785907869078790788907899079090791907929079390794907959079690797907989079990800908019080290803908049080590806908079080890809908109081190812908139081490815908169081790818908199082090821908229082390824908259082690827908289082990830908319083290833908349083590836908379083890839908409084190842908439084490845908469084790848908499085090851908529085390854908559085690857908589085990860908619086290863908649086590866908679086890869908709087190872908739087490875908769087790878908799088090881908829088390884908859088690887908889088990890908919089290893908949089590896908979089890899909009090190902909039090490905909069090790908909099091090911909129091390914909159091690917909189091990920909219092290923909249092590926909279092890929909309093190932909339093490935909369093790938909399094090941909429094390944909459094690947909489094990950909519095290953909549095590956909579095890959909609096190962909639096490965909669096790968909699097090971909729097390974909759097690977909789097990980909819098290983909849098590986909879098890989909909099190992909939099490995909969099790998909999100091001910029100391004910059100691007910089100991010910119101291013910149101591016910179101891019910209102191022910239102491025910269102791028910299103091031910329103391034910359103691037910389103991040910419104291043910449104591046910479104891049910509105191052910539105491055910569105791058910599106091061910629106391064910659106691067910689106991070910719107291073910749107591076910779107891079910809108191082910839108491085910869108791088910899109091091910929109391094910959109691097910989109991100911019110291103911049110591106911079110891109911109111191112911139111491115911169111791118911199112091121911229112391124911259112691127911289112991130911319113291133911349113591136911379113891139911409114191142911439114491145911469114791148911499115091151911529115391154911559115691157911589115991160911619116291163911649116591166911679116891169911709117191172911739117491175911769117791178911799118091181911829118391184911859118691187911889118991190911919119291193911949119591196911979119891199912009120191202912039120491205912069120791208912099121091211912129121391214912159121691217912189121991220912219122291223912249122591226912279122891229912309123191232912339123491235912369123791238912399124091241912429124391244912459124691247912489124991250912519125291253912549125591256912579125891259912609126191262912639126491265912669126791268912699127091271912729127391274912759127691277912789127991280912819128291283912849128591286912879128891289912909129191292912939129491295912969129791298912999130091301913029130391304913059130691307913089130991310913119131291313913149131591316913179131891319913209132191322913239132491325913269132791328913299133091331913329133391334913359133691337913389133991340913419134291343913449134591346913479134891349913509135191352913539135491355913569135791358913599136091361913629136391364913659136691367913689136991370913719137291373913749137591376913779137891379913809138191382913839138491385913869138791388913899139091391913929139391394913959139691397913989139991400914019140291403914049140591406914079140891409914109141191412914139141491415914169141791418914199142091421914229142391424914259142691427914289142991430914319143291433914349143591436914379143891439914409144191442914439144491445914469144791448914499145091451914529145391454914559145691457914589145991460914619146291463914649146591466914679146891469914709147191472914739147491475914769147791478914799148091481914829148391484914859148691487914889148991490914919149291493914949149591496914979149891499915009150191502915039150491505915069150791508915099151091511915129151391514915159151691517915189151991520915219152291523915249152591526915279152891529915309153191532915339153491535915369153791538915399154091541915429154391544915459154691547915489154991550915519155291553915549155591556915579155891559915609156191562915639156491565915669156791568915699157091571915729157391574915759157691577915789157991580915819158291583915849158591586915879158891589915909159191592915939159491595915969159791598915999160091601916029160391604916059160691607916089160991610916119161291613916149161591616916179161891619916209162191622916239162491625916269162791628916299163091631916329163391634916359163691637916389163991640916419164291643916449164591646916479164891649916509165191652916539165491655916569165791658916599166091661916629166391664916659166691667916689166991670916719167291673916749167591676916779167891679916809168191682916839168491685916869168791688916899169091691916929169391694916959169691697916989169991700917019170291703917049170591706917079170891709917109171191712917139171491715917169171791718917199172091721917229172391724917259172691727917289172991730917319173291733917349173591736917379173891739917409174191742917439174491745917469174791748917499175091751917529175391754917559175691757917589175991760917619176291763917649176591766917679176891769917709177191772917739177491775917769177791778917799178091781917829178391784917859178691787917889178991790917919179291793917949179591796917979179891799918009180191802918039180491805918069180791808918099181091811918129181391814918159181691817918189181991820918219182291823918249182591826918279182891829918309183191832918339183491835918369183791838918399184091841918429184391844918459184691847918489184991850918519185291853918549185591856918579185891859918609186191862918639186491865918669186791868918699187091871918729187391874918759187691877918789187991880918819188291883918849188591886918879188891889918909189191892918939189491895918969189791898918999190091901919029190391904919059190691907919089190991910919119191291913919149191591916919179191891919919209192191922919239192491925919269192791928919299193091931919329193391934919359193691937919389193991940919419194291943919449194591946919479194891949919509195191952919539195491955919569195791958919599196091961919629196391964919659196691967919689196991970919719197291973919749197591976919779197891979919809198191982919839198491985919869198791988919899199091991919929199391994919959199691997919989199992000920019200292003920049200592006920079200892009920109201192012920139201492015920169201792018920199202092021920229202392024920259202692027920289202992030920319203292033920349203592036920379203892039920409204192042920439204492045920469204792048920499205092051920529205392054920559205692057920589205992060920619206292063920649206592066920679206892069920709207192072920739207492075920769207792078920799208092081920829208392084920859208692087920889208992090920919209292093920949209592096920979209892099921009210192102921039210492105921069210792108921099211092111921129211392114921159211692117921189211992120921219212292123921249212592126921279212892129921309213192132921339213492135921369213792138921399214092141921429214392144921459214692147921489214992150921519215292153921549215592156921579215892159921609216192162921639216492165921669216792168921699217092171921729217392174921759217692177921789217992180921819218292183921849218592186921879218892189921909219192192921939219492195921969219792198921999220092201922029220392204922059220692207922089220992210922119221292213922149221592216922179221892219922209222192222922239222492225922269222792228922299223092231922329223392234922359223692237922389223992240922419224292243922449224592246922479224892249922509225192252922539225492255922569225792258922599226092261922629226392264922659226692267922689226992270922719227292273922749227592276922779227892279922809228192282922839228492285922869228792288922899229092291922929229392294922959229692297922989229992300923019230292303923049230592306923079230892309923109231192312923139231492315923169231792318923199232092321923229232392324923259232692327923289232992330923319233292333923349233592336923379233892339923409234192342923439234492345923469234792348923499235092351923529235392354923559235692357923589235992360923619236292363923649236592366923679236892369923709237192372923739237492375923769237792378923799238092381923829238392384923859238692387923889238992390923919239292393923949239592396923979239892399924009240192402924039240492405924069240792408924099241092411924129241392414924159241692417924189241992420924219242292423924249242592426924279242892429924309243192432924339243492435924369243792438924399244092441924429244392444924459244692447924489244992450924519245292453924549245592456924579245892459924609246192462924639246492465924669246792468924699247092471924729247392474924759247692477924789247992480924819248292483924849248592486924879248892489924909249192492924939249492495924969249792498924999250092501925029250392504925059250692507925089250992510925119251292513925149251592516925179251892519925209252192522925239252492525925269252792528925299253092531925329253392534925359253692537925389253992540925419254292543925449254592546925479254892549925509255192552925539255492555925569255792558925599256092561925629256392564925659256692567925689256992570925719257292573925749257592576925779257892579925809258192582925839258492585925869258792588925899259092591925929259392594925959259692597925989259992600926019260292603926049260592606926079260892609926109261192612926139261492615926169261792618926199262092621926229262392624926259262692627926289262992630926319263292633926349263592636926379263892639926409264192642926439264492645926469264792648926499265092651926529265392654926559265692657926589265992660926619266292663926649266592666926679266892669926709267192672926739267492675926769267792678926799268092681926829268392684926859268692687926889268992690926919269292693926949269592696926979269892699927009270192702927039270492705927069270792708927099271092711927129271392714927159271692717927189271992720927219272292723927249272592726927279272892729927309273192732927339273492735927369273792738927399274092741927429274392744927459274692747927489274992750927519275292753927549275592756927579275892759927609276192762927639276492765927669276792768927699277092771927729277392774927759277692777927789277992780927819278292783927849278592786927879278892789927909279192792927939279492795927969279792798927999280092801928029280392804928059280692807928089280992810928119281292813928149281592816928179281892819928209282192822928239282492825928269282792828928299283092831928329283392834928359283692837928389283992840928419284292843928449284592846928479284892849928509285192852928539285492855928569285792858928599286092861928629286392864928659286692867928689286992870928719287292873928749287592876928779287892879928809288192882928839288492885928869288792888928899289092891928929289392894928959289692897928989289992900929019290292903929049290592906929079290892909929109291192912929139291492915929169291792918929199292092921929229292392924929259292692927929289292992930929319293292933929349293592936929379293892939929409294192942929439294492945929469294792948929499295092951929529295392954929559295692957929589295992960929619296292963929649296592966929679296892969929709297192972929739297492975929769297792978929799298092981929829298392984929859298692987929889298992990929919299292993929949299592996929979299892999930009300193002930039300493005930069300793008930099301093011930129301393014930159301693017930189301993020930219302293023930249302593026930279302893029930309303193032930339303493035930369303793038930399304093041930429304393044930459304693047930489304993050930519305293053930549305593056930579305893059930609306193062930639306493065930669306793068930699307093071930729307393074930759307693077930789307993080930819308293083930849308593086930879308893089930909309193092930939309493095930969309793098930999310093101931029310393104931059310693107931089310993110931119311293113931149311593116931179311893119931209312193122931239312493125931269312793128931299313093131931329313393134931359313693137931389313993140931419314293143931449314593146931479314893149931509315193152931539315493155931569315793158931599316093161931629316393164931659316693167931689316993170931719317293173931749317593176931779317893179931809318193182931839318493185931869318793188931899319093191931929319393194931959319693197931989319993200932019320293203932049320593206932079320893209932109321193212932139321493215932169321793218932199322093221932229322393224932259322693227932289322993230932319323293233932349323593236932379323893239932409324193242932439324493245932469324793248932499325093251932529325393254932559325693257932589325993260932619326293263932649326593266932679326893269932709327193272932739327493275932769327793278932799328093281932829328393284932859328693287932889328993290932919329293293932949329593296932979329893299933009330193302933039330493305933069330793308933099331093311933129331393314933159331693317933189331993320933219332293323933249332593326933279332893329933309333193332933339333493335933369333793338933399334093341933429334393344933459334693347933489334993350933519335293353933549335593356933579335893359933609336193362933639336493365933669336793368933699337093371933729337393374933759337693377933789337993380933819338293383933849338593386933879338893389933909339193392933939339493395933969339793398933999340093401934029340393404934059340693407934089340993410934119341293413934149341593416934179341893419934209342193422934239342493425934269342793428934299343093431934329343393434934359343693437934389343993440934419344293443934449344593446934479344893449934509345193452934539345493455934569345793458934599346093461934629346393464934659346693467934689346993470934719347293473934749347593476934779347893479934809348193482934839348493485934869348793488934899349093491934929349393494934959349693497934989349993500935019350293503935049350593506935079350893509935109351193512935139351493515935169351793518935199352093521935229352393524935259352693527935289352993530935319353293533935349353593536935379353893539935409354193542935439354493545935469354793548935499355093551935529355393554935559355693557935589355993560935619356293563935649356593566935679356893569935709357193572935739357493575935769357793578935799358093581935829358393584935859358693587935889358993590935919359293593935949359593596935979359893599936009360193602936039360493605936069360793608936099361093611936129361393614936159361693617936189361993620936219362293623936249362593626936279362893629936309363193632936339363493635936369363793638936399364093641936429364393644936459364693647936489364993650936519365293653936549365593656936579365893659936609366193662936639366493665936669366793668936699367093671936729367393674936759367693677936789367993680936819368293683936849368593686936879368893689936909369193692936939369493695936969369793698936999370093701937029370393704937059370693707937089370993710937119371293713937149371593716937179371893719937209372193722937239372493725937269372793728937299373093731937329373393734937359373693737937389373993740937419374293743937449374593746937479374893749937509375193752937539375493755937569375793758937599376093761937629376393764937659376693767937689376993770937719377293773937749377593776937779377893779937809378193782937839378493785937869378793788937899379093791937929379393794937959379693797937989379993800938019380293803938049380593806938079380893809938109381193812938139381493815938169381793818938199382093821938229382393824938259382693827938289382993830938319383293833938349383593836938379383893839938409384193842938439384493845938469384793848938499385093851938529385393854938559385693857938589385993860938619386293863938649386593866938679386893869938709387193872938739387493875938769387793878938799388093881938829388393884938859388693887938889388993890938919389293893938949389593896938979389893899939009390193902939039390493905939069390793908939099391093911939129391393914939159391693917939189391993920939219392293923939249392593926939279392893929939309393193932939339393493935939369393793938939399394093941939429394393944939459394693947939489394993950939519395293953939549395593956939579395893959939609396193962939639396493965939669396793968939699397093971939729397393974939759397693977939789397993980939819398293983939849398593986939879398893989939909399193992939939399493995939969399793998939999400094001940029400394004940059400694007940089400994010940119401294013940149401594016940179401894019940209402194022940239402494025940269402794028940299403094031940329403394034940359403694037940389403994040940419404294043940449404594046940479404894049940509405194052940539405494055940569405794058940599406094061940629406394064940659406694067940689406994070940719407294073940749407594076940779407894079940809408194082940839408494085940869408794088940899409094091940929409394094940959409694097940989409994100941019410294103941049410594106941079410894109941109411194112941139411494115941169411794118941199412094121941229412394124941259412694127941289412994130941319413294133941349413594136941379413894139941409414194142941439414494145941469414794148941499415094151941529415394154941559415694157941589415994160941619416294163941649416594166941679416894169941709417194172941739417494175941769417794178941799418094181941829418394184941859418694187941889418994190941919419294193941949419594196941979419894199942009420194202942039420494205942069420794208942099421094211942129421394214942159421694217942189421994220942219422294223942249422594226942279422894229942309423194232942339423494235942369423794238942399424094241942429424394244942459424694247942489424994250942519425294253942549425594256942579425894259942609426194262942639426494265942669426794268942699427094271942729427394274942759427694277942789427994280942819428294283942849428594286942879428894289942909429194292942939429494295942969429794298942999430094301943029430394304943059430694307943089430994310943119431294313943149431594316943179431894319943209432194322943239432494325943269432794328943299433094331943329433394334943359433694337943389433994340943419434294343943449434594346943479434894349943509435194352943539435494355943569435794358943599436094361943629436394364943659436694367943689436994370943719437294373943749437594376943779437894379943809438194382943839438494385943869438794388943899439094391943929439394394943959439694397943989439994400944019440294403944049440594406944079440894409944109441194412944139441494415944169441794418944199442094421944229442394424944259442694427944289442994430944319443294433944349443594436944379443894439944409444194442944439444494445944469444794448944499445094451944529445394454944559445694457944589445994460944619446294463944649446594466944679446894469944709447194472944739447494475944769447794478944799448094481944829448394484944859448694487944889448994490944919449294493944949449594496944979449894499945009450194502945039450494505945069450794508945099451094511945129451394514945159451694517945189451994520945219452294523945249452594526945279452894529945309453194532945339453494535945369453794538945399454094541945429454394544945459454694547945489454994550945519455294553945549455594556945579455894559945609456194562945639456494565945669456794568945699457094571945729457394574945759457694577945789457994580945819458294583945849458594586945879458894589945909459194592945939459494595945969459794598945999460094601946029460394604946059460694607946089460994610946119461294613946149461594616946179461894619946209462194622946239462494625946269462794628946299463094631946329463394634946359463694637946389463994640946419464294643946449464594646946479464894649946509465194652946539465494655946569465794658946599466094661946629466394664946659466694667946689466994670946719467294673946749467594676946779467894679946809468194682946839468494685946869468794688946899469094691946929469394694946959469694697946989469994700947019470294703947049470594706947079470894709947109471194712947139471494715947169471794718947199472094721947229472394724947259472694727947289472994730947319473294733947349473594736947379473894739947409474194742947439474494745947469474794748947499475094751947529475394754947559475694757947589475994760947619476294763947649476594766947679476894769947709477194772947739477494775947769477794778947799478094781947829478394784947859478694787947889478994790947919479294793947949479594796947979479894799948009480194802948039480494805948069480794808948099481094811948129481394814948159481694817948189481994820948219482294823948249482594826948279482894829948309483194832948339483494835948369483794838948399484094841948429484394844948459484694847948489484994850948519485294853948549485594856948579485894859948609486194862948639486494865948669486794868948699487094871948729487394874948759487694877948789487994880948819488294883948849488594886948879488894889948909489194892948939489494895948969489794898948999490094901949029490394904949059490694907949089490994910949119491294913949149491594916949179491894919949209492194922949239492494925949269492794928949299493094931949329493394934949359493694937949389493994940949419494294943949449494594946949479494894949949509495194952949539495494955949569495794958949599496094961949629496394964949659496694967949689496994970949719497294973949749497594976949779497894979949809498194982949839498494985949869498794988949899499094991949929499394994949959499694997949989499995000950019500295003950049500595006950079500895009950109501195012950139501495015950169501795018950199502095021950229502395024950259502695027950289502995030950319503295033950349503595036950379503895039950409504195042950439504495045950469504795048950499505095051950529505395054950559505695057950589505995060950619506295063950649506595066950679506895069950709507195072950739507495075950769507795078950799508095081950829508395084950859508695087950889508995090950919509295093950949509595096950979509895099951009510195102951039510495105951069510795108951099511095111951129511395114951159511695117951189511995120951219512295123951249512595126951279512895129951309513195132951339513495135951369513795138951399514095141951429514395144951459514695147951489514995150951519515295153951549515595156951579515895159951609516195162951639516495165951669516795168951699517095171951729517395174951759517695177951789517995180951819518295183951849518595186951879518895189951909519195192951939519495195951969519795198951999520095201952029520395204952059520695207952089520995210952119521295213952149521595216952179521895219952209522195222952239522495225952269522795228952299523095231952329523395234952359523695237952389523995240952419524295243952449524595246952479524895249952509525195252952539525495255952569525795258952599526095261952629526395264952659526695267952689526995270952719527295273952749527595276952779527895279952809528195282952839528495285952869528795288952899529095291952929529395294952959529695297952989529995300953019530295303953049530595306953079530895309953109531195312953139531495315953169531795318953199532095321953229532395324953259532695327953289532995330953319533295333953349533595336953379533895339953409534195342953439534495345953469534795348953499535095351953529535395354953559535695357953589535995360953619536295363953649536595366953679536895369953709537195372953739537495375953769537795378953799538095381953829538395384953859538695387953889538995390953919539295393953949539595396953979539895399954009540195402954039540495405954069540795408954099541095411954129541395414954159541695417954189541995420954219542295423954249542595426954279542895429954309543195432954339543495435954369543795438954399544095441954429544395444954459544695447954489544995450954519545295453954549545595456954579545895459954609546195462954639546495465954669546795468954699547095471954729547395474954759547695477954789547995480954819548295483954849548595486954879548895489954909549195492954939549495495954969549795498954999550095501955029550395504955059550695507955089550995510955119551295513955149551595516955179551895519955209552195522955239552495525955269552795528955299553095531955329553395534955359553695537955389553995540955419554295543955449554595546955479554895549955509555195552955539555495555955569555795558955599556095561955629556395564955659556695567955689556995570955719557295573955749557595576955779557895579955809558195582955839558495585955869558795588955899559095591955929559395594955959559695597955989559995600956019560295603956049560595606956079560895609956109561195612956139561495615956169561795618956199562095621956229562395624956259562695627956289562995630956319563295633956349563595636956379563895639956409564195642956439564495645956469564795648956499565095651956529565395654956559565695657956589565995660956619566295663956649566595666956679566895669956709567195672956739567495675956769567795678956799568095681956829568395684956859568695687956889568995690956919569295693956949569595696956979569895699957009570195702957039570495705957069570795708957099571095711957129571395714957159571695717957189571995720957219572295723957249572595726957279572895729957309573195732957339573495735957369573795738957399574095741957429574395744957459574695747957489574995750957519575295753957549575595756957579575895759957609576195762957639576495765957669576795768957699577095771957729577395774957759577695777957789577995780957819578295783957849578595786957879578895789957909579195792957939579495795957969579795798957999580095801958029580395804958059580695807958089580995810958119581295813958149581595816958179581895819958209582195822958239582495825958269582795828958299583095831958329583395834958359583695837958389583995840958419584295843958449584595846958479584895849958509585195852958539585495855958569585795858958599586095861958629586395864958659586695867958689586995870958719587295873958749587595876958779587895879958809588195882958839588495885958869588795888958899589095891958929589395894958959589695897958989589995900959019590295903959049590595906959079590895909959109591195912959139591495915959169591795918959199592095921959229592395924959259592695927959289592995930959319593295933959349593595936959379593895939959409594195942959439594495945959469594795948959499595095951959529595395954959559595695957959589595995960959619596295963959649596595966959679596895969959709597195972959739597495975959769597795978959799598095981959829598395984959859598695987959889598995990959919599295993959949599595996959979599895999960009600196002960039600496005960069600796008960099601096011960129601396014960159601696017960189601996020960219602296023960249602596026960279602896029960309603196032960339603496035960369603796038960399604096041960429604396044960459604696047960489604996050960519605296053960549605596056960579605896059960609606196062960639606496065960669606796068960699607096071960729607396074960759607696077960789607996080960819608296083960849608596086960879608896089960909609196092960939609496095960969609796098960999610096101961029610396104961059610696107961089610996110961119611296113961149611596116961179611896119961209612196122961239612496125961269612796128961299613096131961329613396134961359613696137961389613996140961419614296143961449614596146961479614896149961509615196152961539615496155961569615796158961599616096161961629616396164961659616696167961689616996170961719617296173961749617596176961779617896179961809618196182961839618496185961869618796188961899619096191961929619396194961959619696197961989619996200962019620296203962049620596206962079620896209962109621196212962139621496215962169621796218962199622096221962229622396224962259622696227962289622996230962319623296233962349623596236962379623896239962409624196242962439624496245962469624796248962499625096251962529625396254962559625696257962589625996260962619626296263962649626596266962679626896269962709627196272962739627496275962769627796278962799628096281962829628396284962859628696287962889628996290962919629296293962949629596296962979629896299963009630196302963039630496305963069630796308963099631096311963129631396314963159631696317963189631996320963219632296323963249632596326963279632896329963309633196332963339633496335963369633796338963399634096341963429634396344963459634696347963489634996350963519635296353963549635596356963579635896359963609636196362963639636496365963669636796368963699637096371963729637396374963759637696377963789637996380963819638296383963849638596386963879638896389963909639196392963939639496395963969639796398963999640096401964029640396404964059640696407964089640996410964119641296413964149641596416964179641896419964209642196422964239642496425964269642796428964299643096431964329643396434964359643696437964389643996440964419644296443964449644596446964479644896449964509645196452964539645496455964569645796458964599646096461964629646396464964659646696467964689646996470964719647296473964749647596476964779647896479964809648196482964839648496485964869648796488964899649096491964929649396494964959649696497964989649996500965019650296503965049650596506965079650896509965109651196512965139651496515965169651796518965199652096521965229652396524965259652696527965289652996530965319653296533965349653596536965379653896539965409654196542965439654496545965469654796548965499655096551965529655396554965559655696557965589655996560965619656296563965649656596566965679656896569965709657196572965739657496575965769657796578965799658096581965829658396584965859658696587965889658996590965919659296593965949659596596965979659896599966009660196602966039660496605966069660796608966099661096611966129661396614966159661696617966189661996620966219662296623966249662596626966279662896629966309663196632966339663496635966369663796638966399664096641966429664396644966459664696647966489664996650966519665296653966549665596656966579665896659966609666196662966639666496665966669666796668966699667096671966729667396674966759667696677966789667996680966819668296683966849668596686966879668896689966909669196692966939669496695966969669796698966999670096701967029670396704967059670696707967089670996710967119671296713967149671596716967179671896719967209672196722967239672496725967269672796728967299673096731967329673396734967359673696737967389673996740967419674296743967449674596746967479674896749967509675196752967539675496755967569675796758967599676096761967629676396764967659676696767967689676996770967719677296773967749677596776967779677896779967809678196782967839678496785967869678796788967899679096791967929679396794967959679696797967989679996800968019680296803968049680596806968079680896809968109681196812968139681496815968169681796818968199682096821968229682396824968259682696827968289682996830968319683296833968349683596836968379683896839968409684196842968439684496845968469684796848968499685096851968529685396854968559685696857968589685996860968619686296863968649686596866968679686896869968709687196872968739687496875968769687796878968799688096881968829688396884968859688696887968889688996890968919689296893968949689596896968979689896899969009690196902969039690496905969069690796908969099691096911969129691396914969159691696917969189691996920969219692296923969249692596926969279692896929969309693196932969339693496935969369693796938969399694096941969429694396944969459694696947969489694996950969519695296953969549695596956969579695896959969609696196962969639696496965969669696796968969699697096971969729697396974969759697696977969789697996980969819698296983969849698596986969879698896989969909699196992969939699496995969969699796998969999700097001970029700397004970059700697007970089700997010970119701297013970149701597016970179701897019970209702197022970239702497025970269702797028970299703097031970329703397034970359703697037
  1. /*!
  2. *
  3. * iclient-mapboxgl.(https://iclient.supermap.io)
  4. * Copyright© 2000 - 2020 SuperMap Software Co.Ltd
  5. * license: Apache-2.0
  6. * version: v10.1.0
  7. *
  8. */
  9. /******/ (function(modules) { // webpackBootstrap
  10. /******/ // The module cache
  11. /******/ var installedModules = {};
  12. /******/
  13. /******/ // The require function
  14. /******/ function __webpack_require__(moduleId) {
  15. /******/
  16. /******/ // Check if module is in cache
  17. /******/ if(installedModules[moduleId]) {
  18. /******/ return installedModules[moduleId].exports;
  19. /******/ }
  20. /******/ // Create a new module (and put it into the cache)
  21. /******/ var module = installedModules[moduleId] = {
  22. /******/ i: moduleId,
  23. /******/ l: false,
  24. /******/ exports: {}
  25. /******/ };
  26. /******/
  27. /******/ // Execute the module function
  28. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  29. /******/
  30. /******/ // Flag the module as loaded
  31. /******/ module.l = true;
  32. /******/
  33. /******/ // Return the exports of the module
  34. /******/ return module.exports;
  35. /******/ }
  36. /******/
  37. /******/
  38. /******/ // expose the modules object (__webpack_modules__)
  39. /******/ __webpack_require__.m = modules;
  40. /******/
  41. /******/ // expose the module cache
  42. /******/ __webpack_require__.c = installedModules;
  43. /******/
  44. /******/ // define getter function for harmony exports
  45. /******/ __webpack_require__.d = function(exports, name, getter) {
  46. /******/ if(!__webpack_require__.o(exports, name)) {
  47. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  48. /******/ }
  49. /******/ };
  50. /******/
  51. /******/ // define __esModule on exports
  52. /******/ __webpack_require__.r = function(exports) {
  53. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  54. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  55. /******/ }
  56. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  57. /******/ };
  58. /******/
  59. /******/ // create a fake namespace object
  60. /******/ // mode & 1: value is a module id, require it
  61. /******/ // mode & 2: merge all properties of value into the ns
  62. /******/ // mode & 4: return value when already ns object
  63. /******/ // mode & 8|1: behave like require
  64. /******/ __webpack_require__.t = function(value, mode) {
  65. /******/ if(mode & 1) value = __webpack_require__(value);
  66. /******/ if(mode & 8) return value;
  67. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  68. /******/ var ns = Object.create(null);
  69. /******/ __webpack_require__.r(ns);
  70. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  71. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  72. /******/ return ns;
  73. /******/ };
  74. /******/
  75. /******/ // getDefaultExport function for compatibility with non-harmony modules
  76. /******/ __webpack_require__.n = function(module) {
  77. /******/ var getter = module && module.__esModule ?
  78. /******/ function getDefault() { return module['default']; } :
  79. /******/ function getModuleExports() { return module; };
  80. /******/ __webpack_require__.d(getter, 'a', getter);
  81. /******/ return getter;
  82. /******/ };
  83. /******/
  84. /******/ // Object.prototype.hasOwnProperty.call
  85. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  86. /******/
  87. /******/ // __webpack_public_path__
  88. /******/ __webpack_require__.p = "";
  89. /******/
  90. /******/
  91. /******/ // Load entry module and return exports
  92. /******/ return __webpack_require__(__webpack_require__.s = 11);
  93. /******/ })
  94. /************************************************************************/
  95. /******/ ([
  96. /* 0 */
  97. /***/ (function(module, exports) {
  98. module.exports = mapboxgl;
  99. /***/ }),
  100. /* 1 */
  101. /***/ (function(module, exports) {
  102. module.exports = function(){try{return THREE}catch(e){return {}}}();
  103. /***/ }),
  104. /* 2 */
  105. /***/ (function(module, exports) {
  106. module.exports = function(){try{return mapv}catch(e){return {}}}();
  107. /***/ }),
  108. /* 3 */
  109. /***/ (function(module, exports) {
  110. 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); }
  111. var g; // This works in non-strict mode
  112. g = function () {
  113. return this;
  114. }();
  115. try {
  116. // This works if eval is allowed (see CSP)
  117. g = g || new Function("return this")();
  118. } catch (e) {
  119. // This works if the window reference is available
  120. if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
  121. } // g can still be undefined, but nothing to do about it...
  122. // We return undefined, instead of nothing here, so it's
  123. // easier to handle this case. if(!global) { ...}
  124. module.exports = g;
  125. /***/ }),
  126. /* 4 */
  127. /***/ (function(module, exports, __webpack_require__) {
  128. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  129. if (true) {
  130. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  131. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  132. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  133. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  134. } else { var mod; }
  135. })(this, function (exports, module) {
  136. 'use strict';
  137. var defaultOptions = {
  138. timeout: 5000,
  139. jsonpCallback: 'callback',
  140. jsonpCallbackFunction: null
  141. };
  142. function generateCallbackFunction() {
  143. return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
  144. }
  145. function clearFunction(functionName) {
  146. // IE8 throws an exception when you try to delete a property on window
  147. // http://stackoverflow.com/a/1824228/751089
  148. try {
  149. delete window[functionName];
  150. } catch (e) {
  151. window[functionName] = undefined;
  152. }
  153. }
  154. function removeScript(scriptId) {
  155. var script = document.getElementById(scriptId);
  156. if (script) {
  157. document.getElementsByTagName('head')[0].removeChild(script);
  158. }
  159. }
  160. function fetchJsonp(_url) {
  161. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // to avoid param reassign
  162. var url = _url;
  163. var timeout = options.timeout || defaultOptions.timeout;
  164. var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
  165. var timeoutId = undefined;
  166. return new Promise(function (resolve, reject) {
  167. var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
  168. var scriptId = jsonpCallback + '_' + callbackFunction;
  169. window[callbackFunction] = function (response) {
  170. resolve({
  171. ok: true,
  172. // keep consistent with fetch API
  173. json: function json() {
  174. return Promise.resolve(response);
  175. }
  176. });
  177. if (timeoutId) clearTimeout(timeoutId);
  178. removeScript(scriptId);
  179. clearFunction(callbackFunction);
  180. }; // Check if the user set their own params, and if not add a ? to start a list of params
  181. url += url.indexOf('?') === -1 ? '?' : '&';
  182. var jsonpScript = document.createElement('script');
  183. jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);
  184. if (options.charset) {
  185. jsonpScript.setAttribute('charset', options.charset);
  186. }
  187. jsonpScript.id = scriptId;
  188. document.getElementsByTagName('head')[0].appendChild(jsonpScript);
  189. timeoutId = setTimeout(function () {
  190. reject(new Error('JSONP request to ' + _url + ' timed out'));
  191. clearFunction(callbackFunction);
  192. removeScript(scriptId);
  193. window[callbackFunction] = function () {
  194. clearFunction(callbackFunction);
  195. };
  196. }, timeout); // Caught if got 404/500
  197. jsonpScript.onerror = function () {
  198. reject(new Error('JSONP request to ' + _url + ' failed'));
  199. clearFunction(callbackFunction);
  200. removeScript(scriptId);
  201. if (timeoutId) clearTimeout(timeoutId);
  202. };
  203. });
  204. } // export as global function
  205. /*
  206. let local;
  207. if (typeof global !== 'undefined') {
  208. local = global;
  209. } else if (typeof self !== 'undefined') {
  210. local = self;
  211. } else {
  212. try {
  213. local = Function('return this')();
  214. } catch (e) {
  215. throw new Error('polyfill failed because global object is unavailable in this environment');
  216. }
  217. }
  218. local.fetchJsonp = fetchJsonp;
  219. */
  220. module.exports = fetchJsonp;
  221. });
  222. /***/ }),
  223. /* 5 */
  224. /***/ (function(module, exports) {
  225. module.exports = function(){try{return XLSX}catch(e){return {}}}();
  226. /***/ }),
  227. /* 6 */
  228. /***/ (function(module, exports) {
  229. module.exports = function(){try{return convert}catch(e){return {}}}();
  230. /***/ }),
  231. /* 7 */
  232. /***/ (function(module, exports) {
  233. module.exports = function(){try{return elasticsearch}catch(e){return {}}}();
  234. /***/ }),
  235. /* 8 */
  236. /***/ (function(module, exports, __webpack_require__) {
  237. /* WEBPACK VAR INJECTION */(function(global) {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); }
  238. /**
  239. * lodash (Custom Build) <https://lodash.com/>
  240. * Build: `lodash modularize exports="npm" -o ./`
  241. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  242. * Released under MIT license <https://lodash.com/license>
  243. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  244. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  245. */
  246. /** Used as references for various `Number` constants. */
  247. var MAX_SAFE_INTEGER = 9007199254740991;
  248. /** `Object#toString` result references. */
  249. var argsTag = '[object Arguments]',
  250. funcTag = '[object Function]',
  251. genTag = '[object GeneratorFunction]',
  252. mapTag = '[object Map]',
  253. objectTag = '[object Object]',
  254. promiseTag = '[object Promise]',
  255. setTag = '[object Set]',
  256. weakMapTag = '[object WeakMap]';
  257. var dataViewTag = '[object DataView]';
  258. /**
  259. * Used to match `RegExp`
  260. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  261. */
  262. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  263. /** Used to detect host constructors (Safari). */
  264. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  265. /** Used to detect unsigned integer values. */
  266. var reIsUint = /^(?:0|[1-9]\d*)$/;
  267. /** Detect free variable `global` from Node.js. */
  268. var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof(global)) == 'object' && global && global.Object === Object && global;
  269. /** Detect free variable `self`. */
  270. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  271. /** Used as a reference to the global object. */
  272. var root = freeGlobal || freeSelf || Function('return this')();
  273. /**
  274. * A specialized version of `_.map` for arrays without support for iteratee
  275. * shorthands.
  276. *
  277. * @private
  278. * @param {Array} [array] The array to iterate over.
  279. * @param {Function} iteratee The function invoked per iteration.
  280. * @returns {Array} Returns the new mapped array.
  281. */
  282. function arrayMap(array, iteratee) {
  283. var index = -1,
  284. length = array ? array.length : 0,
  285. result = Array(length);
  286. while (++index < length) {
  287. result[index] = iteratee(array[index], index, array);
  288. }
  289. return result;
  290. }
  291. /**
  292. * The base implementation of `_.times` without support for iteratee shorthands
  293. * or max array length checks.
  294. *
  295. * @private
  296. * @param {number} n The number of times to invoke `iteratee`.
  297. * @param {Function} iteratee The function invoked per iteration.
  298. * @returns {Array} Returns the array of results.
  299. */
  300. function baseTimes(n, iteratee) {
  301. var index = -1,
  302. result = Array(n);
  303. while (++index < n) {
  304. result[index] = iteratee(index);
  305. }
  306. return result;
  307. }
  308. /**
  309. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  310. * of key-value pairs for `object` corresponding to the property names of `props`.
  311. *
  312. * @private
  313. * @param {Object} object The object to query.
  314. * @param {Array} props The property names to get values for.
  315. * @returns {Object} Returns the key-value pairs.
  316. */
  317. function baseToPairs(object, props) {
  318. return arrayMap(props, function (key) {
  319. return [key, object[key]];
  320. });
  321. }
  322. /**
  323. * Gets the value at `key` of `object`.
  324. *
  325. * @private
  326. * @param {Object} [object] The object to query.
  327. * @param {string} key The key of the property to get.
  328. * @returns {*} Returns the property value.
  329. */
  330. function getValue(object, key) {
  331. return object == null ? undefined : object[key];
  332. }
  333. /**
  334. * Checks if `value` is a host object in IE < 9.
  335. *
  336. * @private
  337. * @param {*} value The value to check.
  338. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  339. */
  340. function isHostObject(value) {
  341. // Many host objects are `Object` objects that can coerce to strings
  342. // despite having improperly defined `toString` methods.
  343. var result = false;
  344. if (value != null && typeof value.toString != 'function') {
  345. try {
  346. result = !!(value + '');
  347. } catch (e) {}
  348. }
  349. return result;
  350. }
  351. /**
  352. * Converts `map` to its key-value pairs.
  353. *
  354. * @private
  355. * @param {Object} map The map to convert.
  356. * @returns {Array} Returns the key-value pairs.
  357. */
  358. function mapToArray(map) {
  359. var index = -1,
  360. result = Array(map.size);
  361. map.forEach(function (value, key) {
  362. result[++index] = [key, value];
  363. });
  364. return result;
  365. }
  366. /**
  367. * Creates a unary function that invokes `func` with its argument transformed.
  368. *
  369. * @private
  370. * @param {Function} func The function to wrap.
  371. * @param {Function} transform The argument transform.
  372. * @returns {Function} Returns the new function.
  373. */
  374. function overArg(func, transform) {
  375. return function (arg) {
  376. return func(transform(arg));
  377. };
  378. }
  379. /**
  380. * Converts `set` to its value-value pairs.
  381. *
  382. * @private
  383. * @param {Object} set The set to convert.
  384. * @returns {Array} Returns the value-value pairs.
  385. */
  386. function setToPairs(set) {
  387. var index = -1,
  388. result = Array(set.size);
  389. set.forEach(function (value) {
  390. result[++index] = [value, value];
  391. });
  392. return result;
  393. }
  394. /** Used for built-in method references. */
  395. var funcProto = Function.prototype,
  396. objectProto = Object.prototype;
  397. /** Used to detect overreaching core-js shims. */
  398. var coreJsData = root['__core-js_shared__'];
  399. /** Used to detect methods masquerading as native. */
  400. var maskSrcKey = function () {
  401. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  402. return uid ? 'Symbol(src)_1.' + uid : '';
  403. }();
  404. /** Used to resolve the decompiled source of functions. */
  405. var funcToString = funcProto.toString;
  406. /** Used to check objects for own properties. */
  407. var hasOwnProperty = objectProto.hasOwnProperty;
  408. /**
  409. * Used to resolve the
  410. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  411. * of values.
  412. */
  413. var objectToString = objectProto.toString;
  414. /** Used to detect if a method is native. */
  415. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  416. /** Built-in value references. */
  417. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  418. /* Built-in method references for those with the same name as other `lodash` methods. */
  419. var nativeKeys = overArg(Object.keys, Object);
  420. /* Built-in method references that are verified to be native. */
  421. var DataView = getNative(root, 'DataView'),
  422. Map = getNative(root, 'Map'),
  423. Promise = getNative(root, 'Promise'),
  424. Set = getNative(root, 'Set'),
  425. WeakMap = getNative(root, 'WeakMap');
  426. /** Used to detect maps, sets, and weakmaps. */
  427. var dataViewCtorString = toSource(DataView),
  428. mapCtorString = toSource(Map),
  429. promiseCtorString = toSource(Promise),
  430. setCtorString = toSource(Set),
  431. weakMapCtorString = toSource(WeakMap);
  432. /**
  433. * Creates an array of the enumerable property names of the array-like `value`.
  434. *
  435. * @private
  436. * @param {*} value The value to query.
  437. * @param {boolean} inherited Specify returning inherited property names.
  438. * @returns {Array} Returns the array of property names.
  439. */
  440. function arrayLikeKeys(value, inherited) {
  441. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  442. // Safari 9 makes `arguments.length` enumerable in strict mode.
  443. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  444. var length = result.length,
  445. skipIndexes = !!length;
  446. for (var key in value) {
  447. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  448. result.push(key);
  449. }
  450. }
  451. return result;
  452. }
  453. /**
  454. * The base implementation of `getTag`.
  455. *
  456. * @private
  457. * @param {*} value The value to query.
  458. * @returns {string} Returns the `toStringTag`.
  459. */
  460. function baseGetTag(value) {
  461. return objectToString.call(value);
  462. }
  463. /**
  464. * The base implementation of `_.isNative` without bad shim checks.
  465. *
  466. * @private
  467. * @param {*} value The value to check.
  468. * @returns {boolean} Returns `true` if `value` is a native function,
  469. * else `false`.
  470. */
  471. function baseIsNative(value) {
  472. if (!isObject(value) || isMasked(value)) {
  473. return false;
  474. }
  475. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  476. return pattern.test(toSource(value));
  477. }
  478. /**
  479. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  480. *
  481. * @private
  482. * @param {Object} object The object to query.
  483. * @returns {Array} Returns the array of property names.
  484. */
  485. function baseKeys(object) {
  486. if (!isPrototype(object)) {
  487. return nativeKeys(object);
  488. }
  489. var result = [];
  490. for (var key in Object(object)) {
  491. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  492. result.push(key);
  493. }
  494. }
  495. return result;
  496. }
  497. /**
  498. * Creates a `_.toPairs` or `_.toPairsIn` function.
  499. *
  500. * @private
  501. * @param {Function} keysFunc The function to get the keys of a given object.
  502. * @returns {Function} Returns the new pairs function.
  503. */
  504. function createToPairs(keysFunc) {
  505. return function (object) {
  506. var tag = getTag(object);
  507. if (tag == mapTag) {
  508. return mapToArray(object);
  509. }
  510. if (tag == setTag) {
  511. return setToPairs(object);
  512. }
  513. return baseToPairs(object, keysFunc(object));
  514. };
  515. }
  516. /**
  517. * Gets the native function at `key` of `object`.
  518. *
  519. * @private
  520. * @param {Object} object The object to query.
  521. * @param {string} key The key of the method to get.
  522. * @returns {*} Returns the function if it's native, else `undefined`.
  523. */
  524. function getNative(object, key) {
  525. var value = getValue(object, key);
  526. return baseIsNative(value) ? value : undefined;
  527. }
  528. /**
  529. * Gets the `toStringTag` of `value`.
  530. *
  531. * @private
  532. * @param {*} value The value to query.
  533. * @returns {string} Returns the `toStringTag`.
  534. */
  535. var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11,
  536. // for data views in Edge < 14, and promises in Node.js.
  537. 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) {
  538. getTag = function getTag(value) {
  539. var result = objectToString.call(value),
  540. Ctor = result == objectTag ? value.constructor : undefined,
  541. ctorString = Ctor ? toSource(Ctor) : undefined;
  542. if (ctorString) {
  543. switch (ctorString) {
  544. case dataViewCtorString:
  545. return dataViewTag;
  546. case mapCtorString:
  547. return mapTag;
  548. case promiseCtorString:
  549. return promiseTag;
  550. case setCtorString:
  551. return setTag;
  552. case weakMapCtorString:
  553. return weakMapTag;
  554. }
  555. }
  556. return result;
  557. };
  558. }
  559. /**
  560. * Checks if `value` is a valid array-like index.
  561. *
  562. * @private
  563. * @param {*} value The value to check.
  564. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  565. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  566. */
  567. function isIndex(value, length) {
  568. length = length == null ? MAX_SAFE_INTEGER : length;
  569. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  570. }
  571. /**
  572. * Checks if `func` has its source masked.
  573. *
  574. * @private
  575. * @param {Function} func The function to check.
  576. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  577. */
  578. function isMasked(func) {
  579. return !!maskSrcKey && maskSrcKey in func;
  580. }
  581. /**
  582. * Checks if `value` is likely a prototype object.
  583. *
  584. * @private
  585. * @param {*} value The value to check.
  586. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  587. */
  588. function isPrototype(value) {
  589. var Ctor = value && value.constructor,
  590. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  591. return value === proto;
  592. }
  593. /**
  594. * Converts `func` to its source code.
  595. *
  596. * @private
  597. * @param {Function} func The function to process.
  598. * @returns {string} Returns the source code.
  599. */
  600. function toSource(func) {
  601. if (func != null) {
  602. try {
  603. return funcToString.call(func);
  604. } catch (e) {}
  605. try {
  606. return func + '';
  607. } catch (e) {}
  608. }
  609. return '';
  610. }
  611. /**
  612. * Checks if `value` is likely an `arguments` object.
  613. *
  614. * @static
  615. * @memberOf _
  616. * @since 0.1.0
  617. * @category Lang
  618. * @param {*} value The value to check.
  619. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  620. * else `false`.
  621. * @example
  622. *
  623. * _.isArguments(function() { return arguments; }());
  624. * // => true
  625. *
  626. * _.isArguments([1, 2, 3]);
  627. * // => false
  628. */
  629. function isArguments(value) {
  630. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  631. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  632. }
  633. /**
  634. * Checks if `value` is classified as an `Array` object.
  635. *
  636. * @static
  637. * @memberOf _
  638. * @since 0.1.0
  639. * @category Lang
  640. * @param {*} value The value to check.
  641. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  642. * @example
  643. *
  644. * _.isArray([1, 2, 3]);
  645. * // => true
  646. *
  647. * _.isArray(document.body.children);
  648. * // => false
  649. *
  650. * _.isArray('abc');
  651. * // => false
  652. *
  653. * _.isArray(_.noop);
  654. * // => false
  655. */
  656. var isArray = Array.isArray;
  657. /**
  658. * Checks if `value` is array-like. A value is considered array-like if it's
  659. * not a function and has a `value.length` that's an integer greater than or
  660. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  661. *
  662. * @static
  663. * @memberOf _
  664. * @since 4.0.0
  665. * @category Lang
  666. * @param {*} value The value to check.
  667. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  668. * @example
  669. *
  670. * _.isArrayLike([1, 2, 3]);
  671. * // => true
  672. *
  673. * _.isArrayLike(document.body.children);
  674. * // => true
  675. *
  676. * _.isArrayLike('abc');
  677. * // => true
  678. *
  679. * _.isArrayLike(_.noop);
  680. * // => false
  681. */
  682. function isArrayLike(value) {
  683. return value != null && isLength(value.length) && !isFunction(value);
  684. }
  685. /**
  686. * This method is like `_.isArrayLike` except that it also checks if `value`
  687. * is an object.
  688. *
  689. * @static
  690. * @memberOf _
  691. * @since 4.0.0
  692. * @category Lang
  693. * @param {*} value The value to check.
  694. * @returns {boolean} Returns `true` if `value` is an array-like object,
  695. * else `false`.
  696. * @example
  697. *
  698. * _.isArrayLikeObject([1, 2, 3]);
  699. * // => true
  700. *
  701. * _.isArrayLikeObject(document.body.children);
  702. * // => true
  703. *
  704. * _.isArrayLikeObject('abc');
  705. * // => false
  706. *
  707. * _.isArrayLikeObject(_.noop);
  708. * // => false
  709. */
  710. function isArrayLikeObject(value) {
  711. return isObjectLike(value) && isArrayLike(value);
  712. }
  713. /**
  714. * Checks if `value` is classified as a `Function` object.
  715. *
  716. * @static
  717. * @memberOf _
  718. * @since 0.1.0
  719. * @category Lang
  720. * @param {*} value The value to check.
  721. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  722. * @example
  723. *
  724. * _.isFunction(_);
  725. * // => true
  726. *
  727. * _.isFunction(/abc/);
  728. * // => false
  729. */
  730. function isFunction(value) {
  731. // The use of `Object#toString` avoids issues with the `typeof` operator
  732. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  733. var tag = isObject(value) ? objectToString.call(value) : '';
  734. return tag == funcTag || tag == genTag;
  735. }
  736. /**
  737. * Checks if `value` is a valid array-like length.
  738. *
  739. * **Note:** This method is loosely based on
  740. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  741. *
  742. * @static
  743. * @memberOf _
  744. * @since 4.0.0
  745. * @category Lang
  746. * @param {*} value The value to check.
  747. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  748. * @example
  749. *
  750. * _.isLength(3);
  751. * // => true
  752. *
  753. * _.isLength(Number.MIN_VALUE);
  754. * // => false
  755. *
  756. * _.isLength(Infinity);
  757. * // => false
  758. *
  759. * _.isLength('3');
  760. * // => false
  761. */
  762. function isLength(value) {
  763. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  764. }
  765. /**
  766. * Checks if `value` is the
  767. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  768. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  769. *
  770. * @static
  771. * @memberOf _
  772. * @since 0.1.0
  773. * @category Lang
  774. * @param {*} value The value to check.
  775. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  776. * @example
  777. *
  778. * _.isObject({});
  779. * // => true
  780. *
  781. * _.isObject([1, 2, 3]);
  782. * // => true
  783. *
  784. * _.isObject(_.noop);
  785. * // => true
  786. *
  787. * _.isObject(null);
  788. * // => false
  789. */
  790. function isObject(value) {
  791. var type = _typeof(value);
  792. return !!value && (type == 'object' || type == 'function');
  793. }
  794. /**
  795. * Checks if `value` is object-like. A value is object-like if it's not `null`
  796. * and has a `typeof` result of "object".
  797. *
  798. * @static
  799. * @memberOf _
  800. * @since 4.0.0
  801. * @category Lang
  802. * @param {*} value The value to check.
  803. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  804. * @example
  805. *
  806. * _.isObjectLike({});
  807. * // => true
  808. *
  809. * _.isObjectLike([1, 2, 3]);
  810. * // => true
  811. *
  812. * _.isObjectLike(_.noop);
  813. * // => false
  814. *
  815. * _.isObjectLike(null);
  816. * // => false
  817. */
  818. function isObjectLike(value) {
  819. return !!value && _typeof(value) == 'object';
  820. }
  821. /**
  822. * Creates an array of the own enumerable property names of `object`.
  823. *
  824. * **Note:** Non-object values are coerced to objects. See the
  825. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  826. * for more details.
  827. *
  828. * @static
  829. * @since 0.1.0
  830. * @memberOf _
  831. * @category Object
  832. * @param {Object} object The object to query.
  833. * @returns {Array} Returns the array of property names.
  834. * @example
  835. *
  836. * function Foo() {
  837. * this.a = 1;
  838. * this.b = 2;
  839. * }
  840. *
  841. * Foo.prototype.c = 3;
  842. *
  843. * _.keys(new Foo);
  844. * // => ['a', 'b'] (iteration order is not guaranteed)
  845. *
  846. * _.keys('hi');
  847. * // => ['0', '1']
  848. */
  849. function keys(object) {
  850. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  851. }
  852. /**
  853. * Creates an array of own enumerable string keyed-value pairs for `object`
  854. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  855. * entries are returned.
  856. *
  857. * @static
  858. * @memberOf _
  859. * @since 4.0.0
  860. * @alias entries
  861. * @category Object
  862. * @param {Object} object The object to query.
  863. * @returns {Array} Returns the key-value pairs.
  864. * @example
  865. *
  866. * function Foo() {
  867. * this.a = 1;
  868. * this.b = 2;
  869. * }
  870. *
  871. * Foo.prototype.c = 3;
  872. *
  873. * _.toPairs(new Foo);
  874. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  875. */
  876. var toPairs = createToPairs(keys);
  877. module.exports = toPairs;
  878. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(3)))
  879. /***/ }),
  880. /* 9 */
  881. /***/ (function(module, exports) {
  882. module.exports = function(){try{return echarts}catch(e){return {}}}();
  883. /***/ }),
  884. /* 10 */
  885. /***/ (function(module, exports) {
  886. module.exports = function(){try{return canvg}catch(e){return {}}}();
  887. /***/ }),
  888. /* 11 */
  889. /***/ (function(module, exports, __webpack_require__) {
  890. __webpack_require__(18);
  891. module.exports = __webpack_require__(17);
  892. /***/ }),
  893. /* 12 */
  894. /***/ (function(module, exports, __webpack_require__) {
  895. /* WEBPACK VAR INJECTION */(function(setImmediate, global) {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); }
  896. (function (global, factory) {
  897. ( false ? undefined : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  898. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  899. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  900. __WEBPACK_AMD_DEFINE_FACTORY__),
  901. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined;
  902. })(this, function () {
  903. 'use strict';
  904. /**
  905. * @this {Promise}
  906. */
  907. function finallyConstructor(callback) {
  908. var constructor = this.constructor;
  909. return this.then(function (value) {
  910. // @ts-ignore
  911. return constructor.resolve(callback()).then(function () {
  912. return value;
  913. });
  914. }, function (reason) {
  915. // @ts-ignore
  916. return constructor.resolve(callback()).then(function () {
  917. // @ts-ignore
  918. return constructor.reject(reason);
  919. });
  920. });
  921. } // Store setTimeout reference so promise-polyfill will be unaffected by
  922. // other code modifying setTimeout (like sinon.useFakeTimers())
  923. var setTimeoutFunc = setTimeout;
  924. function isArray(x) {
  925. return Boolean(x && typeof x.length !== 'undefined');
  926. }
  927. function noop() {} // Polyfill for Function.prototype.bind
  928. function bind(fn, thisArg) {
  929. return function () {
  930. fn.apply(thisArg, arguments);
  931. };
  932. }
  933. /**
  934. * @constructor
  935. * @param {Function} fn
  936. */
  937. function Promise(fn) {
  938. if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
  939. if (typeof fn !== 'function') throw new TypeError('not a function');
  940. /** @type {!number} */
  941. this._state = 0;
  942. /** @type {!boolean} */
  943. this._handled = false;
  944. /** @type {Promise|undefined} */
  945. this._value = undefined;
  946. /** @type {!Array<!Function>} */
  947. this._deferreds = [];
  948. doResolve(fn, this);
  949. }
  950. function handle(self, deferred) {
  951. while (self._state === 3) {
  952. self = self._value;
  953. }
  954. if (self._state === 0) {
  955. self._deferreds.push(deferred);
  956. return;
  957. }
  958. self._handled = true;
  959. Promise._immediateFn(function () {
  960. var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
  961. if (cb === null) {
  962. (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
  963. return;
  964. }
  965. var ret;
  966. try {
  967. ret = cb(self._value);
  968. } catch (e) {
  969. reject(deferred.promise, e);
  970. return;
  971. }
  972. resolve(deferred.promise, ret);
  973. });
  974. }
  975. function resolve(self, newValue) {
  976. try {
  977. // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
  978. if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
  979. if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) {
  980. var then = newValue.then;
  981. if (newValue instanceof Promise) {
  982. self._state = 3;
  983. self._value = newValue;
  984. finale(self);
  985. return;
  986. } else if (typeof then === 'function') {
  987. doResolve(bind(then, newValue), self);
  988. return;
  989. }
  990. }
  991. self._state = 1;
  992. self._value = newValue;
  993. finale(self);
  994. } catch (e) {
  995. reject(self, e);
  996. }
  997. }
  998. function reject(self, newValue) {
  999. self._state = 2;
  1000. self._value = newValue;
  1001. finale(self);
  1002. }
  1003. function finale(self) {
  1004. if (self._state === 2 && self._deferreds.length === 0) {
  1005. Promise._immediateFn(function () {
  1006. if (!self._handled) {
  1007. Promise._unhandledRejectionFn(self._value);
  1008. }
  1009. });
  1010. }
  1011. for (var i = 0, len = self._deferreds.length; i < len; i++) {
  1012. handle(self, self._deferreds[i]);
  1013. }
  1014. self._deferreds = null;
  1015. }
  1016. /**
  1017. * @constructor
  1018. */
  1019. function Handler(onFulfilled, onRejected, promise) {
  1020. this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
  1021. this.onRejected = typeof onRejected === 'function' ? onRejected : null;
  1022. this.promise = promise;
  1023. }
  1024. /**
  1025. * Take a potentially misbehaving resolver function and make sure
  1026. * onFulfilled and onRejected are only called once.
  1027. *
  1028. * Makes no guarantees about asynchrony.
  1029. */
  1030. function doResolve(fn, self) {
  1031. var done = false;
  1032. try {
  1033. fn(function (value) {
  1034. if (done) return;
  1035. done = true;
  1036. resolve(self, value);
  1037. }, function (reason) {
  1038. if (done) return;
  1039. done = true;
  1040. reject(self, reason);
  1041. });
  1042. } catch (ex) {
  1043. if (done) return;
  1044. done = true;
  1045. reject(self, ex);
  1046. }
  1047. }
  1048. Promise.prototype['catch'] = function (onRejected) {
  1049. return this.then(null, onRejected);
  1050. };
  1051. Promise.prototype.then = function (onFulfilled, onRejected) {
  1052. // @ts-ignore
  1053. var prom = new this.constructor(noop);
  1054. handle(this, new Handler(onFulfilled, onRejected, prom));
  1055. return prom;
  1056. };
  1057. Promise.prototype['finally'] = finallyConstructor;
  1058. Promise.all = function (arr) {
  1059. return new Promise(function (resolve, reject) {
  1060. if (!isArray(arr)) {
  1061. return reject(new TypeError('Promise.all accepts an array'));
  1062. }
  1063. var args = Array.prototype.slice.call(arr);
  1064. if (args.length === 0) return resolve([]);
  1065. var remaining = args.length;
  1066. function res(i, val) {
  1067. try {
  1068. if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
  1069. var then = val.then;
  1070. if (typeof then === 'function') {
  1071. then.call(val, function (val) {
  1072. res(i, val);
  1073. }, reject);
  1074. return;
  1075. }
  1076. }
  1077. args[i] = val;
  1078. if (--remaining === 0) {
  1079. resolve(args);
  1080. }
  1081. } catch (ex) {
  1082. reject(ex);
  1083. }
  1084. }
  1085. for (var i = 0; i < args.length; i++) {
  1086. res(i, args[i]);
  1087. }
  1088. });
  1089. };
  1090. Promise.resolve = function (value) {
  1091. if (value && _typeof(value) === 'object' && value.constructor === Promise) {
  1092. return value;
  1093. }
  1094. return new Promise(function (resolve) {
  1095. resolve(value);
  1096. });
  1097. };
  1098. Promise.reject = function (value) {
  1099. return new Promise(function (resolve, reject) {
  1100. reject(value);
  1101. });
  1102. };
  1103. Promise.race = function (arr) {
  1104. return new Promise(function (resolve, reject) {
  1105. if (!isArray(arr)) {
  1106. return reject(new TypeError('Promise.race accepts an array'));
  1107. }
  1108. for (var i = 0, len = arr.length; i < len; i++) {
  1109. Promise.resolve(arr[i]).then(resolve, reject);
  1110. }
  1111. });
  1112. }; // Use polyfill for setImmediate for performance gains
  1113. Promise._immediateFn = // @ts-ignore
  1114. typeof setImmediate === 'function' && function (fn) {
  1115. // @ts-ignore
  1116. setImmediate(fn);
  1117. } || function (fn) {
  1118. setTimeoutFunc(fn, 0);
  1119. };
  1120. Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
  1121. if (typeof console !== 'undefined' && console) {
  1122. console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
  1123. }
  1124. };
  1125. /** @suppress {undefinedVars} */
  1126. var globalNS = function () {
  1127. // the only reliable means to get the global object is
  1128. // `Function('return this')()`
  1129. // However, this causes CSP violations in Chrome apps.
  1130. if (typeof self !== 'undefined') {
  1131. return self;
  1132. }
  1133. if (typeof window !== 'undefined') {
  1134. return window;
  1135. }
  1136. if (typeof global !== 'undefined') {
  1137. return global;
  1138. }
  1139. throw new Error('unable to locate global object');
  1140. }();
  1141. if (!('Promise' in globalNS)) {
  1142. globalNS['Promise'] = Promise;
  1143. } else if (!globalNS.Promise.prototype['finally']) {
  1144. globalNS.Promise.prototype['finally'] = finallyConstructor;
  1145. }
  1146. });
  1147. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13).setImmediate, __webpack_require__(3)))
  1148. /***/ }),
  1149. /* 13 */
  1150. /***/ (function(module, exports, __webpack_require__) {
  1151. /* WEBPACK VAR INJECTION */(function(global) {var scope = typeof global !== "undefined" && global || typeof self !== "undefined" && self || window;
  1152. var apply = Function.prototype.apply; // DOM APIs, for completeness
  1153. exports.setTimeout = function () {
  1154. return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  1155. };
  1156. exports.setInterval = function () {
  1157. return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  1158. };
  1159. exports.clearTimeout = exports.clearInterval = function (timeout) {
  1160. if (timeout) {
  1161. timeout.close();
  1162. }
  1163. };
  1164. function Timeout(id, clearFn) {
  1165. this._id = id;
  1166. this._clearFn = clearFn;
  1167. }
  1168. Timeout.prototype.unref = Timeout.prototype.ref = function () {};
  1169. Timeout.prototype.close = function () {
  1170. this._clearFn.call(scope, this._id);
  1171. }; // Does not start the time, just sets up the members needed.
  1172. exports.enroll = function (item, msecs) {
  1173. clearTimeout(item._idleTimeoutId);
  1174. item._idleTimeout = msecs;
  1175. };
  1176. exports.unenroll = function (item) {
  1177. clearTimeout(item._idleTimeoutId);
  1178. item._idleTimeout = -1;
  1179. };
  1180. exports._unrefActive = exports.active = function (item) {
  1181. clearTimeout(item._idleTimeoutId);
  1182. var msecs = item._idleTimeout;
  1183. if (msecs >= 0) {
  1184. item._idleTimeoutId = setTimeout(function onTimeout() {
  1185. if (item._onTimeout) item._onTimeout();
  1186. }, msecs);
  1187. }
  1188. }; // setimmediate attaches itself to the global object
  1189. __webpack_require__(14); // On some exotic environments, it's not clear which object `setimmediate` was
  1190. // able to install onto. Search each possibility in the same order as the
  1191. // `setimmediate` library.
  1192. exports.setImmediate = typeof self !== "undefined" && self.setImmediate || typeof global !== "undefined" && global.setImmediate || this && this.setImmediate;
  1193. exports.clearImmediate = typeof self !== "undefined" && self.clearImmediate || typeof global !== "undefined" && global.clearImmediate || this && this.clearImmediate;
  1194. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(3)))
  1195. /***/ }),
  1196. /* 14 */
  1197. /***/ (function(module, exports, __webpack_require__) {
  1198. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  1199. "use strict";
  1200. if (global.setImmediate) {
  1201. return;
  1202. }
  1203. var nextHandle = 1; // Spec says greater than zero
  1204. var tasksByHandle = {};
  1205. var currentlyRunningATask = false;
  1206. var doc = global.document;
  1207. var registerImmediate;
  1208. function setImmediate(callback) {
  1209. // Callback can either be a function or a string
  1210. if (typeof callback !== "function") {
  1211. callback = new Function("" + callback);
  1212. } // Copy function arguments
  1213. var args = new Array(arguments.length - 1);
  1214. for (var i = 0; i < args.length; i++) {
  1215. args[i] = arguments[i + 1];
  1216. } // Store and register the task
  1217. var task = {
  1218. callback: callback,
  1219. args: args
  1220. };
  1221. tasksByHandle[nextHandle] = task;
  1222. registerImmediate(nextHandle);
  1223. return nextHandle++;
  1224. }
  1225. function clearImmediate(handle) {
  1226. delete tasksByHandle[handle];
  1227. }
  1228. function run(task) {
  1229. var callback = task.callback;
  1230. var args = task.args;
  1231. switch (args.length) {
  1232. case 0:
  1233. callback();
  1234. break;
  1235. case 1:
  1236. callback(args[0]);
  1237. break;
  1238. case 2:
  1239. callback(args[0], args[1]);
  1240. break;
  1241. case 3:
  1242. callback(args[0], args[1], args[2]);
  1243. break;
  1244. default:
  1245. callback.apply(undefined, args);
  1246. break;
  1247. }
  1248. }
  1249. function runIfPresent(handle) {
  1250. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  1251. // So if we're currently running a task, we'll need to delay this invocation.
  1252. if (currentlyRunningATask) {
  1253. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  1254. // "too much recursion" error.
  1255. setTimeout(runIfPresent, 0, handle);
  1256. } else {
  1257. var task = tasksByHandle[handle];
  1258. if (task) {
  1259. currentlyRunningATask = true;
  1260. try {
  1261. run(task);
  1262. } finally {
  1263. clearImmediate(handle);
  1264. currentlyRunningATask = false;
  1265. }
  1266. }
  1267. }
  1268. }
  1269. function installNextTickImplementation() {
  1270. registerImmediate = function registerImmediate(handle) {
  1271. process.nextTick(function () {
  1272. runIfPresent(handle);
  1273. });
  1274. };
  1275. }
  1276. function canUsePostMessage() {
  1277. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  1278. // where `global.postMessage` means something completely different and can't be used for this purpose.
  1279. if (global.postMessage && !global.importScripts) {
  1280. var postMessageIsAsynchronous = true;
  1281. var oldOnMessage = global.onmessage;
  1282. global.onmessage = function () {
  1283. postMessageIsAsynchronous = false;
  1284. };
  1285. global.postMessage("", "*");
  1286. global.onmessage = oldOnMessage;
  1287. return postMessageIsAsynchronous;
  1288. }
  1289. }
  1290. function installPostMessageImplementation() {
  1291. // Installs an event handler on `global` for the `message` event: see
  1292. // * https://developer.mozilla.org/en/DOM/window.postMessage
  1293. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  1294. var messagePrefix = "setImmediate$" + Math.random() + "$";
  1295. var onGlobalMessage = function onGlobalMessage(event) {
  1296. if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) {
  1297. runIfPresent(+event.data.slice(messagePrefix.length));
  1298. }
  1299. };
  1300. if (global.addEventListener) {
  1301. global.addEventListener("message", onGlobalMessage, false);
  1302. } else {
  1303. global.attachEvent("onmessage", onGlobalMessage);
  1304. }
  1305. registerImmediate = function registerImmediate(handle) {
  1306. global.postMessage(messagePrefix + handle, "*");
  1307. };
  1308. }
  1309. function installMessageChannelImplementation() {
  1310. var channel = new MessageChannel();
  1311. channel.port1.onmessage = function (event) {
  1312. var handle = event.data;
  1313. runIfPresent(handle);
  1314. };
  1315. registerImmediate = function registerImmediate(handle) {
  1316. channel.port2.postMessage(handle);
  1317. };
  1318. }
  1319. function installReadyStateChangeImplementation() {
  1320. var html = doc.documentElement;
  1321. registerImmediate = function registerImmediate(handle) {
  1322. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  1323. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  1324. var script = doc.createElement("script");
  1325. script.onreadystatechange = function () {
  1326. runIfPresent(handle);
  1327. script.onreadystatechange = null;
  1328. html.removeChild(script);
  1329. script = null;
  1330. };
  1331. html.appendChild(script);
  1332. };
  1333. }
  1334. function installSetTimeoutImplementation() {
  1335. registerImmediate = function registerImmediate(handle) {
  1336. setTimeout(runIfPresent, 0, handle);
  1337. };
  1338. } // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  1339. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  1340. attachTo = attachTo && attachTo.setTimeout ? attachTo : global; // Don't get fooled by e.g. browserify environments.
  1341. if ({}.toString.call(global.process) === "[object process]") {
  1342. // For Node.js before 0.9
  1343. installNextTickImplementation();
  1344. } else if (canUsePostMessage()) {
  1345. // For non-IE10 modern browsers
  1346. installPostMessageImplementation();
  1347. } else if (global.MessageChannel) {
  1348. // For web workers, where supported
  1349. installMessageChannelImplementation();
  1350. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  1351. // For IE 6–8
  1352. installReadyStateChangeImplementation();
  1353. } else {
  1354. // For older browsers
  1355. installSetTimeoutImplementation();
  1356. }
  1357. attachTo.setImmediate = setImmediate;
  1358. attachTo.clearImmediate = clearImmediate;
  1359. })(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self);
  1360. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(3), __webpack_require__(15)))
  1361. /***/ }),
  1362. /* 15 */
  1363. /***/ (function(module, exports) {
  1364. // shim for using process in browser
  1365. var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
  1366. // don't break things. But we need to wrap it in a try catch in case it is
  1367. // wrapped in strict mode code which doesn't define any globals. It's inside a
  1368. // function because try/catches deoptimize in certain engines.
  1369. var cachedSetTimeout;
  1370. var cachedClearTimeout;
  1371. function defaultSetTimout() {
  1372. throw new Error('setTimeout has not been defined');
  1373. }
  1374. function defaultClearTimeout() {
  1375. throw new Error('clearTimeout has not been defined');
  1376. }
  1377. (function () {
  1378. try {
  1379. if (typeof setTimeout === 'function') {
  1380. cachedSetTimeout = setTimeout;
  1381. } else {
  1382. cachedSetTimeout = defaultSetTimout;
  1383. }
  1384. } catch (e) {
  1385. cachedSetTimeout = defaultSetTimout;
  1386. }
  1387. try {
  1388. if (typeof clearTimeout === 'function') {
  1389. cachedClearTimeout = clearTimeout;
  1390. } else {
  1391. cachedClearTimeout = defaultClearTimeout;
  1392. }
  1393. } catch (e) {
  1394. cachedClearTimeout = defaultClearTimeout;
  1395. }
  1396. })();
  1397. function runTimeout(fun) {
  1398. if (cachedSetTimeout === setTimeout) {
  1399. //normal enviroments in sane situations
  1400. return setTimeout(fun, 0);
  1401. } // if setTimeout wasn't available but was latter defined
  1402. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  1403. cachedSetTimeout = setTimeout;
  1404. return setTimeout(fun, 0);
  1405. }
  1406. try {
  1407. // when when somebody has screwed with setTimeout but no I.E. maddness
  1408. return cachedSetTimeout(fun, 0);
  1409. } catch (e) {
  1410. try {
  1411. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  1412. return cachedSetTimeout.call(null, fun, 0);
  1413. } catch (e) {
  1414. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  1415. return cachedSetTimeout.call(this, fun, 0);
  1416. }
  1417. }
  1418. }
  1419. function runClearTimeout(marker) {
  1420. if (cachedClearTimeout === clearTimeout) {
  1421. //normal enviroments in sane situations
  1422. return clearTimeout(marker);
  1423. } // if clearTimeout wasn't available but was latter defined
  1424. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  1425. cachedClearTimeout = clearTimeout;
  1426. return clearTimeout(marker);
  1427. }
  1428. try {
  1429. // when when somebody has screwed with setTimeout but no I.E. maddness
  1430. return cachedClearTimeout(marker);
  1431. } catch (e) {
  1432. try {
  1433. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  1434. return cachedClearTimeout.call(null, marker);
  1435. } catch (e) {
  1436. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  1437. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  1438. return cachedClearTimeout.call(this, marker);
  1439. }
  1440. }
  1441. }
  1442. var queue = [];
  1443. var draining = false;
  1444. var currentQueue;
  1445. var queueIndex = -1;
  1446. function cleanUpNextTick() {
  1447. if (!draining || !currentQueue) {
  1448. return;
  1449. }
  1450. draining = false;
  1451. if (currentQueue.length) {
  1452. queue = currentQueue.concat(queue);
  1453. } else {
  1454. queueIndex = -1;
  1455. }
  1456. if (queue.length) {
  1457. drainQueue();
  1458. }
  1459. }
  1460. function drainQueue() {
  1461. if (draining) {
  1462. return;
  1463. }
  1464. var timeout = runTimeout(cleanUpNextTick);
  1465. draining = true;
  1466. var len = queue.length;
  1467. while (len) {
  1468. currentQueue = queue;
  1469. queue = [];
  1470. while (++queueIndex < len) {
  1471. if (currentQueue) {
  1472. currentQueue[queueIndex].run();
  1473. }
  1474. }
  1475. queueIndex = -1;
  1476. len = queue.length;
  1477. }
  1478. currentQueue = null;
  1479. draining = false;
  1480. runClearTimeout(timeout);
  1481. }
  1482. process.nextTick = function (fun) {
  1483. var args = new Array(arguments.length - 1);
  1484. if (arguments.length > 1) {
  1485. for (var i = 1; i < arguments.length; i++) {
  1486. args[i - 1] = arguments[i];
  1487. }
  1488. }
  1489. queue.push(new Item(fun, args));
  1490. if (queue.length === 1 && !draining) {
  1491. runTimeout(drainQueue);
  1492. }
  1493. }; // v8 likes predictible objects
  1494. function Item(fun, array) {
  1495. this.fun = fun;
  1496. this.array = array;
  1497. }
  1498. Item.prototype.run = function () {
  1499. this.fun.apply(null, this.array);
  1500. };
  1501. process.title = 'browser';
  1502. process.browser = true;
  1503. process.env = {};
  1504. process.argv = [];
  1505. process.version = ''; // empty string to avoid regexp issues
  1506. process.versions = {};
  1507. function noop() {}
  1508. process.on = noop;
  1509. process.addListener = noop;
  1510. process.once = noop;
  1511. process.off = noop;
  1512. process.removeListener = noop;
  1513. process.removeAllListeners = noop;
  1514. process.emit = noop;
  1515. process.prependListener = noop;
  1516. process.prependOnceListener = noop;
  1517. process.listeners = function (name) {
  1518. return [];
  1519. };
  1520. process.binding = function (name) {
  1521. throw new Error('process.binding is not supported');
  1522. };
  1523. process.cwd = function () {
  1524. return '/';
  1525. };
  1526. process.chdir = function (dir) {
  1527. throw new Error('process.chdir is not supported');
  1528. };
  1529. process.umask = function () {
  1530. return 0;
  1531. };
  1532. /***/ }),
  1533. /* 16 */
  1534. /***/ (function(module, exports, __webpack_require__) {
  1535. (function (self) {
  1536. 'use strict'; // if __disableNativeFetch is set to true, the it will always polyfill fetch
  1537. // with Ajax.
  1538. if (!self.__disableNativeFetch && self.fetch) {
  1539. return;
  1540. }
  1541. function normalizeName(name) {
  1542. if (typeof name !== 'string') {
  1543. name = String(name);
  1544. }
  1545. if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
  1546. throw new TypeError('Invalid character in header field name');
  1547. }
  1548. return name.toLowerCase();
  1549. }
  1550. function normalizeValue(value) {
  1551. if (typeof value !== 'string') {
  1552. value = String(value);
  1553. }
  1554. return value;
  1555. }
  1556. function Headers(headers) {
  1557. this.map = {};
  1558. if (headers instanceof Headers) {
  1559. headers.forEach(function (value, name) {
  1560. this.append(name, value);
  1561. }, this);
  1562. } else if (headers) {
  1563. Object.getOwnPropertyNames(headers).forEach(function (name) {
  1564. this.append(name, headers[name]);
  1565. }, this);
  1566. }
  1567. }
  1568. Headers.prototype.append = function (name, value) {
  1569. name = normalizeName(name);
  1570. value = normalizeValue(value);
  1571. var list = this.map[name];
  1572. if (!list) {
  1573. list = [];
  1574. this.map[name] = list;
  1575. }
  1576. list.push(value);
  1577. };
  1578. Headers.prototype['delete'] = function (name) {
  1579. delete this.map[normalizeName(name)];
  1580. };
  1581. Headers.prototype.get = function (name) {
  1582. var values = this.map[normalizeName(name)];
  1583. return values ? values[0] : null;
  1584. };
  1585. Headers.prototype.getAll = function (name) {
  1586. return this.map[normalizeName(name)] || [];
  1587. };
  1588. Headers.prototype.has = function (name) {
  1589. return this.map.hasOwnProperty(normalizeName(name));
  1590. };
  1591. Headers.prototype.set = function (name, value) {
  1592. this.map[normalizeName(name)] = [normalizeValue(value)];
  1593. };
  1594. Headers.prototype.forEach = function (callback, thisArg) {
  1595. Object.getOwnPropertyNames(this.map).forEach(function (name) {
  1596. this.map[name].forEach(function (value) {
  1597. callback.call(thisArg, value, name, this);
  1598. }, this);
  1599. }, this);
  1600. };
  1601. function consumed(body) {
  1602. if (body.bodyUsed) {
  1603. return Promise.reject(new TypeError('Already read'));
  1604. }
  1605. body.bodyUsed = true;
  1606. }
  1607. function fileReaderReady(reader) {
  1608. return new Promise(function (resolve, reject) {
  1609. reader.onload = function () {
  1610. resolve(reader.result);
  1611. };
  1612. reader.onerror = function () {
  1613. reject(reader.error);
  1614. };
  1615. });
  1616. }
  1617. function readBlobAsArrayBuffer(blob) {
  1618. var reader = new FileReader();
  1619. reader.readAsArrayBuffer(blob);
  1620. return fileReaderReady(reader);
  1621. }
  1622. function readBlobAsText(blob, options) {
  1623. var reader = new FileReader();
  1624. var contentType = options.headers.map['content-type'] ? options.headers.map['content-type'].toString() : '';
  1625. var regex = /charset\=[0-9a-zA-Z\-\_]*;?/;
  1626. var _charset = blob.type.match(regex) || contentType.match(regex);
  1627. var args = [blob];
  1628. if (_charset) {
  1629. args.push(_charset[0].replace(/^charset\=/, '').replace(/;$/, ''));
  1630. }
  1631. reader.readAsText.apply(reader, args);
  1632. return fileReaderReady(reader);
  1633. }
  1634. var support = {
  1635. blob: 'FileReader' in self && 'Blob' in self && function () {
  1636. try {
  1637. new Blob();
  1638. return true;
  1639. } catch (e) {
  1640. return false;
  1641. }
  1642. }(),
  1643. formData: 'FormData' in self,
  1644. arrayBuffer: 'ArrayBuffer' in self
  1645. };
  1646. function Body() {
  1647. this.bodyUsed = false;
  1648. this._initBody = function (body, options) {
  1649. this._bodyInit = body;
  1650. if (typeof body === 'string') {
  1651. this._bodyText = body;
  1652. } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
  1653. this._bodyBlob = body;
  1654. this._options = options;
  1655. } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
  1656. this._bodyFormData = body;
  1657. } else if (!body) {
  1658. this._bodyText = '';
  1659. } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {// Only support ArrayBuffers for POST method.
  1660. // Receiving ArrayBuffers happens via Blobs, instead.
  1661. } else {
  1662. throw new Error('unsupported BodyInit type');
  1663. }
  1664. };
  1665. if (support.blob) {
  1666. this.blob = function () {
  1667. var rejected = consumed(this);
  1668. if (rejected) {
  1669. return rejected;
  1670. }
  1671. if (this._bodyBlob) {
  1672. return Promise.resolve(this._bodyBlob);
  1673. } else if (this._bodyFormData) {
  1674. throw new Error('could not read FormData body as blob');
  1675. } else {
  1676. return Promise.resolve(new Blob([this._bodyText]));
  1677. }
  1678. };
  1679. this.arrayBuffer = function () {
  1680. return this.blob().then(readBlobAsArrayBuffer);
  1681. };
  1682. this.text = function () {
  1683. var rejected = consumed(this);
  1684. if (rejected) {
  1685. return rejected;
  1686. }
  1687. if (this._bodyBlob) {
  1688. return readBlobAsText(this._bodyBlob, this._options);
  1689. } else if (this._bodyFormData) {
  1690. throw new Error('could not read FormData body as text');
  1691. } else {
  1692. return Promise.resolve(this._bodyText);
  1693. }
  1694. };
  1695. } else {
  1696. this.text = function () {
  1697. var rejected = consumed(this);
  1698. return rejected ? rejected : Promise.resolve(this._bodyText);
  1699. };
  1700. }
  1701. if (support.formData) {
  1702. this.formData = function () {
  1703. return this.text().then(decode);
  1704. };
  1705. }
  1706. this.json = function () {
  1707. return this.text().then(JSON.parse);
  1708. };
  1709. return this;
  1710. } // HTTP methods whose capitalization should be normalized
  1711. var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
  1712. function normalizeMethod(method) {
  1713. var upcased = method.toUpperCase();
  1714. return methods.indexOf(upcased) > -1 ? upcased : method;
  1715. }
  1716. function Request(input, options) {
  1717. options = options || {};
  1718. var body = options.body;
  1719. if (Request.prototype.isPrototypeOf(input)) {
  1720. if (input.bodyUsed) {
  1721. throw new TypeError('Already read');
  1722. }
  1723. this.url = input.url;
  1724. this.credentials = input.credentials;
  1725. if (!options.headers) {
  1726. this.headers = new Headers(input.headers);
  1727. }
  1728. this.method = input.method;
  1729. this.mode = input.mode;
  1730. if (!body) {
  1731. body = input._bodyInit;
  1732. input.bodyUsed = true;
  1733. }
  1734. } else {
  1735. this.url = input;
  1736. }
  1737. this.credentials = options.credentials || this.credentials || 'omit';
  1738. if (options.headers || !this.headers) {
  1739. this.headers = new Headers(options.headers);
  1740. }
  1741. this.method = normalizeMethod(options.method || this.method || 'GET');
  1742. this.mode = options.mode || this.mode || null;
  1743. this.referrer = null;
  1744. if ((this.method === 'GET' || this.method === 'HEAD') && body) {
  1745. throw new TypeError('Body not allowed for GET or HEAD requests');
  1746. }
  1747. this._initBody(body, options);
  1748. }
  1749. Request.prototype.clone = function () {
  1750. return new Request(this);
  1751. };
  1752. function decode(body) {
  1753. var form = new FormData();
  1754. body.trim().split('&').forEach(function (bytes) {
  1755. if (bytes) {
  1756. var split = bytes.split('=');
  1757. var name = split.shift().replace(/\+/g, ' ');
  1758. var value = split.join('=').replace(/\+/g, ' ');
  1759. form.append(decodeURIComponent(name), decodeURIComponent(value));
  1760. }
  1761. });
  1762. return form;
  1763. }
  1764. function headers(xhr) {
  1765. var head = new Headers();
  1766. var pairs = xhr.getAllResponseHeaders().trim().split('\n');
  1767. pairs.forEach(function (header) {
  1768. var split = header.trim().split(':');
  1769. var key = split.shift().trim();
  1770. var value = split.join(':').trim();
  1771. head.append(key, value);
  1772. });
  1773. return head;
  1774. }
  1775. Body.call(Request.prototype);
  1776. function Response(bodyInit, options) {
  1777. if (!options) {
  1778. options = {};
  1779. }
  1780. this._initBody(bodyInit, options);
  1781. this.type = 'default';
  1782. this.status = options.status;
  1783. this.ok = this.status >= 200 && this.status < 300;
  1784. this.statusText = options.statusText;
  1785. this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
  1786. this.url = options.url || '';
  1787. }
  1788. Body.call(Response.prototype);
  1789. Response.prototype.clone = function () {
  1790. return new Response(this._bodyInit, {
  1791. status: this.status,
  1792. statusText: this.statusText,
  1793. headers: new Headers(this.headers),
  1794. url: this.url
  1795. });
  1796. };
  1797. Response.error = function () {
  1798. var response = new Response(null, {
  1799. status: 0,
  1800. statusText: ''
  1801. });
  1802. response.type = 'error';
  1803. return response;
  1804. };
  1805. var redirectStatuses = [301, 302, 303, 307, 308];
  1806. Response.redirect = function (url, status) {
  1807. if (redirectStatuses.indexOf(status) === -1) {
  1808. throw new RangeError('Invalid status code');
  1809. }
  1810. return new Response(null, {
  1811. status: status,
  1812. headers: {
  1813. location: url
  1814. }
  1815. });
  1816. };
  1817. self.Headers = Headers;
  1818. self.Request = Request;
  1819. self.Response = Response;
  1820. self.fetch = function (input, init) {
  1821. return new Promise(function (resolve, reject) {
  1822. var request;
  1823. if (Request.prototype.isPrototypeOf(input) && !init) {
  1824. request = input;
  1825. } else {
  1826. request = new Request(input, init);
  1827. }
  1828. var xhr = new XMLHttpRequest();
  1829. function responseURL() {
  1830. if ('responseURL' in xhr) {
  1831. return xhr.responseURL;
  1832. } // Avoid security warnings on getResponseHeader when not allowed by CORS
  1833. if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
  1834. return xhr.getResponseHeader('X-Request-URL');
  1835. }
  1836. return;
  1837. }
  1838. var __onLoadHandled = false;
  1839. function onload() {
  1840. if (xhr.readyState !== 4) {
  1841. return;
  1842. }
  1843. var status = xhr.status === 1223 ? 204 : xhr.status;
  1844. if (status < 100 || status > 599) {
  1845. if (__onLoadHandled) {
  1846. return;
  1847. } else {
  1848. __onLoadHandled = true;
  1849. }
  1850. reject(new TypeError('Network request failed'));
  1851. return;
  1852. }
  1853. var options = {
  1854. status: status,
  1855. statusText: xhr.statusText,
  1856. headers: headers(xhr),
  1857. url: responseURL()
  1858. };
  1859. var body = 'response' in xhr ? xhr.response : xhr.responseText;
  1860. if (__onLoadHandled) {
  1861. return;
  1862. } else {
  1863. __onLoadHandled = true;
  1864. }
  1865. resolve(new Response(body, options));
  1866. }
  1867. xhr.onreadystatechange = onload;
  1868. xhr.onload = onload;
  1869. xhr.onerror = function () {
  1870. if (__onLoadHandled) {
  1871. return;
  1872. } else {
  1873. __onLoadHandled = true;
  1874. }
  1875. reject(new TypeError('Network request failed'));
  1876. };
  1877. xhr.open(request.method, request.url, true); // `withCredentials` should be setted after calling `.open` in IE10
  1878. // http://stackoverflow.com/a/19667959/1219343
  1879. try {
  1880. if (request.credentials === 'include') {
  1881. if ('withCredentials' in xhr) {
  1882. xhr.withCredentials = true;
  1883. } else {
  1884. console && console.warn && console.warn('withCredentials is not supported, you can ignore this warning');
  1885. }
  1886. }
  1887. } catch (e) {
  1888. console && console.warn && console.warn('set withCredentials error:' + e);
  1889. }
  1890. if ('responseType' in xhr && support.blob) {
  1891. xhr.responseType = 'blob';
  1892. }
  1893. request.headers.forEach(function (value, name) {
  1894. xhr.setRequestHeader(name, value);
  1895. });
  1896. xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
  1897. });
  1898. };
  1899. self.fetch.polyfill = true; // Support CommonJS
  1900. if ( true && module.exports) {
  1901. module.exports = self.fetch;
  1902. }
  1903. })(typeof self !== 'undefined' ? self : this);
  1904. /***/ }),
  1905. /* 17 */
  1906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1907. "use strict";
  1908. __webpack_require__.r(__webpack_exports__);
  1909. /* harmony import */ var _supermap_iclient_common_css_webmapfont_iconfont_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19);
  1910. /* harmony import */ var _supermap_iclient_common_css_webmapfont_iconfont_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_supermap_iclient_common_css_webmapfont_iconfont_css__WEBPACK_IMPORTED_MODULE_0__);
  1911. /* harmony import */ var _supermap_iclient_common_components_css_MessageBox_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
  1912. /* harmony import */ var _supermap_iclient_common_components_css_MessageBox_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_supermap_iclient_common_components_css_MessageBox_css__WEBPACK_IMPORTED_MODULE_1__);
  1913. /***/ }),
  1914. /* 18 */
  1915. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1916. "use strict";
  1917. // ESM COMPAT FLAG
  1918. __webpack_require__.r(__webpack_exports__);
  1919. // EXPORTS
  1920. __webpack_require__.d(__webpack_exports__, "SuperMap", function() { return /* reexport */ SuperMap; });
  1921. __webpack_require__.d(__webpack_exports__, "DataFormat", function() { return /* reexport */ DataFormat; });
  1922. __webpack_require__.d(__webpack_exports__, "ServerType", function() { return /* reexport */ ServerType; });
  1923. __webpack_require__.d(__webpack_exports__, "GeometryType", function() { return /* reexport */ GeometryType; });
  1924. __webpack_require__.d(__webpack_exports__, "QueryOption", function() { return /* reexport */ QueryOption; });
  1925. __webpack_require__.d(__webpack_exports__, "JoinType", function() { return /* reexport */ JoinType; });
  1926. __webpack_require__.d(__webpack_exports__, "EngineType", function() { return /* reexport */ EngineType; });
  1927. __webpack_require__.d(__webpack_exports__, "MeasureMode", function() { return /* reexport */ MeasureMode; });
  1928. __webpack_require__.d(__webpack_exports__, "SpatialRelationType", function() { return /* reexport */ SpatialRelationType; });
  1929. __webpack_require__.d(__webpack_exports__, "DataReturnMode", function() { return /* reexport */ DataReturnMode; });
  1930. __webpack_require__.d(__webpack_exports__, "Unit", function() { return /* reexport */ Unit; });
  1931. __webpack_require__.d(__webpack_exports__, "BufferRadiusUnit", function() { return /* reexport */ BufferRadiusUnit; });
  1932. __webpack_require__.d(__webpack_exports__, "SpatialQueryMode", function() { return /* reexport */ SpatialQueryMode; });
  1933. __webpack_require__.d(__webpack_exports__, "ThemeGraphTextFormat", function() { return /* reexport */ ThemeGraphTextFormat; });
  1934. __webpack_require__.d(__webpack_exports__, "ThemeGraphType", function() { return /* reexport */ ThemeGraphType; });
  1935. __webpack_require__.d(__webpack_exports__, "GraphAxesTextDisplayMode", function() { return /* reexport */ GraphAxesTextDisplayMode; });
  1936. __webpack_require__.d(__webpack_exports__, "GraduatedMode", function() { return /* reexport */ GraduatedMode; });
  1937. __webpack_require__.d(__webpack_exports__, "RangeMode", function() { return /* reexport */ RangeMode; });
  1938. __webpack_require__.d(__webpack_exports__, "ThemeType", function() { return /* reexport */ ThemeType; });
  1939. __webpack_require__.d(__webpack_exports__, "ColorGradientType", function() { return /* reexport */ ColorGradientType; });
  1940. __webpack_require__.d(__webpack_exports__, "TextAlignment", function() { return /* reexport */ TextAlignment; });
  1941. __webpack_require__.d(__webpack_exports__, "FillGradientMode", function() { return /* reexport */ FillGradientMode; });
  1942. __webpack_require__.d(__webpack_exports__, "SideType", function() { return /* reexport */ SideType; });
  1943. __webpack_require__.d(__webpack_exports__, "AlongLineDirection", function() { return /* reexport */ AlongLineDirection; });
  1944. __webpack_require__.d(__webpack_exports__, "LabelBackShape", function() { return /* reexport */ LabelBackShape; });
  1945. __webpack_require__.d(__webpack_exports__, "LabelOverLengthMode", function() { return /* reexport */ LabelOverLengthMode; });
  1946. __webpack_require__.d(__webpack_exports__, "DirectionType", function() { return /* reexport */ DirectionType; });
  1947. __webpack_require__.d(__webpack_exports__, "OverlayOperationType", function() { return /* reexport */ OverlayOperationType; });
  1948. __webpack_require__.d(__webpack_exports__, "SupplyCenterType", function() { return /* reexport */ SupplyCenterType; });
  1949. __webpack_require__.d(__webpack_exports__, "TurnType", function() { return /* reexport */ TurnType; });
  1950. __webpack_require__.d(__webpack_exports__, "BufferEndType", function() { return /* reexport */ BufferEndType; });
  1951. __webpack_require__.d(__webpack_exports__, "SmoothMethod", function() { return /* reexport */ SmoothMethod; });
  1952. __webpack_require__.d(__webpack_exports__, "SurfaceAnalystMethod", function() { return /* reexport */ SurfaceAnalystMethod; });
  1953. __webpack_require__.d(__webpack_exports__, "ColorSpaceType", function() { return /* reexport */ ColorSpaceType; });
  1954. __webpack_require__.d(__webpack_exports__, "ChartType", function() { return /* reexport */ ChartType; });
  1955. __webpack_require__.d(__webpack_exports__, "EditType", function() { return /* reexport */ EditType; });
  1956. __webpack_require__.d(__webpack_exports__, "TransferTactic", function() { return /* reexport */ TransferTactic; });
  1957. __webpack_require__.d(__webpack_exports__, "TransferPreference", function() { return /* reexport */ TransferPreference; });
  1958. __webpack_require__.d(__webpack_exports__, "GridType", function() { return /* reexport */ GridType; });
  1959. __webpack_require__.d(__webpack_exports__, "ClientType", function() { return /* reexport */ ClientType; });
  1960. __webpack_require__.d(__webpack_exports__, "LayerType", function() { return /* reexport */ LayerType; });
  1961. __webpack_require__.d(__webpack_exports__, "UGCLayerType", function() { return /* reexport */ UGCLayerType; });
  1962. __webpack_require__.d(__webpack_exports__, "StatisticMode", function() { return /* reexport */ StatisticMode; });
  1963. __webpack_require__.d(__webpack_exports__, "PixelFormat", function() { return /* reexport */ PixelFormat; });
  1964. __webpack_require__.d(__webpack_exports__, "SearchMode", function() { return /* reexport */ SearchMode; });
  1965. __webpack_require__.d(__webpack_exports__, "SummaryType", function() { return /* reexport */ SummaryType; });
  1966. __webpack_require__.d(__webpack_exports__, "InterpolationAlgorithmType", function() { return /* reexport */ InterpolationAlgorithmType; });
  1967. __webpack_require__.d(__webpack_exports__, "VariogramMode", function() { return /* reexport */ VariogramMode; });
  1968. __webpack_require__.d(__webpack_exports__, "Exponent", function() { return /* reexport */ Exponent; });
  1969. __webpack_require__.d(__webpack_exports__, "ClipAnalystMode", function() { return /* reexport */ ClipAnalystMode; });
  1970. __webpack_require__.d(__webpack_exports__, "AnalystAreaUnit", function() { return /* reexport */ AnalystAreaUnit; });
  1971. __webpack_require__.d(__webpack_exports__, "AnalystSizeUnit", function() { return /* reexport */ AnalystSizeUnit; });
  1972. __webpack_require__.d(__webpack_exports__, "StatisticAnalystMode", function() { return /* reexport */ StatisticAnalystMode; });
  1973. __webpack_require__.d(__webpack_exports__, "TopologyValidatorRule", function() { return /* reexport */ TopologyValidatorRule; });
  1974. __webpack_require__.d(__webpack_exports__, "OutputType", function() { return /* reexport */ OutputType; });
  1975. __webpack_require__.d(__webpack_exports__, "AggregationQueryBuilderType", function() { return /* reexport */ AggregationQueryBuilderType; });
  1976. __webpack_require__.d(__webpack_exports__, "AggregationType", function() { return /* reexport */ AggregationType; });
  1977. __webpack_require__.d(__webpack_exports__, "GetFeatureMode", function() { return /* reexport */ GetFeatureMode; });
  1978. __webpack_require__.d(__webpack_exports__, "TimeFlowControl", function() { return /* reexport */ TimeFlowControl; });
  1979. __webpack_require__.d(__webpack_exports__, "IManager", function() { return /* reexport */ iManager_IManager; });
  1980. __webpack_require__.d(__webpack_exports__, "IManagerServiceBase", function() { return /* reexport */ iManagerServiceBase_IManagerServiceBase; });
  1981. __webpack_require__.d(__webpack_exports__, "IManagerCreateNodeParam", function() { return /* reexport */ iManagerCreateNodeParam_IManagerCreateNodeParam; });
  1982. __webpack_require__.d(__webpack_exports__, "IPortal", function() { return /* reexport */ iPortal_IPortal; });
  1983. __webpack_require__.d(__webpack_exports__, "IPortalQueryParam", function() { return /* reexport */ iPortalQueryParam_IPortalQueryParam; });
  1984. __webpack_require__.d(__webpack_exports__, "IPortalResource", function() { return /* reexport */ iPortalResource_IPortalResource; });
  1985. __webpack_require__.d(__webpack_exports__, "IPortalQueryResult", function() { return /* reexport */ iPortalQueryResult_IPortalQueryResult; });
  1986. __webpack_require__.d(__webpack_exports__, "IPortalShareParam", function() { return /* reexport */ iPortalShareParam_IPortalShareParam; });
  1987. __webpack_require__.d(__webpack_exports__, "IPortalShareEntity", function() { return /* reexport */ iPortalShareEntity_IPortalShareEntity; });
  1988. __webpack_require__.d(__webpack_exports__, "IPortalServiceBase", function() { return /* reexport */ iPortalServiceBase_IPortalServiceBase; });
  1989. __webpack_require__.d(__webpack_exports__, "IPortalUser", function() { return /* reexport */ iPortalUser_IPortalUser; });
  1990. __webpack_require__.d(__webpack_exports__, "IPortalAddResourceParam", function() { return /* reexport */ iPortalAddResourceParam_IPortalAddResourceParam; });
  1991. __webpack_require__.d(__webpack_exports__, "IPortalRegisterServiceParam", function() { return /* reexport */ iPortalRegisterServiceParam_IPortalRegisterServiceParam; });
  1992. __webpack_require__.d(__webpack_exports__, "IPortalAddDataParam", function() { return /* reexport */ iPortalAddDataParam_IPortalAddDataParam; });
  1993. __webpack_require__.d(__webpack_exports__, "IPortalDataMetaInfoParam", function() { return /* reexport */ iPortalDataMetaInfoParam_IPortalDataMetaInfoParam; });
  1994. __webpack_require__.d(__webpack_exports__, "IPortalDataStoreInfoParam", function() { return /* reexport */ iPortalDataStoreInfoParam_IPortalDataStoreInfoParam; });
  1995. __webpack_require__.d(__webpack_exports__, "IPortalDataConnectionInfoParam", function() { return /* reexport */ iPortalDataConnectionInfoParam_IPortalDataConnectionInfoParam; });
  1996. __webpack_require__.d(__webpack_exports__, "Online", function() { return /* reexport */ Online_Online; });
  1997. __webpack_require__.d(__webpack_exports__, "OnlineData", function() { return /* reexport */ OnlineData_OnlineData; });
  1998. __webpack_require__.d(__webpack_exports__, "OnlineQueryDatasParameter", function() { return /* reexport */ OnlineQueryDatasParameter_OnlineQueryDatasParameter; });
  1999. __webpack_require__.d(__webpack_exports__, "ServiceStatus", function() { return /* reexport */ ServiceStatus; });
  2000. __webpack_require__.d(__webpack_exports__, "DataItemType", function() { return /* reexport */ OnlineResources_DataItemType; });
  2001. __webpack_require__.d(__webpack_exports__, "DataItemOrderBy", function() { return /* reexport */ DataItemOrderBy; });
  2002. __webpack_require__.d(__webpack_exports__, "FilterField", function() { return /* reexport */ FilterField; });
  2003. __webpack_require__.d(__webpack_exports__, "OnlineServiceBase", function() { return /* reexport */ OnlineServiceBase_OnlineServiceBase; });
  2004. __webpack_require__.d(__webpack_exports__, "KeyServiceParameter", function() { return /* reexport */ KeyServiceParameter_KeyServiceParameter; });
  2005. __webpack_require__.d(__webpack_exports__, "SecurityManager", function() { return /* reexport */ SecurityManager_SecurityManager; });
  2006. __webpack_require__.d(__webpack_exports__, "ServerInfo", function() { return /* reexport */ ServerInfo_ServerInfo; });
  2007. __webpack_require__.d(__webpack_exports__, "TokenServiceParameter", function() { return /* reexport */ TokenServiceParameter_TokenServiceParameter; });
  2008. __webpack_require__.d(__webpack_exports__, "ElasticSearch", function() { return /* reexport */ ElasticSearch_ElasticSearch; });
  2009. __webpack_require__.d(__webpack_exports__, "FetchRequest", function() { return /* reexport */ FetchRequest; });
  2010. __webpack_require__.d(__webpack_exports__, "ColorsPickerUtil", function() { return /* reexport */ ColorsPickerUtil; });
  2011. __webpack_require__.d(__webpack_exports__, "ArrayStatistic", function() { return /* reexport */ ArrayStatistic; });
  2012. __webpack_require__.d(__webpack_exports__, "AreaSolarRadiationParameters", function() { return /* reexport */ AreaSolarRadiationParameters_AreaSolarRadiationParameters; });
  2013. __webpack_require__.d(__webpack_exports__, "AggregationParameter", function() { return /* reexport */ AggregationParameter_AggregationParameter; });
  2014. __webpack_require__.d(__webpack_exports__, "AggQueryBuilderParameter", function() { return /* reexport */ AggQueryBuilderParameter_AggQueryBuilderParameter; });
  2015. __webpack_require__.d(__webpack_exports__, "BufferAnalystParameters", function() { return /* reexport */ BufferAnalystParameters_BufferAnalystParameters; });
  2016. __webpack_require__.d(__webpack_exports__, "BufferDistance", function() { return /* reexport */ BufferDistance_BufferDistance; });
  2017. __webpack_require__.d(__webpack_exports__, "BuffersAnalystJobsParameter", function() { return /* reexport */ BuffersAnalystJobsParameter_BuffersAnalystJobsParameter; });
  2018. __webpack_require__.d(__webpack_exports__, "BufferSetting", function() { return /* reexport */ BufferSetting_BufferSetting; });
  2019. __webpack_require__.d(__webpack_exports__, "BurstPipelineAnalystParameters", function() { return /* reexport */ BurstPipelineAnalystParameters_BurstPipelineAnalystParameters; });
  2020. __webpack_require__.d(__webpack_exports__, "ChartQueryFilterParameter", function() { return /* reexport */ ChartQueryFilterParameter_ChartQueryFilterParameter; });
  2021. __webpack_require__.d(__webpack_exports__, "ChartQueryParameters", function() { return /* reexport */ ChartQueryParameters_ChartQueryParameters; });
  2022. __webpack_require__.d(__webpack_exports__, "ClipParameter", function() { return /* reexport */ ClipParameter_ClipParameter; });
  2023. __webpack_require__.d(__webpack_exports__, "ColorDictionary", function() { return /* reexport */ ColorDictionary_ColorDictionary; });
  2024. __webpack_require__.d(__webpack_exports__, "ComputeWeightMatrixParameters", function() { return /* reexport */ ComputeWeightMatrixParameters_ComputeWeightMatrixParameters; });
  2025. __webpack_require__.d(__webpack_exports__, "DataReturnOption", function() { return /* reexport */ DataReturnOption_DataReturnOption; });
  2026. __webpack_require__.d(__webpack_exports__, "DatasetBufferAnalystParameters", function() { return /* reexport */ DatasetBufferAnalystParameters_DatasetBufferAnalystParameters; });
  2027. __webpack_require__.d(__webpack_exports__, "DatasetInfo", function() { return /* reexport */ DatasetInfo_DatasetInfo; });
  2028. __webpack_require__.d(__webpack_exports__, "DatasetOverlayAnalystParameters", function() { return /* reexport */ DatasetOverlayAnalystParameters_DatasetOverlayAnalystParameters; });
  2029. __webpack_require__.d(__webpack_exports__, "DatasetSurfaceAnalystParameters", function() { return /* reexport */ DatasetSurfaceAnalystParameters_DatasetSurfaceAnalystParameters; });
  2030. __webpack_require__.d(__webpack_exports__, "DatasetThiessenAnalystParameters", function() { return /* reexport */ DatasetThiessenAnalystParameters_DatasetThiessenAnalystParameters; });
  2031. __webpack_require__.d(__webpack_exports__, "DatasourceConnectionInfo", function() { return /* reexport */ DatasourceConnectionInfo_DatasourceConnectionInfo; });
  2032. __webpack_require__.d(__webpack_exports__, "DensityKernelAnalystParameters", function() { return /* reexport */ DensityKernelAnalystParameters_DensityKernelAnalystParameters; });
  2033. __webpack_require__.d(__webpack_exports__, "EditFeaturesParameters", function() { return /* reexport */ EditFeaturesParameters_EditFeaturesParameters; });
  2034. __webpack_require__.d(__webpack_exports__, "FacilityAnalyst3DParameters", function() { return /* reexport */ FacilityAnalyst3DParameters_FacilityAnalyst3DParameters; });
  2035. __webpack_require__.d(__webpack_exports__, "FacilityAnalystSinks3DParameters", function() { return /* reexport */ FacilityAnalystSinks3DParameters; });
  2036. __webpack_require__.d(__webpack_exports__, "FacilityAnalystSources3DParameters", function() { return /* reexport */ FacilityAnalystSources3DParameters; });
  2037. __webpack_require__.d(__webpack_exports__, "FacilityAnalystStreamParameters", function() { return /* reexport */ FacilityAnalystStreamParameters_FacilityAnalystStreamParameters; });
  2038. __webpack_require__.d(__webpack_exports__, "FacilityAnalystTracedown3DParameters", function() { return /* reexport */ FacilityAnalystTracedown3DParameters; });
  2039. __webpack_require__.d(__webpack_exports__, "FacilityAnalystTraceup3DParameters", function() { return /* reexport */ FacilityAnalystTraceup3DParameters; });
  2040. __webpack_require__.d(__webpack_exports__, "FacilityAnalystUpstream3DParameters", function() { return /* reexport */ FacilityAnalystUpstream3DParameters_FacilityAnalystUpstream3DParameters; });
  2041. __webpack_require__.d(__webpack_exports__, "FieldParameters", function() { return /* reexport */ FieldParameters_FieldParameters; });
  2042. __webpack_require__.d(__webpack_exports__, "FieldStatisticsParameters", function() { return /* reexport */ FieldStatisticsParameters_FieldStatisticsParameters; });
  2043. __webpack_require__.d(__webpack_exports__, "FilterParameter", function() { return /* reexport */ FilterParameter_FilterParameter; });
  2044. __webpack_require__.d(__webpack_exports__, "FilterAggParameter", function() { return /* reexport */ FilterAggParameter_FilterAggParameter; });
  2045. __webpack_require__.d(__webpack_exports__, "FindClosestFacilitiesParameters", function() { return /* reexport */ FindClosestFacilitiesParameters_FindClosestFacilitiesParameters; });
  2046. __webpack_require__.d(__webpack_exports__, "FindLocationParameters", function() { return /* reexport */ FindLocationParameters_FindLocationParameters; });
  2047. __webpack_require__.d(__webpack_exports__, "FindMTSPPathsParameters", function() { return /* reexport */ FindMTSPPathsParameters_FindMTSPPathsParameters; });
  2048. __webpack_require__.d(__webpack_exports__, "FindPathParameters", function() { return /* reexport */ FindPathParameters_FindPathParameters; });
  2049. __webpack_require__.d(__webpack_exports__, "FindServiceAreasParameters", function() { return /* reexport */ FindServiceAreasParameters_FindServiceAreasParameters; });
  2050. __webpack_require__.d(__webpack_exports__, "FindTSPPathsParameters", function() { return /* reexport */ FindTSPPathsParameters_FindTSPPathsParameters; });
  2051. __webpack_require__.d(__webpack_exports__, "GenerateSpatialDataParameters", function() { return /* reexport */ GenerateSpatialDataParameters_GenerateSpatialDataParameters; });
  2052. __webpack_require__.d(__webpack_exports__, "GeoBoundingBoxQueryBuilderParameter", function() { return /* reexport */ GeoBoundingBoxQueryBuilderParameter_GeoBoundingBoxQueryBuilderParameter; });
  2053. __webpack_require__.d(__webpack_exports__, "GeoCodingParameter", function() { return /* reexport */ GeoCodingParameter_GeoCodingParameter; });
  2054. __webpack_require__.d(__webpack_exports__, "GeoDecodingParameter", function() { return /* reexport */ GeoDecodingParameter_GeoDecodingParameter; });
  2055. __webpack_require__.d(__webpack_exports__, "GeoHashGridAggParameter", function() { return /* reexport */ GeoHashGridAggParameter_GeoHashGridAggParameter; });
  2056. __webpack_require__.d(__webpack_exports__, "GeometryBufferAnalystParameters", function() { return /* reexport */ GeometryBufferAnalystParameters_GeometryBufferAnalystParameters; });
  2057. __webpack_require__.d(__webpack_exports__, "GeometryOverlayAnalystParameters", function() { return /* reexport */ GeometryOverlayAnalystParameters_GeometryOverlayAnalystParameters; });
  2058. __webpack_require__.d(__webpack_exports__, "GeometrySurfaceAnalystParameters", function() { return /* reexport */ GeometrySurfaceAnalystParameters_GeometrySurfaceAnalystParameters; });
  2059. __webpack_require__.d(__webpack_exports__, "GeometryThiessenAnalystParameters", function() { return /* reexport */ GeometryThiessenAnalystParameters_GeometryThiessenAnalystParameters; });
  2060. __webpack_require__.d(__webpack_exports__, "GeoRelationAnalystParameters", function() { return /* reexport */ GeoRelationAnalystParameters_GeoRelationAnalystParameters; });
  2061. __webpack_require__.d(__webpack_exports__, "GetFeaturesByBoundsParameters", function() { return /* reexport */ GetFeaturesByBoundsParameters_GetFeaturesByBoundsParameters; });
  2062. __webpack_require__.d(__webpack_exports__, "GetFeaturesByBufferParameters", function() { return /* reexport */ GetFeaturesByBufferParameters_GetFeaturesByBufferParameters; });
  2063. __webpack_require__.d(__webpack_exports__, "GetFeaturesByGeometryParameters", function() { return /* reexport */ GetFeaturesByGeometryParameters_GetFeaturesByGeometryParameters; });
  2064. __webpack_require__.d(__webpack_exports__, "GetFeaturesByIDsParameters", function() { return /* reexport */ GetFeaturesByIDsParameters_GetFeaturesByIDsParameters; });
  2065. __webpack_require__.d(__webpack_exports__, "GetFeaturesBySQLParameters", function() { return /* reexport */ GetFeaturesBySQLParameters_GetFeaturesBySQLParameters; });
  2066. __webpack_require__.d(__webpack_exports__, "GetGridCellInfosParameters", function() { return /* reexport */ GetGridCellInfosParameters_GetGridCellInfosParameters; });
  2067. __webpack_require__.d(__webpack_exports__, "Grid", function() { return /* reexport */ Grid_Grid; });
  2068. __webpack_require__.d(__webpack_exports__, "Image", function() { return /* reexport */ Image_Image; });
  2069. __webpack_require__.d(__webpack_exports__, "InterpolationAnalystParameters", function() { return /* reexport */ InterpolationAnalystParameters_InterpolationAnalystParameters; });
  2070. __webpack_require__.d(__webpack_exports__, "InterpolationIDWAnalystParameters", function() { return /* reexport */ InterpolationIDWAnalystParameters_InterpolationIDWAnalystParameters; });
  2071. __webpack_require__.d(__webpack_exports__, "InterpolationKrigingAnalystParameters", function() { return /* reexport */ InterpolationKrigingAnalystParameters_InterpolationKrigingAnalystParameters; });
  2072. __webpack_require__.d(__webpack_exports__, "InterpolationRBFAnalystParameters", function() { return /* reexport */ InterpolationRBFAnalystParameters_InterpolationRBFAnalystParameters; });
  2073. __webpack_require__.d(__webpack_exports__, "JoinItem", function() { return /* reexport */ JoinItem_JoinItem; });
  2074. __webpack_require__.d(__webpack_exports__, "KernelDensityJobParameter", function() { return /* reexport */ KernelDensityJobParameter_KernelDensityJobParameter; });
  2075. __webpack_require__.d(__webpack_exports__, "LabelImageCell", function() { return /* reexport */ LabelImageCell_LabelImageCell; });
  2076. __webpack_require__.d(__webpack_exports__, "LabelMatrixCell", function() { return /* reexport */ LabelMatrixCell; });
  2077. __webpack_require__.d(__webpack_exports__, "LabelMixedTextStyle", function() { return /* reexport */ LabelMixedTextStyle_LabelMixedTextStyle; });
  2078. __webpack_require__.d(__webpack_exports__, "LabelSymbolCell", function() { return /* reexport */ LabelSymbolCell_LabelSymbolCell; });
  2079. __webpack_require__.d(__webpack_exports__, "LabelThemeCell", function() { return /* reexport */ LabelThemeCell_LabelThemeCell; });
  2080. __webpack_require__.d(__webpack_exports__, "LayerStatus", function() { return /* reexport */ LayerStatus_LayerStatus; });
  2081. __webpack_require__.d(__webpack_exports__, "LinkItem", function() { return /* reexport */ LinkItem_LinkItem; });
  2082. __webpack_require__.d(__webpack_exports__, "MathExpressionAnalysisParameters", function() { return /* reexport */ MathExpressionAnalysisParameters_MathExpressionAnalysisParameters; });
  2083. __webpack_require__.d(__webpack_exports__, "MeasureParameters", function() { return /* reexport */ MeasureParameters_MeasureParameters; });
  2084. __webpack_require__.d(__webpack_exports__, "OutputSetting", function() { return /* reexport */ OutputSetting_OutputSetting; });
  2085. __webpack_require__.d(__webpack_exports__, "MappingParameters", function() { return /* reexport */ MappingParameters_MappingParameters; });
  2086. __webpack_require__.d(__webpack_exports__, "OverlapDisplayedOptions", function() { return /* reexport */ OverlapDisplayedOptions_OverlapDisplayedOptions; });
  2087. __webpack_require__.d(__webpack_exports__, "OverlayAnalystParameters", function() { return /* reexport */ OverlayAnalystParameters_OverlayAnalystParameters; });
  2088. __webpack_require__.d(__webpack_exports__, "OverlayGeoJobParameter", function() { return /* reexport */ OverlayGeoJobParameter_OverlayGeoJobParameter; });
  2089. __webpack_require__.d(__webpack_exports__, "PointWithMeasure", function() { return /* reexport */ PointWithMeasure_PointWithMeasure; });
  2090. __webpack_require__.d(__webpack_exports__, "QueryByBoundsParameters", function() { return /* reexport */ QueryByBoundsParameters_QueryByBoundsParameters; });
  2091. __webpack_require__.d(__webpack_exports__, "QueryByDistanceParameters", function() { return /* reexport */ QueryByDistanceParameters_QueryByDistanceParameters; });
  2092. __webpack_require__.d(__webpack_exports__, "QueryByGeometryParameters", function() { return /* reexport */ QueryByGeometryParameters_QueryByGeometryParameters; });
  2093. __webpack_require__.d(__webpack_exports__, "QueryBySQLParameters", function() { return /* reexport */ QueryBySQLParameters_QueryBySQLParameters; });
  2094. __webpack_require__.d(__webpack_exports__, "QueryParameters", function() { return /* reexport */ QueryParameters_QueryParameters; });
  2095. __webpack_require__.d(__webpack_exports__, "Route", function() { return /* reexport */ Route_Route; });
  2096. __webpack_require__.d(__webpack_exports__, "RouteCalculateMeasureParameters", function() { return /* reexport */ RouteCalculateMeasureParameters_RouteCalculateMeasureParameters; });
  2097. __webpack_require__.d(__webpack_exports__, "RouteLocatorParameters", function() { return /* reexport */ RouteLocatorParameters_RouteLocatorParameters; });
  2098. __webpack_require__.d(__webpack_exports__, "ServerColor", function() { return /* reexport */ ServerColor; });
  2099. __webpack_require__.d(__webpack_exports__, "ServerFeature", function() { return /* reexport */ ServerFeature_ServerFeature; });
  2100. __webpack_require__.d(__webpack_exports__, "ServerGeometry", function() { return /* reexport */ ServerGeometry_ServerGeometry; });
  2101. __webpack_require__.d(__webpack_exports__, "ServerStyle", function() { return /* reexport */ ServerStyle_ServerStyle; });
  2102. __webpack_require__.d(__webpack_exports__, "ServerTextStyle", function() { return /* reexport */ ServerTextStyle_ServerTextStyle; });
  2103. __webpack_require__.d(__webpack_exports__, "ServerTheme", function() { return /* reexport */ ServerTheme_ServerTheme; });
  2104. __webpack_require__.d(__webpack_exports__, "SetLayerInfoParameters", function() { return /* reexport */ SetLayerInfoParameters_SetLayerInfoParameters; });
  2105. __webpack_require__.d(__webpack_exports__, "SetLayersInfoParameters", function() { return /* reexport */ SetLayersInfoParameters_SetLayersInfoParameters; });
  2106. __webpack_require__.d(__webpack_exports__, "SetLayerStatusParameters", function() { return /* reexport */ SetLayerStatusParameters_SetLayerStatusParameters; });
  2107. __webpack_require__.d(__webpack_exports__, "SingleObjectQueryJobsParameter", function() { return /* reexport */ SingleObjectQueryJobsParameter_SingleObjectQueryJobsParameter; });
  2108. __webpack_require__.d(__webpack_exports__, "StopQueryParameters", function() { return /* reexport */ StopQueryParameters_StopQueryParameters; });
  2109. __webpack_require__.d(__webpack_exports__, "SummaryAttributesJobsParameter", function() { return /* reexport */ SummaryAttributesJobsParameter_SummaryAttributesJobsParameter; });
  2110. __webpack_require__.d(__webpack_exports__, "SummaryMeshJobParameter", function() { return /* reexport */ SummaryMeshJobParameter_SummaryMeshJobParameter; });
  2111. __webpack_require__.d(__webpack_exports__, "SummaryRegionJobParameter", function() { return /* reexport */ SummaryRegionJobParameter_SummaryRegionJobParameter; });
  2112. __webpack_require__.d(__webpack_exports__, "SupplyCenter", function() { return /* reexport */ SupplyCenter_SupplyCenter; });
  2113. __webpack_require__.d(__webpack_exports__, "SurfaceAnalystParameters", function() { return /* reexport */ SurfaceAnalystParameters_SurfaceAnalystParameters; });
  2114. __webpack_require__.d(__webpack_exports__, "SurfaceAnalystParametersSetting", function() { return /* reexport */ SurfaceAnalystParametersSetting_SurfaceAnalystParametersSetting; });
  2115. __webpack_require__.d(__webpack_exports__, "TerrainCurvatureCalculationParameters", function() { return /* reexport */ TerrainCurvatureCalculationParameters_TerrainCurvatureCalculationParameters; });
  2116. __webpack_require__.d(__webpack_exports__, "Theme", function() { return /* reexport */ Theme_Theme; });
  2117. __webpack_require__.d(__webpack_exports__, "ThemeDotDensity", function() { return /* reexport */ ThemeDotDensity_ThemeDotDensity; });
  2118. __webpack_require__.d(__webpack_exports__, "ThemeFlow", function() { return /* reexport */ ThemeFlow_ThemeFlow; });
  2119. __webpack_require__.d(__webpack_exports__, "ThemeGraduatedSymbol", function() { return /* reexport */ ThemeGraduatedSymbol_ThemeGraduatedSymbol; });
  2120. __webpack_require__.d(__webpack_exports__, "ThemeGraduatedSymbolStyle", function() { return /* reexport */ ThemeGraduatedSymbolStyle_ThemeGraduatedSymbolStyle; });
  2121. __webpack_require__.d(__webpack_exports__, "ThemeGraph", function() { return /* reexport */ ThemeGraph_ThemeGraph; });
  2122. __webpack_require__.d(__webpack_exports__, "ThemeGraphAxes", function() { return /* reexport */ ThemeGraphAxes_ThemeGraphAxes; });
  2123. __webpack_require__.d(__webpack_exports__, "ThemeGraphItem", function() { return /* reexport */ ThemeGraphItem_ThemeGraphItem; });
  2124. __webpack_require__.d(__webpack_exports__, "ThemeGraphSize", function() { return /* reexport */ ThemeGraphSize_ThemeGraphSize; });
  2125. __webpack_require__.d(__webpack_exports__, "ThemeGraphText", function() { return /* reexport */ ThemeGraphText_ThemeGraphText; });
  2126. __webpack_require__.d(__webpack_exports__, "ThemeGridRange", function() { return /* reexport */ ThemeGridRange_ThemeGridRange; });
  2127. __webpack_require__.d(__webpack_exports__, "ThemeGridRangeItem", function() { return /* reexport */ ThemeGridRangeItem_ThemeGridRangeItem; });
  2128. __webpack_require__.d(__webpack_exports__, "ThemeGridUnique", function() { return /* reexport */ ThemeGridUnique_ThemeGridUnique; });
  2129. __webpack_require__.d(__webpack_exports__, "ThemeGridUniqueItem", function() { return /* reexport */ ThemeGridUniqueItem_ThemeGridUniqueItem; });
  2130. __webpack_require__.d(__webpack_exports__, "ThemeLabel", function() { return /* reexport */ ThemeLabel_ThemeLabel; });
  2131. __webpack_require__.d(__webpack_exports__, "ThemeLabelAlongLine", function() { return /* reexport */ ThemeLabelAlongLine_ThemeLabelAlongLine; });
  2132. __webpack_require__.d(__webpack_exports__, "ThemeLabelBackground", function() { return /* reexport */ ThemeLabelBackground_ThemeLabelBackground; });
  2133. __webpack_require__.d(__webpack_exports__, "ThemeLabelItem", function() { return /* reexport */ ThemeLabelItem_ThemeLabelItem; });
  2134. __webpack_require__.d(__webpack_exports__, "ThemeLabelText", function() { return /* reexport */ ThemeLabelText_ThemeLabelText; });
  2135. __webpack_require__.d(__webpack_exports__, "ThemeLabelUniqueItem", function() { return /* reexport */ ThemeLabelUniqueItem_ThemeLabelUniqueItem; });
  2136. __webpack_require__.d(__webpack_exports__, "ThemeMemoryData", function() { return /* reexport */ ThemeMemoryData; });
  2137. __webpack_require__.d(__webpack_exports__, "ThemeOffset", function() { return /* reexport */ ThemeOffset_ThemeOffset; });
  2138. __webpack_require__.d(__webpack_exports__, "ThemeParameters", function() { return /* reexport */ ThemeParameters_ThemeParameters; });
  2139. __webpack_require__.d(__webpack_exports__, "ThemeRange", function() { return /* reexport */ ThemeRange_ThemeRange; });
  2140. __webpack_require__.d(__webpack_exports__, "ThemeRangeItem", function() { return /* reexport */ ThemeRangeItem_ThemeRangeItem; });
  2141. __webpack_require__.d(__webpack_exports__, "ThemeUnique", function() { return /* reexport */ ThemeUnique_ThemeUnique; });
  2142. __webpack_require__.d(__webpack_exports__, "ThemeUniqueItem", function() { return /* reexport */ ThemeUniqueItem_ThemeUniqueItem; });
  2143. __webpack_require__.d(__webpack_exports__, "ThiessenAnalystParameters", function() { return /* reexport */ ThiessenAnalystParameters_ThiessenAnalystParameters; });
  2144. __webpack_require__.d(__webpack_exports__, "TopologyValidatorJobsParameter", function() { return /* reexport */ TopologyValidatorJobsParameter_TopologyValidatorJobsParameter; });
  2145. __webpack_require__.d(__webpack_exports__, "TransferLine", function() { return /* reexport */ TransferLine_TransferLine; });
  2146. __webpack_require__.d(__webpack_exports__, "TransferPathParameters", function() { return /* reexport */ TransferPathParameters_TransferPathParameters; });
  2147. __webpack_require__.d(__webpack_exports__, "TransferSolutionParameters", function() { return /* reexport */ TransferSolutionParameters_TransferSolutionParameters; });
  2148. __webpack_require__.d(__webpack_exports__, "TransportationAnalystParameter", function() { return /* reexport */ TransportationAnalystParameter_TransportationAnalystParameter; });
  2149. __webpack_require__.d(__webpack_exports__, "TransportationAnalystResultSetting", function() { return /* reexport */ TransportationAnalystResultSetting_TransportationAnalystResultSetting; });
  2150. __webpack_require__.d(__webpack_exports__, "UGCLayer", function() { return /* reexport */ UGCLayer_UGCLayer; });
  2151. __webpack_require__.d(__webpack_exports__, "UGCMapLayer", function() { return /* reexport */ UGCMapLayer_UGCMapLayer; });
  2152. __webpack_require__.d(__webpack_exports__, "UGCSubLayer", function() { return /* reexport */ UGCSubLayer_UGCSubLayer; });
  2153. __webpack_require__.d(__webpack_exports__, "UpdateEdgeWeightParameters", function() { return /* reexport */ UpdateEdgeWeightParameters_UpdateEdgeWeightParameters; });
  2154. __webpack_require__.d(__webpack_exports__, "UpdateTurnNodeWeightParameters", function() { return /* reexport */ UpdateTurnNodeWeightParameters_UpdateTurnNodeWeightParameters; });
  2155. __webpack_require__.d(__webpack_exports__, "Vector", function() { return /* reexport */ iServer_Vector_Vector; });
  2156. __webpack_require__.d(__webpack_exports__, "VectorClipJobsParameter", function() { return /* reexport */ VectorClipJobsParameter_VectorClipJobsParameter; });
  2157. __webpack_require__.d(__webpack_exports__, "WebPrintingJobCustomItems", function() { return /* reexport */ WebPrintingJobCustomItems_WebPrintingJobCustomItems; });
  2158. __webpack_require__.d(__webpack_exports__, "WebPrintingJobImage", function() { return /* reexport */ WebPrintingJobImage_WebPrintingJobImage; });
  2159. __webpack_require__.d(__webpack_exports__, "WebPrintingJobLayers", function() { return /* reexport */ WebPrintingJobLayers_WebPrintingJobLayers; });
  2160. __webpack_require__.d(__webpack_exports__, "WebPrintingJobLegendOptions", function() { return /* reexport */ WebPrintingJobLegendOptions_WebPrintingJobLegendOptions; });
  2161. __webpack_require__.d(__webpack_exports__, "WebPrintingJobLittleMapOptions", function() { return /* reexport */ WebPrintingJobLittleMapOptions_WebPrintingJobLittleMapOptions; });
  2162. __webpack_require__.d(__webpack_exports__, "WebPrintingJobNorthArrowOptions", function() { return /* reexport */ WebPrintingJobNorthArrowOptions_WebPrintingJobNorthArrowOptions; });
  2163. __webpack_require__.d(__webpack_exports__, "WebPrintingJobScaleBarOptions", function() { return /* reexport */ WebPrintingJobScaleBarOptions_WebPrintingJobScaleBarOptions; });
  2164. __webpack_require__.d(__webpack_exports__, "WebPrintingJobContent", function() { return /* reexport */ WebPrintingJobContent_WebPrintingJobContent; });
  2165. __webpack_require__.d(__webpack_exports__, "WebPrintingJobLayoutOptions", function() { return /* reexport */ WebPrintingJobLayoutOptions_WebPrintingJobLayoutOptions; });
  2166. __webpack_require__.d(__webpack_exports__, "WebPrintingJobExportOptions", function() { return /* reexport */ WebPrintingJobExportOptions_WebPrintingJobExportOptions; });
  2167. __webpack_require__.d(__webpack_exports__, "WebPrintingJobParameters", function() { return /* reexport */ WebPrintingJobParameters_WebPrintingJobParameters; });
  2168. __webpack_require__.d(__webpack_exports__, "WebPrintingService", function() { return /* reexport */ WebPrintingService_WebPrintingService; });
  2169. __webpack_require__.d(__webpack_exports__, "FileTypes", function() { return /* reexport */ FileTypes; });
  2170. __webpack_require__.d(__webpack_exports__, "FileConfig", function() { return /* reexport */ FileConfig; });
  2171. __webpack_require__.d(__webpack_exports__, "FileModel", function() { return /* reexport */ FileModel_FileModel; });
  2172. __webpack_require__.d(__webpack_exports__, "MessageBox", function() { return /* reexport */ MessageBox; });
  2173. __webpack_require__.d(__webpack_exports__, "CommonContainer", function() { return /* reexport */ CommonContainer; });
  2174. __webpack_require__.d(__webpack_exports__, "DropDownBox", function() { return /* reexport */ DropDownBox; });
  2175. __webpack_require__.d(__webpack_exports__, "Select", function() { return /* reexport */ Select; });
  2176. __webpack_require__.d(__webpack_exports__, "AttributesPopContainer", function() { return /* reexport */ AttributesPopContainer; });
  2177. __webpack_require__.d(__webpack_exports__, "PopContainer", function() { return /* reexport */ PopContainer; });
  2178. __webpack_require__.d(__webpack_exports__, "IndexTabsPageContainer", function() { return /* reexport */ IndexTabsPageContainer; });
  2179. __webpack_require__.d(__webpack_exports__, "CityTabsPage", function() { return /* reexport */ CityTabsPage_CityTabsPage; });
  2180. __webpack_require__.d(__webpack_exports__, "NavTabsPage", function() { return /* reexport */ NavTabsPage; });
  2181. __webpack_require__.d(__webpack_exports__, "PaginationContainer", function() { return /* reexport */ PaginationContainer; });
  2182. __webpack_require__.d(__webpack_exports__, "ComponentsUtil", function() { return /* reexport */ ComponentsUtil; });
  2183. __webpack_require__.d(__webpack_exports__, "FileReaderUtil", function() { return /* reexport */ FileReaderUtil; });
  2184. __webpack_require__.d(__webpack_exports__, "ChartView", function() { return /* reexport */ ChartView_ChartView; });
  2185. __webpack_require__.d(__webpack_exports__, "ChartViewModel", function() { return /* reexport */ ChartViewModel_ChartViewModel; });
  2186. __webpack_require__.d(__webpack_exports__, "Logo", function() { return /* reexport */ Logo_Logo; });
  2187. __webpack_require__.d(__webpack_exports__, "Util", function() { return /* reexport */ core_Util_Util; });
  2188. __webpack_require__.d(__webpack_exports__, "MapExtend", function() { return /* reexport */ MapExtend; });
  2189. __webpack_require__.d(__webpack_exports__, "Graph", function() { return /* reexport */ GraphThemeLayer_Graph; });
  2190. __webpack_require__.d(__webpack_exports__, "Label", function() { return /* reexport */ LabelThemeLayer_Label; });
  2191. __webpack_require__.d(__webpack_exports__, "MapvLayer", function() { return /* reexport */ MapvLayer_MapvLayer; });
  2192. __webpack_require__.d(__webpack_exports__, "RangeTheme3DLayer", function() { return /* reexport */ RangeTheme3DLayer; });
  2193. __webpack_require__.d(__webpack_exports__, "Range", function() { return /* reexport */ RangeThemeLayer_Range; });
  2194. __webpack_require__.d(__webpack_exports__, "RankSymbol", function() { return /* reexport */ RankSymbolThemeLayer_RankSymbol; });
  2195. __webpack_require__.d(__webpack_exports__, "UniqueTheme3DLayer", function() { return /* reexport */ UniqueTheme3DLayer; });
  2196. __webpack_require__.d(__webpack_exports__, "Unique", function() { return /* reexport */ UniqueThemeLayer_Unique; });
  2197. __webpack_require__.d(__webpack_exports__, "GraphicLayer", function() { return /* reexport */ GraphicLayer_GraphicLayer; });
  2198. __webpack_require__.d(__webpack_exports__, "ThreeLayer", function() { return /* reexport */ ThreeLayer_ThreeLayer; });
  2199. __webpack_require__.d(__webpack_exports__, "HeatMapLayer", function() { return /* reexport */ HeatMapLayer_HeatMapLayer; });
  2200. __webpack_require__.d(__webpack_exports__, "DeckglLayer", function() { return /* reexport */ DeckglLayer_DeckglLayer; });
  2201. __webpack_require__.d(__webpack_exports__, "Graphic", function() { return /* reexport */ Graphic_Graphic; });
  2202. __webpack_require__.d(__webpack_exports__, "MapvDataSet", function() { return /* reexport */ MapvDataSet; });
  2203. __webpack_require__.d(__webpack_exports__, "MapvRenderer", function() { return /* reexport */ MapvRenderer_MapvRenderer; });
  2204. __webpack_require__.d(__webpack_exports__, "getDefaultVectorTileStyle", function() { return /* reexport */ getDefaultVectorTileStyle; });
  2205. __webpack_require__.d(__webpack_exports__, "setBackground", function() { return /* reexport */ setBackground; });
  2206. __webpack_require__.d(__webpack_exports__, "setPaintProperty", function() { return /* reexport */ setPaintProperty; });
  2207. __webpack_require__.d(__webpack_exports__, "GeoFeature", function() { return /* reexport */ GeoFeatureThemeLayer_GeoFeature; });
  2208. __webpack_require__.d(__webpack_exports__, "Theme3DLayer", function() { return /* reexport */ Theme3DLayer; });
  2209. __webpack_require__.d(__webpack_exports__, "ThemeFeature", function() { return /* reexport */ ThemeFeature_ThemeFeature; });
  2210. __webpack_require__.d(__webpack_exports__, "ThemeLayer", function() { return /* reexport */ ThemeLayer_Theme; });
  2211. __webpack_require__.d(__webpack_exports__, "ThreeLayerRenderer", function() { return /* reexport */ ThreeLayerRenderer_ThreeLayerRenderer; });
  2212. __webpack_require__.d(__webpack_exports__, "Transform", function() { return /* reexport */ Transform; });
  2213. __webpack_require__.d(__webpack_exports__, "AddressMatchService", function() { return /* reexport */ services_AddressMatchService_AddressMatchService; });
  2214. __webpack_require__.d(__webpack_exports__, "ChartService", function() { return /* reexport */ ChartService_ChartService; });
  2215. __webpack_require__.d(__webpack_exports__, "DataFlowService", function() { return /* reexport */ services_DataFlowService_DataFlowService; });
  2216. __webpack_require__.d(__webpack_exports__, "FeatureService", function() { return /* reexport */ FeatureService_FeatureService; });
  2217. __webpack_require__.d(__webpack_exports__, "FieldService", function() { return /* reexport */ FieldService_FieldService; });
  2218. __webpack_require__.d(__webpack_exports__, "GridCellInfosService", function() { return /* reexport */ GridCellInfosService_GridCellInfosService; });
  2219. __webpack_require__.d(__webpack_exports__, "GeoprocessingService", function() { return /* reexport */ services_GeoprocessingService_GeoprocessingService; });
  2220. __webpack_require__.d(__webpack_exports__, "LayerInfoService", function() { return /* reexport */ LayerInfoService_LayerInfoService; });
  2221. __webpack_require__.d(__webpack_exports__, "MapService", function() { return /* reexport */ services_MapService_MapService; });
  2222. __webpack_require__.d(__webpack_exports__, "MeasureService", function() { return /* reexport */ services_MeasureService_MeasureService; });
  2223. __webpack_require__.d(__webpack_exports__, "NetworkAnalystService", function() { return /* reexport */ NetworkAnalystService_NetworkAnalystService; });
  2224. __webpack_require__.d(__webpack_exports__, "NetworkAnalyst3DService", function() { return /* reexport */ NetworkAnalyst3DService_NetworkAnalyst3DService; });
  2225. __webpack_require__.d(__webpack_exports__, "ProcessingService", function() { return /* reexport */ ProcessingService_ProcessingService; });
  2226. __webpack_require__.d(__webpack_exports__, "QueryService", function() { return /* reexport */ services_QueryService_QueryService; });
  2227. __webpack_require__.d(__webpack_exports__, "ServiceBase", function() { return /* reexport */ ServiceBase; });
  2228. __webpack_require__.d(__webpack_exports__, "SpatialAnalystService", function() { return /* reexport */ SpatialAnalystService_SpatialAnalystService; });
  2229. __webpack_require__.d(__webpack_exports__, "ThemeService", function() { return /* reexport */ services_ThemeService_ThemeService; });
  2230. __webpack_require__.d(__webpack_exports__, "TrafficTransferAnalystService", function() { return /* reexport */ TrafficTransferAnalystService_TrafficTransferAnalystService; });
  2231. __webpack_require__.d(__webpack_exports__, "WebPrintingJobService", function() { return /* reexport */ WebPrintingJobService_WebPrintingJobService; });
  2232. __webpack_require__.d(__webpack_exports__, "WebMap", function() { return /* reexport */ WebMap_WebMap; });
  2233. // CONCATENATED MODULE: ./src/common/SuperMap.js
  2234. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  2235. * This program are made available under the terms of the Apache License, Version 2.0
  2236. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  2237. var SuperMap = window.SuperMap = window.SuperMap || {};
  2238. SuperMap.Components = window.SuperMap.Components || {};
  2239. // CONCATENATED MODULE: ./src/common/REST.js
  2240. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  2241. * This program are made available under the terms of the Apache License, Version 2.0
  2242. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  2243. /**
  2244. * @enum DataFormat
  2245. * @memberOf SuperMap
  2246. * @description 服务请求返回结果数据类型
  2247. * @type {string}
  2248. */
  2249. var DataFormat = SuperMap.DataFormat = {
  2250. /** GEOJSON */
  2251. GEOJSON: "GEOJSON",
  2252. /** ISERVER */
  2253. ISERVER: "ISERVER"
  2254. };
  2255. /**
  2256. * @enum ServerType
  2257. * @memberOf SuperMap
  2258. * @description 服务器类型
  2259. * @type {string}
  2260. */
  2261. var ServerType = SuperMap.ServerType = {
  2262. /** ISERVER */
  2263. ISERVER: "ISERVER",
  2264. /** IPORTAL */
  2265. IPORTAL: "IPORTAL",
  2266. /** ONLINE */
  2267. ONLINE: "ONLINE"
  2268. };
  2269. /**
  2270. * @enum GeometryType
  2271. * @memberOf SuperMap
  2272. * @description 几何对象枚举,定义了一系列几何对象类型。
  2273. * @type {string}
  2274. */
  2275. var GeometryType = SuperMap.GeometryType = {
  2276. /** LINE */
  2277. LINE: "LINE",
  2278. /** LINEM */
  2279. LINEM: "LINEM",
  2280. /** POINT */
  2281. POINT: "POINT",
  2282. /** REGION */
  2283. REGION: "REGION",
  2284. /** POINTEPS */
  2285. POINTEPS: "POINTEPS",
  2286. /** LINEEPS */
  2287. LINEEPS: "LINEEPS",
  2288. /** REGIONEPS */
  2289. REGIONEPS: "REGIONEPS",
  2290. /** ELLIPSE */
  2291. ELLIPSE: "ELLIPSE",
  2292. /** CIRCLE */
  2293. CIRCLE: "CIRCLE",
  2294. /** TEXT */
  2295. TEXT: "TEXT",
  2296. /** RECTANGLE */
  2297. RECTANGLE: "RECTANGLE",
  2298. /** UNKNOWN */
  2299. UNKNOWN: "UNKNOWN",
  2300. /** GEOCOMPOUND */
  2301. GEOCOMPOUND: "GEOCOMPOUND"
  2302. };
  2303. /**
  2304. * @enum QueryOption
  2305. * @memberOf SuperMap
  2306. * @description 查询结果类型枚举,描述查询结果返回类型,包括只返回属性、只返回几何实体以及返回属性和几何实体。
  2307. * @type {string}
  2308. */
  2309. var QueryOption = SuperMap.QueryOption = {
  2310. /** 属性 */
  2311. ATTRIBUTE: "ATTRIBUTE",
  2312. /** 属性和几何对象 */
  2313. ATTRIBUTEANDGEOMETRY: "ATTRIBUTEANDGEOMETRY",
  2314. /** 几何对象 */
  2315. GEOMETRY: "GEOMETRY"
  2316. };
  2317. /**
  2318. * @enum JoinType
  2319. * @memberOf SuperMap
  2320. * @description 关联查询时的关联类型常量。
  2321. * 该类定义了两个表之间的连接类型常量,决定了对两个表之间进行连接查询时,查询结果中得到的记录的情况。
  2322. * @type {string}
  2323. */
  2324. var JoinType = SuperMap.JoinType = {
  2325. /** INNERJOIN */
  2326. INNERJOIN: "INNERJOIN",
  2327. /** LEFTJOIN */
  2328. LEFTJOIN: "LEFTJOIN"
  2329. };
  2330. /**
  2331. * @enum SpatialQueryMode
  2332. * @memberOf SuperMap
  2333. * @description 空间查询模式枚举。该类定义了空间查询操作模式常量。
  2334. * @type {string}
  2335. */
  2336. var SpatialQueryMode = SuperMap.SpatialQueryMode = {
  2337. /** 包含空间查询模式 */
  2338. CONTAIN: "CONTAIN",
  2339. /** 交叉空间查询模式 */
  2340. CROSS: "CROSS",
  2341. /** 分离空间查询模式 */
  2342. DISJOINT: "DISJOINT",
  2343. /** 重合空间查询模式 */
  2344. IDENTITY: "IDENTITY",
  2345. /** 相交空间查询模式 */
  2346. INTERSECT: "INTERSECT",
  2347. /** 无空间查询 */
  2348. NONE: "NONE",
  2349. /** 叠加空间查询模式 */
  2350. OVERLAP: "OVERLAP",
  2351. /** 邻接空间查询模式 */
  2352. TOUCH: "TOUCH",
  2353. /** 被包含空间查询模式 */
  2354. WITHIN: "WITHIN"
  2355. };
  2356. /**
  2357. * @enum SpatialRelationType
  2358. * @memberOf SuperMap
  2359. * @description 数据集对象间的空间关系枚举。
  2360. * 该类定义了数据集对象间的空间关系类型常量。
  2361. * @type {string}
  2362. */
  2363. var SpatialRelationType = SuperMap.SpatialRelationType = {
  2364. /** 包含关系 */
  2365. CONTAIN: "CONTAIN",
  2366. /** 相交关系 */
  2367. INTERSECT: "INTERSECT",
  2368. /** 被包含关系 */
  2369. WITHIN: "WITHIN"
  2370. };
  2371. /**
  2372. * @enum MeasureMode
  2373. * @memberOf SuperMap
  2374. * @type {string}
  2375. * @description 量算模式枚举。
  2376. * 该类定义了两种测量模式:距离测量和面积测量。
  2377. */
  2378. var MeasureMode = SuperMap.MeasureMode = {
  2379. /** 距离测量 */
  2380. DISTANCE: "DISTANCE",
  2381. /** 面积测量 */
  2382. AREA: "AREA"
  2383. };
  2384. /**
  2385. * @enum Unit
  2386. * @memberOf SuperMap
  2387. * @description 距离单位枚举。
  2388. * 该类定义了一系列距离单位类型。
  2389. * @type {string}
  2390. */
  2391. var Unit = SuperMap.Unit = {
  2392. /** 米 */
  2393. METER: "METER",
  2394. /** 千米 */
  2395. KILOMETER: "KILOMETER",
  2396. /** 英里 */
  2397. MILE: "MILE",
  2398. /** 码 */
  2399. YARD: "YARD",
  2400. /** 度 */
  2401. DEGREE: "DEGREE",
  2402. /** 毫米 */
  2403. MILLIMETER: "MILLIMETER",
  2404. /** 厘米 */
  2405. CENTIMETER: "CENTIMETER",
  2406. /** 英寸 */
  2407. INCH: "INCH",
  2408. /** 分米 */
  2409. DECIMETER: "DECIMETER",
  2410. /** 英尺 */
  2411. FOOT: "FOOT",
  2412. /** 秒 */
  2413. SECOND: "SECOND",
  2414. /** 分 */
  2415. MINUTE: "MINUTE",
  2416. /** 弧度 */
  2417. RADIAN: "RADIAN"
  2418. };
  2419. /**
  2420. * @enum BufferRadiusUnit
  2421. * @memberOf SuperMap
  2422. * @description 缓冲区距离单位枚举。
  2423. * 该类定义了一系列缓冲距离单位类型。
  2424. * @type {string}
  2425. */
  2426. var BufferRadiusUnit = SuperMap.BufferRadiusUnit = {
  2427. /** 厘米 */
  2428. CENTIMETER: "CENTIMETER",
  2429. /** 分米 */
  2430. DECIMETER: "DECIMETER",
  2431. /** 英尺 */
  2432. FOOT: "FOOT",
  2433. /** 英寸 */
  2434. INCH: "INCH",
  2435. /** 千米 */
  2436. KILOMETER: "KILOMETER",
  2437. /** 米 */
  2438. METER: "METER",
  2439. /** 英里 */
  2440. MILE: "MILE",
  2441. /** 毫米 */
  2442. MILLIMETER: "MILLIMETER",
  2443. /** 码 */
  2444. YARD: "YARD"
  2445. };
  2446. /**
  2447. * @enum EngineType
  2448. * @memberOf SuperMap
  2449. * @description 数据源引擎类型枚举。
  2450. * @type {string}
  2451. */
  2452. var EngineType = SuperMap.EngineType = {
  2453. /** 影像只读引擎类型,文件引擎,针对通用影像格式如 BMP,JPG,TIFF 以及超图自定义影像格式 SIT 等。 */
  2454. IMAGEPLUGINS: "IMAGEPLUGINS",
  2455. /** OGC 引擎类型,针对于 Web 数据源,Web 引擎,目前支持的类型有 WMS,WFS,WCS。 */
  2456. OGC: "OGC",
  2457. /** Oracle 引擎类型,针对 Oracle 数据源,数据库引擎。 */
  2458. ORACLEPLUS: "ORACLEPLUS",
  2459. /** SDB 引擎类型,文件引擎,即 SDB 数据源。 */
  2460. SDBPLUS: "SDBPLUS",
  2461. /** SQL Server 引擎类型,针对 SQL Server 数据源,数据库引擎 */
  2462. SQLPLUS: "SQLPLUS",
  2463. /** UDB 引擎类型,文件引擎。 */
  2464. UDB: "UDB"
  2465. };
  2466. /**
  2467. * @enum ThemeGraphTextFormat
  2468. * @memberOf SuperMap
  2469. * @description 统计专题图文本显示格式枚举。
  2470. * @type {string}
  2471. */
  2472. var ThemeGraphTextFormat = SuperMap.ThemeGraphTextFormat = {
  2473. /** 标题。以各子项的标题来进行标注。 */
  2474. CAPTION: "CAPTION",
  2475. /** 标题 + 百分数。以各子项的标题和所占的百分比来进行标注。 */
  2476. CAPTION_PERCENT: "CAPTION_PERCENT",
  2477. /** 标题 + 实际数值。以各子项的标题和真实数值来进行标注。 */
  2478. CAPTION_VALUE: "CAPTION_VALUE",
  2479. /** 百分数。以各子项所占的百分比来进行标注。 */
  2480. PERCENT: "PERCENT",
  2481. /** 实际数值。以各子项的真实数值来进行标注。 */
  2482. VALUE: "VALUE"
  2483. };
  2484. /**
  2485. * @enum ThemeGraphType
  2486. * @memberOf SuperMap
  2487. * @description 统计专题图类型枚举。
  2488. * @type {string}
  2489. */
  2490. var ThemeGraphType = SuperMap.ThemeGraphType = {
  2491. /** 面积图。 */
  2492. AREA: "AREA",
  2493. /** 柱状图。 */
  2494. BAR: "BAR",
  2495. /** 三维柱状图。 */
  2496. BAR3D: "BAR3D",
  2497. /** 折线图。 */
  2498. LINE: "LINE",
  2499. /** 饼图。 */
  2500. PIE: "PIE",
  2501. /** 三维饼图。 */
  2502. PIE3D: "PIE3D",
  2503. /** 点状图。 */
  2504. POINT: "POINT",
  2505. /** 环状图。 */
  2506. RING: "RING",
  2507. /** 玫瑰图。 */
  2508. ROSE: "ROSE",
  2509. /** 三维玫瑰图。 */
  2510. ROSE3D: "ROSE3D",
  2511. /** 堆叠柱状图。 */
  2512. STACK_BAR: "STACK_BAR",
  2513. /** 三维堆叠柱状图。 */
  2514. STACK_BAR3D: "STACK_BAR3D",
  2515. /** 阶梯图。 */
  2516. STEP: "STEP"
  2517. };
  2518. /**
  2519. * @enum GraphAxesTextDisplayMode
  2520. * @memberOf SuperMap
  2521. * @description 统计专题图坐标轴文本显示模式。
  2522. * @type {string}
  2523. */
  2524. var GraphAxesTextDisplayMode = SuperMap.GraphAxesTextDisplayMode = {
  2525. /** 显示全部文本。 */
  2526. ALL: "ALL",
  2527. /** 不显示。 */
  2528. NONE: "NONE",
  2529. /** 显示Y轴的文本。 */
  2530. YAXES: "YAXES"
  2531. };
  2532. /**
  2533. * @enum GraduatedMode
  2534. * @memberOf SuperMap
  2535. * @description 专题图分级模式枚举。
  2536. *
  2537. * @type {string}
  2538. */
  2539. var GraduatedMode = SuperMap.GraduatedMode = {
  2540. /** 常量分级模式。 */
  2541. CONSTANT: "CONSTANT",
  2542. /** 对数分级模式。 */
  2543. LOGARITHM: "LOGARITHM",
  2544. /** 平方根分级模式。 */
  2545. SQUAREROOT: "SQUAREROOT"
  2546. };
  2547. /**
  2548. * @enum RangeMode
  2549. * @memberOf SuperMap
  2550. * @description 范围分段专题图分段方式枚举。
  2551. * @type {string}
  2552. */
  2553. var RangeMode = SuperMap.RangeMode = {
  2554. /** 自定义分段法。 */
  2555. CUSTOMINTERVAL: "CUSTOMINTERVAL",
  2556. /** 等距离分段法。 */
  2557. EQUALINTERVAL: "EQUALINTERVAL",
  2558. /** 对数分段法。 */
  2559. LOGARITHM: "LOGARITHM",
  2560. /** 等计数分段法。 */
  2561. QUANTILE: "QUANTILE",
  2562. /** 平方根分段法。 */
  2563. SQUAREROOT: "SQUAREROOT",
  2564. /** 标准差分段法。 */
  2565. STDDEVIATION: "STDDEVIATION"
  2566. };
  2567. /**
  2568. * @enum ThemeType
  2569. * @memberOf SuperMap
  2570. * @description 专题图类型枚举。
  2571. * @type {string}
  2572. */
  2573. var ThemeType = SuperMap.ThemeType = {
  2574. /** 点密度专题图。 */
  2575. DOTDENSITY: "DOTDENSITY",
  2576. /** 等级符号专题图。 */
  2577. GRADUATEDSYMBOL: "GRADUATEDSYMBOL",
  2578. /** 统计专题图。 */
  2579. GRAPH: "GRAPH",
  2580. /** 标签专题图。 */
  2581. LABEL: "LABEL",
  2582. /** 分段专题图。 */
  2583. RANGE: "RANGE",
  2584. /** 単值专题图。 */
  2585. UNIQUE: "UNIQUE"
  2586. };
  2587. /**
  2588. * @enum ColorGradientType
  2589. * @memberOf SuperMap
  2590. * @description 渐变颜色枚举。
  2591. * @type {string}
  2592. */
  2593. var ColorGradientType = SuperMap.ColorGradientType = {
  2594. /** 黑白渐变色。 */
  2595. BLACK_WHITE: "BLACKWHITE",
  2596. /** 蓝黑渐变色。 */
  2597. BLUE_BLACK: "BLUEBLACK",
  2598. /** 蓝红渐变色。 */
  2599. BLUE_RED: "BLUERED",
  2600. /** 蓝白渐变色。 */
  2601. BLUE_WHITE: "BLUEWHITE",
  2602. /** 青黑渐变色。 */
  2603. CYAN_BLACK: "CYANBLACK",
  2604. /** 青蓝渐变色。 */
  2605. CYAN_BLUE: "CYANBLUE",
  2606. /** 青绿渐变色。 */
  2607. CYAN_GREEN: "CYANGREEN",
  2608. /** 青白渐变色。 */
  2609. CYAN_WHITE: "CYANWHITE",
  2610. /** 绿黑渐变色。 */
  2611. GREEN_BLACK: "GREENBLACK",
  2612. /** 绿蓝渐变色。 */
  2613. GREEN_BLUE: "GREENBLUE",
  2614. /** 绿橙紫渐变色。 */
  2615. GREEN_ORANGE_VIOLET: "GREENORANGEVIOLET",
  2616. /** 绿红渐变色。 */
  2617. GREEN_RED: "GREENRED",
  2618. /** 蓝红渐变色。 */
  2619. GREEN_WHITE: "GREENWHITE",
  2620. /** 粉黑渐变色。 */
  2621. PINK_BLACK: "PINKBLACK",
  2622. /** 粉蓝渐变色。 */
  2623. PINK_BLUE: "PINKBLUE",
  2624. /** 粉红渐变色。 */
  2625. PINK_RED: "PINKRED",
  2626. /** 粉白渐变色。 */
  2627. PINK_WHITE: "PINKWHITE",
  2628. /** 彩虹色。 */
  2629. RAIN_BOW: "RAINBOW",
  2630. /** 红黑渐变色。 */
  2631. RED_BLACK: "REDBLACK",
  2632. /** 红白渐变色。 */
  2633. RED_WHITE: "REDWHITE",
  2634. /** 光谱渐变。 */
  2635. SPECTRUM: "SPECTRUM",
  2636. /** 地形渐变,用于三维显示效果较好。 */
  2637. TERRAIN: "TERRAIN",
  2638. /** 黄黑渐变色。 */
  2639. YELLOW_BLACK: "YELLOWBLACK",
  2640. /** 黄蓝渐变色。 */
  2641. YELLOW_BLUE: "YELLOWBLUE",
  2642. /** 黄绿渐变色。 */
  2643. YELLOW_GREEN: "YELLOWGREEN",
  2644. /** 黄红渐变色。 */
  2645. YELLOW_RED: "YELLOWRED",
  2646. /** 黄白渐变色。 */
  2647. YELLOW_WHITE: "YELLOWWHITE"
  2648. };
  2649. /**
  2650. * @enum TextAlignment
  2651. * @memberOf SuperMap
  2652. * @description 文本对齐枚举。
  2653. * @type {string}
  2654. */
  2655. var TextAlignment = SuperMap.TextAlignment = {
  2656. /** 左上角对齐。 */
  2657. TOPLEFT: "TOPLEFT",
  2658. /** 顶部居中对齐。 */
  2659. TOPCENTER: "TOPCENTER",
  2660. /** 右上角对齐。 */
  2661. TOPRIGHT: "TOPRIGHT",
  2662. /** 基准线左对齐。 */
  2663. BASELINELEFT: "BASELINELEFT",
  2664. /** 基准线居中对齐。 */
  2665. BASELINECENTER: "BASELINECENTER",
  2666. /** 基准线右对齐。 */
  2667. BASELINERIGHT: "BASELINERIGHT",
  2668. /** 左下角对齐。 */
  2669. BOTTOMLEFT: "BOTTOMLEFT",
  2670. /** 底部居中对齐。 */
  2671. BOTTOMCENTER: "BOTTOMCENTER",
  2672. /** 右下角对齐。 */
  2673. BOTTOMRIGHT: "BOTTOMRIGHT",
  2674. /** 左中对齐。 */
  2675. MIDDLELEFT: "MIDDLELEFT",
  2676. /** 中心对齐。 */
  2677. MIDDLECENTER: "MIDDLECENTER",
  2678. /** 右中对齐。 */
  2679. MIDDLERIGHT: "MIDDLERIGHT"
  2680. };
  2681. /**
  2682. * @enum FillGradientMode
  2683. * @memberOf SuperMap
  2684. * @description 渐变填充风格的渐变类型枚举。
  2685. * @type {string}
  2686. */
  2687. var FillGradientMode = SuperMap.FillGradientMode = {
  2688. /** 无渐变。 */
  2689. NONE: "NONE",
  2690. /** 线性渐变填充。 */
  2691. LINEAR: "LINEAR",
  2692. /** 辐射渐变填充。 */
  2693. RADIAL: "RADIAL",
  2694. /** 圆锥渐变填充。 */
  2695. CONICAL: "CONICAL",
  2696. /** 四角渐变填充。 */
  2697. SQUARE: "SQUARE"
  2698. };
  2699. /**
  2700. * @enum AlongLineDirection
  2701. * @memberOf SuperMap
  2702. * @description 标签沿线标注方向枚举。
  2703. * @type {string}
  2704. */
  2705. var AlongLineDirection = SuperMap.AlongLineDirection = {
  2706. /** 沿线的法线方向放置标签。 */
  2707. NORMAL: "ALONG_LINE_NORMAL",
  2708. /** 从下到上,从左到右放置。 */
  2709. LB_TO_RT: "LEFT_BOTTOM_TO_RIGHT_TOP",
  2710. /** 从上到下,从左到右放置。 */
  2711. LT_TO_RB: "LEFT_TOP_TO_RIGHT_BOTTOM",
  2712. /** 从下到上,从右到左放置。 */
  2713. RB_TO_LT: "RIGHT_BOTTOM_TO_LEFT_TOP",
  2714. /** 从上到下,从右到左放置。 */
  2715. RT_TO_LB: "RIGHT_TOP_TO_LEFT_BOTTOM"
  2716. };
  2717. /**
  2718. * @enum LabelBackShape
  2719. * @memberOf SuperMap
  2720. * @description 标签专题图中标签背景的形状枚举。
  2721. * @type {string}
  2722. */
  2723. var LabelBackShape = SuperMap.LabelBackShape = {
  2724. /** 菱形背景,即标签背景的形状为菱形。 */
  2725. DIAMOND: "DIAMOND",
  2726. /** 椭圆形背景,即标签背景的行状为椭圆形。 */
  2727. ELLIPSE: "ELLIPSE",
  2728. /** 符号背景,即标签背景的形状为设定的符号。 */
  2729. MARKER: "MARKER",
  2730. /** 空背景,即不使用任何形状作为标签的背景。 */
  2731. NONE: "NONE",
  2732. /** 矩形背景,即标签背景的形状为矩形。 */
  2733. RECT: "RECT",
  2734. /** 圆角矩形背景,即标签背景的形状为圆角矩形。 */
  2735. ROUNDRECT: "ROUNDRECT",
  2736. /** 三角形背景,即标签背景的形状为三角形。 */
  2737. TRIANGLE: "TRIANGLE"
  2738. };
  2739. /**
  2740. * @enum LabelOverLengthMode
  2741. * @memberOf SuperMap
  2742. * @description 标签专题图中超长标签的处理模式枚举。
  2743. * @type {string}
  2744. */
  2745. var LabelOverLengthMode = SuperMap.LabelOverLengthMode = {
  2746. /** 换行显示。 */
  2747. NEWLINE: "NEWLINE",
  2748. /** 对超长标签不进行处理。 */
  2749. NONE: "NONE",
  2750. /** 省略超出部分。 */
  2751. OMIT: "OMIT"
  2752. };
  2753. /**
  2754. * @enum DirectionType
  2755. * @memberOf SuperMap
  2756. * @description 网络分析中方向枚举。
  2757. * 在行驶引导子项中使用。
  2758. * @type {string}
  2759. */
  2760. var DirectionType = SuperMap.DirectionType = {
  2761. /** 东。 */
  2762. EAST: "EAST",
  2763. /** 无方向。 */
  2764. NONE: "NONE",
  2765. /** 北。 */
  2766. NORTH: "NORTH",
  2767. /** 南。 */
  2768. SOURTH: "SOURTH",
  2769. /** 西。 */
  2770. WEST: "WEST"
  2771. };
  2772. /**
  2773. * @enum SideType
  2774. * @memberOf SuperMap
  2775. * @description 行驶位置枚举。
  2776. * 表示在行驶在路的左边、右边或者路上的枚举,该类用在行驶导引子项类中。
  2777. * @type {string}
  2778. */
  2779. var SideType = SuperMap.SideType = {
  2780. /** 路的左侧。 */
  2781. LEFT: "LEFT",
  2782. /** 在路上(即路的中间)。 */
  2783. MIDDLE: "MIDDLE",
  2784. /** 无效值。 */
  2785. NONE: "NONE",
  2786. /** 路的右侧。 */
  2787. RIGHT: "RIGHT"
  2788. };
  2789. /**
  2790. * @enum SupplyCenterType
  2791. * @memberOf SuperMap
  2792. * @description 资源供给中心类型枚举。
  2793. * 该枚举定义了网络分析中资源中心点的类型,主要用于资源分配和选址分区。
  2794. * 资源供给中心点的类型包括非中心,固定中心和可选中心。固定中心用于资源分配分析; 固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  2795. * @type {string}
  2796. */
  2797. var SupplyCenterType = SuperMap.SupplyCenterType = {
  2798. /** 固定中心点。 */
  2799. FIXEDCENTER: "FIXEDCENTER",
  2800. /** 非中心点。 */
  2801. NULL: "NULL",
  2802. /** 可选中心点。 */
  2803. OPTIONALCENTER: "OPTIONALCENTER"
  2804. };
  2805. /**
  2806. * @enum TurnType
  2807. * @memberOf SuperMap
  2808. * @description 转弯方向枚举。
  2809. * 用在行驶引导子项类中,表示转弯的方向。
  2810. * @type {string}
  2811. */
  2812. var TurnType = SuperMap.TurnType = {
  2813. /** 向前直行。 */
  2814. AHEAD: "AHEAD",
  2815. /** 掉头。 */
  2816. BACK: "BACK",
  2817. /** 终点,不拐弯。 */
  2818. END: "END",
  2819. /** 左转弯。 */
  2820. LEFT: "LEFT",
  2821. /** 无效值。 */
  2822. NONE: "NONE",
  2823. /** 右转弯。 */
  2824. RIGHT: "RIGHT"
  2825. };
  2826. /**
  2827. * @enum BufferEndType
  2828. * @memberOf SuperMap
  2829. * @description 缓冲区分析BufferEnd类型。
  2830. * @type {string}
  2831. */
  2832. var BufferEndType = SuperMap.BufferEndType = {
  2833. /** FLAT */
  2834. FLAT: "FLAT",
  2835. /** ROUND */
  2836. ROUND: "ROUND"
  2837. };
  2838. /**
  2839. * @enum OverlayOperationType
  2840. * @memberOf SuperMap
  2841. * @description 叠加分析类型枚举。
  2842. * @type {string}
  2843. */
  2844. var OverlayOperationType = SuperMap.OverlayOperationType = {
  2845. /** 操作数据集(几何对象)裁剪被操作数据集(几何对象)。 */
  2846. CLIP: "CLIP",
  2847. /** 在被操作数据集(几何对象)上擦除掉与操作数据集(几何对象)相重合的部分。 */
  2848. ERASE: "ERASE",
  2849. /**对被操作数据集(几何对象)进行同一操作,即操作执行后,被操作数据集(几何对象)包含来自操作数据集(几何对象)的几何形状。 */
  2850. IDENTITY: "IDENTITY",
  2851. /** 对两个数据集(几何对象)求交,返回两个数据集(几何对象)的交集。 */
  2852. INTERSECT: "INTERSECT",
  2853. /** 对两个面数据集(几何对象)进行合并操作。 */
  2854. UNION: "UNION",
  2855. /** 对两个面数据集(几何对象)进行更新操作。 */
  2856. UPDATE: "UPDATE",
  2857. /** 对两个面数据集(几何对象)进行对称差操作。 */
  2858. XOR: "XOR"
  2859. };
  2860. /**
  2861. * @enum OutputType
  2862. * @memberOf SuperMap
  2863. * @description 分布式分析输出类型枚举。
  2864. * @type {string}
  2865. */
  2866. var OutputType = SuperMap.OutputType = {
  2867. /** INDEXEDHDFS */
  2868. INDEXEDHDFS: "INDEXEDHDFS",
  2869. /** UDB */
  2870. UDB: "UDB",
  2871. /** MONGODB */
  2872. MONGODB: "MONGODB",
  2873. /** PG */
  2874. PG: "PG"
  2875. };
  2876. /**
  2877. * @enum SmoothMethod
  2878. * @memberOf SuperMap
  2879. * @description 光滑方法枚举。
  2880. * 用于从Grid 或DEM数据生成等值线或等值面时对等值线或者等值面的边界线进行平滑处理的方法。
  2881. * @type {string}
  2882. */
  2883. var SmoothMethod = SuperMap.SmoothMethod = {
  2884. /** B 样条法。 */
  2885. BSPLINE: "BSPLINE",
  2886. /** 磨角法。 */
  2887. POLISH: "POLISH"
  2888. };
  2889. /**
  2890. * @enum SurfaceAnalystMethod
  2891. * @memberOf SuperMap
  2892. * @description 表面分析方法枚举。
  2893. * 通过对数据进行表面分析,能够挖掘原始数据所包含的信息,使某些细节明显化,易于分析。
  2894. * @type {string}
  2895. */
  2896. var SurfaceAnalystMethod = SuperMap.SurfaceAnalystMethod = {
  2897. /** 等值线提取。 */
  2898. ISOLINE: "ISOLINE",
  2899. /** 等值面提取。 */
  2900. ISOREGION: "ISOREGION"
  2901. };
  2902. /**
  2903. * @enum DataReturnMode
  2904. * @memberOf SuperMap
  2905. * @description 数据返回模式枚举。
  2906. * 该枚举用于指定空间分析返回结果模式,包含返回数据集标识和记录集、只返回数据集标识(数据集名称@数据源名称)及只返回记录集三种模式。
  2907. * @type {string}
  2908. */
  2909. var DataReturnMode = SuperMap.DataReturnMode = {
  2910. /** 返回结果数据集标识(数据集名称@数据源名称)和记录集(RecordSet)。 */
  2911. DATASET_AND_RECORDSET: "DATASET_AND_RECORDSET",
  2912. /** 只返回数据集标识(数据集名称@数据源名称)。 */
  2913. DATASET_ONLY: "DATASET_ONLY",
  2914. /** 只返回记录集(RecordSet)。 */
  2915. RECORDSET_ONLY: "RECORDSET_ONLY"
  2916. };
  2917. /**
  2918. * @enum EditType
  2919. * @memberOf SuperMap
  2920. * @description 要素集更新模式枚举。
  2921. * 该枚举用于指定数据服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  2922. * @type {string}
  2923. */
  2924. var EditType = SuperMap.EditType = {
  2925. /** 增加操作。 */
  2926. ADD: "add",
  2927. /** 修改操作。 */
  2928. UPDATE: "update",
  2929. /** 删除操作。 */
  2930. DELETE: "delete"
  2931. };
  2932. /**
  2933. * @enum TransferTactic
  2934. * @memberOf SuperMap
  2935. * @description 公交换乘策略枚举。
  2936. * 该枚举用于指定公交服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  2937. * @type {string}
  2938. */
  2939. var TransferTactic = SuperMap.TransferTactic = {
  2940. /** 时间短。 */
  2941. LESS_TIME: "LESS_TIME",
  2942. /** 少换乘。 */
  2943. LESS_TRANSFER: "LESS_TRANSFER",
  2944. /** 少步行。 */
  2945. LESS_WALK: "LESS_WALK",
  2946. /** 距离最短。 */
  2947. MIN_DISTANCE: "MIN_DISTANCE"
  2948. };
  2949. /**
  2950. * @enum TransferPreference
  2951. * @memberOf SuperMap
  2952. * @description 公交换乘策略枚举。
  2953. * 该枚举用于指定交通换乘服务中设置地铁优先、公交优先、不乘地铁、无偏好等偏好设置。
  2954. * @type {string}
  2955. */
  2956. var TransferPreference = SuperMap.TransferPreference = {
  2957. /** 公交汽车优先。 */
  2958. BUS: "BUS",
  2959. /** 地铁优先。 */
  2960. SUBWAY: "SUBWAY",
  2961. /** 不乘坐地铁。 */
  2962. NO_SUBWAY: "NO_SUBWAY",
  2963. /** 无乘车偏好。 */
  2964. NONE: "NONE"
  2965. };
  2966. /**
  2967. * @enum GridType
  2968. * @memberOf SuperMap
  2969. * @description 地图背景格网类型枚举。
  2970. * @type {string}
  2971. */
  2972. var GridType = SuperMap.GridType = {
  2973. /** 十字叉丝。 */
  2974. CROSS: "CROSS",
  2975. /** 网格线。 */
  2976. GRID: "GRID",
  2977. /** 点。 */
  2978. POINT: "POINT"
  2979. };
  2980. /**
  2981. * @enum ColorSpaceType
  2982. * @memberOf SuperMap
  2983. * @description 色彩空间枚举。
  2984. * 由于成色原理的不同,决定了显示器、投影仪这类靠色光直接合成颜色的颜色设备和打印机、
  2985. * 印刷机这类靠使用颜料的印刷设备在生成颜色方式上的区别。
  2986. * 针对上述不同成色方式,SuperMap 提供两种色彩空间,
  2987. * 分别为 RGB 和 CMYK。RGB 主要用于显示系统中,CMYK 主要用于印刷系统中。
  2988. * @type {string}
  2989. */
  2990. var ColorSpaceType = SuperMap.ColorSpaceType = {
  2991. /** 该类型主要在印刷系统使用。 */
  2992. CMYK: "CMYK",
  2993. /** 该类型主要在显示系统中使用。 */
  2994. RGB: "RGB"
  2995. };
  2996. /**
  2997. * @enum LayerType
  2998. * @memberOf SuperMap
  2999. * @description 图层类型。
  3000. * @type {string}
  3001. */
  3002. var LayerType = SuperMap.LayerType = {
  3003. /** SuperMap UGC 类型图层。如矢量图层、栅格(Grid)图层、影像图层。 */
  3004. UGC: "UGC",
  3005. /** WMS 图层。 */
  3006. WMS: "WMS",
  3007. /** WFS 图层。 */
  3008. WFS: "WFS",
  3009. /** 自定义图层。 */
  3010. CUSTOM: "CUSTOM"
  3011. };
  3012. /**
  3013. * @enum UGCLayerType
  3014. * @memberOf SuperMap
  3015. * @description UGC图层类型。
  3016. * @type {string}
  3017. */
  3018. var UGCLayerType = SuperMap.UGCLayerType = {
  3019. /** 专题图层。 */
  3020. THEME: "THEME",
  3021. /** 矢量图层。 */
  3022. VECTOR: "VECTOR",
  3023. /** 栅格图层。。 */
  3024. GRID: "GRID",
  3025. /** 影像图层。 */
  3026. IMAGE: "IMAGE"
  3027. };
  3028. /**
  3029. * @enum StatisticMode
  3030. * @memberOf SuperMap
  3031. * @description 字段统计方法类型。
  3032. * @type {string}
  3033. */
  3034. var StatisticMode = SuperMap.StatisticMode = {
  3035. /** 统计所选字段的平均值。 */
  3036. AVERAGE: "AVERAGE",
  3037. /** 统计所选字段的最大值。 */
  3038. MAX: "MAX",
  3039. /** 统计所选字段的最小值。 */
  3040. MIN: "MIN",
  3041. /** 统计所选字段的标准差 */
  3042. STDDEVIATION: "STDDEVIATION",
  3043. /** 统计所选字段的总和。 */
  3044. SUM: "SUM",
  3045. /** 统计所选字段的方差。 */
  3046. VARIANCE: "VARIANCE"
  3047. };
  3048. /**
  3049. * @enum PixelFormat
  3050. * @memberOf SuperMap
  3051. * @description 栅格与影像数据存储的像素格式枚举。
  3052. * @type {string}
  3053. */
  3054. var PixelFormat = SuperMap.PixelFormat = {
  3055. /** 每个像元用16个比特(即2个字节)表示。 */
  3056. BIT16: "BIT16",
  3057. /** 每个像元用32个比特(即4个字节)表示。 */
  3058. BIT32: "BIT32",
  3059. /** 每个像元用64个比特(即8个字节)表示,只提供给栅格数据集使用。 */
  3060. BIT64: "BIT64",
  3061. /** 每个像元用4个字节来表示,只提供给栅格数据集使用。 */
  3062. SINGLE: "SINGLE",
  3063. /** 每个像元用8个字节来表示,只提供给栅格数据集使用。 */
  3064. DOUBLE: "DOUBLE",
  3065. /** 每个像元用1个比特表示。 */
  3066. UBIT1: "UBIT1",
  3067. /** 每个像元用4个比特来表示。 */
  3068. UBIT4: "UBIT4",
  3069. /** 每个像元用8个比特(即1个字节)来表示。 */
  3070. UBIT8: "UBIT8",
  3071. /** 每个像元用24个比特(即3个字节)来表示。 */
  3072. UBIT24: "UBIT24",
  3073. /** 每个像元用32个比特(即4个字节)来表示。 */
  3074. UBIT32: "UBIT32"
  3075. };
  3076. /**
  3077. * @enum SearchMode
  3078. * @memberOf SuperMap
  3079. * @description 内插时使用的样本点的查找方式枚举
  3080. * @type {string}
  3081. */
  3082. var SearchMode = SuperMap.SearchMode = {
  3083. /** 使用 KDTREE 的固定点数方式查找参与内插分析的点。 */
  3084. KDTREE_FIXED_COUNT: "KDTREE_FIXED_COUNT",
  3085. /** 使用 KDTREE 的定长方式查找参与内插分析的点。 */
  3086. KDTREE_FIXED_RADIUS: "KDTREE_FIXED_RADIUS",
  3087. /** 不进行查找,使用所有的输入点进行内插分析。 */
  3088. NONE: "NONE",
  3089. /** 使用 QUADTREE 方式查找参与内插分析的点,仅对样条(RBF)插值和普通克吕金(Kriging)有用。 */
  3090. QUADTREE: "QUADTREE"
  3091. };
  3092. /**
  3093. * @enum InterpolationAlgorithmType
  3094. * @memberOf SuperMap
  3095. * @description 插值分析的算法的类型
  3096. * @type {string}
  3097. */
  3098. var InterpolationAlgorithmType = SuperMap.InterpolationAlgorithmType = {
  3099. /** 普通克吕金插值法。 */
  3100. KRIGING: "KRIGING",
  3101. /** 简单克吕金插值法。 */
  3102. SimpleKriging: "SimpleKriging",
  3103. /** 泛克吕金插值法。 */
  3104. UniversalKriging: "UniversalKriging"
  3105. };
  3106. /**
  3107. * @enum VariogramMode
  3108. * @memberOf SuperMap
  3109. * @description 克吕金(Kriging)插值时的半变函数类型枚举
  3110. * @type {string}
  3111. */
  3112. var VariogramMode = SuperMap.VariogramMode = {
  3113. /** 指数函数。 */
  3114. EXPONENTIAL: "EXPONENTIAL",
  3115. /** 高斯函数。 */
  3116. GAUSSIAN: "GAUSSIAN",
  3117. /** 球型函数。 */
  3118. SPHERICAL: "SPHERICAL"
  3119. };
  3120. /**
  3121. * @enum Exponent
  3122. * @memberOf SuperMap
  3123. * @description 定义了泛克吕金(UniversalKriging)插值时样点数据中趋势面方程的阶数
  3124. * @type {string}
  3125. */
  3126. var Exponent = SuperMap.Exponent = {
  3127. /** 阶数为1。 */
  3128. EXP1: "EXP1",
  3129. /** 阶数为2。 */
  3130. EXP2: "EXP2"
  3131. };
  3132. /**
  3133. * @enum ClientType
  3134. * @memberOf SuperMap
  3135. * @description token申请的客户端标识类型
  3136. * @type {string}
  3137. */
  3138. var ClientType = SuperMap.ClientType = {
  3139. /** 指定的 IP 地址。 */
  3140. IP: "IP",
  3141. /** 指定的 URL。 */
  3142. REFERER: "Referer",
  3143. /** 发送申请令牌请求的客户端 IP。 */
  3144. REQUESTIP: "RequestIP",
  3145. /** 不做任何验证。 */
  3146. NONE: "NONE",
  3147. /** SERVER。 */
  3148. SERVER: "SERVER",
  3149. /** WEB。 */
  3150. WEB: "WEB"
  3151. };
  3152. /**
  3153. * @enum ChartType
  3154. * @memberOf SuperMap
  3155. * @description 客户端专题图图表类型
  3156. * @type {string}
  3157. */
  3158. var ChartType = SuperMap.ChartType = {
  3159. /** 柱状图。 */
  3160. BAR: "Bar",
  3161. /** 三维柱状图。 */
  3162. BAR3D: "Bar3D",
  3163. /** 圆形图。 */
  3164. CIRCLE: "Circle",
  3165. /** 饼图。 */
  3166. PIE: "Pie",
  3167. /** 散点图。 */
  3168. POINT: "Point",
  3169. /** 折线图。 */
  3170. LINE: "Line",
  3171. /** 环状图。 */
  3172. RING: "Ring"
  3173. };
  3174. /**
  3175. * @enum ClipAnalystMode
  3176. * @memberOf SuperMap
  3177. * @description 裁剪分析模式
  3178. * @type {string}
  3179. */
  3180. var ClipAnalystMode = SuperMap.ClipAnalystMode = {
  3181. /** CLIP。 */
  3182. CLIP: "clip",
  3183. /** INTERSECT。 */
  3184. INTERSECT: "intersect"
  3185. };
  3186. /**
  3187. * @enum AnalystAreaUnit
  3188. * @memberOf SuperMap
  3189. * @description 分布式分析面积单位
  3190. * @type {string}
  3191. */
  3192. var AnalystAreaUnit = SuperMap.AnalystAreaUnit = {
  3193. /** 平方米。 */
  3194. "SQUAREMETER": "SquareMeter",
  3195. /** 平方千米。 */
  3196. "SQUAREKILOMETER": "SquareKiloMeter",
  3197. /** 公顷。 */
  3198. "HECTARE": "Hectare",
  3199. /** 公亩。 */
  3200. "ARE": "Are",
  3201. /** 英亩。 */
  3202. "ACRE": "Acre",
  3203. /** 平方英尺。 */
  3204. "SQUAREFOOT": "SquareFoot",
  3205. /** 平方码。 */
  3206. "SQUAREYARD": "SquareYard",
  3207. /** 平方英里。 */
  3208. "SQUAREMILE": "SquareMile"
  3209. };
  3210. /**
  3211. * @enum AnalystSizeUnit
  3212. * @memberOf SuperMap
  3213. * @description 分布式分析单位
  3214. * @type {string}
  3215. */
  3216. var AnalystSizeUnit = SuperMap.AnalystSizeUnit = {
  3217. /** 米。 */
  3218. "METER": "Meter",
  3219. /** 千米。 */
  3220. "KILOMETER": "Kilometer",
  3221. /** 码。 */
  3222. "YARD": "Yard",
  3223. /** 英尺。 */
  3224. "FOOT": "Foot",
  3225. /** 英里。 */
  3226. "MILE": "Mile"
  3227. };
  3228. /**
  3229. * @enum StatisticAnalystMode
  3230. * @memberOf SuperMap
  3231. * @description 分布式分析统计模式
  3232. * @type {string}
  3233. */
  3234. var StatisticAnalystMode = SuperMap.StatisticAnalystMode = {
  3235. /** 统计所选字段的最大值。 */
  3236. "MAX": "max",
  3237. /** 统计所选字段的最小值。 */
  3238. "MIN": "min",
  3239. /** 统计所选字段的平均值。 */
  3240. "AVERAGE": "average",
  3241. /** 统计所选字段的总和。 */
  3242. "SUM": "sum",
  3243. /** 统计所选字段的方差。 */
  3244. "VARIANCE": "variance",
  3245. /** 统计所选字段的标准差 */
  3246. "STDDEVIATION": "stdDeviation"
  3247. };
  3248. /**
  3249. * @enum SummaryType
  3250. * @memberOf SuperMap
  3251. * @description 分布式分析聚合类型
  3252. * @type {string}
  3253. */
  3254. var SummaryType = SuperMap.SummaryType = {
  3255. /** 格网聚合。 */
  3256. "SUMMARYMESH": "SUMMARYMESH",
  3257. /** 多边形聚合。 */
  3258. "SUMMARYREGION": "SUMMARYREGION"
  3259. };
  3260. /**
  3261. * @enum TopologyValidatorRule
  3262. * @memberOf SuperMap
  3263. * @description 拓扑检查模式枚举。该类定义了拓扑检查操作模式常量。
  3264. * @type {string}
  3265. */
  3266. var TopologyValidatorRule = SuperMap.TopologyValidatorRule = {
  3267. /** 面内无重叠,用于对面数据进行拓扑检查。 */
  3268. REGIONNOOVERLAP: "REGIONNOOVERLAP",
  3269. /** 面与面无重叠,用于对面数据进行拓扑检查。 */
  3270. REGIONNOOVERLAPWITH: "REGIONNOOVERLAPWITH",
  3271. /** 面被面包含,用于对面数据进行拓扑检查。 */
  3272. REGIONCONTAINEDBYREGION: "REGIONCONTAINEDBYREGION",
  3273. /** 面被面覆盖,用于对面数据进行拓扑检查。 */
  3274. REGIONCOVEREDBYREGION: "REGIONCOVEREDBYREGION",
  3275. /** 线与线无重叠,用于对线数据进行拓扑检查。 */
  3276. LINENOOVERLAP: "LINENOOVERLAP",
  3277. /** 线内无重叠,用于对线数据进行拓扑检查。 */
  3278. LINENOOVERLAPWITH: "LINENOOVERLAPWITH",
  3279. /** 点不相同,用于对点数据进行拓扑检查。 */
  3280. POINTNOIDENTICAL: "POINTNOIDENTICAL"
  3281. };
  3282. /**
  3283. * @enum AggregationType
  3284. * @memberOf SuperMap
  3285. * @description 聚合查询枚举类,该类定义了Es数据服务中聚合查询模式常量
  3286. * @type {string}
  3287. */
  3288. var AggregationType = SuperMap.AggregationType = {
  3289. /** 格网聚合类型。 */
  3290. GEOHASH_GRID: "geohash_grid",
  3291. /** 过滤聚合类型。 */
  3292. FILTER: "filter"
  3293. };
  3294. /**
  3295. * @enum AggregationType
  3296. * @memberOf SuperMap
  3297. * @description 聚合查询中filter查询枚举类
  3298. * @type {string}
  3299. */
  3300. var AggregationQueryBuilderType = SuperMap.AggregationQueryBuilderType = {
  3301. /** 范围查询。 */
  3302. GEO_BOUNDING_BOX: "geo_bounding_box"
  3303. };
  3304. /**
  3305. * @enum GetFeatureMode
  3306. * @memberOf SuperMap
  3307. * @description feature 查询方式。
  3308. * @type {string}
  3309. */
  3310. var GetFeatureMode = SuperMap.GetFeatureMode = {
  3311. /** 通过范围查询来获取要素。 */
  3312. BOUNDS: "BOUNDS",
  3313. /** 通过几何对象的缓冲区来获取要素。 */
  3314. BUFFER: "BUFFER",
  3315. /** 通过 ID 来获取要素。 */
  3316. ID: "ID",
  3317. /** 通过空间查询模式来获取要素。 */
  3318. SPATIAL: "SPATIAL",
  3319. /** 通过 SQL 查询来获取要素。 */
  3320. SQL: 'SQL'
  3321. };
  3322. /**
  3323. * @enum RasterFunctionType
  3324. * @memberOf SuperMap
  3325. * @description 栅格分析方法。
  3326. * @type {string}
  3327. */
  3328. var RasterFunctionType = SuperMap.RasterFunctionType = {
  3329. /** 归一化植被指数。 */
  3330. NDVI: "NDVI",
  3331. /** 阴影面分析。 */
  3332. HILLSHADE: "HILLSHADE"
  3333. };
  3334. /**
  3335. * @enum ResourceType
  3336. * @memberOf SuperMap
  3337. * @description iportal资源类型。
  3338. * @version 10.0.1
  3339. * @type {string}
  3340. */
  3341. var ResourceType = SuperMap.ResourceType = {
  3342. /** 地图。 */
  3343. MAP: "MAP",
  3344. /** 服务。 */
  3345. SERVICE: "SERVICE",
  3346. /** 场景。 */
  3347. SCENE: "SCENE",
  3348. /** 数据。 */
  3349. DATA: "DATA",
  3350. /** 洞察。 */
  3351. INSIGHTS_WORKSPACE: "INSIGHTS_WORKSPACE",
  3352. /** 大屏。 */
  3353. MAP_DASHBOARD: "MAP_DASHBOARD"
  3354. };
  3355. /**
  3356. * @enum OrderBy
  3357. * @memberOf SuperMap
  3358. * @description iportal资源排序字段。
  3359. * @version 10.0.1
  3360. * @type {string}
  3361. */
  3362. var OrderBy = SuperMap.OrderBy = {
  3363. /** 按更新时间排序 */
  3364. UPDATETIME: "UPDATETIME",
  3365. /** 按热度(可能是访问量、下载量)排序 */
  3366. HEATLEVEL: "HEATLEVEL",
  3367. /** 按相关性排序 */
  3368. RELEVANCE: "RELEVANCE"
  3369. };
  3370. /**
  3371. * @enum OrderType
  3372. * @memberOf SuperMap
  3373. * @description iportal资源升序还是降序过滤
  3374. * @version 10.0.1
  3375. * @type {string}
  3376. */
  3377. var OrderType = SuperMap.OrderType = {
  3378. /** 升序 */
  3379. ASC: "ASC",
  3380. /** 降序 */
  3381. DESC: "DESC"
  3382. };
  3383. /**
  3384. * @enum SearchType
  3385. * @memberOf SuperMap
  3386. * @description iportal资源查询的范围进行过滤
  3387. * @version 10.0.1
  3388. * @type {string}
  3389. */
  3390. var SearchType = SuperMap.SearchType = {
  3391. /** 公开资源。 */
  3392. PUBLIC: "PUBLIC",
  3393. /** 我的资源。 */
  3394. MY_RES: "MY_RES",
  3395. /** 我的群组资源。 */
  3396. MYGROUP_RES: "MYGROUP_RES",
  3397. /** 我的部门资源。 */
  3398. MYDEPARTMENT_RES: "MYDEPARTMENT_RES",
  3399. /** 分享给我的资源。 */
  3400. SHARETOME_RES: "SHARETOME_RES"
  3401. };
  3402. /**
  3403. * @enum AggregationTypes
  3404. * @memberOf SuperMap
  3405. * @description iportal资源聚合查询的类型
  3406. * @version 10.0.1
  3407. * @type {string}
  3408. */
  3409. var AggregationTypes = SuperMap.AggregationTypes = {
  3410. /** 标签 */
  3411. TAG: "TAG",
  3412. /** 资源类型 */
  3413. TYPE: "TYPE"
  3414. };
  3415. /**
  3416. * @enum PermissionType
  3417. * @memberOf SuperMap
  3418. * @description iportal资源权限类型。
  3419. * @version 10.0.1
  3420. * @type {string}
  3421. */
  3422. var PermissionType = SuperMap.PermissionType = {
  3423. /** 可检索 */
  3424. SEARCH: "SEARCH",
  3425. /** 可查看 */
  3426. READ: "READ",
  3427. /** 可编辑 */
  3428. READWRITE: "READWRITE",
  3429. /** 可删除 */
  3430. DELETE: "DELETE",
  3431. /** 可下载,包括可读、可检索 */
  3432. DOWNLOAD: "DOWNLOAD"
  3433. };
  3434. /**
  3435. * @enum EntityType
  3436. * @memberOf SuperMap
  3437. * @description iportal资源实体类型。
  3438. * @version 10.0.1
  3439. * @type {string}
  3440. */
  3441. var EntityType = SuperMap.EntityType = {
  3442. /** 部门 */
  3443. DEPARTMENT: "DEPARTMENT",
  3444. /** 用户组 */
  3445. GROUP: "GROUP",
  3446. /** 群组 */
  3447. IPORTALGROUP: "IPORTALGROUP",
  3448. /** 角色 */
  3449. ROLE: "ROLE",
  3450. /** 用户 */
  3451. USER: "USER"
  3452. };
  3453. /**
  3454. * @enum DataItemType
  3455. * @memberOf SuperMap
  3456. * @description iportal数据类型。
  3457. * @version 10.0.1
  3458. * @type {string}
  3459. */
  3460. var DataItemType = SuperMap.DataItemType = {
  3461. /** 工作空间 sxwu, smwu, sxw, smw */
  3462. WORKSPACE: "WORKSPACE",
  3463. /** udb 数据源 */
  3464. UDB: "UDB",
  3465. /** shp空间数据 */
  3466. SHP: "SHP",
  3467. /** excel数据 */
  3468. EXCEL: "EXCEL",
  3469. /** csv数据 */
  3470. CSV: "CSV",
  3471. /** geojson数据。 */
  3472. GEOJSON: "GEOJSON",
  3473. /** smtiles */
  3474. SMTILES: "SMTILES",
  3475. /** svtiles */
  3476. SVTILES: "SVTILES",
  3477. /** mbtiles */
  3478. MBTILES: "MBTILES",
  3479. /** tpk */
  3480. TPK: "TPK",
  3481. /** ugc v5 */
  3482. UGCV5: "UGCV5",
  3483. /** UGCV5_MVT */
  3484. UGCV5_MVT: "UGCV5_MVT",
  3485. /** json数据 */
  3486. JSON: "JSON"
  3487. };
  3488. /**
  3489. * @enum WebExportFormatType
  3490. * @memberOf SuperMap
  3491. * @description Web 打印输出的格式。
  3492. * @version 10.0.1
  3493. * @type {string}
  3494. */
  3495. var WebExportFormatType = SuperMap.WebExportFormatType = {
  3496. /** png */
  3497. PNG: "PNG",
  3498. /** pdf */
  3499. PDF: "PDF"
  3500. };
  3501. /**
  3502. * @enum WebScaleOrientationType
  3503. * @memberOf SuperMap
  3504. * @description Web 比例尺的方位样式。
  3505. * @version 10.0.1
  3506. * @type {string}
  3507. */
  3508. var WebScaleOrientationType = SuperMap.WebScaleOrientationType = {
  3509. /** horizontal labels below */
  3510. HORIZONTALLABELSBELOW: "HORIZONTALLABELSBELOW",
  3511. /** horizontal labels above */
  3512. HORIZONTALLABELSABOVE: "HORIZONTALLABELSABOVE",
  3513. /** vertical labels left */
  3514. VERTICALLABELSLEFT: "VERTICALLABELSLEFT",
  3515. /** vertical labels right */
  3516. VERTICALLABELSRIGHT: "VERTICALLABELSRIGHT"
  3517. };
  3518. /**
  3519. * @enum WebScaleType
  3520. * @memberOf SuperMap
  3521. * @description Web 比例尺的样式。
  3522. * @version 10.0.1
  3523. * @type {string}
  3524. */
  3525. var WebScaleType = SuperMap.WebScaleType = {
  3526. /** line */
  3527. LINE: "LINE",
  3528. /** bar */
  3529. BAR: "BAR",
  3530. /** bar sub */
  3531. BAR_SUB: "BAR_SUB"
  3532. };
  3533. /**
  3534. * @enum WebScaleUnit
  3535. * @memberOf SuperMap
  3536. * @description Web 比例尺的单位制。
  3537. * @version 10.0.1
  3538. * @type {string}
  3539. */
  3540. var WebScaleUnit = SuperMap.WebScaleUnit = {
  3541. /** meter */
  3542. METER: "METER",
  3543. /** foot */
  3544. FOOT: "FOOT",
  3545. /** degrees */
  3546. DEGREES: "DEGREES"
  3547. };
  3548. // CONCATENATED MODULE: ./src/common/commontypes/Size.js
  3549. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3550. 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); } }
  3551. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3552. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  3553. * This program are made available under the terms of the Apache License, Version 2.0
  3554. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  3555. /**
  3556. * @class SuperMap.Size
  3557. * @category BaseTypes Style
  3558. * @classdesc 此类描绘一对高宽值的实例。
  3559. * @param {number} [w=0.0] - 宽度。
  3560. * @param {number} [h=0.0] - 高度。
  3561. *
  3562. * @example
  3563. * var size = new SuperMap.Size(31,46);
  3564. */
  3565. var Size = /*#__PURE__*/function () {
  3566. function Size(w, h) {
  3567. _classCallCheck(this, Size);
  3568. /**
  3569. * @member {number} [SuperMap.Size.prototype.w=0.0]
  3570. * @description 宽度。
  3571. */
  3572. this.w = w ? parseFloat(w) : 0.0;
  3573. /**
  3574. * @member {number} [SuperMap.Size.prototype.h=0.0]
  3575. * @description 高度。
  3576. */
  3577. this.h = w ? parseFloat(h) : 0.0;
  3578. this.CLASS_NAME = "SuperMap.Size";
  3579. }
  3580. /**
  3581. * @function SuperMap.Size.prototype.toString
  3582. * @description 返回此对象的字符串形式。
  3583. * @example
  3584. * var size = new SuperMap.Size(10,5);
  3585. * var str = size.toString();
  3586. * @returns {string} 例如:"w=10,h=5"。
  3587. */
  3588. _createClass(Size, [{
  3589. key: "toString",
  3590. value: function toString() {
  3591. return "w=" + this.w + ",h=" + this.h;
  3592. }
  3593. /**
  3594. * @function SuperMap.Size.prototype.clone
  3595. * @description 克隆当前size对象。
  3596. * @example
  3597. * var size = new SuperMap.Size(31,46);
  3598. * var size2 = size.clone();
  3599. * @returns {SuperMap.Size} 返回一个新的与当前 size 对象有相同宽、高的 Size 对象。
  3600. */
  3601. }, {
  3602. key: "clone",
  3603. value: function clone() {
  3604. return new Size(this.w, this.h);
  3605. }
  3606. /**
  3607. *
  3608. * @function SuperMap.Size.prototype.equals
  3609. * @description 比较两个 size 对象是否相等。
  3610. * @example
  3611. * var size = new SuperMap.Size(31,46);
  3612. * var size2 = new SuperMap.Size(31,46);
  3613. * var isEquals = size.equals(size2);
  3614. *
  3615. * @param {SuperMap.Size} sz - 用于比较相等的 Size 对象。
  3616. * @returns {boolean} 传入的 size 和当前 size 高宽相等,注意:如果传入的 size 为空则返回 false。
  3617. *
  3618. */
  3619. }, {
  3620. key: "equals",
  3621. value: function equals(sz) {
  3622. var equals = false;
  3623. if (sz != null) {
  3624. equals = this.w === sz.w && this.h === sz.h || isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h);
  3625. }
  3626. return equals;
  3627. }
  3628. /**
  3629. *
  3630. * @function SuperMap.Size.prototype.destroy
  3631. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  3632. * @example
  3633. * var size = new SuperMap.Size(31,46);
  3634. * size.destroy();
  3635. */
  3636. }, {
  3637. key: "destroy",
  3638. value: function destroy() {
  3639. this.w = null;
  3640. this.h = null;
  3641. }
  3642. }]);
  3643. return Size;
  3644. }();
  3645. SuperMap.Size = Size;
  3646. // CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
  3647. function Pixel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3648. 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); } }
  3649. function Pixel_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pixel_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pixel_defineProperties(Constructor, staticProps); return Constructor; }
  3650. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  3651. * This program are made available under the terms of the Apache License, Version 2.0
  3652. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  3653. /**
  3654. * @class SuperMap.Pixel
  3655. * @category BaseTypes Geometry
  3656. * @classdesc 此类用 x,y 坐标描绘屏幕坐标(像素点)。
  3657. * @param {number} [x=0.0] - x 坐标。
  3658. * @param {number} [y=0.0] - y 坐标。
  3659. * @param {SuperMap.Pixel.Mode} [mode=SuperMap.Pixel.Mode.LeftTop] - 坐标模式。
  3660. *
  3661. * @example
  3662. * //单独创建一个对象
  3663. * var pixcel = new SuperMap.Pixel(100,50);
  3664. *
  3665. * //依据 size 创建
  3666. * var size = new SuperMap.Size(21,25);
  3667. * var offset = new SuperMap.Pixel(-(size.w/2), -size.h);
  3668. */
  3669. var Pixel_Pixel = /*#__PURE__*/function () {
  3670. function Pixel(x, y, mode) {
  3671. Pixel_classCallCheck(this, Pixel);
  3672. /**
  3673. * @member {number} [SuperMap.Pixel.prototype.x=0.0]
  3674. * @description x 坐标。
  3675. */
  3676. this.x = x ? parseFloat(x) : 0.0;
  3677. /**
  3678. * @member {number} [SuperMap.Pixel.prototype.y=0.0]
  3679. * @description y 坐标。
  3680. */
  3681. this.y = y ? parseFloat(y) : 0.0;
  3682. /**
  3683. * @member {SuperMap.Pixel.Mode} [SuperMap.Pixel.prototype.mode=SuperMap.Pixel.Mode.LeftTop]
  3684. * @description 坐标模式,有左上、右上、右下、左下这几种模式,分别表示相对于左上角、右上角、右下角、左下角的坐标。
  3685. */
  3686. this.mode = mode;
  3687. this.CLASS_NAME = "SuperMap.Pixel";
  3688. /**
  3689. * @enum SuperMap.Pixel.Mode
  3690. * @readonly
  3691. * @description 模式。
  3692. * @type {string}
  3693. */
  3694. SuperMap.Pixel.Mode = {
  3695. /** 左上模式。*/
  3696. LeftTop: "lefttop",
  3697. /** 右上模式。 */
  3698. RightTop: "righttop",
  3699. /** 右下模式。 */
  3700. RightBottom: "rightbottom",
  3701. /** 左下模式。 */
  3702. LeftBottom: "leftbottom"
  3703. };
  3704. }
  3705. /**
  3706. * @function SuperMap.Pixel.prototype.toString
  3707. * @description 返回此对象的字符串形式。
  3708. * @example
  3709. *
  3710. * var pixcel = new SuperMap.Pixel(100,50);
  3711. * var str = pixcel.toString();
  3712. *
  3713. * @returns {string} 例如: "x=200.4,y=242.2"
  3714. */
  3715. Pixel_createClass(Pixel, [{
  3716. key: "toString",
  3717. value: function toString() {
  3718. return "x=" + this.x + ",y=" + this.y;
  3719. }
  3720. /**
  3721. * @function SuperMap.Pixel.prototype.clone
  3722. * @description 克隆当前的 pixel 对象。
  3723. * @example
  3724. * var pixcel = new SuperMap.Pixel(100,50);
  3725. * var pixcel2 = pixcel.clone();
  3726. * @returns {SuperMap.Pixel} 返回一个新的与当前 pixel 对象有相同 x、y 坐标的 pixel 对象。
  3727. */
  3728. }, {
  3729. key: "clone",
  3730. value: function clone() {
  3731. return new Pixel(this.x, this.y, this.mode);
  3732. }
  3733. /**
  3734. * @function SuperMap.Pixel.prototype.equals
  3735. * @description 比较两 pixel 是否相等。
  3736. * @example
  3737. * var pixcel = new SuperMap.Pixel(100,50);
  3738. * var pixcel2 = new SuperMap.Pixel(100,50);
  3739. * var isEquals = pixcel.equals(pixcel2);
  3740. *
  3741. * @param {SuperMap.Pixel} px - 用于比较相等的 pixel 对象。
  3742. * @returns {boolean} 如果传入的像素点和当前像素点相同返回 true,如果不同或传入参数为 NULL 则返回 false。
  3743. */
  3744. }, {
  3745. key: "equals",
  3746. value: function equals(px) {
  3747. var equals = false;
  3748. if (px != null) {
  3749. equals = this.x == px.x && this.y == px.y || isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y);
  3750. }
  3751. return equals;
  3752. }
  3753. /**
  3754. * @function SuperMap.Pixel.prototype.distanceTo
  3755. * @description 返回两个 pixel 的距离。
  3756. * @example
  3757. * var pixcel = new SuperMap.Pixel(100,50);
  3758. * var pixcel2 = new SuperMap.Pixel(110,30);
  3759. * var distance = pixcel.distanceTo(pixcel2);
  3760. *
  3761. * @param {SuperMap.Pixel} px - 用于计算的一个 pixel。
  3762. * @returns {float} 作为参数传入的像素与当前像素点的距离。
  3763. */
  3764. }, {
  3765. key: "distanceTo",
  3766. value: function distanceTo(px) {
  3767. return Math.sqrt(Math.pow(this.x - px.x, 2) + Math.pow(this.y - px.y, 2));
  3768. }
  3769. /**
  3770. * @function SuperMap.Pixel.prototype.add
  3771. * @description 在原来像素坐标基础上,x 值加上传入的 x 参数,y 值加上传入的 y 参数。
  3772. * @example
  3773. * var pixcel = new SuperMap.Pixel(100,50);
  3774. * //pixcel2是新的对象
  3775. * var pixcel2 = pixcel.add(20,30);
  3776. *
  3777. * @param {number} x - 传入的 x 值。
  3778. * @param {number} y - 传入的 y 值。
  3779. * @returns {SuperMap.Pixel} 返回一个新的 pixel 对象,该 pixel 是由当前的 pixel 与传入的 x,y 相加得到。
  3780. */
  3781. }, {
  3782. key: "add",
  3783. value: function add(x, y) {
  3784. if (x == null || y == null) {
  3785. throw new TypeError('Pixel.add cannot receive null values');
  3786. }
  3787. return new Pixel(this.x + x, this.y + y);
  3788. }
  3789. /**
  3790. * @function SuperMap.Pixel.prototype.offset
  3791. * @description 通过传入的 {@link SuperMap.Pixel} 参数对原屏幕坐标进行偏移。
  3792. * @example
  3793. * var pixcel = new SuperMap.Pixel(100,50);
  3794. * var pixcel2 = new SuperMap.Pixel(130,20);
  3795. * //pixcel3 是新的对象
  3796. * var pixcel3 = pixcel.offset(pixcel2);
  3797. *
  3798. * @param {SuperMap.Pixel} px - 传入的 <SuperMap.Pixel> 对象。
  3799. * @returns {SuperMap.Pixel} 返回一个新的 pixel,该 pixel 是由当前的 pixel 对象的 x,y 值与传入的 Pixel 对象的 x,y 值相加得到。
  3800. */
  3801. }, {
  3802. key: "offset",
  3803. value: function offset(px) {
  3804. var newPx = this.clone();
  3805. if (px) {
  3806. newPx = this.add(px.x, px.y);
  3807. }
  3808. return newPx;
  3809. }
  3810. /**
  3811. *
  3812. * @function SuperMap.Pixel.prototype.destroy
  3813. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  3814. * @example
  3815. * var pixcel = new SuperMap.Pixel(100,50);
  3816. * pixcel.destroy();
  3817. */
  3818. }, {
  3819. key: "destroy",
  3820. value: function destroy() {
  3821. this.x = null;
  3822. this.y = null;
  3823. this.mode = null;
  3824. }
  3825. }]);
  3826. return Pixel;
  3827. }();
  3828. SuperMap.Pixel = Pixel_Pixel;
  3829. // CONCATENATED MODULE: ./src/common/commontypes/BaseTypes.js
  3830. function BaseTypes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3831. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  3832. * This program are made available under the terms of the Apache License, Version 2.0
  3833. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  3834. /**
  3835. *@namespace SuperMap
  3836. *@category BaseTypes Namespace
  3837. */
  3838. /**
  3839. * @function SuperMap.inherit
  3840. * @description 除了 C 和 P 两个必要参数外,可以传递任意数量的对象,这些对象都将继承C。
  3841. * @memberOf SuperMap
  3842. * @param {Object} C - 继承的类。
  3843. * @param {Object} P - 被继承的父类。
  3844. */
  3845. SuperMap.inherit = function (C, P) {
  3846. var F = function F() {};
  3847. F.prototype = P.prototype;
  3848. C.prototype = new F();
  3849. var i, l, o;
  3850. for (i = 2, l = arguments.length; i < l; i++) {
  3851. o = arguments[i];
  3852. if (typeof o === "function") {
  3853. o = o.prototype;
  3854. }
  3855. SuperMap.Util.extend(C.prototype, o);
  3856. }
  3857. };
  3858. /**
  3859. * @function SuperMap.mixin
  3860. * @description 实现多重继承。
  3861. * @memberOf SuperMap
  3862. * @param {Class|Object} ...mixins - 继承的类。
  3863. */
  3864. SuperMap.mixin = function () {
  3865. for (var _len = arguments.length, mixins = new Array(_len), _key = 0; _key < _len; _key++) {
  3866. mixins[_key] = arguments[_key];
  3867. }
  3868. var Mix = function Mix(options) {
  3869. BaseTypes_classCallCheck(this, Mix);
  3870. for (var index = 0; index < mixins.length; index++) {
  3871. copyProperties(this, new mixins[index](options));
  3872. }
  3873. };
  3874. for (var index = 0; index < mixins.length; index++) {
  3875. var mixin = mixins[index];
  3876. copyProperties(Mix, mixin);
  3877. copyProperties(Mix.prototype, mixin.prototype);
  3878. copyProperties(Mix.prototype, new mixin());
  3879. }
  3880. return Mix;
  3881. function copyProperties(target, source) {
  3882. var ownKeys = Object.getOwnPropertyNames(source);
  3883. if (Object.getOwnPropertySymbols) {
  3884. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source));
  3885. }
  3886. for (var index = 0; index < ownKeys.length; index++) {
  3887. var key = ownKeys[index];
  3888. if (key !== "constructor" && key !== "prototype" && key !== "name" && key !== "length") {
  3889. var desc = Object.getOwnPropertyDescriptor(source, key);
  3890. if (window["ActiveXObject"]) {
  3891. Object.defineProperty(target, key, desc || {});
  3892. } else {
  3893. Object.defineProperty(target, key, desc);
  3894. }
  3895. }
  3896. }
  3897. }
  3898. };
  3899. /**
  3900. * @name String
  3901. * @namespace
  3902. * @memberOf SuperMap
  3903. * @category BaseTypes Util
  3904. * @description 字符串操作的一系列常用扩展函数。
  3905. */
  3906. var StringExt = SuperMap.String = {
  3907. /**
  3908. * @function SuperMap.String.startsWith
  3909. * @description 判断目标字符串是否以指定的子字符串开头。
  3910. * @param {string} str - 目标字符串。
  3911. * @param {string} sub - 查找的子字符串。
  3912. * @returns {boolean} 目标字符串以指定的子字符串开头,则返回 true;否则返回 false。
  3913. */
  3914. startsWith: function startsWith(str, sub) {
  3915. return str.indexOf(sub) == 0;
  3916. },
  3917. /**
  3918. * @function SuperMap.String.contains
  3919. * @description 判断目标字符串是否包含指定的子字符串。
  3920. * @param {string} str - 目标字符串。
  3921. * @param {string} sub - 查找的子字符串。
  3922. * @returns {boolean} 目标字符串中包含指定的子字符串,则返回 true;否则返回 false。
  3923. */
  3924. contains: function contains(str, sub) {
  3925. return str.indexOf(sub) != -1;
  3926. },
  3927. /**
  3928. * @function SuperMap.String.trim
  3929. * @description 删除一个字符串的开头和结尾处的所有空白字符。
  3930. * @param {string} str - (可能)存在空白字符填塞的字符串。
  3931. * @returns {string} 删除开头和结尾处空白字符后的字符串。
  3932. */
  3933. trim: function trim(str) {
  3934. return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  3935. },
  3936. /**
  3937. * @function SuperMap.String.camelize
  3938. * @description 骆驼式("-")连字符的字符串处理。
  3939. * 例如:"chicken-head" becomes "chickenHead",
  3940. * "-chicken-head" becomes "ChickenHead"。
  3941. * @param {string} str - 要处理的字符串,原始内容不应被修改。
  3942. * @returns {string}
  3943. */
  3944. camelize: function camelize(str) {
  3945. var oStringList = str.split('-');
  3946. var camelizedString = oStringList[0];
  3947. for (var i = 1, len = oStringList.length; i < len; i++) {
  3948. var s = oStringList[i];
  3949. camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
  3950. }
  3951. return camelizedString;
  3952. },
  3953. /**
  3954. * @function SuperMap.String.format
  3955. * @description 提供带 ${token} 标记的字符串, 返回 context 对象属性中指定标记的属性值。
  3956. * @example
  3957. * 示例:
  3958. * (code)
  3959. * 1、template = "${value,getValue}";
  3960. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  3961. * args = [2,23,12,36,21];
  3962. * 返回值:36
  3963. * (end)
  3964. * 示例:
  3965. * (code)
  3966. * 2、template = "$${{value,getValue}}";
  3967. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  3968. * args = [2,23,12,36,21];
  3969. * 返回值:"${36}"
  3970. * (end)
  3971. * 示例:
  3972. * (code)
  3973. * 3、template = "${a,b}";
  3974. * context = {a: {b:"format"}};
  3975. * args = null;
  3976. * 返回值:"format"
  3977. * (end)
  3978. * 示例:
  3979. * (code)
  3980. * 3、template = "${a,b}";
  3981. * context = null;
  3982. * args = null;
  3983. * 返回值:"${a.b}"
  3984. * (end)
  3985. * @param {string} template - 带标记的字符串将要被替换。参数 template 格式为"${token}",此处的 token 标记会替换为 context["token"] 属性的值。
  3986. * @param {Object} [context=window] - 带有属性的可选对象的属性用于匹配格式化字符串中的标记。如果该参数为空,将使用 window 对象。
  3987. * @param {Array} [args] - 可选参数传递给在 context 对象上找到的函数。
  3988. * @returns {string} 从 context 对象属性中替换字符串标记位的字符串。
  3989. */
  3990. format: function format(template, context, args) {
  3991. if (!context) {
  3992. context = window;
  3993. } // Example matching:
  3994. // str = ${foo.bar}
  3995. // match = foo.bar
  3996. var replacer = function replacer(str, match) {
  3997. var replacement; // Loop through all subs. Example: ${a.b.c}
  3998. // 0 -> replacement = context[a];
  3999. // 1 -> replacement = context[a][b];
  4000. // 2 -> replacement = context[a][b][c];
  4001. var subs = match.split(/\.+/);
  4002. for (var i = 0; i < subs.length; i++) {
  4003. if (i == 0) {
  4004. replacement = context;
  4005. }
  4006. replacement = replacement[subs[i]];
  4007. }
  4008. if (typeof replacement === "function") {
  4009. replacement = args ? replacement.apply(null, args) : replacement();
  4010. } // If replacement is undefined, return the string 'undefined'.
  4011. // This is a workaround for a bugs in browsers not properly
  4012. // dealing with non-participating groups in regular expressions:
  4013. // http://blog.stevenlevithan.com/archives/npcg-javascript
  4014. if (typeof replacement == 'undefined') {
  4015. return 'undefined';
  4016. } else {
  4017. return replacement;
  4018. }
  4019. };
  4020. return template.replace(SuperMap.String.tokenRegEx, replacer);
  4021. },
  4022. /**
  4023. * @member {RegExp} [SuperMap.String.tokenRegEx]
  4024. * @description 寻找带 token 的字符串,默认为 tokenRegEx=/\$\{([\w.]+?)\}/g。
  4025. * @example
  4026. * Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
  4027. */
  4028. tokenRegEx: /\$\{([\w.]+?)\}/g,
  4029. /**
  4030. * @member {RegExp} [SuperMap.String.numberRegEx]
  4031. * @description 判断一个字符串是否只包含一个数值,默认为 numberRegEx=/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/。
  4032. */
  4033. numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
  4034. /**
  4035. * @function SuperMap.String.isNumeric
  4036. * @description 判断一个字符串是否只包含一个数值。
  4037. * @example
  4038. * (code)
  4039. * SuperMap.String.isNumeric("6.02e23") // true
  4040. * SuperMap.String.isNumeric("12 dozen") // false
  4041. * SuperMap.String.isNumeric("4") // true
  4042. * SuperMap.String.isNumeric(" 4 ") // false
  4043. * (end)
  4044. * @returns {boolean} 字符串包含唯一的数值,返回 true;否则返回 false。
  4045. */
  4046. isNumeric: function isNumeric(value) {
  4047. return SuperMap.String.numberRegEx.test(value);
  4048. },
  4049. /**
  4050. * @function SuperMap.String.numericIf
  4051. * @description 把一个看似数值型的字符串转化为一个数值。
  4052. * @returns {(number|string)} 如果能转换为数值则返回数值,否则返回字符串本身。
  4053. */
  4054. numericIf: function numericIf(value) {
  4055. return SuperMap.String.isNumeric(value) ? parseFloat(value) : value;
  4056. }
  4057. };
  4058. /**
  4059. * @name Number
  4060. * @memberOf SuperMap
  4061. * @namespace
  4062. * @category BaseTypes Util
  4063. * @description 数值操作的一系列常用扩展函数。
  4064. */
  4065. var NumberExt = SuperMap.Number = {
  4066. /**
  4067. * @member {string} [SuperMap.Number.decimalSeparator='.']
  4068. * @description 格式化数字时默认的小数点分隔符。
  4069. * @constant
  4070. */
  4071. decimalSeparator: ".",
  4072. /**
  4073. * @member {string} [SuperMap.Number.thousandsSeparator=',']
  4074. * @description 格式化数字时默认的千位分隔符。
  4075. * @constant
  4076. */
  4077. thousandsSeparator: ",",
  4078. /**
  4079. * @function SuperMap.Number.limitSigDigs
  4080. * @description 限制浮点数的有效数字位数。
  4081. * @param {number} num - 浮点数。
  4082. * @param {integer} sig - 有效位数。
  4083. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  4084. */
  4085. limitSigDigs: function limitSigDigs(num, sig) {
  4086. var fig = 0;
  4087. if (sig > 0) {
  4088. fig = parseFloat(num.toPrecision(sig));
  4089. }
  4090. return fig;
  4091. },
  4092. /**
  4093. * @function SuperMap.Number.format
  4094. * @description 数字格式化输出。
  4095. * @param {number} num - 数字。
  4096. * @param {integer} [dec=0] - 数字的小数部分四舍五入到指定的位数。设置为 null 值时小数部分不变。
  4097. * @param {string} [tsep=','] - 千位分隔符。
  4098. * @param {string} [dsep='.'] - 小数点分隔符。
  4099. * @returns {string} 数字格式化后的字符串。
  4100. */
  4101. format: function format(num, dec, tsep, dsep) {
  4102. dec = typeof dec != "undefined" ? dec : 0;
  4103. tsep = typeof tsep != "undefined" ? tsep : SuperMap.Number.thousandsSeparator;
  4104. dsep = typeof dsep != "undefined" ? dsep : SuperMap.Number.decimalSeparator;
  4105. if (dec != null) {
  4106. num = parseFloat(num.toFixed(dec));
  4107. }
  4108. var parts = num.toString().split(".");
  4109. if (parts.length === 1 && dec == null) {
  4110. // integer where we do not want to touch the decimals
  4111. dec = 0;
  4112. }
  4113. var integer = parts[0];
  4114. if (tsep) {
  4115. var thousands = /(-?[0-9]+)([0-9]{3})/;
  4116. while (thousands.test(integer)) {
  4117. integer = integer.replace(thousands, "$1" + tsep + "$2");
  4118. }
  4119. }
  4120. var str;
  4121. if (dec == 0) {
  4122. str = integer;
  4123. } else {
  4124. var rem = parts.length > 1 ? parts[1] : "0";
  4125. if (dec != null) {
  4126. rem = rem + new Array(dec - rem.length + 1).join("0");
  4127. }
  4128. str = integer + dsep + rem;
  4129. }
  4130. return str;
  4131. }
  4132. };
  4133. if (!Number.prototype.limitSigDigs) {
  4134. /**
  4135. * APIMethod: Number.limitSigDigs
  4136. * 限制浮点数的有效数字位数.
  4137. * @param {integer} sig -有效位数。
  4138. * @returns {integer} 将数字四舍五入到指定数量的有效位数。
  4139. * 如果传入值 为 null、0、或者是负数, 返回值 0。
  4140. */
  4141. Number.prototype.limitSigDigs = function (sig) {
  4142. return NumberExt.limitSigDigs(this, sig);
  4143. };
  4144. }
  4145. /**
  4146. * @name Function
  4147. * @memberOf SuperMap
  4148. * @namespace
  4149. * @category BaseTypes Util
  4150. * @description 函数操作的一系列常用扩展函数。
  4151. */
  4152. var FunctionExt = SuperMap.Function = {
  4153. /**
  4154. * @function SuperMap.Function.bind
  4155. * @description 绑定函数到对象。方便创建 this 的作用域。
  4156. * @param {function} func - 输入函数。
  4157. * @param {Object} object - 对象绑定到输入函数(作为输入函数的 this 对象)。
  4158. * @returns {function} object 参数作为 func 函数的 this 对象。
  4159. */
  4160. bind: function bind(func, object) {
  4161. // create a reference to all arguments past the second one
  4162. var args = Array.prototype.slice.apply(arguments, [2]);
  4163. return function () {
  4164. // Push on any additional arguments from the actual function call.
  4165. // These will come after those sent to the bind call.
  4166. var newArgs = args.concat(Array.prototype.slice.apply(arguments, [0]));
  4167. return func.apply(object, newArgs);
  4168. };
  4169. },
  4170. /**
  4171. * @function SuperMap.Function.bindAsEventListener
  4172. * @description 绑定函数到对象,在调用该函数时配置并使用事件对象作为第一个参数。
  4173. * @param {function} func - 用于监听事件的函数。
  4174. * @param {Object} object - this 对象的引用。
  4175. * @returns {function}
  4176. */
  4177. bindAsEventListener: function bindAsEventListener(func, object) {
  4178. return function (event) {
  4179. return func.call(object, event || window.event);
  4180. };
  4181. },
  4182. /**
  4183. * @function SuperMap.Function.False
  4184. * @description 该函数仅仅返回 false。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  4185. * @example
  4186. * document.onclick = SuperMap.Function.False;
  4187. * @returns {boolean}
  4188. */
  4189. False: function False() {
  4190. return false;
  4191. },
  4192. /**
  4193. * @function SuperMap.Function.True
  4194. * @description 该函数仅仅返回 true。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  4195. * @example
  4196. * document.onclick = SuperMap.Function.True;
  4197. * @returns {boolean}
  4198. */
  4199. True: function True() {
  4200. return true;
  4201. },
  4202. /**
  4203. * @function SuperMap.Function.Void
  4204. * @description 可重用函数,仅仅返回 "undefined"。
  4205. * @returns {undefined}
  4206. */
  4207. Void: function Void() {}
  4208. };
  4209. /**
  4210. * @name Array
  4211. * @memberOf SuperMap
  4212. * @namespace
  4213. * @category BaseTypes Util
  4214. * @description 数组操作的一系列常用扩展函数。
  4215. */
  4216. var ArrayExt = SuperMap.Array = {
  4217. /**
  4218. * @function SuperMap.Array.filter
  4219. * @description 过滤数组,提供了 ECMA-262 标准中 Array.prototype.filter 函数的扩展。详见:{@link http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter}
  4220. * @param {Array} array - 要过滤的数组。
  4221. * @param {function} callback - 数组中的每一个元素调用该函数。</br>
  4222. * 如果函数的返回值为 true,该元素将包含在返回的数组中。该函数有三个参数: 数组中的元素,元素的索引,数组自身。</br>
  4223. * 如果设置了可选参数 caller,在调用 callback 时,使用可选参数 caller 设置为 callback 的参数。</br>
  4224. * @param {Object} [caller] - 在调用 callback 时,使用参数 caller 设置为 callback 的参数。
  4225. * @returns {Array} callback 函数返回 true 时的元素将作为返回数组中的元素。
  4226. */
  4227. filter: function filter(array, callback, caller) {
  4228. var selected = [];
  4229. if (Array.prototype.filter) {
  4230. selected = array.filter(callback, caller);
  4231. } else {
  4232. var len = array.length;
  4233. if (typeof callback != "function") {
  4234. throw new TypeError();
  4235. }
  4236. for (var i = 0; i < len; i++) {
  4237. if (i in array) {
  4238. var val = array[i];
  4239. if (callback.call(caller, val, i, array)) {
  4240. selected.push(val);
  4241. }
  4242. }
  4243. }
  4244. }
  4245. return selected;
  4246. }
  4247. };
  4248. // CONCATENATED MODULE: ./src/common/commontypes/Util.js
  4249. 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); }
  4250. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  4251. * This program are made available under the terms of the Apache License, Version 2.0
  4252. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  4253. var Util_Util = SuperMap.Util = SuperMap.Util || {};
  4254. /**
  4255. * @name Util
  4256. * @memberOf SuperMap
  4257. * @namespace
  4258. * @category BaseTypes Util
  4259. * @description common 工具类。
  4260. */
  4261. /**
  4262. * @description 复制源对象的所有属性到目标对象上,源对象上的没有定义的属性在目标对象上也不会被设置。
  4263. * @example
  4264. * 要复制 SuperMap.Size 对象的所有属性到自定义对象上,使用方法如下:
  4265. * var size = new SuperMap.Size(100, 100);
  4266. * var obj = {};
  4267. * SuperMap.Util.extend(obj, size);
  4268. * @param {Object} [destination] - 目标对象。
  4269. * @param {Object} source - 源对象,其属性将被设置到目标对象上。
  4270. * @returns {Object} 目标对象。
  4271. */
  4272. SuperMap.Util.extend = function (destination, source) {
  4273. destination = destination || {};
  4274. if (source) {
  4275. for (var property in source) {
  4276. var value = source[property];
  4277. if (value !== undefined) {
  4278. destination[property] = value;
  4279. }
  4280. }
  4281. /**
  4282. * IE doesn't include the toString property when iterating over an object's
  4283. * properties with the for(property in object) syntax. Explicitly check if
  4284. * the source has its own toString property.
  4285. */
  4286. /*
  4287. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  4288. * prototype object" when calling hawOwnProperty if the source object
  4289. * is an instance of window.Event.
  4290. */
  4291. var sourceIsEvt = typeof window.Event === "function" && source instanceof window.Event;
  4292. if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty("toString")) {
  4293. destination.toString = source.toString;
  4294. }
  4295. }
  4296. return destination;
  4297. };
  4298. /**
  4299. * @description 对象拷贝。
  4300. * @param {Object} [des] - 目标对象。
  4301. * @param {Object} soc - 源对象。
  4302. */
  4303. SuperMap.Util.copy = function (des, soc) {
  4304. des = des || {};
  4305. var v;
  4306. if (soc) {
  4307. for (var p in des) {
  4308. v = soc[p];
  4309. if (typeof v !== 'undefined') {
  4310. des[p] = v;
  4311. }
  4312. }
  4313. }
  4314. };
  4315. /**
  4316. * @description 销毁对象,将其属性置空。
  4317. * @param {Object} [obj] - 目标对象。
  4318. */
  4319. SuperMap.Util.reset = function (obj) {
  4320. obj = obj || {};
  4321. for (var p in obj) {
  4322. if (obj.hasOwnProperty(p)) {
  4323. if (_typeof(obj[p]) === "object" && obj[p] instanceof Array) {
  4324. for (var i in obj[p]) {
  4325. if (obj[p][i].destroy) {
  4326. obj[p][i].destroy();
  4327. }
  4328. }
  4329. obj[p].length = 0;
  4330. } else if (_typeof(obj[p]) === "object" && obj[p] instanceof Object) {
  4331. if (obj[p].destroy) {
  4332. obj[p].destroy();
  4333. }
  4334. }
  4335. obj[p] = null;
  4336. }
  4337. }
  4338. };
  4339. /**
  4340. * @description 获取 HTML 元素数组。
  4341. * @returns {Array.<HTMLElement>} HTML 元素数组。
  4342. */
  4343. SuperMap.Util.getElement = function () {
  4344. var elements = [];
  4345. for (var i = 0, len = arguments.length; i < len; i++) {
  4346. var element = arguments[i];
  4347. if (typeof element === 'string') {
  4348. element = document.getElementById(element);
  4349. }
  4350. if (arguments.length === 1) {
  4351. return element;
  4352. }
  4353. elements.push(element);
  4354. }
  4355. return elements;
  4356. };
  4357. /**
  4358. * @description instance of 的跨浏览器实现。
  4359. * @param {Object} o - 对象。
  4360. * @returns {boolean} 是否是页面元素。
  4361. */
  4362. SuperMap.Util.isElement = function (o) {
  4363. return !!(o && o.nodeType === 1);
  4364. };
  4365. /**
  4366. * @description 判断一个对象是否是数组。
  4367. * @param {Object} a - 对象。
  4368. * @returns {boolean} 是否是数组。
  4369. */
  4370. SuperMap.Util.isArray = function (a) {
  4371. return Object.prototype.toString.call(a) === '[object Array]';
  4372. };
  4373. /**
  4374. * @description 从数组中删除某一项。
  4375. * @param {Array} array - 数组。
  4376. * @param {Object} item - 数组中要删除的一项。
  4377. * @returns {Array} 执行删除操作后的数组。
  4378. */
  4379. SuperMap.Util.removeItem = function (array, item) {
  4380. for (var i = array.length - 1; i >= 0; i--) {
  4381. if (array[i] === item) {
  4382. array.splice(i, 1); //break;more than once??
  4383. }
  4384. }
  4385. return array;
  4386. };
  4387. /**
  4388. * @description 获取某对象再数组中的索引值。
  4389. * @param {Array} array - 数组。
  4390. * @param {Object} obj - 对象。
  4391. * @returns {number} 某对象再数组中的索引值。
  4392. */
  4393. SuperMap.Util.indexOf = function (array, obj) {
  4394. if (array == null) {
  4395. return -1;
  4396. } else {
  4397. // use the build-in function if available.
  4398. if (typeof array.indexOf === "function") {
  4399. return array.indexOf(obj);
  4400. } else {
  4401. for (var i = 0, len = array.length; i < len; i++) {
  4402. if (array[i] === obj) {
  4403. return i;
  4404. }
  4405. }
  4406. return -1;
  4407. }
  4408. }
  4409. };
  4410. /**
  4411. * @description 修改某 DOM 元素的许多属性。
  4412. * @param {HTMLElement} element - 待修改的 DOM 元素。
  4413. * @param {string} [id] - DOM 元素的 ID。
  4414. * @param {SuperMap.Pixel} [px] - 包含 DOM 元素的 style 属性的 left 和 top 属性。
  4415. * @param {SuperMap.Size} [sz] - 包含 DOM 元素的 width 和 height 属性。
  4416. * @param {string} [position] - DOM 元素的 position 属性。
  4417. * @param {string} [border] - DOM 元素的 style 属性的 border 属性。
  4418. * @param {string} [overflow] - DOM 元素的 style 属性的 overflow 属性。
  4419. * @param {number} [opacity] - 不透明度值。取值范围为(0.0 - 1.0)。
  4420. */
  4421. SuperMap.Util.modifyDOMElement = function (element, id, px, sz, position, border, overflow, opacity) {
  4422. if (id) {
  4423. element.id = id;
  4424. }
  4425. if (px) {
  4426. element.style.left = px.x + "px";
  4427. element.style.top = px.y + "px";
  4428. }
  4429. if (sz) {
  4430. element.style.width = sz.w + "px";
  4431. element.style.height = sz.h + "px";
  4432. }
  4433. if (position) {
  4434. element.style.position = position;
  4435. }
  4436. if (border) {
  4437. element.style.border = border;
  4438. }
  4439. if (overflow) {
  4440. element.style.overflow = overflow;
  4441. }
  4442. if (parseFloat(opacity) >= 0.0 && parseFloat(opacity) < 1.0) {
  4443. element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
  4444. element.style.opacity = opacity;
  4445. } else if (parseFloat(opacity) === 1.0) {
  4446. element.style.filter = '';
  4447. element.style.opacity = '';
  4448. }
  4449. };
  4450. /**
  4451. * @description Takes an object and copies any properties that don't exist from
  4452. * another properties, by analogy with SuperMap.Util.extend() from
  4453. * Prototype.js.
  4454. *
  4455. * @param {Object} [to] - 目标对象。
  4456. * @param {Object} from - 源对象。Any properties of this object that
  4457. * are undefined in the to object will be set on the to object.
  4458. *
  4459. * @returns {Object} A reference to the to object. Note that the to argument is modified
  4460. * in place and returned by this function.
  4461. */
  4462. SuperMap.Util.applyDefaults = function (to, from) {
  4463. to = to || {};
  4464. /*
  4465. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  4466. * prototype object" when calling hawOwnProperty if the source object is an
  4467. * instance of window.Event.
  4468. */
  4469. var fromIsEvt = typeof window.Event === "function" && from instanceof window.Event;
  4470. for (var key in from) {
  4471. if (to[key] === undefined || !fromIsEvt && from.hasOwnProperty && from.hasOwnProperty(key) && !to.hasOwnProperty(key)) {
  4472. to[key] = from[key];
  4473. }
  4474. }
  4475. /**
  4476. * IE doesn't include the toString property when iterating over an object's
  4477. * properties with the for(property in object) syntax. Explicitly check if
  4478. * the source has its own toString property.
  4479. */
  4480. if (!fromIsEvt && from && from.hasOwnProperty && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) {
  4481. to.toString = from.toString;
  4482. }
  4483. return to;
  4484. };
  4485. /**
  4486. * @description 将参数对象转换为 HTTP 的 GET 请求中的参数字符串。例如:"key1=value1&key2=value2&key3=value3"。
  4487. * @param {Object} params - 参数对象。
  4488. * @returns {string} HTTP 的 GET 请求中的参数字符串。
  4489. */
  4490. SuperMap.Util.getParameterString = function (params) {
  4491. var paramsArray = [];
  4492. for (var key in params) {
  4493. var value = params[key];
  4494. if (value != null && typeof value !== 'function') {
  4495. var encodedValue;
  4496. if (Array.isArray(value) || value.toString() === '[object Object]') {
  4497. encodedValue = encodeURIComponent(JSON.stringify(value));
  4498. } else {
  4499. /* value is a string; simply encode */
  4500. encodedValue = encodeURIComponent(value);
  4501. }
  4502. paramsArray.push(encodeURIComponent(key) + "=" + encodedValue);
  4503. }
  4504. }
  4505. return paramsArray.join("&");
  4506. };
  4507. /**
  4508. * @description 给 URL 追加查询参数。
  4509. * @param {string} url - 待追加参数的 URL 字符串。
  4510. * @param {string} paramStr - 待追加的查询参数。
  4511. * @returns {string} 新的 URL。
  4512. */
  4513. SuperMap.Util.urlAppend = function (url, paramStr) {
  4514. var newUrl = url;
  4515. if (paramStr) {
  4516. if (paramStr.indexOf('?') === 0) {
  4517. paramStr = paramStr.substring(1);
  4518. }
  4519. var parts = (url + " ").split(/[?&]/);
  4520. newUrl += parts.pop() === " " ? paramStr : parts.length ? "&" + paramStr : "?" + paramStr;
  4521. }
  4522. return newUrl;
  4523. };
  4524. /**
  4525. * @description 给 URL 追加 path 参数。
  4526. * @param {string} url - 待追加参数的 URL 字符串。
  4527. * @param {string} paramStr - 待追加的path参数。
  4528. * @returns {string} 新的 URL。
  4529. */
  4530. SuperMap.Util.urlPathAppend = function (url, pathStr) {
  4531. var newUrl = url;
  4532. if (!pathStr) {
  4533. return newUrl;
  4534. }
  4535. if (pathStr.indexOf('/') === 0) {
  4536. pathStr = pathStr.substring(1);
  4537. }
  4538. var parts = url.split('?');
  4539. if (parts[0].indexOf('/', parts[0].length - 1) < 0) {
  4540. parts[0] += '/';
  4541. }
  4542. newUrl = "".concat(parts[0]).concat(pathStr).concat(parts.length > 1 ? "?".concat(parts[1]) : '');
  4543. return newUrl;
  4544. };
  4545. /**
  4546. * @description 为了避免浮点精度错误而保留的有效位数。
  4547. * @type {number}
  4548. * @default 14
  4549. */
  4550. SuperMap.Util.DEFAULT_PRECISION = 14;
  4551. /**
  4552. * @description 将字符串以接近的精度转换为数字。
  4553. * @param {string} number - 字符串。
  4554. * @param {number} [precision=14] - 精度。
  4555. * @returns {number} 数字。
  4556. */
  4557. SuperMap.Util.toFloat = function (number, precision) {
  4558. if (precision == null) {
  4559. precision = SuperMap.Util.DEFAULT_PRECISION;
  4560. }
  4561. if (typeof number !== "number") {
  4562. number = parseFloat(number);
  4563. }
  4564. return precision === 0 ? number : parseFloat(number.toPrecision(precision));
  4565. };
  4566. /**
  4567. * @description 角度转弧度。
  4568. * @param {number} x - 角度。
  4569. * @returns {number} 弧度。
  4570. */
  4571. SuperMap.Util.rad = function (x) {
  4572. return x * Math.PI / 180;
  4573. };
  4574. /**
  4575. * @description 从 URL 字符串中解析出参数对象。
  4576. * @param {string} url - URL。
  4577. * @returns {Object} 解析出的参数对象。
  4578. */
  4579. SuperMap.Util.getParameters = function (url) {
  4580. // if no url specified, take it from the location bar
  4581. url = url === null || url === undefined ? window.location.href : url; //parse out parameters portion of url string
  4582. var paramsString = "";
  4583. if (SuperMap.String.contains(url, '?')) {
  4584. var start = url.indexOf('?') + 1;
  4585. var end = SuperMap.String.contains(url, "#") ? url.indexOf('#') : url.length;
  4586. paramsString = url.substring(start, end);
  4587. }
  4588. var parameters = {};
  4589. var pairs = paramsString.split(/[&;]/);
  4590. for (var i = 0, len = pairs.length; i < len; ++i) {
  4591. var keyValue = pairs[i].split('=');
  4592. if (keyValue[0]) {
  4593. var key = keyValue[0];
  4594. try {
  4595. key = decodeURIComponent(key);
  4596. } catch (err) {
  4597. key = unescape(key);
  4598. } // being liberal by replacing "+" with " "
  4599. var value = (keyValue[1] || '').replace(/\+/g, " ");
  4600. try {
  4601. value = decodeURIComponent(value);
  4602. } catch (err) {
  4603. value = unescape(value);
  4604. } // follow OGC convention of comma delimited values
  4605. value = value.split(","); //if there's only one value, do not return as array
  4606. if (value.length == 1) {
  4607. value = value[0];
  4608. }
  4609. parameters[key] = value;
  4610. }
  4611. }
  4612. return parameters;
  4613. };
  4614. /**
  4615. * @description 不断递增计数变量,用于生成唯一 ID。
  4616. * @type {number}
  4617. * @default 0
  4618. */
  4619. SuperMap.Util.lastSeqID = 0;
  4620. /**
  4621. * @description 创建唯一 ID 值。
  4622. * @param {string} [prefix] - 前缀。
  4623. * @returns {string} 唯一的 ID 值。
  4624. */
  4625. SuperMap.Util.createUniqueID = function (prefix) {
  4626. if (prefix == null) {
  4627. prefix = "id_";
  4628. }
  4629. SuperMap.Util.lastSeqID += 1;
  4630. return prefix + SuperMap.Util.lastSeqID;
  4631. };
  4632. /**
  4633. * @memberOf SuperMap
  4634. * @description 每单位的英尺数。
  4635. * @type {Object}
  4636. * @constant
  4637. */
  4638. SuperMap.INCHES_PER_UNIT = {
  4639. 'inches': 1.0,
  4640. 'ft': 12.0,
  4641. 'mi': 63360.0,
  4642. 'm': 39.3701,
  4643. 'km': 39370.1,
  4644. 'dd': 4374754,
  4645. 'yd': 36
  4646. };
  4647. SuperMap.INCHES_PER_UNIT["in"] = SuperMap.INCHES_PER_UNIT.inches;
  4648. SuperMap.INCHES_PER_UNIT["degrees"] = SuperMap.INCHES_PER_UNIT.dd;
  4649. SuperMap.INCHES_PER_UNIT["nmi"] = 1852 * SuperMap.INCHES_PER_UNIT.m; // Units from CS-Map
  4650. SuperMap.METERS_PER_INCH = 0.02540005080010160020;
  4651. SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
  4652. "Inch": SuperMap.INCHES_PER_UNIT.inches,
  4653. "Meter": 1.0 / SuperMap.METERS_PER_INCH,
  4654. //EPSG:9001
  4655. "Foot": 0.30480060960121920243 / SuperMap.METERS_PER_INCH,
  4656. //EPSG:9003
  4657. "IFoot": 0.30480000000000000000 / SuperMap.METERS_PER_INCH,
  4658. //EPSG:9002
  4659. "ClarkeFoot": 0.3047972651151 / SuperMap.METERS_PER_INCH,
  4660. //EPSG:9005
  4661. "SearsFoot": 0.30479947153867624624 / SuperMap.METERS_PER_INCH,
  4662. //EPSG:9041
  4663. "GoldCoastFoot": 0.30479971018150881758 / SuperMap.METERS_PER_INCH,
  4664. //EPSG:9094
  4665. "IInch": 0.02540000000000000000 / SuperMap.METERS_PER_INCH,
  4666. "MicroInch": 0.00002540000000000000 / SuperMap.METERS_PER_INCH,
  4667. "Mil": 0.00000002540000000000 / SuperMap.METERS_PER_INCH,
  4668. "Centimeter": 0.01000000000000000000 / SuperMap.METERS_PER_INCH,
  4669. "Kilometer": 1000.00000000000000000000 / SuperMap.METERS_PER_INCH,
  4670. //EPSG:9036
  4671. "Yard": 0.91440182880365760731 / SuperMap.METERS_PER_INCH,
  4672. "SearsYard": 0.914398414616029 / SuperMap.METERS_PER_INCH,
  4673. //EPSG:9040
  4674. "IndianYard": 0.91439853074444079983 / SuperMap.METERS_PER_INCH,
  4675. //EPSG:9084
  4676. "IndianYd37": 0.91439523 / SuperMap.METERS_PER_INCH,
  4677. //EPSG:9085
  4678. "IndianYd62": 0.9143988 / SuperMap.METERS_PER_INCH,
  4679. //EPSG:9086
  4680. "IndianYd75": 0.9143985 / SuperMap.METERS_PER_INCH,
  4681. //EPSG:9087
  4682. "IndianFoot": 0.30479951 / SuperMap.METERS_PER_INCH,
  4683. //EPSG:9080
  4684. "IndianFt37": 0.30479841 / SuperMap.METERS_PER_INCH,
  4685. //EPSG:9081
  4686. "IndianFt62": 0.3047996 / SuperMap.METERS_PER_INCH,
  4687. //EPSG:9082
  4688. "IndianFt75": 0.3047995 / SuperMap.METERS_PER_INCH,
  4689. //EPSG:9083
  4690. "Mile": 1609.34721869443738887477 / SuperMap.METERS_PER_INCH,
  4691. "IYard": 0.91440000000000000000 / SuperMap.METERS_PER_INCH,
  4692. //EPSG:9096
  4693. "IMile": 1609.34400000000000000000 / SuperMap.METERS_PER_INCH,
  4694. //EPSG:9093
  4695. "NautM": 1852.00000000000000000000 / SuperMap.METERS_PER_INCH,
  4696. //EPSG:9030
  4697. "Lat-66": 110943.316488932731 / SuperMap.METERS_PER_INCH,
  4698. "Lat-83": 110946.25736872234125 / SuperMap.METERS_PER_INCH,
  4699. "Decimeter": 0.10000000000000000000 / SuperMap.METERS_PER_INCH,
  4700. "Millimeter": 0.00100000000000000000 / SuperMap.METERS_PER_INCH,
  4701. "Dekameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
  4702. "Decameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
  4703. "Hectometer": 100.00000000000000000000 / SuperMap.METERS_PER_INCH,
  4704. "GermanMeter": 1.0000135965 / SuperMap.METERS_PER_INCH,
  4705. //EPSG:9031
  4706. "CaGrid": 0.999738 / SuperMap.METERS_PER_INCH,
  4707. "ClarkeChain": 20.1166194976 / SuperMap.METERS_PER_INCH,
  4708. //EPSG:9038
  4709. "GunterChain": 20.11684023368047 / SuperMap.METERS_PER_INCH,
  4710. //EPSG:9033
  4711. "BenoitChain": 20.116782494375872 / SuperMap.METERS_PER_INCH,
  4712. //EPSG:9062
  4713. "SearsChain": 20.11676512155 / SuperMap.METERS_PER_INCH,
  4714. //EPSG:9042
  4715. "ClarkeLink": 0.201166194976 / SuperMap.METERS_PER_INCH,
  4716. //EPSG:9039
  4717. "GunterLink": 0.2011684023368047 / SuperMap.METERS_PER_INCH,
  4718. //EPSG:9034
  4719. "BenoitLink": 0.20116782494375872 / SuperMap.METERS_PER_INCH,
  4720. //EPSG:9063
  4721. "SearsLink": 0.2011676512155 / SuperMap.METERS_PER_INCH,
  4722. //EPSG:9043
  4723. "Rod": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  4724. "IntnlChain": 20.1168 / SuperMap.METERS_PER_INCH,
  4725. //EPSG:9097
  4726. "IntnlLink": 0.201168 / SuperMap.METERS_PER_INCH,
  4727. //EPSG:9098
  4728. "Perch": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  4729. "Pole": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  4730. "Furlong": 201.1684023368046 / SuperMap.METERS_PER_INCH,
  4731. "Rood": 3.778266898 / SuperMap.METERS_PER_INCH,
  4732. "CapeFoot": 0.3047972615 / SuperMap.METERS_PER_INCH,
  4733. "Brealey": 375.00000000000000000000 / SuperMap.METERS_PER_INCH,
  4734. "ModAmFt": 0.304812252984505969011938 / SuperMap.METERS_PER_INCH,
  4735. "Fathom": 1.8288 / SuperMap.METERS_PER_INCH,
  4736. "NautM-UK": 1853.184 / SuperMap.METERS_PER_INCH,
  4737. "50kilometers": 50000.0 / SuperMap.METERS_PER_INCH,
  4738. "150kilometers": 150000.0 / SuperMap.METERS_PER_INCH
  4739. }); //unit abbreviations supported by PROJ.4
  4740. SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
  4741. "mm": SuperMap.INCHES_PER_UNIT["Meter"] / 1000.0,
  4742. "cm": SuperMap.INCHES_PER_UNIT["Meter"] / 100.0,
  4743. "dm": SuperMap.INCHES_PER_UNIT["Meter"] * 100.0,
  4744. "km": SuperMap.INCHES_PER_UNIT["Meter"] * 1000.0,
  4745. "kmi": SuperMap.INCHES_PER_UNIT["nmi"],
  4746. //International Nautical Mile
  4747. "fath": SuperMap.INCHES_PER_UNIT["Fathom"],
  4748. //International Fathom
  4749. "ch": SuperMap.INCHES_PER_UNIT["IntnlChain"],
  4750. //International Chain
  4751. "link": SuperMap.INCHES_PER_UNIT["IntnlLink"],
  4752. //International Link
  4753. "us-in": SuperMap.INCHES_PER_UNIT["inches"],
  4754. //U.S. Surveyor's Inch
  4755. "us-ft": SuperMap.INCHES_PER_UNIT["Foot"],
  4756. //U.S. Surveyor's Foot
  4757. "us-yd": SuperMap.INCHES_PER_UNIT["Yard"],
  4758. //U.S. Surveyor's Yard
  4759. "us-ch": SuperMap.INCHES_PER_UNIT["GunterChain"],
  4760. //U.S. Surveyor's Chain
  4761. "us-mi": SuperMap.INCHES_PER_UNIT["Mile"],
  4762. //U.S. Surveyor's Statute Mile
  4763. "ind-yd": SuperMap.INCHES_PER_UNIT["IndianYd37"],
  4764. //Indian Yard
  4765. "ind-ft": SuperMap.INCHES_PER_UNIT["IndianFt37"],
  4766. //Indian Foot
  4767. "ind-ch": 20.11669506 / SuperMap.METERS_PER_INCH //Indian Chain
  4768. });
  4769. /**
  4770. * @memberOf SuperMap
  4771. * @member [SuperMap.DOTS_PER_INCH=96]
  4772. * @description 分辨率与比例尺之间转换的常量。
  4773. * @type {Object}
  4774. */
  4775. SuperMap.DOTS_PER_INCH = 96;
  4776. /**
  4777. * @param {number} scale - 比例尺。
  4778. * @returns {number} 返回正常的 scale 值。
  4779. */
  4780. SuperMap.Util.normalizeScale = function (scale) {
  4781. var normScale = scale > 1.0 ? 1.0 / scale : scale;
  4782. return normScale;
  4783. };
  4784. /**
  4785. * @description 比例尺转分辨率。
  4786. * @param {number} scale - 比例尺。
  4787. * @param {string} [units='degrees'] - 比例尺单位。
  4788. * @returns {number} 分辨率。
  4789. */
  4790. SuperMap.Util.getResolutionFromScale = function (scale, units) {
  4791. var resolution;
  4792. if (scale) {
  4793. if (units == null) {
  4794. units = "degrees";
  4795. }
  4796. var normScale = SuperMap.Util.normalizeScale(scale);
  4797. resolution = 1 / (normScale * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH);
  4798. }
  4799. return resolution;
  4800. };
  4801. /**
  4802. * @description 分辨率转比例尺。
  4803. * @param {number} resolution - 分辨率。
  4804. * @param {string} [units='degrees'] - 分辨率单位。
  4805. * @returns {number} 比例尺。
  4806. */
  4807. SuperMap.Util.getScaleFromResolution = function (resolution, units) {
  4808. if (units == null) {
  4809. units = "degrees";
  4810. }
  4811. var scale = resolution * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH;
  4812. return scale;
  4813. };
  4814. /**
  4815. * @memberOf SuperMap
  4816. * @description 如果 userAgent 捕获到浏览器使用的是 Gecko 引擎则返回 true。
  4817. * @constant
  4818. */
  4819. SuperMap.IS_GECKO = function () {
  4820. var ua = navigator.userAgent.toLowerCase();
  4821. return ua.indexOf("webkit") === -1 && ua.indexOf("gecko") !== -1;
  4822. }();
  4823. /**
  4824. * @memberOf SuperMap
  4825. * @description 浏览器名称,依赖于 userAgent 属性,BROWSER_NAME 可以是空,或者以下浏览器:
  4826. * * "opera" -- Opera
  4827. * * "msie" -- Internet Explorer
  4828. * * "safari" -- Safari
  4829. * * "firefox" -- Firefox
  4830. * * "mozilla" -- Mozilla
  4831. * @constant
  4832. */
  4833. SuperMap.Browser = function () {
  4834. var name = '',
  4835. version = '',
  4836. device = 'pc',
  4837. uaMatch; //以下进行测试
  4838. var ua = navigator.userAgent.toLowerCase();
  4839. if (ua.indexOf("msie") > -1 || ua.indexOf("trident") > -1 && ua.indexOf("rv") > -1) {
  4840. name = 'msie';
  4841. uaMatch = ua.match(/msie ([\d.]+)/) || ua.match(/rv:([\d.]+)/);
  4842. } else if (ua.indexOf("chrome") > -1) {
  4843. name = 'chrome';
  4844. uaMatch = ua.match(/chrome\/([\d.]+)/);
  4845. } else if (ua.indexOf("firefox") > -1) {
  4846. name = 'firefox';
  4847. uaMatch = ua.match(/firefox\/([\d.]+)/);
  4848. } else if (ua.indexOf("opera") > -1) {
  4849. name = 'opera';
  4850. uaMatch = ua.match(/version\/([\d.]+)/);
  4851. } else if (ua.indexOf("safari") > -1) {
  4852. name = 'safari';
  4853. uaMatch = ua.match(/version\/([\d.]+)/);
  4854. }
  4855. version = uaMatch ? uaMatch[1] : '';
  4856. if (ua.indexOf("ipad") > -1 || ua.indexOf("ipod") > -1 || ua.indexOf("iphone") > -1) {
  4857. device = 'apple';
  4858. } else if (ua.indexOf("android") > -1) {
  4859. uaMatch = ua.match(/version\/([\d.]+)/);
  4860. version = uaMatch ? uaMatch[1] : '';
  4861. device = 'android';
  4862. }
  4863. return {
  4864. name: name,
  4865. version: version,
  4866. device: device
  4867. };
  4868. }();
  4869. /**
  4870. * @description 获取浏览器相关信息。支持的浏览器包括:Opera,Internet Explorer,Safari,Firefox。
  4871. * @returns {Object} 获取浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
  4872. */
  4873. SuperMap.Util.getBrowser = function () {
  4874. return SuperMap.Browser;
  4875. };
  4876. /**
  4877. * @description 浏览器是否支持 Canvas。
  4878. * @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas。
  4879. */
  4880. SuperMap.Util.isSupportCanvas = function () {
  4881. var checkRes = true,
  4882. broz = SuperMap.Util.getBrowser();
  4883. if (document.createElement("canvas").getContext) {
  4884. if (broz.name === 'firefox' && parseFloat(broz.version) < 5) {
  4885. checkRes = false;
  4886. }
  4887. if (broz.name === 'safari' && parseFloat(broz.version) < 4) {
  4888. checkRes = false;
  4889. }
  4890. if (broz.name === 'opera' && parseFloat(broz.version) < 10) {
  4891. checkRes = false;
  4892. }
  4893. if (broz.name === 'msie' && parseFloat(broz.version) < 9) {
  4894. checkRes = false;
  4895. }
  4896. } else {
  4897. checkRes = false;
  4898. }
  4899. return checkRes;
  4900. }();
  4901. /**
  4902. * @description 判断;浏览器是否支持 Canvas。
  4903. * @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas 。
  4904. */
  4905. SuperMap.Util.supportCanvas = function () {
  4906. return SuperMap.Util.isSupportCanvas;
  4907. }; //将服务端的地图单位转成SuperMap的地图单位
  4908. SuperMap.INCHES_PER_UNIT["degree"] = SuperMap.INCHES_PER_UNIT.dd;
  4909. SuperMap.INCHES_PER_UNIT["meter"] = SuperMap.INCHES_PER_UNIT.m;
  4910. SuperMap.INCHES_PER_UNIT["foot"] = SuperMap.INCHES_PER_UNIT.ft;
  4911. SuperMap.INCHES_PER_UNIT["inch"] = SuperMap.INCHES_PER_UNIT.inches;
  4912. SuperMap.INCHES_PER_UNIT["mile"] = SuperMap.INCHES_PER_UNIT.mi;
  4913. SuperMap.INCHES_PER_UNIT["kilometer"] = SuperMap.INCHES_PER_UNIT.km;
  4914. SuperMap.INCHES_PER_UNIT["yard"] = SuperMap.INCHES_PER_UNIT.yd;
  4915. /**
  4916. * @description 判断一个 URL 请求是否在当前域中。
  4917. * @param {string} url - URL 请求字符串。
  4918. * @returns {boolean} URL 请求是否在当前域中。
  4919. */
  4920. SuperMap.Util.isInTheSameDomain = function (url) {
  4921. if (!url) {
  4922. return true;
  4923. }
  4924. var index = url.indexOf("//");
  4925. var documentUrl = document.location.toString();
  4926. var documentIndex = documentUrl.indexOf("//");
  4927. if (index === -1) {
  4928. return true;
  4929. } else {
  4930. var protocol;
  4931. var substring = protocol = url.substring(0, index);
  4932. var documentSubString = documentUrl.substring(documentIndex + 2);
  4933. documentIndex = documentSubString.indexOf("/");
  4934. var documentPortIndex = documentSubString.indexOf(":");
  4935. var documentDomainWithPort = documentSubString.substring(0, documentIndex); //var documentPort;
  4936. var documentprotocol = document.location.protocol;
  4937. if (documentPortIndex !== -1) {// documentPort = +documentSubString.substring(documentPortIndex, documentIndex);
  4938. } else {
  4939. documentDomainWithPort += ':' + (documentprotocol.toLowerCase() === 'http:' ? 80 : 443);
  4940. }
  4941. if (documentprotocol.toLowerCase() !== substring.toLowerCase()) {
  4942. return false;
  4943. }
  4944. substring = url.substring(index + 2);
  4945. var portIndex = substring.indexOf(":");
  4946. index = substring.indexOf("/");
  4947. var domainWithPort = substring.substring(0, index);
  4948. var domain;
  4949. if (portIndex !== -1) {
  4950. domain = substring.substring(0, portIndex);
  4951. } else {
  4952. domain = substring.substring(0, index);
  4953. domainWithPort += ':' + (protocol.toLowerCase() === 'http:' ? 80 : 443);
  4954. }
  4955. var documentDomain = document.domain;
  4956. if (domain === documentDomain && domainWithPort === documentDomainWithPort) {
  4957. return true;
  4958. }
  4959. }
  4960. return false;
  4961. };
  4962. /**
  4963. * @description 计算 iServer 服务的 REST 图层的显示分辨率,需要从 iServer 的 REST 图层表述中获取 viewBounds、viewer、scale、coordUnit、datumAxis 五个参数,来进行计算。
  4964. * @param {SuperMap.Bounds} viewBounds - 地图的参照可视范围,即地图初始化时默认的地图显示范围。
  4965. * @param {SuperMap.Size} viewer - 地图初始化时默认的地图图片的尺寸。
  4966. * @param {number} scale - 地图初始化时默认的显示比例尺。
  4967. * @param {string} [coordUnit='degrees'] - 投影坐标系统的地图单位。
  4968. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则系统默认为 WGS84 参考系的椭球体长半轴 6378137。
  4969. * @returns {number} 返回图层显示分辨率。
  4970. */
  4971. SuperMap.Util.calculateDpi = function (viewBounds, viewer, scale, coordUnit, datumAxis) {
  4972. //10000 是 0.1毫米与米的转换。DPI的计算公式:Viewer / DPI * 0.0254 * 10000 = ViewBounds * scale ,公式中的10000是为了提高计算结果的精度,以下出现的ratio皆为如此。
  4973. if (!viewBounds || !viewer || !scale) {
  4974. return;
  4975. }
  4976. var ratio = 10000,
  4977. rvbWidth = viewBounds.getWidth(),
  4978. rvbHeight = viewBounds.getHeight(),
  4979. rvWidth = viewer.w,
  4980. rvHeight = viewer.h; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  4981. datumAxis = datumAxis || 6378137;
  4982. coordUnit = coordUnit || "degrees";
  4983. var dpi;
  4984. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  4985. var num1 = rvbWidth / rvWidth,
  4986. num2 = rvbHeight / rvHeight,
  4987. resolution = num1 > num2 ? num1 : num2;
  4988. dpi = 0.0254 * ratio / resolution / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  4989. } else {
  4990. var _resolution = rvbWidth / rvWidth;
  4991. dpi = 0.0254 * ratio / _resolution / scale / ratio;
  4992. }
  4993. return dpi;
  4994. };
  4995. /**
  4996. * @description 将对象转换成 JSON 字符串。
  4997. * @param {Object} obj - 要转换成 JSON 的 Object 对象。
  4998. * @returns {string} 返回转换后的 JSON 对象。
  4999. */
  5000. SuperMap.Util.toJSON = function (obj) {
  5001. var objInn = obj;
  5002. if (objInn == null) {
  5003. return null;
  5004. }
  5005. switch (objInn.constructor) {
  5006. case String:
  5007. //s = "'" + str.replace(/(["\\])/g, "\\$1") + "'"; string含有单引号出错
  5008. objInn = '"' + objInn.replace(/(["\\])/g, '\\$1') + '"';
  5009. objInn = objInn.replace(/\n/g, "\\n");
  5010. objInn = objInn.replace(/\r/g, "\\r");
  5011. objInn = objInn.replace("<", "&lt;");
  5012. objInn = objInn.replace(">", "&gt;");
  5013. objInn = objInn.replace(/%/g, "%25");
  5014. objInn = objInn.replace(/&/g, "%26");
  5015. return objInn;
  5016. case Array:
  5017. var arr = [];
  5018. for (var i = 0, len = objInn.length; i < len; i++) {
  5019. arr.push(SuperMap.Util.toJSON(objInn[i]));
  5020. }
  5021. return "[" + arr.join(",") + "]";
  5022. case Number:
  5023. return isFinite(objInn) ? String(objInn) : null;
  5024. case Boolean:
  5025. return String(objInn);
  5026. case Date:
  5027. 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() + "}";
  5028. return dateStr;
  5029. default:
  5030. if (objInn["toJSON"] != null && typeof objInn["toJSON"] === "function") {
  5031. return objInn.toJSON();
  5032. }
  5033. if (_typeof(objInn) === "object") {
  5034. if (objInn.length) {
  5035. var _arr2 = [];
  5036. for (var _i = 0, _len = objInn.length; _i < _len; _i++) {
  5037. _arr2.push(SuperMap.Util.toJSON(objInn[_i]));
  5038. }
  5039. return "[" + _arr2.join(",") + "]";
  5040. }
  5041. var _arr = [];
  5042. for (var attr in objInn) {
  5043. //为解决SuperMap.Geometry类型头json时堆栈溢出的问题,attr == "parent"时不进行json转换
  5044. if (typeof objInn[attr] !== "function" && attr !== "CLASS_NAME" && attr !== "parent") {
  5045. _arr.push("'" + attr + "':" + SuperMap.Util.toJSON(objInn[attr]));
  5046. }
  5047. }
  5048. if (_arr.length > 0) {
  5049. return "{" + _arr.join(",") + "}";
  5050. } else {
  5051. return "{}";
  5052. }
  5053. }
  5054. return objInn.toString();
  5055. }
  5056. };
  5057. /**
  5058. * @description 根据比例尺和 dpi 计算屏幕分辨率。
  5059. * @param {number} scale - 比例尺。
  5060. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  5061. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  5062. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  5063. * @returns {number} 返回当前比例尺下的屏幕分辨率。
  5064. */
  5065. SuperMap.Util.getResolutionFromScaleDpi = function (scale, dpi, coordUnit, datumAxis) {
  5066. var resolution = null,
  5067. ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  5068. datumAxis = datumAxis || 6378137;
  5069. coordUnit = coordUnit || "";
  5070. if (scale > 0 && dpi > 0) {
  5071. scale = SuperMap.Util.normalizeScale(scale);
  5072. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  5073. //scale = SuperMap.Util.normalizeScale(scale);
  5074. resolution = 0.0254 * ratio / dpi / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  5075. return resolution;
  5076. } else {
  5077. resolution = 0.0254 * ratio / dpi / scale / ratio;
  5078. return resolution;
  5079. }
  5080. }
  5081. return -1;
  5082. };
  5083. /**
  5084. * @description 根据 resolution、dpi、coordUnit 和 datumAxis 计算比例尺。
  5085. * @param {number} resolution - 用于计算比例尺的地图分辨率。
  5086. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  5087. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  5088. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  5089. * @returns {number} 返回当前屏幕分辨率下的比例尺。
  5090. */
  5091. SuperMap.Util.getScaleFromResolutionDpi = function (resolution, dpi, coordUnit, datumAxis) {
  5092. var scale = null,
  5093. ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  5094. datumAxis = datumAxis || 6378137;
  5095. coordUnit = coordUnit || "";
  5096. if (resolution > 0 && dpi > 0) {
  5097. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  5098. scale = 0.0254 * ratio / dpi / resolution / (Math.PI * 2 * datumAxis / 360) / ratio;
  5099. return scale;
  5100. } else {
  5101. scale = 0.0254 * ratio / dpi / resolution / ratio;
  5102. return scale;
  5103. }
  5104. }
  5105. return -1;
  5106. };
  5107. /**
  5108. * @description 转换查询结果。
  5109. * @param {Object} result - 查询结果。
  5110. * @returns {Object} 转换后的查询结果。
  5111. */
  5112. SuperMap.Util.transformResult = function (result) {
  5113. if (result.responseText && typeof result.responseText === "string") {
  5114. result = JSON.parse(result.responseText);
  5115. }
  5116. return result;
  5117. };
  5118. /**
  5119. * @description 属性拷贝,不拷贝方法类名(CLASS_NAME)等。
  5120. * @param {Object} [destination] - 拷贝目标。
  5121. * @param {Object} source - 源对象。
  5122. *
  5123. */
  5124. SuperMap.Util.copyAttributes = function (destination, source) {
  5125. destination = destination || {};
  5126. if (source) {
  5127. for (var property in source) {
  5128. var value = source[property];
  5129. if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
  5130. destination[property] = value;
  5131. }
  5132. }
  5133. }
  5134. return destination;
  5135. };
  5136. /**
  5137. * @description 将源对象上的属性拷贝到目标对象上。(不拷贝 CLASS_NAME 和方法)
  5138. * @param {Object} [destination] - 目标对象。
  5139. * @param {Object} source - 源对象。
  5140. * @param {Array.<string>} clip - 源对象中禁止拷贝到目标对象的属性,目的是防止目标对象上不可修改的属性被篡改。
  5141. *
  5142. */
  5143. SuperMap.Util.copyAttributesWithClip = function (destination, source, clip) {
  5144. destination = destination || {};
  5145. if (source) {
  5146. for (var property in source) {
  5147. //去掉禁止拷贝的属性
  5148. var isInClip = false;
  5149. if (clip && clip.length) {
  5150. for (var i = 0, len = clip.length; i < len; i++) {
  5151. if (property === clip[i]) {
  5152. isInClip = true;
  5153. break;
  5154. }
  5155. }
  5156. }
  5157. if (isInClip === true) {
  5158. continue;
  5159. }
  5160. var value = source[property];
  5161. if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
  5162. destination[property] = value;
  5163. }
  5164. }
  5165. }
  5166. return destination;
  5167. };
  5168. /**
  5169. * @description 克隆一个 Object 对象
  5170. * @param {Object} obj - 需要克隆的对象。
  5171. * @returns {Object} 返回对象的拷贝对象,注意是新的对象,不是指向。
  5172. */
  5173. SuperMap.Util.cloneObject = function (obj) {
  5174. // Handle the 3 simple types, and null or undefined
  5175. if (null === obj || "object" !== _typeof(obj)) {
  5176. return obj;
  5177. } // Handle Date
  5178. if (obj instanceof Date) {
  5179. var copy = new Date();
  5180. copy.setTime(obj.getTime());
  5181. return copy;
  5182. } // Handle Array
  5183. if (obj instanceof Array) {
  5184. var _copy = obj.slice(0);
  5185. return _copy;
  5186. } // Handle Object
  5187. if (obj instanceof Object) {
  5188. var _copy2 = {};
  5189. for (var attr in obj) {
  5190. if (obj.hasOwnProperty(attr)) {
  5191. _copy2[attr] = SuperMap.Util.cloneObject(obj[attr]);
  5192. }
  5193. }
  5194. return _copy2;
  5195. }
  5196. throw new Error("Unable to copy obj! Its type isn't supported.");
  5197. };
  5198. /**
  5199. * @description 判断两条线段是不是有交点。
  5200. * @param {SuperMap.Geometry.Point} a1 - 第一条线段的起始节点。
  5201. * @param {SuperMap.Geometry.Point} a2 - 第一条线段的结束节点。
  5202. * @param {SuperMap.Geometry.Point} b1 - 第二条线段的起始节点。
  5203. * @param {SuperMap.Geometry.Point} b2 - 第二条线段的结束节点。
  5204. * @returns {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
  5205. */
  5206. SuperMap.Util.lineIntersection = function (a1, a2, b1, b2) {
  5207. var intersectValue = null;
  5208. var k1;
  5209. var k2;
  5210. var b = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x);
  5211. var a = (a2.x - a1.x) * (a1.y - b1.y) - (a2.y - a1.y) * (a1.x - b1.x);
  5212. var ab = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y); //ab==0代表两条线断的斜率一样
  5213. if (ab != 0) {
  5214. k1 = b / ab;
  5215. k2 = a / ab;
  5216. if (k1 >= 0 && k2 <= 1 && k1 <= 1 && k2 >= 0) {
  5217. intersectValue = new SuperMap.Geometry.Point(a1.x + k1 * (a2.x - a1.x), a1.y + k1 * (a2.y - a1.y));
  5218. } else {
  5219. intersectValue = "No Intersection";
  5220. }
  5221. } else {
  5222. if (b == 0 && a == 0) {
  5223. var maxy = Math.max(a1.y, a2.y);
  5224. var miny = Math.min(a1.y, a2.y);
  5225. var maxx = Math.max(a1.x, a2.x);
  5226. var minx = Math.min(a1.x, a2.x);
  5227. 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) {
  5228. intersectValue = "Coincident"; //重合
  5229. } else {
  5230. intersectValue = "Parallel"; //平行
  5231. }
  5232. } else {
  5233. intersectValue = "Parallel"; //平行
  5234. }
  5235. }
  5236. return intersectValue;
  5237. };
  5238. /**
  5239. * @description 获取文本外接矩形宽度与高度。
  5240. * @param {SuperMap.ThemeStyle} style - 文本样式。
  5241. * @param {string} text - 文本内容。
  5242. * @param {Object} element - DOM 元素。
  5243. * @returns {Object} 返回裁剪后的宽度,高度信息。
  5244. */
  5245. SuperMap.Util.getTextBounds = function (style, text, element) {
  5246. document.body.appendChild(element);
  5247. element.style.width = 'auto';
  5248. element.style.height = 'auto';
  5249. if (style.fontSize) {
  5250. element.style.fontSize = style.fontSize;
  5251. }
  5252. if (style.fontFamily) {
  5253. element.style.fontFamily = style.fontFamily;
  5254. }
  5255. if (style.fontWeight) {
  5256. element.style.fontWeight = style.fontWeight;
  5257. }
  5258. element.style.position = 'relative';
  5259. element.style.visibility = 'hidden'; //fix 在某些情况下,element内的文本变成竖起排列,导致宽度计算不正确的bug
  5260. element.style.display = 'inline-block';
  5261. element.innerHTML = text;
  5262. var textWidth = element.clientWidth;
  5263. var textHeight = element.clientHeight;
  5264. document.body.removeChild(element);
  5265. return {
  5266. textWidth: textWidth,
  5267. textHeight: textHeight
  5268. };
  5269. };
  5270. // CONCATENATED MODULE: ./src/common/commontypes/LonLat.js
  5271. function LonLat_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5272. 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); } }
  5273. function LonLat_createClass(Constructor, protoProps, staticProps) { if (protoProps) LonLat_defineProperties(Constructor.prototype, protoProps); if (staticProps) LonLat_defineProperties(Constructor, staticProps); return Constructor; }
  5274. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  5275. * This program are made available under the terms of the Apache License, Version 2.0
  5276. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5277. /**
  5278. * @class SuperMap.LonLat
  5279. * @category BaseTypes Geometry
  5280. * @classdesc 这个类用来表示经度和纬度对。
  5281. * @param {number} [lon=0.0] - 地图单位上的 X 轴坐标,如果地图是地理投影,则此值是经度,否则,此值是地图地理位置的 x 坐标。
  5282. * @param {number} [lat=0.0] - 地图单位上的 Y 轴坐标,如果地图是地理投影,则此值是纬度,否则,此值是地图地理位置的 y 坐标。
  5283. * @param {Array.<float>} [location] - 如果要同时设置,则使用传入横纵坐标组成的数组。
  5284. * @example
  5285. * var lonLat = new SuperMap.LonLat(30,45);
  5286. */
  5287. var LonLat_LonLat = /*#__PURE__*/function () {
  5288. function LonLat(lon, lat) {
  5289. LonLat_classCallCheck(this, LonLat);
  5290. if (Util_Util.isArray(lon)) {
  5291. lat = lon[1];
  5292. lon = lon[0];
  5293. }
  5294. /**
  5295. * @member {float} [SuperMap.LonLat.prototype.lon=0.0]
  5296. * @description 地图的单位的 X 轴(横轴)坐标。
  5297. */
  5298. this.lon = lon ? Util_Util.toFloat(lon) : 0.0;
  5299. /**
  5300. * @member {float} [SuperMap.LonLat.prototype.lat=0.0]
  5301. * @description 地图的单位的 Y 轴(纵轴)坐标。
  5302. */
  5303. this.lat = lat ? Util_Util.toFloat(lat) : 0.0;
  5304. this.CLASS_NAME = "SuperMap.LonLat";
  5305. }
  5306. /**
  5307. * @function SuperMap.LonLat.prototype.toString
  5308. * @description 返回此对象的字符串形式
  5309. * @example
  5310. * var lonLat = new SuperMap.LonLat(100,50);
  5311. * var str = lonLat.toString();
  5312. * @returns {string} 例如: "lon=100,lat=50"
  5313. */
  5314. LonLat_createClass(LonLat, [{
  5315. key: "toString",
  5316. value: function toString() {
  5317. return "lon=" + this.lon + ",lat=" + this.lat;
  5318. }
  5319. /**
  5320. * @function SuperMap.LonLat.prototype.toShortString
  5321. * @description 将经度纬度转换成简单字符串。
  5322. * @example
  5323. * var lonLat = new SuperMap.LonLat(100,50);
  5324. * var str = lonLat.toShortString();
  5325. * @returns {string} 返回处理后的经纬度字符串。例如:"100,50"
  5326. */
  5327. }, {
  5328. key: "toShortString",
  5329. value: function toShortString() {
  5330. return this.lon + "," + this.lat;
  5331. }
  5332. /**
  5333. * @function SuperMap.LonLat.prototype.clone
  5334. * @description 复制坐标对象,并返回复制后的新对象。
  5335. * @example
  5336. * var lonLat1 = new SuperMap.LonLat(100,50);
  5337. * var lonLat2 = lonLat1.clone();
  5338. * @returns {SuperMap.LonLat} 返回相同坐标值的新的坐标对象。
  5339. */
  5340. }, {
  5341. key: "clone",
  5342. value: function clone() {
  5343. return new LonLat(this.lon, this.lat);
  5344. }
  5345. /**
  5346. * @function SuperMap.LonLat.prototype.add
  5347. * @description 在已有坐标对象的经纬度基础上加上新的坐标经纬度,并返回新的坐标对象。
  5348. * @example
  5349. * var lonLat1 = new SuperMap.LonLat(100,50);
  5350. * //lonLat2 是新的对象
  5351. * var lonLat2 = lonLat1.add(100,50);
  5352. * @param {float} lon - 传入的经度参数。
  5353. * @param {float} lat - 传入的纬度参数。
  5354. * @returns {SuperMap.LonLat} 返回一个新的 LonLat 对象,此对象的经纬度是由传入的经纬度与当前的经纬度相加所得。
  5355. */
  5356. }, {
  5357. key: "add",
  5358. value: function add(lon, lat) {
  5359. if (lon == null || lat == null) {
  5360. throw new TypeError('LonLat.add cannot receive null values');
  5361. }
  5362. return new LonLat(this.lon + Util_Util.toFloat(lon), this.lat + Util_Util.toFloat(lat));
  5363. }
  5364. /**
  5365. * @function SuperMap.LonLat.prototype.equals
  5366. * @description 判断两个坐标对象是否相等。
  5367. * @example
  5368. * var lonLat1 = new SuperMap.LonLat(100,50);
  5369. * var lonLat2 = new SuperMap.LonLat(100,50);
  5370. * var isEquals = lonLat1.equals(lonLat2);
  5371. * @param {SuperMap.LonLat} ll - 需要进行比较的坐标对象。
  5372. * @returns {boolean} 如果LonLat对象的经纬度和传入的经纬度一致则返回true,不一
  5373. * 致或传入的ll参数为NULL则返回false。
  5374. */
  5375. }, {
  5376. key: "equals",
  5377. value: function equals(ll) {
  5378. var equals = false;
  5379. if (ll != null) {
  5380. equals = this.lon === ll.lon && this.lat === ll.lat || isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat);
  5381. }
  5382. return equals;
  5383. }
  5384. /**
  5385. * @function SuperMap.LonLat.prototype.wrapDateLine
  5386. * @description 通过传入的范围对象对坐标对象转换到该范围内。
  5387. * 如果经度小于给定范围最小精度,则在原经度基础上加上范围宽度,直到精度在范围内为止,如果经度大于给定范围则在原经度基础上减去范围宽度。
  5388. * 即指将不在经度范围内的坐标转换到范围以内(只会转换 lon,不会转换 lat,主要用于转移到日界线以内)。
  5389. * @example
  5390. * var lonLat1 = new SuperMap.LonLat(420,50);
  5391. * var lonLat2 = lonLat1.wrapDateLine(
  5392. * new SuperMap.Bounds(-180,-90,180,90)
  5393. * );
  5394. * @param {SuperMap.Bounds} maxExtent - 最大边界的范围。
  5395. * @returns {SuperMap.LonLat} 将坐标转换到范围对象以内,并返回新的坐标。
  5396. */
  5397. }, {
  5398. key: "wrapDateLine",
  5399. value: function wrapDateLine(maxExtent) {
  5400. var newLonLat = this.clone();
  5401. if (maxExtent) {
  5402. //shift right?
  5403. while (newLonLat.lon < maxExtent.left) {
  5404. newLonLat.lon += maxExtent.getWidth();
  5405. } //shift left?
  5406. while (newLonLat.lon > maxExtent.right) {
  5407. newLonLat.lon -= maxExtent.getWidth();
  5408. }
  5409. }
  5410. return newLonLat;
  5411. }
  5412. /**
  5413. *
  5414. * @function SuperMap.LonLat.prototype.destroy
  5415. * @description 销毁此对象。
  5416. * 销毁后此对象的所有属性为 null,而不是初始值。
  5417. * @example
  5418. * var lonLat = new SuperMap.LonLat(100,50);
  5419. * lonLat.destroy();
  5420. */
  5421. }, {
  5422. key: "destroy",
  5423. value: function destroy() {
  5424. this.lon = null;
  5425. this.lat = null;
  5426. }
  5427. /**
  5428. * @function SuperMap.LonLat.fromString
  5429. * @description 通过字符串生成一个 {@link SuperMap.LonLat} 对象。
  5430. * @example
  5431. * var str = "100,50";
  5432. * var lonLat = SuperMap.LonLat.fromString(str);
  5433. * @param {string} str - 字符串的格式:Lon+","+Lat。如:"100,50"。
  5434. * @returns {SuperMap.LonLat} 返回一个 {@link SuperMap.LonLat} 对象。
  5435. */
  5436. }], [{
  5437. key: "fromString",
  5438. value: function fromString(str) {
  5439. var pair = str.split(",");
  5440. return new LonLat(pair[0], pair[1]);
  5441. }
  5442. /**
  5443. * @function SuperMap.LonLat.fromArray
  5444. * @description 通过数组生成一个 <SuperMap.LonLat> 对象。
  5445. * @param {Array.<float>} arr - 数组的格式,长度只能为2,:[Lon,Lat]。如:[5,-42]。
  5446. * @returns {SuperMap.LonLat} 返回一个 <SuperMap.LonLat> 对象。
  5447. */
  5448. }, {
  5449. key: "fromArray",
  5450. value: function fromArray(arr) {
  5451. var gotArr = Util_Util.isArray(arr),
  5452. lon = gotArr && arr[0],
  5453. lat = gotArr && arr[1];
  5454. return new LonLat(lon, lat);
  5455. }
  5456. }]);
  5457. return LonLat;
  5458. }();
  5459. // CONCATENATED MODULE: ./src/common/commontypes/Bounds.js
  5460. function Bounds_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5461. 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); } }
  5462. function Bounds_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bounds_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bounds_defineProperties(Constructor, staticProps); return Constructor; }
  5463. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  5464. * This program are made available under the terms of the Apache License, Version 2.0
  5465. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5466. /**
  5467. * @class SuperMap.Bounds
  5468. * @category BaseTypes Geometry
  5469. * @classdesc 表示边界类实例。使用 bounds 之前需要设置 left,bottom,right,top 四个属性,这些属性的初始值为 null。
  5470. * @param {number} [left] - 左边界,注意考虑宽度,理论上小于 right 值。
  5471. * @param {number} [bottom] - 下边界。考虑高度,理论上小于 top 值。
  5472. * @param {number} [right] - 右边界。
  5473. * @param {number} [top] - 上边界。
  5474. * @param {Array.<number>} [array] - [left, bottom, right, top],如果同时传多个参数,则使用左下右上组成的数组。
  5475. * @example
  5476. * var bounds = new SuperMap.Bounds();
  5477. * bounds.extend(new SuperMap.LonLat(4,5));
  5478. * bounds.extend(new SuperMap.LonLat(5,6));
  5479. * bounds.toBBOX(); // returns 4,5,5,6
  5480. */
  5481. var Bounds_Bounds = /*#__PURE__*/function () {
  5482. function Bounds(left, bottom, right, top) {
  5483. Bounds_classCallCheck(this, Bounds);
  5484. if (Util_Util.isArray(left)) {
  5485. top = left[3];
  5486. right = left[2];
  5487. bottom = left[1];
  5488. left = left[0];
  5489. }
  5490. /**
  5491. * @member {number} SuperMap.Bounds.prototype.left
  5492. * @description 最小的水平坐标系。
  5493. */
  5494. this.left = left != null ? Util_Util.toFloat(left) : this.left;
  5495. /**
  5496. * @member {number} SuperMap.Bounds.prototype.bottom
  5497. * @description 最小的垂直坐标系。
  5498. */
  5499. this.bottom = bottom != null ? Util_Util.toFloat(bottom) : this.bottom;
  5500. /**
  5501. * @member {number} SuperMap.Bounds.prototype.right
  5502. * @description 最大的水平坐标系。
  5503. */
  5504. this.right = right != null ? Util_Util.toFloat(right) : this.right;
  5505. /**
  5506. * @member {number} SuperMap.Bounds.prototype.top
  5507. * @description 最大的垂直坐标系。
  5508. */
  5509. this.top = top != null ? Util_Util.toFloat(top) : this.top;
  5510. /**
  5511. * @member {SuperMap.LonLat} SuperMap.Bounds.prototype.centerLonLat
  5512. * @description bounds 的地图空间的中心点。用 getCenterLonLat() 获得。
  5513. */
  5514. this.centerLonLat = null;
  5515. this.CLASS_NAME = "SuperMap.Bounds";
  5516. }
  5517. /**
  5518. * @function SuperMap.Bounds.prototype.clone
  5519. * @description 复制当前 bounds 对象。
  5520. * @example
  5521. * var bounds1 = new SuperMap.Bounds(-180,-90,180,90);
  5522. * var bounds2 = bounds1.clone();
  5523. * @returns {SuperMap.Bounds} 返回一个克隆的 bounds。
  5524. */
  5525. Bounds_createClass(Bounds, [{
  5526. key: "clone",
  5527. value: function clone() {
  5528. return new Bounds(this.left, this.bottom, this.right, this.top);
  5529. }
  5530. /**
  5531. * @function SuperMap.Bounds.prototype.equals
  5532. * @description 判断两个 bounds 对象是否相等。
  5533. * @example
  5534. * var bounds1 = new SuperMap.Bounds(-180,-90,180,90);
  5535. * var bounds2 = new SuperMap.Bounds(-180,-90,180,90);
  5536. * var isEquals = bounds1.equals(bounds2);
  5537. * @param {SuperMap.Bounds} bounds - 需要进行计较的 bounds。
  5538. * @returns {boolean} 如果 bounds 对象的边和传入的 bounds 一致则返回 true,不一致或传入的 bounds 参数为 NULL 则返回 false。
  5539. */
  5540. }, {
  5541. key: "equals",
  5542. value: function equals(bounds) {
  5543. var equals = false;
  5544. if (bounds != null) {
  5545. equals = this.left === bounds.left && this.right === bounds.right && this.top === bounds.top && this.bottom === bounds.bottom;
  5546. }
  5547. return equals;
  5548. }
  5549. /**
  5550. * @function SuperMap.Bounds.prototype.toString
  5551. * @description 返回此对象的字符串形式。
  5552. * @example
  5553. * var bounds = new SuperMap.Bounds(-180,-90,180,90);
  5554. * var str = bounds.toString();
  5555. * @returns {string} 边界对象的字符串表示形式(left,bottom,right,top),例如: "-180,-90,180,90"。
  5556. */
  5557. }, {
  5558. key: "toString",
  5559. value: function toString() {
  5560. return [this.left, this.bottom, this.right, this.top].join(",");
  5561. }
  5562. /**
  5563. * @function SuperMap.Bounds.prototype.toArray
  5564. * @description 边界对象的数组表示形式。
  5565. * @example
  5566. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5567. * //array1 = [-180,-90,100,80];
  5568. * var array1 = bounds.toArray();
  5569. * //array1 = [-90,-180,80,100];
  5570. * var array2 = bounds.toArray(true);
  5571. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  5572. * 如果设为 true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  5573. * @returns {Array.<number>} left, bottom, right, top 数组。
  5574. */
  5575. }, {
  5576. key: "toArray",
  5577. value: function toArray(reverseAxisOrder) {
  5578. if (reverseAxisOrder === true) {
  5579. return [this.bottom, this.left, this.top, this.right];
  5580. } else {
  5581. return [this.left, this.bottom, this.right, this.top];
  5582. }
  5583. }
  5584. /**
  5585. * @function SuperMap.Bounds.prototype.toBBOX
  5586. * @description 取小数点后 decimal 位数字进行四舍五入再转换为 BBOX 字符串。
  5587. * @example
  5588. * var bounds = new SuperMap.Bounds(-1.1234567,-1.7654321,1.4444444,1.5555555);
  5589. * //str1 = "-1.123457,-1.765432,1.444444,1.555556";
  5590. * var str1 = bounds.toBBOX();
  5591. * //str2 = "-1.1,-1.8,1.4,1.6";
  5592. * var str2 = bounds.toBBOX(1);
  5593. * //str2 = "-1.8,-1.1,1.6,1.4";
  5594. * var str2 = bounds.toBBOX(1,true);
  5595. * @param {integer} [decimal=6] - 边界方位坐标的有效数字个数。
  5596. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。
  5597. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  5598. * @returns {string} 边界对象的字符串表示形式,如:"5,42,10,45"。
  5599. */
  5600. }, {
  5601. key: "toBBOX",
  5602. value: function toBBOX(decimal, reverseAxisOrder) {
  5603. if (decimal == null) {
  5604. decimal = 6;
  5605. }
  5606. var mult = Math.pow(10, decimal);
  5607. var xmin = Math.round(this.left * mult) / mult;
  5608. var ymin = Math.round(this.bottom * mult) / mult;
  5609. var xmax = Math.round(this.right * mult) / mult;
  5610. var ymax = Math.round(this.top * mult) / mult;
  5611. if (reverseAxisOrder === true) {
  5612. return ymin + "," + xmin + "," + ymax + "," + xmax;
  5613. } else {
  5614. return xmin + "," + ymin + "," + xmax + "," + ymax;
  5615. }
  5616. }
  5617. /**
  5618. * @function SuperMap.Bounds.prototype.toGeometry
  5619. * @description 基于当前边界范围创建一个新的多边形对象。
  5620. * @example
  5621. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5622. * //SuperMap.Geometry.Polygon对象
  5623. * var geo = bounds.toGeometry();
  5624. * @returns {SuperMap.Geometry.Polygon} 基于当前 bounds 坐标创建的新的多边形。
  5625. */
  5626. // toGeometry() {
  5627. // return new Polygon([
  5628. // new LinearRing([
  5629. // new Point(this.left, this.bottom),
  5630. // new Point(this.right, this.bottom),
  5631. // new Point(this.right, this.top),
  5632. // new Point(this.left, this.top)
  5633. // ])
  5634. // ]);
  5635. // }
  5636. /**
  5637. * @function SuperMap.Bounds.prototype.getWidth
  5638. * @description 获取 bounds 的宽度。
  5639. * @example
  5640. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5641. * //width = 280;
  5642. * var width = bounds.getWidth();
  5643. * @returns {float} 获取当前 bounds 的宽度(right 减去 left)。
  5644. */
  5645. }, {
  5646. key: "getWidth",
  5647. value: function getWidth() {
  5648. return this.right - this.left;
  5649. }
  5650. /**
  5651. * @function SuperMap.Bounds.prototype.getHeight
  5652. * @description 获取 bounds 的高度。
  5653. * @example
  5654. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5655. * //height = 170;
  5656. * var height = bounds.getHeight();
  5657. * @returns {float} 返回边界高度(top 减去 bottom)。
  5658. */
  5659. }, {
  5660. key: "getHeight",
  5661. value: function getHeight() {
  5662. return this.top - this.bottom;
  5663. }
  5664. /**
  5665. * @function SuperMap.Bounds.prototype.getSize
  5666. * @description 获取边框大小。
  5667. * @example
  5668. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5669. * var size = bounds.getSize();
  5670. * @returns {SuperMap.Size} 返回边框大小。
  5671. */
  5672. }, {
  5673. key: "getSize",
  5674. value: function getSize() {
  5675. return new Size(this.getWidth(), this.getHeight());
  5676. }
  5677. /**
  5678. * @function SuperMap.Bounds.prototype.getCenterPixel
  5679. * @description 获取像素格式的范围中心点。
  5680. * @example
  5681. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5682. * var pixel = bounds.getCenterPixel();
  5683. * @returns {SuperMap.Pixel} 返回像素格式的当前范围的中心点。
  5684. */
  5685. }, {
  5686. key: "getCenterPixel",
  5687. value: function getCenterPixel() {
  5688. return new Pixel_Pixel((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  5689. }
  5690. /**
  5691. * @function SuperMap.Bounds.prototype.getCenterLonLat
  5692. * @description 获取地理格式的范围中心点。
  5693. * @example
  5694. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5695. * var lonlat = bounds.getCenterLonLat();
  5696. * @returns {SuperMap.LonLat} 返回当前地理范围的中心点。
  5697. */
  5698. }, {
  5699. key: "getCenterLonLat",
  5700. value: function getCenterLonLat() {
  5701. if (!this.centerLonLat) {
  5702. this.centerLonLat = new LonLat_LonLat((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  5703. }
  5704. return this.centerLonLat;
  5705. }
  5706. /**
  5707. * @function SuperMap.Bounds.prototype.scale
  5708. * @description 按照比例扩大/缩小出一个新的 bounds。
  5709. * @example
  5710. * var bounds = new SuperMap.Bounds(-50,-50,40,40);
  5711. * var bounds2 = bounds.scale(2);
  5712. * @param {float} [ratio=1] - 需要扩大的比例。
  5713. * @param {(SuperMap.Pixel|SuperMap.LonLat)} [origin] - 扩大时的基准点,默认为当前 bounds 的中心点。
  5714. * @returns {SuperMap.Bounds} 返回通过 ratio、origin 计算得到的新的边界范围。
  5715. */
  5716. }, {
  5717. key: "scale",
  5718. value: function scale(ratio, origin) {
  5719. ratio = ratio ? ratio : 1;
  5720. if (origin == null) {
  5721. origin = this.getCenterLonLat();
  5722. }
  5723. var origx, origy; // get origin coordinates
  5724. if (origin.CLASS_NAME === "SuperMap.LonLat") {
  5725. origx = origin.lon;
  5726. origy = origin.lat;
  5727. } else {
  5728. origx = origin.x;
  5729. origy = origin.y;
  5730. }
  5731. var left = (this.left - origx) * ratio + origx;
  5732. var bottom = (this.bottom - origy) * ratio + origy;
  5733. var right = (this.right - origx) * ratio + origx;
  5734. var top = (this.top - origy) * ratio + origy;
  5735. return new Bounds(left, bottom, right, top);
  5736. }
  5737. /**
  5738. * @function SuperMap.Bounds.prototype.add
  5739. * @description 在当前的 Bounds 上按照传入的坐标点进行平移,返回新的范围。
  5740. * @example
  5741. * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
  5742. * //bounds2 是新的 bounds
  5743. * var bounds2 = bounds.add(20,10);
  5744. * @param {float} x - 传入坐标点的 x 坐标。
  5745. * @param {float} y - 传入坐标点的 y 坐标。
  5746. * @returns {SuperMap.Bounds} 返回一个新的 bounds,此 bounds 的坐标是由传入的 x,y 参数与当前 bounds 坐标计算所得。
  5747. */
  5748. }, {
  5749. key: "add",
  5750. value: function add(x, y) {
  5751. if (x == null || y == null) {
  5752. throw new TypeError('Bounds.add cannot receive null values');
  5753. }
  5754. return new Bounds(this.left + x, this.bottom + y, this.right + x, this.top + y);
  5755. }
  5756. /**
  5757. * @function SuperMap.Bounds.prototype.extend
  5758. * @description 在当前 bounds 上扩展 bounds,支持 point,lanlat 和 bounds。扩展后的 bounds 的范围是两者的结合。
  5759. * @example
  5760. * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
  5761. * //bounds 改变
  5762. * bounds.extend(new SuperMap.LonLat(50,60));
  5763. * @param {(SuperMap.Geometry.Point|SuperMap.LonLat|SuperMap.Bounds)} object - 可以是 point、lonlat 和 bounds。
  5764. */
  5765. }, {
  5766. key: "extend",
  5767. value: function extend(object) {
  5768. var bounds = null;
  5769. if (object) {
  5770. // clear cached center location
  5771. switch (object.CLASS_NAME) {
  5772. case "SuperMap.LonLat":
  5773. bounds = new Bounds(object.lon, object.lat, object.lon, object.lat);
  5774. break;
  5775. case "SuperMap.Geometry.Point":
  5776. bounds = new Bounds(object.x, object.y, object.x, object.y);
  5777. break;
  5778. case "SuperMap.Bounds":
  5779. bounds = object;
  5780. break;
  5781. }
  5782. if (bounds) {
  5783. this.centerLonLat = null;
  5784. if (this.left == null || bounds.left < this.left) {
  5785. this.left = bounds.left;
  5786. }
  5787. if (this.bottom == null || bounds.bottom < this.bottom) {
  5788. this.bottom = bounds.bottom;
  5789. }
  5790. if (this.right == null || bounds.right > this.right) {
  5791. this.right = bounds.right;
  5792. }
  5793. if (this.top == null || bounds.top > this.top) {
  5794. this.top = bounds.top;
  5795. }
  5796. }
  5797. }
  5798. }
  5799. /**
  5800. * @function SuperMap.Bounds.prototype.containsLonLat
  5801. * @description 判断传入的坐标是否在范围内。
  5802. * @example
  5803. * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
  5804. * //isContains1 = true
  5805. * //这里的第二个参数可以直接为 boolean 类型,也就是inclusive
  5806. * var isContains1 = bounds.containsLonLat(new SuperMap.LonLat(40,40),true);
  5807. *
  5808. * //(40,40)在范围内,同样(40+360,40)也在范围内
  5809. * var bounds2 = new SuperMap.Bounds(-50,-50,40,40);
  5810. * //isContains2 = true;
  5811. * var isContains2 = bounds2.containsLonLat(
  5812. * new SuperMap.LonLat(400,40),
  5813. * {
  5814. * inclusive:true,
  5815. * //全球的范围
  5816. * worldBounds: new SuperMap.Bounds(-180,-90,180,90)
  5817. * }
  5818. * );
  5819. * @param {(SuperMap.LonLat|Object)} ll - <SuperMap.LonLat> 对象或者是一个包含 'lon' 与 'lat' 属性的对象。
  5820. * @param {Object} options - 可选参数。
  5821. * @param {boolean} [options.inclusive=true] - 是否包含边界。
  5822. * @param {SuperMap.Bounds} [options.worldBounds] - 如果提供 worldBounds 参数, 如果 ll 参数提供的坐标超出了世界边界(worldBounds),
  5823. * 但是通过日界线的转化可以被包含, 它将被认为是包含在该范围内的。
  5824. * @returns {boolean} 传入坐标是否包含在范围内。
  5825. */
  5826. }, {
  5827. key: "containsLonLat",
  5828. value: function containsLonLat(ll, options) {
  5829. if (typeof options === "boolean") {
  5830. options = {
  5831. inclusive: options
  5832. };
  5833. }
  5834. options = options || {};
  5835. var contains = this.contains(ll.lon, ll.lat, options.inclusive),
  5836. worldBounds = options.worldBounds; //日界线以外的也有可能算包含,
  5837. if (worldBounds && !contains) {
  5838. var worldWidth = worldBounds.getWidth();
  5839. var worldCenterX = (worldBounds.left + worldBounds.right) / 2; //这一步很关键
  5840. var worldsAway = Math.round((ll.lon - worldCenterX) / worldWidth);
  5841. contains = this.containsLonLat({
  5842. lon: ll.lon - worldsAway * worldWidth,
  5843. lat: ll.lat
  5844. }, {
  5845. inclusive: options.inclusive
  5846. });
  5847. }
  5848. return contains;
  5849. }
  5850. /**
  5851. * @function SuperMap.Bounds.prototype.containsPixel
  5852. * @description 判断传入的像素是否在范围内。直接匹配大小,不涉及像素和地理转换。
  5853. * @example
  5854. * var bounds = new SuperMap.Bounds(-50,-50,40,40);
  5855. * //isContains = true
  5856. * var isContains = bounds.containsPixel(new SuperMap.Pixel(40,40),true);
  5857. * @param {SuperMap.Pixel} px - 提供的像素参数。
  5858. * @param {boolean} [inclusive=true] - 是否包含边界。
  5859. * @returns {boolean} 传入的 pixel 在当前边界范围之内。
  5860. */
  5861. }, {
  5862. key: "containsPixel",
  5863. value: function containsPixel(px, inclusive) {
  5864. return this.contains(px.x, px.y, inclusive);
  5865. }
  5866. /**
  5867. * @function SuperMap.Bounds.prototype.contains
  5868. * @description 判断传入的 x,y 坐标值是否在范围内。
  5869. * @example
  5870. * var bounds = new SuperMap.Bounds(-50,-50,40,40);
  5871. * //isContains = true
  5872. * var isContains = bounds.contains(40,40,true);
  5873. * @param {float} x - 传入的 x 坐标值。
  5874. * @param {float} y - 传入的 y 坐标值。
  5875. * @param {boolean} [inclusive=true] - 是否包含边界。
  5876. * @returns {boolean} 传入的 x,y 坐标是否在当前范围内。
  5877. */
  5878. }, {
  5879. key: "contains",
  5880. value: function contains(x, y, inclusive) {
  5881. //set default
  5882. if (inclusive == null) {
  5883. inclusive = true;
  5884. }
  5885. if (x == null || y == null) {
  5886. return false;
  5887. } //x = Util.toFloat(x);
  5888. //y = Util.toFloat(y);
  5889. var contains = false;
  5890. if (inclusive) {
  5891. contains = x >= this.left && x <= this.right && y >= this.bottom && y <= this.top;
  5892. } else {
  5893. contains = x > this.left && x < this.right && y > this.bottom && y < this.top;
  5894. }
  5895. return contains;
  5896. }
  5897. /**
  5898. * @function SuperMap.Bounds.prototype.intersectsBounds
  5899. * @description 判断目标边界范围是否与当前边界范围相交。如果两个边界范围中的任意
  5900. * 边缘相交或者一个边界包含了另外一个就认为这两个边界相交。
  5901. * @example
  5902. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5903. * var isIntersects = bounds.intersectsBounds(
  5904. * new SuperMap.Bounds(-170,-90,120,80)
  5905. * );
  5906. * @param {SuperMap.Bounds} bounds - 目标边界。
  5907. * @param {Object} options - 参数。
  5908. * @param {boolean} [options.inclusive=true] - 边缘重合也看成相交。如果是false,
  5909. * 两个边界范围没有重叠部分仅仅是在边缘相接(重合),
  5910. * 这种情况被认为没有相交。
  5911. * @param {SuperMap.Bounds} [options.worldBounds] - 提供了 worldBounds 参数, 如果他们相交时
  5912. * 是在全球范围内, 两个边界将被视为相交。这仅适用于交叉或完全不在世界范围的边界。
  5913. * @returns {boolean} 传入的 bounds 对象与当前 bounds 相交。
  5914. */
  5915. }, {
  5916. key: "intersectsBounds",
  5917. value: function intersectsBounds(bounds, options) {
  5918. if (typeof options === "boolean") {
  5919. options = {
  5920. inclusive: options
  5921. };
  5922. }
  5923. options = options || {};
  5924. if (options.worldBounds) {
  5925. var self = this.wrapDateLine(options.worldBounds);
  5926. bounds = bounds.wrapDateLine(options.worldBounds);
  5927. } else {
  5928. self = this;
  5929. }
  5930. if (options.inclusive == null) {
  5931. options.inclusive = true;
  5932. }
  5933. var intersects = false;
  5934. 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,
  5935. // then the bounds don't *really* intersect.
  5936. if (options.inclusive || !mightTouch) {
  5937. // otherwise, if one of the boundaries even partially contains another,
  5938. // inclusive of the edges, then they do intersect.
  5939. var inBottom = bounds.bottom >= self.bottom && bounds.bottom <= self.top || self.bottom >= bounds.bottom && self.bottom <= bounds.top;
  5940. var inTop = bounds.top >= self.bottom && bounds.top <= self.top || self.top > bounds.bottom && self.top < bounds.top;
  5941. var inLeft = bounds.left >= self.left && bounds.left <= self.right || self.left >= bounds.left && self.left <= bounds.right;
  5942. var inRight = bounds.right >= self.left && bounds.right <= self.right || self.right >= bounds.left && self.right <= bounds.right;
  5943. intersects = (inBottom || inTop) && (inLeft || inRight);
  5944. } // document me
  5945. if (options.worldBounds && !intersects) {
  5946. var world = options.worldBounds;
  5947. var width = world.getWidth();
  5948. var selfCrosses = !world.containsBounds(self);
  5949. var boundsCrosses = !world.containsBounds(bounds);
  5950. if (selfCrosses && !boundsCrosses) {
  5951. bounds = bounds.add(-width, 0);
  5952. intersects = self.intersectsBounds(bounds, {
  5953. inclusive: options.inclusive
  5954. });
  5955. } else if (boundsCrosses && !selfCrosses) {
  5956. self = self.add(-width, 0);
  5957. intersects = bounds.intersectsBounds(self, {
  5958. inclusive: options.inclusive
  5959. });
  5960. }
  5961. }
  5962. return intersects;
  5963. }
  5964. /**
  5965. * @function SuperMap.Bounds.prototype.containsBounds
  5966. * @description 判断目标边界是否被当前边界包含在内。
  5967. * @example
  5968. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5969. * var isContains = bounds.containsBounds(
  5970. * new SuperMap.Bounds(-170,-90,100,80),true,true
  5971. * );
  5972. * @param {SuperMap.Bounds} bounds - 目标边界。
  5973. * @param {boolean} [partial=false] - 目标边界的任意部分都包含在当前边界中则被认为是包含关系。
  5974. * 如果设为 false,整个目标边界全部被包含在当前边界范围内。
  5975. * @param {boolean} [inclusive=true] - 边缘共享被视为包含。
  5976. * @returns {boolean} 传入的边界被当前边界包含。
  5977. */
  5978. }, {
  5979. key: "containsBounds",
  5980. value: function containsBounds(bounds, partial, inclusive) {
  5981. if (partial == null) {
  5982. partial = false;
  5983. }
  5984. if (inclusive == null) {
  5985. inclusive = true;
  5986. }
  5987. var bottomLeft = this.contains(bounds.left, bounds.bottom, inclusive);
  5988. var bottomRight = this.contains(bounds.right, bounds.bottom, inclusive);
  5989. var topLeft = this.contains(bounds.left, bounds.top, inclusive);
  5990. var topRight = this.contains(bounds.right, bounds.top, inclusive);
  5991. return partial ? bottomLeft || bottomRight || topLeft || topRight : bottomLeft && bottomRight && topLeft && topRight;
  5992. }
  5993. /**
  5994. * @function SuperMap.Bounds.prototype.determineQuadrant
  5995. * @description 判断传入坐标是否在 bounds 范围内的象限。以 bounds 中心点为坐标原点。
  5996. * @example
  5997. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5998. * //str = "tr";
  5999. * var str = bounds.determineQuadrant(
  6000. * new SuperMap.LonLat(20,20)
  6001. * );
  6002. * @param {SuperMap.LonLat} lonlat - 传入的坐标对象。
  6003. * @returns {string} 传入坐标所在的象限("br" "tr" "tl" "bl" 分别对应"右下","右上","左上" "左下")。
  6004. */
  6005. }, {
  6006. key: "determineQuadrant",
  6007. value: function determineQuadrant(lonlat) {
  6008. var quadrant = "";
  6009. var center = this.getCenterLonLat();
  6010. quadrant += lonlat.lat < center.lat ? "b" : "t";
  6011. quadrant += lonlat.lon < center.lon ? "l" : "r";
  6012. return quadrant;
  6013. }
  6014. /**
  6015. * @function SuperMap.Bounds.prototype.wrapDateLine
  6016. * @description 将当前 bounds 移动到最大边界范围内部(所谓的内部是相交或者内部)。
  6017. * @example
  6018. * var bounds = new SuperMap.Bounds(380,-40,400,-20);
  6019. * var maxExtent = new SuperMap.Bounds(-180,-90,100,80);
  6020. * //新的bounds
  6021. * var newBounds = bounds.wrapDateLine(maxExtent);
  6022. * @param {SuperMap.Bounds} maxExtent - 最大的边界范围(一般是全球范围)。
  6023. * @param {Object} options - 可选选项参数。
  6024. * @param {float} [options.leftTolerance=0] - left 允许的误差。
  6025. * @param {float} [options.rightTolerance=0] - right 允许的误差。
  6026. * @returns {SuperMap.Bounds} 克隆当前边界。如果当前边界完全在最大范围之外此函数则返回一个不同值的边界,
  6027. * 若落在最大边界的左边,则给当前的bounds值加上最大范围的宽度,即向右移动,
  6028. * 若落在右边,则向左移动,即给当前的bounds值加上负的最大范围的宽度。
  6029. */
  6030. }, {
  6031. key: "wrapDateLine",
  6032. value: function wrapDateLine(maxExtent, options) {
  6033. options = options || {};
  6034. var leftTolerance = options.leftTolerance || 0;
  6035. var rightTolerance = options.rightTolerance || 0;
  6036. var newBounds = this.clone();
  6037. if (maxExtent) {
  6038. var width = maxExtent.getWidth(); //如果 newBounds 在 maxExtent 的左边,那么一直向右移动,直到相交或者包含为止,每次移动width
  6039. //shift right?
  6040. while (newBounds.left < maxExtent.left && newBounds.right - rightTolerance <= maxExtent.left) {
  6041. newBounds = newBounds.add(width, 0);
  6042. } //如果 newBounds 在 maxExtent 的右边,那么一直向左移动,直到相交或者包含为止,每次移动width
  6043. //shift left?
  6044. while (newBounds.left + leftTolerance >= maxExtent.right && newBounds.right > maxExtent.right) {
  6045. newBounds = newBounds.add(-width, 0);
  6046. } //如果和右边相交,左边又在内部,那么再次向左边移动一次
  6047. // crosses right only? force left
  6048. var newLeft = newBounds.left + leftTolerance;
  6049. if (newLeft < maxExtent.right && newLeft > maxExtent.left && newBounds.right - rightTolerance > maxExtent.right) {
  6050. newBounds = newBounds.add(-width, 0);
  6051. }
  6052. }
  6053. return newBounds;
  6054. }
  6055. /**
  6056. * @function SuperMap.Bounds.prototype.toServerJSONObject
  6057. * @description 转换成对应的 JSON 格式对象。
  6058. * @example
  6059. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  6060. * var obj = bounds.toServerJSONObject();
  6061. * @returns {Object} 返回 JSON 格式的 Object 对象。
  6062. */
  6063. }, {
  6064. key: "toServerJSONObject",
  6065. value: function toServerJSONObject() {
  6066. var jsonObject = {
  6067. rightTop: {
  6068. x: this.right,
  6069. y: this.top
  6070. },
  6071. leftBottom: {
  6072. x: this.left,
  6073. y: this.bottom
  6074. },
  6075. left: this.left,
  6076. right: this.right,
  6077. top: this.top,
  6078. bottom: this.bottom
  6079. };
  6080. return jsonObject;
  6081. }
  6082. /**
  6083. *
  6084. * @function SuperMap.Bounds.prototype.destroy
  6085. * @description 销毁此对象。
  6086. * 销毁后此对象的所有属性为 null,而不是初始值。
  6087. * @example
  6088. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  6089. * bounds.destroy();
  6090. */
  6091. }, {
  6092. key: "destroy",
  6093. value: function destroy() {
  6094. this.left = null;
  6095. this.right = null;
  6096. this.top = null;
  6097. this.bottom = null;
  6098. this.centerLonLat = null;
  6099. }
  6100. /**
  6101. * @function SuperMap.Bounds.fromString
  6102. * @description 通过字符串参数创建新的 bounds 的构造函数。
  6103. * @example
  6104. * var bounds = SuperMap.Bounds.fromString("-180,-90,100,80");
  6105. * @param {string} str - 边界字符串,用逗号隔开(e.g. <i>"5,42,10,45"</i>)。
  6106. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  6107. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  6108. * @returns {SuperMap.Bounds} 返回给定的字符串创建的新的边界对象。
  6109. */
  6110. }], [{
  6111. key: "fromString",
  6112. value: function fromString(str, reverseAxisOrder) {
  6113. var bounds = str.split(",");
  6114. return Bounds.fromArray(bounds, reverseAxisOrder);
  6115. }
  6116. /**
  6117. * @function SuperMap.Bounds.fromArray
  6118. * @description 通过边界框数组创建 Bounds。
  6119. * @example
  6120. * var bounds = SuperMap.Bounds.fromArray([-180,-90,100,80]);
  6121. * @param {Array.<float>} bbox - 边界值数组。(e.g. <i>[5,42,10,45]</i>)。
  6122. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  6123. * @returns {SuperMap.Bounds} 返回根据传入的数组创建的新的边界对象。
  6124. */
  6125. }, {
  6126. key: "fromArray",
  6127. value: function fromArray(bbox, reverseAxisOrder) {
  6128. return reverseAxisOrder === true ? new Bounds(bbox[1], bbox[0], bbox[3], bbox[2]) : new Bounds(bbox[0], bbox[1], bbox[2], bbox[3]);
  6129. }
  6130. /**
  6131. * @function SuperMap.Bounds.fromSize
  6132. * @description 通过传入的边界大小来创建新的边界。
  6133. * @example
  6134. * var bounds = SuperMap.Bounds.fromSize(new SuperMap.Size(20,10));
  6135. * @param {SuperMap.Size} size - 传入的边界大小。
  6136. * @returns {SuperMap.Bounds} 返回根据传入的边界大小的创建新的边界。
  6137. */
  6138. }, {
  6139. key: "fromSize",
  6140. value: function fromSize(size) {
  6141. return new Bounds(0, size.h, size.w, 0);
  6142. }
  6143. /**
  6144. * @function SuperMap.Bounds.oppositeQuadrant
  6145. * @description 反转象限。"t"和"b" 交换,"r"和"l"交换, 如:"tl"变为"br"。
  6146. * @param {string} quadrant - 代表象限的字符串,如:"tl"。
  6147. * @returns {string} 反转后的象限。
  6148. */
  6149. }, {
  6150. key: "oppositeQuadrant",
  6151. value: function oppositeQuadrant(quadrant) {
  6152. var opp = "";
  6153. opp += quadrant.charAt(0) === 't' ? 'b' : 't';
  6154. opp += quadrant.charAt(1) === 'l' ? 'r' : 'l';
  6155. return opp;
  6156. }
  6157. }]);
  6158. return Bounds;
  6159. }();
  6160. SuperMap.Bounds = Bounds_Bounds;
  6161. // CONCATENATED MODULE: ./src/common/commontypes/Geometry.js
  6162. function Geometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6163. 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); } }
  6164. function Geometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) Geometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) Geometry_defineProperties(Constructor, staticProps); return Constructor; }
  6165. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  6166. * This program are made available under the terms of the Apache License, Version 2.0
  6167. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6168. // import {WKT} from '../format/WKT';
  6169. // import {Vector} from './Vector';
  6170. /**
  6171. * @class SuperMap.Geometry
  6172. * @category BaseTypes Geometry
  6173. * @classdesc 几何对象类,描述地理对象的几何图形。
  6174. */
  6175. var Geometry_Geometry = /*#__PURE__*/function () {
  6176. function Geometry() {
  6177. Geometry_classCallCheck(this, Geometry);
  6178. this.CLASS_NAME = "SuperMap.Geometry";
  6179. /**
  6180. * @member {string} SuperMap.Geometry.prototype.id
  6181. * @description 此几何对象的唯一标示符。
  6182. *
  6183. */
  6184. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  6185. /**
  6186. * @member {SuperMap.Geometry} SuperMap.Geometry.prototype.parent
  6187. * @description This is set when a Geometry is added as component
  6188. * of another geometry
  6189. */
  6190. this.parent = null;
  6191. /**
  6192. * @member {SuperMap.Bounds} SuperMap.Geometry.prototype.bounds
  6193. * @description 几何对象的范围。
  6194. *
  6195. */
  6196. this.bounds = null;
  6197. /**
  6198. * @member {interger} SuperMap.Geometry.prototype.SRID
  6199. * @description 投影坐标参数。通过该参数,服务器判断 Geometry 对象的坐标参考系是否与数据集相同,如果不同,则在数据入库前进行投影变换。
  6200. * @example
  6201. * var geometry= new SuperMap.Geometry();
  6202. * geometry. SRID=4326;
  6203. *
  6204. */
  6205. this.SRID = null;
  6206. }
  6207. /**
  6208. * @function SuperMap.Geometry.prototype.destroy
  6209. * @description 解构 Geometry 类,释放资源。
  6210. */
  6211. Geometry_createClass(Geometry, [{
  6212. key: "destroy",
  6213. value: function destroy() {
  6214. this.id = null;
  6215. this.bounds = null;
  6216. this.SRID = null;
  6217. }
  6218. /**
  6219. * @function SuperMap.Geometry.prototype.clone
  6220. * @description 创建克隆的几何图形。克隆的几何图形不设置非标准的属性。
  6221. * @returns {SuperMap.Geometry} 克隆的几何图形。
  6222. */
  6223. }, {
  6224. key: "clone",
  6225. value: function clone() {
  6226. return new Geometry();
  6227. }
  6228. /**
  6229. * @function SuperMap.Geometry.prototype.setBounds
  6230. * @description 设置此几何对象的 bounds。
  6231. * @param {SuperMap.Bounds} bounds - 范围。
  6232. */
  6233. }, {
  6234. key: "setBounds",
  6235. value: function setBounds(bounds) {
  6236. if (bounds) {
  6237. this.bounds = bounds.clone();
  6238. }
  6239. }
  6240. /**
  6241. * @function SuperMap.Geometry.prototype.clearBounds
  6242. * @description 清除几何对象的 bounds。
  6243. * 如果该对象有父类,也会清除父类几何对象的 bounds。
  6244. */
  6245. }, {
  6246. key: "clearBounds",
  6247. value: function clearBounds() {
  6248. this.bounds = null;
  6249. if (this.parent) {
  6250. this.parent.clearBounds();
  6251. }
  6252. }
  6253. /**
  6254. * @function SuperMap.Geometry.prototype.extendBounds
  6255. * @description Extend the existing bounds to include the new bounds.
  6256. * If geometry's bounds is not yet set, then set a new Bounds.
  6257. *
  6258. * @param {SuperMap.Bounds} newBounds - 范围。
  6259. */
  6260. }, {
  6261. key: "extendBounds",
  6262. value: function extendBounds(newBounds) {
  6263. var bounds = this.getBounds();
  6264. if (!bounds) {
  6265. this.setBounds(newBounds);
  6266. } else {
  6267. this.bounds.extend(newBounds);
  6268. }
  6269. }
  6270. /**
  6271. * @function SuperMap.Geometry.prototype.getBounds
  6272. * @description 获得几何图形的边界。如果没有设置边界,可通过计算获得。
  6273. * @returns {SuperMap.Bounds} 返回的几何对象的边界。
  6274. */
  6275. }, {
  6276. key: "getBounds",
  6277. value: function getBounds() {
  6278. if (this.bounds == null) {
  6279. this.calculateBounds();
  6280. }
  6281. return this.bounds;
  6282. }
  6283. /**
  6284. * @function SuperMap.Geometry.prototype.calculateBounds
  6285. * @description 重新计算几何图形的边界(需要在子类中实现此方法)。
  6286. */
  6287. }, {
  6288. key: "calculateBounds",
  6289. value: function calculateBounds() {//
  6290. // This should be overridden by subclasses.
  6291. //
  6292. }
  6293. /**
  6294. * @function SuperMap.Geometry.prototype.getVertices
  6295. * @description 返回几何图形的所有顶点的列表(需要在子类中实现此方法)。
  6296. * @param {boolean} [nodes] - 如果是 true,线则只返回线的末端点,如果 false,仅仅返回顶点,如果没有设置,则返回顶点。
  6297. * @returns {Array} 几何图形的顶点列表。
  6298. */
  6299. }, {
  6300. key: "getVertices",
  6301. value: function getVertices(nodes) {// eslint-disable-line no-unused-vars
  6302. }
  6303. /**
  6304. * @function SuperMap.Geometry.prototype.getArea
  6305. * @description 计算几何对象的面积 ,此方法需要在子类中定义。
  6306. * @returns {float} The area of the collection by summing its parts
  6307. */
  6308. }, {
  6309. key: "getArea",
  6310. value: function getArea() {
  6311. //to be overridden by geometries that actually have an area
  6312. //
  6313. return 0.0;
  6314. } // /**
  6315. // * @function SuperMap.Geometry.prototype.toString
  6316. // * @description 返回geometry对象的字符串表述,需要引入{@link SuperMap.Format.WKT}。此方法只能在子类实现,在父类使用会报错。
  6317. // * @returns {string} geometry对象的字符串表述(Well-Known Text)
  6318. // */
  6319. // toString() {
  6320. // var string;
  6321. // if (WKT) {
  6322. // var wkt = new WKT();
  6323. // string = wkt.write(new Vector(this));
  6324. // } else {
  6325. // string = Object.prototype.toString.call(this);
  6326. // }
  6327. // return string;
  6328. // }
  6329. }]);
  6330. return Geometry;
  6331. }();
  6332. SuperMap.Geometry = Geometry_Geometry;
  6333. // CONCATENATED MODULE: ./src/common/commontypes/geometry/Collection.js
  6334. 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); }
  6335. function Collection_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6336. 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); } }
  6337. function Collection_createClass(Constructor, protoProps, staticProps) { if (protoProps) Collection_defineProperties(Constructor.prototype, protoProps); if (staticProps) Collection_defineProperties(Constructor, staticProps); return Constructor; }
  6338. 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); }
  6339. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
  6340. 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); }
  6341. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6342. 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); }; }
  6343. function _possibleConstructorReturn(self, call) { if (call && (Collection_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6344. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6345. 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; } }
  6346. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6347. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  6348. * This program are made available under the terms of the Apache License, Version 2.0
  6349. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6350. /**
  6351. * @class SuperMap.Geometry.Collection
  6352. * @classdesc 几何对象集合类,存储在本地的 components 属性中(可作为参数传递给构造函数)。<br>
  6353. * 随着新的几何图形添加到集合中,将不能被克隆,当移动几何图形时,需要指定参照物。<br>
  6354. * getArea 和 getLength 函数只能通过遍历存储几何对象的 components 数组,总计所有几何图形的面积和长度。
  6355. * @category BaseTypes Geometry
  6356. * @extends {SuperMap.Geometry}
  6357. * @param {Array.<SuperMap.Geometry>} components - 几何对象数组。
  6358. * @example
  6359. * var point1 = new SuperMap.Geometry.Point(10,20);
  6360. * var point2 = new SuperMap.Geometry.Point(30,40);
  6361. * var col = new SuperMap.Geometry.Collection([point1,point2]);
  6362. */
  6363. var Collection_Collection = /*#__PURE__*/function (_Geometry) {
  6364. _inherits(Collection, _Geometry);
  6365. var _super = _createSuper(Collection);
  6366. function Collection(components) {
  6367. var _this;
  6368. Collection_classCallCheck(this, Collection);
  6369. _this = _super.call(this);
  6370. /**
  6371. * @description 存储几何对象的数组。
  6372. * @member {Array.<SuperMap.Geometry>} SuperMap.Geometry.Collection.prototype.components
  6373. */
  6374. _this.components = [];
  6375. /**
  6376. * @member {Array.<string>} SuperMap.Geometry.Collection.prototype.componentTypes
  6377. * @description components 存储的的几何对象所支持的几何类型数组,为空表示类型不受限制。
  6378. */
  6379. _this.componentTypes = null;
  6380. if (components != null) {
  6381. _this.addComponents(components);
  6382. }
  6383. _this.CLASS_NAME = "SuperMap.Geometry.Collection";
  6384. _this.geometryType = "Collection";
  6385. return _this;
  6386. }
  6387. /**
  6388. * @function SuperMap.Geometry.Collection.prototype.destroy
  6389. * @description 销毁几何图形。
  6390. */
  6391. Collection_createClass(Collection, [{
  6392. key: "destroy",
  6393. value: function destroy() {
  6394. this.components.length = 0;
  6395. this.components = null;
  6396. _get(_getPrototypeOf(Collection.prototype), "destroy", this).call(this);
  6397. }
  6398. /**
  6399. * @function SuperMap.Geometry.Collection.prototype.clone
  6400. * @description 克隆当前几何对象。
  6401. * @returns {SuperMap.Geometry.Collection} 克隆的几何对象集合。
  6402. */
  6403. }, {
  6404. key: "clone",
  6405. value: function clone() {
  6406. var geometry = new Collection();
  6407. for (var i = 0, len = this.components.length; i < len; i++) {
  6408. geometry.addComponent(this.components[i].clone());
  6409. } // catch any randomly tagged-on properties
  6410. Util_Util.applyDefaults(geometry, this);
  6411. return geometry;
  6412. }
  6413. /**
  6414. * @function SuperMap.Geometry.Collection.prototype.getComponentsString
  6415. * @description 获取 components 字符串。
  6416. * @returns {string} components 字符串。
  6417. */
  6418. }, {
  6419. key: "getComponentsString",
  6420. value: function getComponentsString() {
  6421. var strings = [];
  6422. for (var i = 0, len = this.components.length; i < len; i++) {
  6423. strings.push(this.components[i].toShortString());
  6424. }
  6425. return strings.join(",");
  6426. }
  6427. /**
  6428. * @function SuperMap.Geometry.Collection.prototype.calculateBounds
  6429. * @description 通过遍历数组重新计算边界,在遍历每一子项中时调用 extend 方法。
  6430. */
  6431. }, {
  6432. key: "calculateBounds",
  6433. value: function calculateBounds() {
  6434. this.bounds = null;
  6435. var bounds = new Bounds_Bounds();
  6436. var components = this.components;
  6437. if (components) {
  6438. for (var i = 0, len = components.length; i < len; i++) {
  6439. bounds.extend(components[i].getBounds());
  6440. }
  6441. } // to preserve old behavior, we only set bounds if non-null
  6442. // in the future, we could add bounds.isEmpty()
  6443. if (bounds.left != null && bounds.bottom != null && bounds.right != null && bounds.top != null) {
  6444. this.setBounds(bounds);
  6445. }
  6446. }
  6447. /**
  6448. * @function SuperMap.Geometry.Collection.prototype.addComponents
  6449. * @description 给几何图形对象添加元素。
  6450. * @param {Array.<SuperMap.Geometry>} components - 几何对象组件。
  6451. * @example
  6452. * var collection = new SuperMap.Geometry.Collection();
  6453. * collection.addComponents(new SuerpMap.Geometry.Point(10,10));
  6454. */
  6455. }, {
  6456. key: "addComponents",
  6457. value: function addComponents(components) {
  6458. if (!Util_Util.isArray(components)) {
  6459. components = [components];
  6460. }
  6461. for (var i = 0, len = components.length; i < len; i++) {
  6462. this.addComponent(components[i]);
  6463. }
  6464. }
  6465. /**
  6466. * @function SuperMap.Geometry.Collection.prototype.addComponent
  6467. * @description 添加一个几何对象到集合中。如果设置了 componentTypes 类型,则添加的几何对象必须是 componentTypes 中的类型。
  6468. * @param {SuperMap.Geometry} component - 待添加的几何对象。
  6469. * @param {int} [index] - 几何对象插入的位置。
  6470. * @returns {boolean} 是否添加成功。
  6471. */
  6472. }, {
  6473. key: "addComponent",
  6474. value: function addComponent(component, index) {
  6475. var added = false;
  6476. if (component) {
  6477. if (this.componentTypes == null || Util_Util.indexOf(this.componentTypes, component.CLASS_NAME) > -1) {
  6478. if (index != null && index < this.components.length) {
  6479. var components1 = this.components.slice(0, index);
  6480. var components2 = this.components.slice(index, this.components.length);
  6481. components1.push(component);
  6482. this.components = components1.concat(components2);
  6483. } else {
  6484. this.components.push(component);
  6485. }
  6486. component.parent = this;
  6487. this.clearBounds();
  6488. added = true;
  6489. }
  6490. }
  6491. return added;
  6492. }
  6493. /**
  6494. * @function SuperMap.Geometry.Collection.prototype.removeComponents
  6495. * @description 清除几何对象。
  6496. * @param {Array.<SuperMap.Geometry>} components - 需要清除的几何对象。
  6497. * @returns {boolean} 元素是否被删除。
  6498. */
  6499. }, {
  6500. key: "removeComponents",
  6501. value: function removeComponents(components) {
  6502. var removed = false;
  6503. if (!Util_Util.isArray(components)) {
  6504. components = [components];
  6505. }
  6506. for (var i = components.length - 1; i >= 0; --i) {
  6507. removed = this.removeComponent(components[i]) || removed;
  6508. }
  6509. return removed;
  6510. }
  6511. /**
  6512. * @function SuperMap.Geometry.Collection.prototype.removeComponent
  6513. * @description 从集合中移除一个几何对象。
  6514. * @param {SuperMap.Geometry} component - 要移除的几何对象。
  6515. * @returns {boolean} 几何对象是否移除成功。
  6516. */
  6517. }, {
  6518. key: "removeComponent",
  6519. value: function removeComponent(component) {
  6520. Util_Util.removeItem(this.components, component); // clearBounds() so that it gets recalculated on the next call
  6521. // to this.getBounds();
  6522. this.clearBounds();
  6523. return true;
  6524. }
  6525. /**
  6526. * @function SuperMap.Geometry.Collection.prototype.getArea
  6527. * @description 计算几何对象的面积。注意,这个方法在 {@link SuperMap.Geometry.Polygon} 类中需要重写。
  6528. * @returns {number} 几何图形的面积,是几何对象中所有组成部分的面积之和。
  6529. */
  6530. }, {
  6531. key: "getArea",
  6532. value: function getArea() {
  6533. var area = 0.0;
  6534. for (var i = 0, len = this.components.length; i < len; i++) {
  6535. area += this.components[i].getArea();
  6536. }
  6537. return area;
  6538. }
  6539. /**
  6540. * @function SuperMap.Geometry.Collection.prototype.equals
  6541. * @description 判断两个几何图形是否相等。如果所有的 components 具有相同的坐标,则认为是相等的。
  6542. * @param {SuperMap.Geometry} geometry - 需要判断的几何图形。
  6543. * @returns {boolean} 输入的几何图形与当前几何图形是否相等。
  6544. */
  6545. }, {
  6546. key: "equals",
  6547. value: function equals(geometry) {
  6548. var equivalent = true;
  6549. if (!geometry || !geometry.CLASS_NAME || this.CLASS_NAME !== geometry.CLASS_NAME) {
  6550. equivalent = false;
  6551. } else if (!Util_Util.isArray(geometry.components) || geometry.components.length !== this.components.length) {
  6552. equivalent = false;
  6553. } else {
  6554. for (var i = 0, len = this.components.length; i < len; ++i) {
  6555. if (!this.components[i].equals(geometry.components[i])) {
  6556. equivalent = false;
  6557. break;
  6558. }
  6559. }
  6560. }
  6561. return equivalent;
  6562. }
  6563. /**
  6564. * @function SuperMap.Geometry.Collection.prototype.getVertices
  6565. * @description 返回几何对象的所有结点的列表。
  6566. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点如果没有设置此参数,则返回所有顶点。
  6567. * @returns {Array} 几何对象的顶点列表。
  6568. */
  6569. }, {
  6570. key: "getVertices",
  6571. value: function getVertices(nodes) {
  6572. var vertices = [];
  6573. for (var i = 0, len = this.components.length; i < len; ++i) {
  6574. Array.prototype.push.apply(vertices, this.components[i].getVertices(nodes));
  6575. }
  6576. return vertices;
  6577. }
  6578. }]);
  6579. return Collection;
  6580. }(Geometry_Geometry);
  6581. SuperMap.Geometry.Collection = Collection_Collection;
  6582. // CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPoint.js
  6583. 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); }
  6584. function MultiPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6585. 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); } }
  6586. function MultiPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) MultiPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) MultiPoint_defineProperties(Constructor, staticProps); return Constructor; }
  6587. 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); }
  6588. function MultiPoint_setPrototypeOf(o, p) { MultiPoint_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPoint_setPrototypeOf(o, p); }
  6589. 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); }; }
  6590. function MultiPoint_possibleConstructorReturn(self, call) { if (call && (MultiPoint_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiPoint_assertThisInitialized(self); }
  6591. function MultiPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6592. 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; } }
  6593. function MultiPoint_getPrototypeOf(o) { MultiPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPoint_getPrototypeOf(o); }
  6594. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  6595. * This program are made available under the terms of the Apache License, Version 2.0
  6596. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6597. /**
  6598. * @class SuperMap.Geometry.MultiPoint
  6599. * @classdesc 几何对象多点类。
  6600. * @category BaseTypes Geometry
  6601. * @extends {SuperMap.Geometry.Collection}
  6602. * @param {Array.<SuperMap.Geometry.Point>} components - 点对象数组。
  6603. * @example
  6604. * var point1 = new SuperMap.Geometry.Point(5,6);
  6605. * var poine2 = new SuperMap.Geometry.Point(7,8);
  6606. * var multiPoint = new SuperMap.Geometry.MultiPoint([point1,point2]);
  6607. */
  6608. var MultiPoint = /*#__PURE__*/function (_Collection) {
  6609. MultiPoint_inherits(MultiPoint, _Collection);
  6610. var _super = MultiPoint_createSuper(MultiPoint);
  6611. function MultiPoint(components) {
  6612. var _this;
  6613. MultiPoint_classCallCheck(this, MultiPoint);
  6614. _this = _super.call(this, components);
  6615. /**
  6616. * @member {Array.<string>} [SuperMap.Geometry.MultiPoint.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  6617. * @description components 存储的的几何对象所支持的几何类型数组。
  6618. * @readonly
  6619. */
  6620. _this.componentTypes = ["SuperMap.Geometry.Point"];
  6621. _this.CLASS_NAME = "SuperMap.Geometry.MultiPoint";
  6622. _this.geometryType = "MultiPoint";
  6623. return _this;
  6624. }
  6625. /**
  6626. * @function SuperMap.Geometry.MultiPoint.prototype.addPoint
  6627. * @description 添加点,封装了 {@link SuperMap.Geometry.Collection|SuperMap.Geometry.Collection.addComponent} 方法。
  6628. * @param {SuperMap.Geometry.Point} point - 添加的点。
  6629. * @param {integer} [index] - 下标。
  6630. */
  6631. MultiPoint_createClass(MultiPoint, [{
  6632. key: "addPoint",
  6633. value: function addPoint(point, index) {
  6634. this.addComponent(point, index);
  6635. }
  6636. /**
  6637. * @function SuperMap.Geometry.MultiPoint.prototype.removePoint
  6638. * @description 移除点,封装了 {@link SuperMap.Geometry.Collection|SuperMap.Geometry.Collection.removeComponent} 方法。
  6639. * @param {SuperMap.Geometry.Point} point - 移除的点对象。
  6640. */
  6641. }, {
  6642. key: "removePoint",
  6643. value: function removePoint(point) {
  6644. this.removeComponent(point);
  6645. }
  6646. }]);
  6647. return MultiPoint;
  6648. }(Collection_Collection);
  6649. SuperMap.Geometry.MultiPoint = MultiPoint;
  6650. // CONCATENATED MODULE: ./src/common/commontypes/geometry/Curve.js
  6651. 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); }
  6652. function Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6653. 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); }
  6654. function Curve_setPrototypeOf(o, p) { Curve_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Curve_setPrototypeOf(o, p); }
  6655. 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); }; }
  6656. function Curve_possibleConstructorReturn(self, call) { if (call && (Curve_typeof(call) === "object" || typeof call === "function")) { return call; } return Curve_assertThisInitialized(self); }
  6657. function Curve_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6658. 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; } }
  6659. function Curve_getPrototypeOf(o) { Curve_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Curve_getPrototypeOf(o); }
  6660. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  6661. * This program are made available under the terms of the Apache License, Version 2.0
  6662. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6663. /**
  6664. * @class SuperMap.Geometry.Curve
  6665. * @classdesc 几何对象曲线类。
  6666. * @category BaseTypes Geometry
  6667. * @extends {SuperMap.Geometry.MultiPoint}
  6668. * @param {Array.<SuperMap.Geometry.Point>} components - 几何对象数组。
  6669. * @example
  6670. * var point1 = new SuperMap.Geometry.Point(10,20);
  6671. * var point2 = new SuperMap.Geometry.Point(30,40);
  6672. * var curve = new SuperMap.Geometry.Curve([point1,point2]);
  6673. */
  6674. var Curve_Curve = /*#__PURE__*/function (_MultiPoint) {
  6675. Curve_inherits(Curve, _MultiPoint);
  6676. var _super = Curve_createSuper(Curve);
  6677. function Curve(components) {
  6678. var _this;
  6679. Curve_classCallCheck(this, Curve);
  6680. _this = _super.call(this, components);
  6681. /**
  6682. * @member {Array.<string>} [SuperMap.Geometry.Curve.prototype.componentType=["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"]]
  6683. * @description components 存储的的几何对象所支持的几何类型数组。
  6684. * @readonly
  6685. */
  6686. _this.componentTypes = ["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"];
  6687. _this.CLASS_NAME = "SuperMap.Geometry.Curve";
  6688. _this.geometryType = "Curve";
  6689. return _this;
  6690. }
  6691. return Curve;
  6692. }(MultiPoint);
  6693. SuperMap.Geometry.Curve = Curve_Curve;
  6694. // CONCATENATED MODULE: ./src/common/commontypes/geometry/Point.js
  6695. 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); }
  6696. function Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6697. 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); } }
  6698. function Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) Point_defineProperties(Constructor, staticProps); return Constructor; }
  6699. 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); }
  6700. function Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Point_getPrototypeOf(object); if (object === null) break; } return object; }
  6701. 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); }
  6702. function Point_setPrototypeOf(o, p) { Point_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Point_setPrototypeOf(o, p); }
  6703. 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); }; }
  6704. function Point_possibleConstructorReturn(self, call) { if (call && (Point_typeof(call) === "object" || typeof call === "function")) { return call; } return Point_assertThisInitialized(self); }
  6705. function Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6706. 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; } }
  6707. function Point_getPrototypeOf(o) { Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Point_getPrototypeOf(o); }
  6708. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  6709. * This program are made available under the terms of the Apache License, Version 2.0
  6710. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6711. /**
  6712. * @class SuperMap.Geometry.Point
  6713. * @classdesc 点几何对象类。
  6714. * @category BaseTypes Geometry
  6715. * @extends {SuperMap.Geometry}
  6716. * @param {float} x - x 坐标。
  6717. * @param {float} y - y 坐标。
  6718. * @param {string} [type = 'Point'] - 用来存储点的类型。
  6719. * @param {float} [tag] - 用来存储额外的属性,比如差值分析中的 Z 值。
  6720. * @example
  6721. * var point = new SuperMap.Geometry.Point(-111.04, 45.68);
  6722. */
  6723. var Point_Point = /*#__PURE__*/function (_Geometry) {
  6724. Point_inherits(Point, _Geometry);
  6725. var _super = Point_createSuper(Point);
  6726. function Point(x, y, type, tag) {
  6727. var _this;
  6728. Point_classCallCheck(this, Point);
  6729. _this = _super.call(this, x, y, type, tag);
  6730. /**
  6731. * @member {float} SuperMap.Geometry.Point.prototype.x
  6732. * @description 横坐标。
  6733. */
  6734. _this.x = parseFloat(x);
  6735. /**
  6736. * @member {float} SuperMap.Geometry.Point.prototype.y
  6737. * @description 纵坐标。
  6738. */
  6739. _this.y = parseFloat(y);
  6740. /**
  6741. * @member {string} SuperMap.Geometry.Point.prototype.tag
  6742. * @description 用来存储额外的属性,比如差值分析中的 Z 值。
  6743. */
  6744. _this.tag = tag || tag == 0 ? parseFloat(tag) : null;
  6745. /**
  6746. * @member {string} SuperMap.Geometry.Point.prototype.tag
  6747. * @description 用来存储点的类型
  6748. */
  6749. _this.type = type || "Point";
  6750. _this.CLASS_NAME = "SuperMap.Geometry.Point";
  6751. _this.geometryType = "Point";
  6752. return _this;
  6753. }
  6754. /**
  6755. * @function SuperMap.Geometry.Point.prototype.clone
  6756. * @description 克隆点对象。
  6757. * @returns {SuperMap.Geometry.Point} 克隆后的点对象。
  6758. */
  6759. Point_createClass(Point, [{
  6760. key: "clone",
  6761. value: function clone(obj) {
  6762. if (obj == null) {
  6763. obj = new Point(this.x, this.y);
  6764. } // catch any randomly tagged-on properties
  6765. Util_Util.applyDefaults(obj, this);
  6766. return obj;
  6767. }
  6768. /**
  6769. * @function SuperMap.Geometry.Point.prototype.calculateBounds
  6770. * @description 计算点对象的范围。
  6771. */
  6772. }, {
  6773. key: "calculateBounds",
  6774. value: function calculateBounds() {
  6775. this.bounds = new Bounds_Bounds(this.x, this.y, this.x, this.y);
  6776. }
  6777. /**
  6778. * @function SuperMap.Geometry.Point.prototype.equals
  6779. * @description 判断两个点对象是否相等。如果两个点对象具有相同的坐标,则认为是相等的。
  6780. * @example
  6781. * var point= new SuperMap.Geometry.Point(0,0);
  6782. * var point1={x:0,y:0};
  6783. * var result= point.equals(point1);
  6784. * @param {SuperMap.Geometry.Point} geom - 需要判断的点对象。
  6785. * @returns {boolean} 两个点对象是否相等(true 为相等,false 为不等)。
  6786. */
  6787. }, {
  6788. key: "equals",
  6789. value: function equals(geom) {
  6790. var equals = false;
  6791. if (geom != null) {
  6792. equals = this.x === geom.x && this.y === geom.y || isNaN(this.x) && isNaN(this.y) && isNaN(geom.x) && isNaN(geom.y);
  6793. }
  6794. return equals;
  6795. }
  6796. /**
  6797. * @function SuperMap.Geometry.Point.prototype.move
  6798. * @description 沿着 x、y 轴的正方向上按照给定的位移移动点对象,move 不仅改变了几何对象的位置并且清理了边界缓存。
  6799. * @param {float} x - x 轴正方向上的偏移量。
  6800. * @param {float} y - y 轴正方向上偏移量。
  6801. */
  6802. }, {
  6803. key: "move",
  6804. value: function move(x, y) {
  6805. this.x = this.x + x;
  6806. this.y = this.y + y;
  6807. this.clearBounds();
  6808. }
  6809. /**
  6810. * @function SuperMap.Geometry.Point.prototype.toShortString
  6811. * @returns {string} 字符串代表点对象。(ex. <i>"5, 42"</i>)
  6812. */
  6813. }, {
  6814. key: "toShortString",
  6815. value: function toShortString() {
  6816. return this.x + ", " + this.y;
  6817. }
  6818. /**
  6819. * @function SuperMap.Geometry.Point.prototype.destroy
  6820. * @description 释放点对象的资源。
  6821. */
  6822. }, {
  6823. key: "destroy",
  6824. value: function destroy() {
  6825. this.x = null;
  6826. this.y = null;
  6827. this.tag = null;
  6828. Point_get(Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  6829. }
  6830. /**
  6831. * @function SuperMap.Geometry.Point.prototype.getVertices
  6832. * @description 返回点对象的所有顶点的列表。
  6833. * @param {boolean} [nodes] - 对于点对象此参数不起作用,直接返回点。
  6834. * @returns {Array} 几何图形的顶点列表。
  6835. */
  6836. }, {
  6837. key: "getVertices",
  6838. value: function getVertices(nodes) {
  6839. // eslint-disable-line no-unused-vars
  6840. return [this];
  6841. }
  6842. }]);
  6843. return Point;
  6844. }(Geometry_Geometry);
  6845. SuperMap.Geometry.Point = Point_Point;
  6846. // CONCATENATED MODULE: ./src/common/commontypes/geometry/LineString.js
  6847. 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); }
  6848. function LineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6849. 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); } }
  6850. function LineString_createClass(Constructor, protoProps, staticProps) { if (protoProps) LineString_defineProperties(Constructor.prototype, protoProps); if (staticProps) LineString_defineProperties(Constructor, staticProps); return Constructor; }
  6851. 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); }
  6852. function LineString_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LineString_getPrototypeOf(object); if (object === null) break; } return object; }
  6853. 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); }
  6854. function LineString_setPrototypeOf(o, p) { LineString_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LineString_setPrototypeOf(o, p); }
  6855. 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); }; }
  6856. function LineString_possibleConstructorReturn(self, call) { if (call && (LineString_typeof(call) === "object" || typeof call === "function")) { return call; } return LineString_assertThisInitialized(self); }
  6857. function LineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6858. 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; } }
  6859. function LineString_getPrototypeOf(o) { LineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LineString_getPrototypeOf(o); }
  6860. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  6861. * This program are made available under the terms of the Apache License, Version 2.0
  6862. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6863. /**
  6864. * @class SuperMap.Geometry.LineString
  6865. * @classdesc 几何对象线串类。
  6866. * @category BaseTypes Geometry
  6867. * @param {Array.<SuperMap.Geometry.Point>} points - 用来生成线串的点数组。
  6868. * @extends {SuperMap.Geometry.Curve}
  6869. * @example
  6870. * var points = [new SuperMap.Geometry.Point(4933.319287022352, -3337.3849141502124),
  6871. * new SuperMap.Geometry.Point(4960.9674060199022, -3349.3316322355736),
  6872. * new SuperMap.Geometry.Point(5006.0235999418364, -3358.8890067038628),
  6873. * new SuperMap.Geometry.Point(5075.3145648369318, -3378.0037556404409),
  6874. * new SuperMap.Geometry.Point(5305.19551436013, -3376.9669111768926)],
  6875. * var roadLine = new SuperMap.Geometry.LineString(points);
  6876. */
  6877. var LineString_LineString = /*#__PURE__*/function (_Curve) {
  6878. LineString_inherits(LineString, _Curve);
  6879. var _super = LineString_createSuper(LineString);
  6880. function LineString(points) {
  6881. var _this;
  6882. LineString_classCallCheck(this, LineString);
  6883. _this = _super.call(this, points);
  6884. _this.CLASS_NAME = "SuperMap.Geometry.LineString";
  6885. _this.geometryType = "LineString";
  6886. return _this;
  6887. }
  6888. /**
  6889. * @function SuperMap.Geometry.LineString.prototype.removeComponent
  6890. * @description 只有在线串上有三个或更多的点的时候,才会允许移除点(否则结果将会是单一的点)。
  6891. * @param {SuperMap.Geometry.Point} point - 将被删除的点。
  6892. * @returns {boolean} 删除的点。
  6893. */
  6894. LineString_createClass(LineString, [{
  6895. key: "removeComponent",
  6896. value: function removeComponent(point) {
  6897. // eslint-disable-line no-unused-vars
  6898. var removed = this.components && this.components.length > 2;
  6899. if (removed) {
  6900. LineString_get(LineString_getPrototypeOf(LineString.prototype), "removeComponent", this).apply(this, arguments);
  6901. }
  6902. return removed;
  6903. }
  6904. /**
  6905. * @function SuperMap.Geometry.LineString.prototype.getSortedSegments
  6906. * @returns {Array} An array of segment objects. Segment objects have properties
  6907. * x1, y1, x2, and y2. The start point is represented by x1 and y1.
  6908. * The end point is represented by x2 and y2. Start and end are
  6909. * ordered so that x1 < x2.
  6910. */
  6911. }, {
  6912. key: "getSortedSegments",
  6913. value: function getSortedSegments() {
  6914. var numSeg = this.components.length - 1;
  6915. var segments = new Array(numSeg),
  6916. point1,
  6917. point2;
  6918. for (var i = 0; i < numSeg; ++i) {
  6919. point1 = this.components[i];
  6920. point2 = this.components[i + 1];
  6921. if (point1.x < point2.x) {
  6922. segments[i] = {
  6923. x1: point1.x,
  6924. y1: point1.y,
  6925. x2: point2.x,
  6926. y2: point2.y
  6927. };
  6928. } else {
  6929. segments[i] = {
  6930. x1: point2.x,
  6931. y1: point2.y,
  6932. x2: point1.x,
  6933. y2: point1.y
  6934. };
  6935. }
  6936. } // more efficient to define this somewhere static
  6937. function byX1(seg1, seg2) {
  6938. return seg1.x1 - seg2.x1;
  6939. }
  6940. return segments.sort(byX1);
  6941. }
  6942. /**
  6943. * @function SuperMap.Geometry.LineString.prototype.getVertices
  6944. * @description 返回几何图形的所有顶点的列表。
  6945. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点。如果没有设置此参数,则返回所有顶点。
  6946. * @returns {Array} 几何图形的顶点列表。
  6947. */
  6948. }, {
  6949. key: "getVertices",
  6950. value: function getVertices(nodes) {
  6951. var vertices;
  6952. if (nodes === true) {
  6953. vertices = [this.components[0], this.components[this.components.length - 1]];
  6954. } else if (nodes === false) {
  6955. vertices = this.components.slice(1, this.components.length - 1);
  6956. } else {
  6957. vertices = this.components.slice();
  6958. }
  6959. return vertices;
  6960. }
  6961. /**
  6962. * @function SuperMap.Geometry.LineString.calculateCircle
  6963. * @description 三点画圆弧。
  6964. * @param {Array.<SuperMap.Geometry.Point>} points - 传入的待计算的初始点串。
  6965. * @returns {Array.<SuperMap.Geometry.Point>} 计算出相应的圆弧控制点。
  6966. * @example
  6967. * var points = [];
  6968. * points.push(new SuperMap.Geometry.Point(-50,30));
  6969. * points.push(new SuperMap.Geometry.Point(-30,50));
  6970. * points.push(new SuperMap.Geometry.Point(2,60));
  6971. * var circle = SuperMap.Geometry.LineString.calculateCircle(points);
  6972. */
  6973. }], [{
  6974. key: "calculateCircle",
  6975. value: function calculateCircle(points) {
  6976. if (points.length < 3) {
  6977. return points;
  6978. }
  6979. var centerPoint = {},
  6980. p1 = points[0],
  6981. p2 = points[1],
  6982. p3 = points[2];
  6983. var R = 0,
  6984. dStep = 0,
  6985. direc = true,
  6986. dRotation = 0,
  6987. dRotationBegin = 0,
  6988. dRotationAngle = 0,
  6989. nSegmentCount = 72,
  6990. circlePoints = [];
  6991. var KTan13 = (p3.y - p1.y) / (p3.x - p1.x);
  6992. var B13 = p3.y - KTan13 * p3.x;
  6993. 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) {
  6994. circlePoints.push(p1);
  6995. circlePoints.push(p2);
  6996. circlePoints.push(p3);
  6997. } else {
  6998. 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));
  6999. 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));
  7000. var F = 4 * ((p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y));
  7001. centerPoint.x = D / F;
  7002. centerPoint.y = E / F;
  7003. R = Math.sqrt((p1.x - centerPoint.x) * (p1.x - centerPoint.x) + (p1.y - centerPoint.y) * (p1.y - centerPoint.y));
  7004. var dis = (p1.x - p3.x) * (p1.x - p3.x) + (p1.y - p3.y) * (p1.y - p3.y);
  7005. var cons = (2 * R * R - dis) / (2 * R * R);
  7006. cons = cons >= 1 ? 1 : cons;
  7007. cons = cons <= -1 ? -1 : cons;
  7008. dRotationAngle = Math.acos(cons) * 180 / Math.PI;
  7009. if (p3.x == p1.x) {
  7010. dRotationAngle = centerPoint.x > p1.x && p2.x > p1.x || centerPoint.x < p1.x && p2.x < p1.x ? 360 - dRotationAngle : dRotationAngle;
  7011. } else {
  7012. 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;
  7013. }
  7014. dStep = dRotationAngle / 72;
  7015. if (p3.y != p1.y) {
  7016. if (p3.x == p1.x) {
  7017. if (p3.y > p1.y) {
  7018. if (p2.x < p1.x) {
  7019. direc = false;
  7020. }
  7021. } else {
  7022. if (p2.x > p1.x) {
  7023. direc = false;
  7024. }
  7025. }
  7026. } else if (p3.x < p1.x) {
  7027. if (p2.y < KTan13 * p2.x + B13) {
  7028. direc = false;
  7029. }
  7030. } else {
  7031. if (p2.y > KTan13 * p2.x + B13) {
  7032. direc = false;
  7033. }
  7034. }
  7035. } else {
  7036. if (p3.x > p1.x) {
  7037. if (p2.y > p1.y) {
  7038. direc = false;
  7039. }
  7040. } else {
  7041. if (p2.y < p1.y) {
  7042. direc = false;
  7043. }
  7044. }
  7045. }
  7046. var K10 = (p1.y - centerPoint.y) / (p1.x - centerPoint.x);
  7047. var atan10 = K10 >= 0 ? Math.atan(K10) * 180 / Math.PI : Math.abs(Math.atan(K10) * 180 / Math.PI) + 90;
  7048. var CY = Math.abs(centerPoint.y);
  7049. if (p1.y == CY && CY == p3.y) {
  7050. if (p1.x < p3.x) {
  7051. atan10 = atan10 + 180;
  7052. }
  7053. }
  7054. var newPY = p1.y - centerPoint.y;
  7055. circlePoints.push(p1);
  7056. for (var i = 1; i < nSegmentCount; i++) {
  7057. dRotation = dStep * i;
  7058. dRotationBegin = atan10;
  7059. if (direc) {
  7060. if (newPY >= 0) {
  7061. if (K10 >= 0) {
  7062. dRotationBegin = dRotationBegin + dRotation;
  7063. } else {
  7064. dRotationBegin = 180 - (dRotationBegin - 90) + dRotation;
  7065. }
  7066. } else {
  7067. if (K10 > 0) {
  7068. dRotationBegin = dRotationBegin - 180 + dRotation;
  7069. } else {
  7070. dRotationBegin = 90 - dRotationBegin + dRotation;
  7071. }
  7072. }
  7073. } else {
  7074. if (newPY >= 0) {
  7075. if (K10 >= 0) {
  7076. dRotationBegin = dRotationBegin - dRotation;
  7077. } else {
  7078. dRotationBegin = 180 - (dRotationBegin - 90) - dRotation;
  7079. }
  7080. } else {
  7081. if (K10 >= 0) {
  7082. dRotationBegin = dRotationBegin - 180 - dRotation;
  7083. } else {
  7084. dRotationBegin = 90 - dRotationBegin - dRotation;
  7085. }
  7086. }
  7087. }
  7088. dRotationBegin = dRotationBegin * Math.PI / 180;
  7089. var x = centerPoint.x + R * Math.cos(dRotationBegin);
  7090. var y = centerPoint.y + R * Math.sin(dRotationBegin);
  7091. circlePoints.push(new Point_Point(x, y));
  7092. }
  7093. circlePoints.push(p3);
  7094. }
  7095. return circlePoints;
  7096. }
  7097. /**
  7098. * @function SuperMap.Geometry.LineString.createLineEPS
  7099. * @description 根据点的类型画出不同类型的曲线。
  7100. * 点的类型有三种:LTypeArc,LTypeCurve,NONE。
  7101. * @param {Array.<SuperMap.Geometry.Point>} points - 传入的待计算的初始点串。
  7102. * @returns {Array.<SuperMap.Geometry.Point>} 计算出相应的 lineEPS 控制点。
  7103. * @example
  7104. * var points = [];
  7105. * points.push(new SuperMap.Geometry.Point(-50,30));
  7106. * points.push(new SuperMap.Geometry.Point(-30,50,"LTypeArc"));
  7107. * points.push(new SuperMap.Geometry.Point(2,60));
  7108. * points.push(new SuperMap.Geometry.Point(8,20));
  7109. * var lineEPS = SuperMap.Geometry.LineString.createLineEPS(points);
  7110. */
  7111. }, {
  7112. key: "createLineEPS",
  7113. value: function createLineEPS(points) {
  7114. var list = [],
  7115. len = points.length;
  7116. if (len < 2) {
  7117. return points;
  7118. }
  7119. for (var i = 0; i < len;) {
  7120. var type = points[i].type;
  7121. if (type == 'LTypeArc') {
  7122. var listObj = LineString.createLineArc(list, i, len, points);
  7123. list = listObj[0];
  7124. i = listObj[1];
  7125. } else {
  7126. list.push(points[i]);
  7127. i++;
  7128. }
  7129. }
  7130. return list;
  7131. }
  7132. }, {
  7133. key: "createLineArc",
  7134. value: function createLineArc(list, i, len, points) {
  7135. if (i == 0) {
  7136. var bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  7137. Array.prototype.push.apply(list, bezierPtsObj[0]);
  7138. i = bezierPtsObj[1] + 1;
  7139. } else if (i == len - 1) {
  7140. var bezierP = [points[i - 1], points[i]],
  7141. bezierPts = LineString.calculateCircle(bezierP);
  7142. Array.prototype.push.apply(list, bezierPts);
  7143. i++;
  7144. } else {
  7145. var _bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  7146. list.pop();
  7147. Array.prototype.push.apply(list, _bezierPtsObj[0]);
  7148. i = _bezierPtsObj[1] + 1;
  7149. }
  7150. return [list, i];
  7151. }
  7152. }, {
  7153. key: "addPointEPS",
  7154. value: function addPointEPS(points, i, len, type) {
  7155. var bezierP = [],
  7156. j = i + 1;
  7157. if (i == 0) {
  7158. Array.prototype.push.apply(bezierP, [points[i], points[i + 1]]);
  7159. } else if (i == len - 1) {
  7160. Array.prototype.push.apply(bezierP, [points[i - 1], points[i]]);
  7161. } else {
  7162. Array.prototype.push.apply(bezierP, [points[i - 1], points[i], points[i + 1]]);
  7163. }
  7164. var bezierPts;
  7165. if (type == 'LTypeCurve') {
  7166. bezierPts = LineString.calculatePointsFBZN(bezierP);
  7167. } else if (type == 'LTypeArc') {
  7168. bezierPts = LineString.calculateCircle(bezierP);
  7169. }
  7170. return [bezierPts, j];
  7171. }
  7172. }]);
  7173. return LineString;
  7174. }(Curve_Curve);
  7175. SuperMap.Geometry.LineString = LineString_LineString;
  7176. // CONCATENATED MODULE: ./src/common/commontypes/geometry/GeoText.js
  7177. 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); }
  7178. function GeoText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7179. 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); } }
  7180. function GeoText_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoText_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoText_defineProperties(Constructor, staticProps); return Constructor; }
  7181. 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); }
  7182. function GeoText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoText_getPrototypeOf(object); if (object === null) break; } return object; }
  7183. 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); }
  7184. function GeoText_setPrototypeOf(o, p) { GeoText_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoText_setPrototypeOf(o, p); }
  7185. 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); }; }
  7186. function GeoText_possibleConstructorReturn(self, call) { if (call && (GeoText_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoText_assertThisInitialized(self); }
  7187. function GeoText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7188. 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; } }
  7189. function GeoText_getPrototypeOf(o) { GeoText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoText_getPrototypeOf(o); }
  7190. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  7191. * This program are made available under the terms of the Apache License, Version 2.0
  7192. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7193. /**
  7194. * @class SuperMap.Geometry.GeoText
  7195. * @classdesc 文本标签类。
  7196. * @category BaseTypes Geometry
  7197. * @extends {SuperMap.Geometry}
  7198. * @param {float} x - x 坐标。
  7199. * @param {float} y - y 坐标。
  7200. * @param {string} text - 标签中的文本内容。
  7201. */
  7202. var GeoText_GeoText = /*#__PURE__*/function (_Geometry) {
  7203. GeoText_inherits(GeoText, _Geometry);
  7204. var _super = GeoText_createSuper(GeoText);
  7205. function GeoText(x, y, text) {
  7206. var _this;
  7207. GeoText_classCallCheck(this, GeoText);
  7208. _this = _super.call(this, x, y, text);
  7209. /**
  7210. * @member {float} SuperMap.Geometry.GeoText.prototype.x
  7211. * @description 横坐标。
  7212. */
  7213. _this.x = parseFloat(x);
  7214. /**
  7215. * @member {float} SuperMap.Geometry.GeoText.prototype.y
  7216. * @description 纵坐标。
  7217. */
  7218. _this.y = parseFloat(y);
  7219. /**
  7220. * @member {string} SuperMap.Geometry.GeoText.prototype.text
  7221. * @description 标签中的文本内容。
  7222. */
  7223. _this.text = text.toString();
  7224. /**
  7225. * @member {Object} SuperMap.Geometry.GeoText.prototype.bsInfo
  7226. * @description 标签范围的基础信息。
  7227. * @property {number} w - bounds 的宽。
  7228. * @property {number} h - bounds 的高度。
  7229. */
  7230. _this.bsInfo = {
  7231. "h": null,
  7232. "w": null
  7233. };
  7234. _this.element = document.createElement('span');
  7235. _this.CLASS_NAME = "SuperMap.Geometry.GeoText";
  7236. _this.geometryType = "GeoText";
  7237. return _this;
  7238. }
  7239. /**
  7240. * @function SuperMap.Geometry.GeoText.prototype.destroy
  7241. * @description 销毁文本标签类。
  7242. */
  7243. GeoText_createClass(GeoText, [{
  7244. key: "destroy",
  7245. value: function destroy() {
  7246. GeoText_get(GeoText_getPrototypeOf(GeoText.prototype), "destroy", this).call(this);
  7247. this.x = null;
  7248. this.y = null;
  7249. this.text = null;
  7250. }
  7251. /**
  7252. * @function SuperMap.Geometry.GeoText.prototype.getCentroid
  7253. * @description 获取标签对象的质心。
  7254. * @returns {SuperMap.Geometry.Point} 标签对象的质心。
  7255. */
  7256. }, {
  7257. key: "getCentroid",
  7258. value: function getCentroid() {
  7259. return new Point_Point(this.x, this.y);
  7260. }
  7261. /**
  7262. * @function SuperMap.Geometry.GeoText.prototype.clone
  7263. * @description 克隆标签对象。
  7264. * @returns {SuperMap.Geometry.GeoText} 克隆后的标签对象。
  7265. */
  7266. }, {
  7267. key: "clone",
  7268. value: function clone(obj) {
  7269. if (obj == null) {
  7270. obj = new GeoText(this.x, this.y, this.text);
  7271. }
  7272. Util_Util.applyDefaults(obj, this);
  7273. return obj;
  7274. }
  7275. /**
  7276. * @function SuperMap.Geometry.GeoText.prototype.calculateBounds
  7277. * @description 计算标签对象的范围。
  7278. */
  7279. }, {
  7280. key: "calculateBounds",
  7281. value: function calculateBounds() {
  7282. this.bounds = new Bounds_Bounds(this.x, this.y, this.x, this.y);
  7283. }
  7284. /**
  7285. * @function SuperMap.Geometry.GeoText.prototype.getLabelPxBoundsByLabel
  7286. * @description 根据绘制好的标签获取文字标签的像素范围,参数的单位是像素;此方法相对于 getLabelPxBoundsByText 效率较低,但支持所有格式的文本。
  7287. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  7288. * @param {string} labelWidth - 标签的宽度,如:“90px”。
  7289. * @param {string} labelHeight - 标签的高度。
  7290. * @param {Object} style - 标签的 style。
  7291. * @returns {SuperMap.Bounds} 标签的像素范围。
  7292. */
  7293. }, {
  7294. key: "getLabelPxBoundsByLabel",
  7295. value: function getLabelPxBoundsByLabel(locationPixel, labelWidth, labelHeight, style) {
  7296. var labelPxBounds, left, bottom, top, right;
  7297. var locationPx = Util_Util.cloneObject(locationPixel); //计算文本行数
  7298. var theText = style.label || this.text;
  7299. var textRows = theText.split('\n');
  7300. var laberRows = textRows.length; //处理文字对齐
  7301. labelWidth = parseFloat(labelWidth);
  7302. labelHeight = parseFloat(labelHeight);
  7303. if (laberRows > 1) {
  7304. labelHeight = parseFloat(labelHeight) * laberRows;
  7305. }
  7306. if (style.labelAlign && style.labelAlign !== "cm") {
  7307. switch (style.labelAlign) {
  7308. case "lt":
  7309. locationPx.x += labelWidth / 2;
  7310. locationPx.y += labelHeight / 2;
  7311. break;
  7312. case "lm":
  7313. locationPx.x += labelWidth / 2;
  7314. break;
  7315. case "lb":
  7316. locationPx.x += labelWidth / 2;
  7317. locationPx.y -= labelHeight / 2;
  7318. break;
  7319. case "ct":
  7320. locationPx.y += labelHeight / 2;
  7321. break;
  7322. case "cb":
  7323. locationPx.y -= labelHeight / 2;
  7324. break;
  7325. case "rt":
  7326. locationPx.x -= labelWidth / 2;
  7327. locationPx.y += labelHeight / 2;
  7328. break;
  7329. case "rm":
  7330. locationPx.x -= labelWidth / 2;
  7331. break;
  7332. case "rb":
  7333. locationPx.x -= labelWidth / 2;
  7334. locationPx.y -= labelHeight / 2;
  7335. break;
  7336. default:
  7337. break;
  7338. }
  7339. }
  7340. this.bsInfo.h = labelHeight;
  7341. this.bsInfo.w = labelWidth; //bounds的四边
  7342. left = locationPx.x - parseFloat(labelWidth) / 2;
  7343. bottom = locationPx.y + parseFloat(labelHeight) / 2;
  7344. right = locationPx.x + parseFloat(labelWidth) / 2;
  7345. top = locationPx.y - parseFloat(labelHeight) / 2;
  7346. labelPxBounds = new Bounds_Bounds(left, bottom, right, top);
  7347. return labelPxBounds;
  7348. }
  7349. /**
  7350. * @function SuperMap.Geometry.GeoText.prototype.getLabelPxBoundsByText
  7351. * @description 根据文本内容获取文字标签的像素范围。
  7352. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  7353. * @param {Object} style - 标签的样式。
  7354. * @returns {SuperMap.Bounds} 标签的像素范围。
  7355. */
  7356. }, {
  7357. key: "getLabelPxBoundsByText",
  7358. value: function getLabelPxBoundsByText(locationPixel, style) {
  7359. var labelPxBounds, left, bottom, top, right;
  7360. var labelSize = this.getLabelPxSize(style);
  7361. var locationPx = Util_Util.cloneObject(locationPixel); //处理文字对齐
  7362. if (style.labelAlign && style.labelAlign !== "cm") {
  7363. switch (style.labelAlign) {
  7364. case "lt":
  7365. locationPx.x += labelSize.w / 2;
  7366. locationPx.y += labelSize.h / 2;
  7367. break;
  7368. case "lm":
  7369. locationPx.x += labelSize.w / 2;
  7370. break;
  7371. case "lb":
  7372. locationPx.x += labelSize.w / 2;
  7373. locationPx.y -= labelSize.h / 2;
  7374. break;
  7375. case "ct":
  7376. locationPx.y += labelSize.h / 2;
  7377. break;
  7378. case "cb":
  7379. locationPx.y -= labelSize.h / 2;
  7380. break;
  7381. case "rt":
  7382. locationPx.x -= labelSize.w / 2;
  7383. locationPx.y += labelSize.h / 2;
  7384. break;
  7385. case "rm":
  7386. locationPx.x -= labelSize.w / 2;
  7387. break;
  7388. case "rb":
  7389. locationPx.x -= labelSize.w / 2;
  7390. locationPx.y -= labelSize.h / 2;
  7391. break;
  7392. default:
  7393. break;
  7394. }
  7395. }
  7396. this.bsInfo.h = labelSize.h;
  7397. this.bsInfo.w = labelSize.w;
  7398. left = locationPx.x - labelSize.w / 2;
  7399. bottom = locationPx.y + labelSize.h / 2; //处理斜体字
  7400. if (style.fontStyle && style.fontStyle === "italic") {
  7401. right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
  7402. } else {
  7403. right = locationPx.x + labelSize.w / 2;
  7404. }
  7405. top = locationPx.y - labelSize.h / 2;
  7406. labelPxBounds = new Bounds_Bounds(left, bottom, right, top);
  7407. return labelPxBounds;
  7408. }
  7409. /**
  7410. * @function SuperMap.Geometry.GeoText.prototype.getLabelPxSize
  7411. * @description 获取 label 的像素大小。
  7412. * @param {Object} style - 标签样式。
  7413. * @returns {Object} 标签大小对象,属性 w 表示标签的宽度,属性 h 表示标签的高度。
  7414. */
  7415. }, {
  7416. key: "getLabelPxSize",
  7417. value: function getLabelPxSize(style) {
  7418. var text,
  7419. //文本内容
  7420. fontSize,
  7421. //字体大小
  7422. spacing = 1,
  7423. //两个字符间的间距(单位:px)
  7424. lineSpacing = 0.2,
  7425. bgstrokeWidth = parseFloat(style.strokeWidth); //标签背景框边框的宽度
  7426. text = style.label || this.text;
  7427. if (style.fontSize) {
  7428. fontSize = parseFloat(style.fontSize);
  7429. } else {
  7430. fontSize = parseFloat("12px");
  7431. } //标签宽高
  7432. var labelW, labelH;
  7433. var textRows = text.split('\n');
  7434. var numRows = textRows.length;
  7435. if (numRows > 1) {
  7436. labelH = fontSize * numRows + numRows + bgstrokeWidth + lineSpacing * fontSize;
  7437. } else {
  7438. labelH = fontSize + bgstrokeWidth + lineSpacing * fontSize + 1;
  7439. } //取最大宽度
  7440. labelW = 0;
  7441. if (this.labelWTmp && labelW < this.labelWTmp) {
  7442. labelW = this.labelWTmp;
  7443. }
  7444. for (var i = 0; i < numRows; i++) {
  7445. var textCharC = this.getTextCount(textRows[i]);
  7446. var labelWTmp = this.labelWTmp = Util_Util.getTextBounds(style, textRows[i], this.element).textWidth + textCharC.textC * spacing + bgstrokeWidth;
  7447. if (labelW < labelWTmp) {
  7448. labelW = labelWTmp;
  7449. }
  7450. }
  7451. var labelSize = new Object(); //标签大小
  7452. labelSize.h = labelH;
  7453. labelSize.w = labelW;
  7454. return labelSize;
  7455. }
  7456. /**
  7457. * @function SuperMap.Geometry.GeoText.prototype.getTextCount
  7458. * @description 获取 text 中的字符个数。
  7459. * @param {string} text - 字符串。
  7460. * @returns {Object} 字符个数统计结果,属性 cnC 表示中文字符个数,属性 enC 表示英文字符个数,属性 textC 表示字符总个数。
  7461. */
  7462. }, {
  7463. key: "getTextCount",
  7464. value: function getTextCount(text) {
  7465. var textCharCount = {};
  7466. var cnCount = 0;
  7467. var enCount = 0;
  7468. for (var i = 0; i < text.length; i++) {
  7469. if (text.charCodeAt(i) > 255) {
  7470. //遍历判断字符串中每个字符的Unicode码,大于255则为中文
  7471. cnCount++;
  7472. } else {
  7473. enCount++;
  7474. }
  7475. } //中午字符个数
  7476. textCharCount.cnC = cnCount; //英文字符个数
  7477. textCharCount.enC = enCount; //字符总个数
  7478. textCharCount.textC = text.length;
  7479. return textCharCount;
  7480. }
  7481. }]);
  7482. return GeoText;
  7483. }(Geometry_Geometry);
  7484. SuperMap.Geometry.GeoText = GeoText_GeoText;
  7485. // CONCATENATED MODULE: ./src/common/commontypes/geometry/LinearRing.js
  7486. 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); }
  7487. function LinearRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7488. 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); } }
  7489. function LinearRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinearRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinearRing_defineProperties(Constructor, staticProps); return Constructor; }
  7490. 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); }
  7491. function LinearRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LinearRing_getPrototypeOf(object); if (object === null) break; } return object; }
  7492. 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); }
  7493. function LinearRing_setPrototypeOf(o, p) { LinearRing_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LinearRing_setPrototypeOf(o, p); }
  7494. 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); }; }
  7495. function LinearRing_possibleConstructorReturn(self, call) { if (call && (LinearRing_typeof(call) === "object" || typeof call === "function")) { return call; } return LinearRing_assertThisInitialized(self); }
  7496. function LinearRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7497. 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; } }
  7498. function LinearRing_getPrototypeOf(o) { LinearRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LinearRing_getPrototypeOf(o); }
  7499. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  7500. * This program are made available under the terms of the Apache License, Version 2.0
  7501. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7502. /**
  7503. * @class SuperMap.Geometry.LinearRing
  7504. * @classdesc 几何对象线环类,是一个特殊的封闭的线串,在每次 addPoint/removePoint 之后会通过添加一个点(此点是复制的第一个点得到的)
  7505. * 作为最后的一个点来自动关闭线环。
  7506. * @category BaseTypes Geometry
  7507. * @extends {SuperMap.Geometry.LineString}
  7508. * @param {Array.<SuperMap.Geometry.Point>} points - 组成线性环的点。
  7509. * @example
  7510. * var points = [new SuperMap.Geometry.Point(4933.319287022352, -3337.3849141502124),
  7511. * new SuperMap.Geometry.Point(4960.9674060199022, -3349.3316322355736),
  7512. * new SuperMap.Geometry.Point(5006.0235999418364, -3358.8890067038628),
  7513. * new SuperMap.Geometry.Point(5075.3145648369318, -3378.0037556404409),
  7514. * new SuperMap.Geometry.Point(5305.19551436013, -3376.9669111768926)],
  7515. * var linearRing = new SuperMap.Geometry.LinearRing(points);
  7516. */
  7517. var LinearRing = /*#__PURE__*/function (_LineString) {
  7518. LinearRing_inherits(LinearRing, _LineString);
  7519. var _super = LinearRing_createSuper(LinearRing);
  7520. function LinearRing(points) {
  7521. var _this;
  7522. LinearRing_classCallCheck(this, LinearRing);
  7523. _this = _super.call(this, points);
  7524. /**
  7525. * @member {Array.<string>} [SuperMap.Geometry.LinearRing.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  7526. * @description components 存储的的几何对象所支持的几何类型数组,为空表示类型不受限制。
  7527. * @readonly
  7528. */
  7529. _this.componentTypes = ["SuperMap.Geometry.Point"];
  7530. _this.CLASS_NAME = "SuperMap.Geometry.LinearRing";
  7531. _this.geometryType = "LinearRing";
  7532. return _this;
  7533. }
  7534. /**
  7535. * @function SuperMap.Geometry.LinearRing.prototype.addComponent
  7536. * @description 添加一个点到几何图形数组中,如果这个点将要被添加到组件数组的末端,并且与数组中已经存在的最后一个点相同,
  7537. * 重复的点是不能被添加的。这将影响未关闭环的关闭。
  7538. * 这个方法可以通过将非空索引(组件数组的下标)作为第二个参数重写。
  7539. * @param {SuperMap.Geometry.Point} point - 点对象。
  7540. * @param {integer} [index] - 插入组件数组的下标。
  7541. * @returns {boolean} 点对象是否添加成功。
  7542. */
  7543. LinearRing_createClass(LinearRing, [{
  7544. key: "addComponent",
  7545. value: function addComponent(point, index) {
  7546. var added = false; //remove last point
  7547. var lastPoint = this.components.pop(); // given an index, add the point
  7548. // without an index only add non-duplicate points
  7549. if (index != null || !point.equals(lastPoint)) {
  7550. added = LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, arguments);
  7551. } //append copy of first point
  7552. var firstPoint = this.components[0];
  7553. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  7554. return added;
  7555. }
  7556. /**
  7557. * @function SuperMap.Geometry.LinearRing.prototype.removeComponent
  7558. * @description 从几何组件中删除一个点。
  7559. * @param {SuperMap.Geometry.Point} point - 点对象。
  7560. * @returns {boolean} 点对象是否删除。
  7561. */
  7562. }, {
  7563. key: "removeComponent",
  7564. value: function removeComponent(point) {
  7565. // eslint-disable-line no-unused-vars
  7566. var removed = this.components && this.components.length > 3;
  7567. if (removed) {
  7568. //remove last point
  7569. this.components.pop(); //remove our point
  7570. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "removeComponent", this).apply(this, arguments); //append copy of first point
  7571. var firstPoint = this.components[0];
  7572. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  7573. }
  7574. return removed;
  7575. }
  7576. /**
  7577. * @function SuperMap.Geometry.LinearRing.prototype.getArea
  7578. * @description 获得当前几何对象区域大小,如果是沿顺时针方向的环则是正值,否则为负值。
  7579. * @returns {float} 环的面积。
  7580. */
  7581. }, {
  7582. key: "getArea",
  7583. value: function getArea() {
  7584. var area = 0.0;
  7585. if (this.components && this.components.length > 2) {
  7586. var sum = 0.0;
  7587. for (var i = 0, len = this.components.length; i < len - 1; i++) {
  7588. var b = this.components[i];
  7589. var c = this.components[i + 1];
  7590. sum += (b.x + c.x) * (c.y - b.y);
  7591. }
  7592. area = -sum / 2.0;
  7593. }
  7594. return area;
  7595. }
  7596. /**
  7597. * @function SuperMap.Geometry.LinearRing.prototype.getVertices
  7598. * @description 返回几何图形的所有点的列表。
  7599. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false ,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  7600. * @returns {Array} 几何对象所有点的列表。
  7601. */
  7602. }, {
  7603. key: "getVertices",
  7604. value: function getVertices(nodes) {
  7605. return nodes === true ? [] : this.components.slice(0, this.components.length - 1);
  7606. }
  7607. }]);
  7608. return LinearRing;
  7609. }(LineString_LineString);
  7610. SuperMap.Geometry.LinearRing = LinearRing;
  7611. // CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiLineString.js
  7612. 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); }
  7613. function MultiLineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7614. 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); }
  7615. function MultiLineString_setPrototypeOf(o, p) { MultiLineString_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiLineString_setPrototypeOf(o, p); }
  7616. 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); }; }
  7617. function MultiLineString_possibleConstructorReturn(self, call) { if (call && (MultiLineString_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiLineString_assertThisInitialized(self); }
  7618. function MultiLineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7619. 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; } }
  7620. function MultiLineString_getPrototypeOf(o) { MultiLineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiLineString_getPrototypeOf(o); }
  7621. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  7622. * This program are made available under the terms of the Apache License, Version 2.0
  7623. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7624. /**
  7625. * @class SuperMap.Geometry.MultiLineString
  7626. * @classdesc 几何对象多线类。
  7627. * @category BaseTypes Geometry
  7628. * @extends {SuperMap.Geometry.Collection}
  7629. * @param {Array.<SuperMap.Geometry.LineString>} components - LineString 数组。
  7630. * @example
  7631. * var multi = new SuperMap.Geometry.MultiLineString([
  7632. * new SuperMap.Geometry.LineString([
  7633. * new SuperMap.Geometry.Point(1, 0),
  7634. * new SuperMap.Geometry.Point(0, 1)
  7635. * ])
  7636. * ]);
  7637. */
  7638. var MultiLineString = /*#__PURE__*/function (_Collection) {
  7639. MultiLineString_inherits(MultiLineString, _Collection);
  7640. var _super = MultiLineString_createSuper(MultiLineString);
  7641. function MultiLineString(components) {
  7642. var _this;
  7643. MultiLineString_classCallCheck(this, MultiLineString);
  7644. _this = _super.call(this, components);
  7645. /**
  7646. * @member {Array.<string>} [SuperMap.Geometry.MultiLineString.prototype.componentTypes=["SuperMap.Geometry.LineString"]]
  7647. * @description components 存储的的几何对象所支持的几何类型数组。
  7648. * @readonly
  7649. */
  7650. _this.componentTypes = ["SuperMap.Geometry.LineString"];
  7651. _this.CLASS_NAME = "SuperMap.Geometry.MultiLineString";
  7652. _this.geometryType = "MultiLineString";
  7653. return _this;
  7654. }
  7655. return MultiLineString;
  7656. }(Collection_Collection);
  7657. SuperMap.Geometry.MultiLineString = MultiLineString;
  7658. // CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPolygon.js
  7659. 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); }
  7660. function MultiPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7661. 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); }
  7662. function MultiPolygon_setPrototypeOf(o, p) { MultiPolygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPolygon_setPrototypeOf(o, p); }
  7663. 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); }; }
  7664. function MultiPolygon_possibleConstructorReturn(self, call) { if (call && (MultiPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiPolygon_assertThisInitialized(self); }
  7665. function MultiPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7666. 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; } }
  7667. function MultiPolygon_getPrototypeOf(o) { MultiPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPolygon_getPrototypeOf(o); }
  7668. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  7669. * This program are made available under the terms of the Apache License, Version 2.0
  7670. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7671. /**
  7672. * @class SuperMap.Geometry.MultiPolygon
  7673. * @classdesc 几何对象多多边形类。
  7674. * @category BaseTypes Geometry
  7675. * @extends {SuperMap.Geometry.Collection}
  7676. * @param {Array.<SuperMap.Geometry.Polygon>} components - 形成 MultiPolygon 的多边形数组。
  7677. * @example
  7678. * var points1 = [new SuperMap.Geometry.Point(10,10),new SuperMap.Geometry.Point(0,0)];
  7679. * 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)];
  7680. *
  7681. * var linearRing1 = new SuperMap.Geometry.LinearRing(points1);
  7682. * var linearRing2 = new SuperMap.Geometry.LinearRing(points2);
  7683. *
  7684. * var polygon1 = new SuperMap.Geometry.Polygon([linearRing1]);
  7685. * var polygon2 = new SuperMap.Geometry.Polygon([linearRing2]);
  7686. *
  7687. * var multiPolygon1 = new SuperMap.Geometry.MultiPolygon([polygon1,polygon2]);
  7688. */
  7689. var MultiPolygon = /*#__PURE__*/function (_Collection) {
  7690. MultiPolygon_inherits(MultiPolygon, _Collection);
  7691. var _super = MultiPolygon_createSuper(MultiPolygon);
  7692. function MultiPolygon(components) {
  7693. var _this;
  7694. MultiPolygon_classCallCheck(this, MultiPolygon);
  7695. _this = _super.call(this, components);
  7696. /**
  7697. * @member {Array.<string>} [SuperMap.Geometry.MultiPolygon.prototype.componentTypes=["SuperMap.Geometry.Polygon"]]
  7698. * @description components 存储的的几何对象所支持的几何类型数组。
  7699. * @readonly
  7700. */
  7701. _this.componentTypes = ["SuperMap.Geometry.Polygon"];
  7702. _this.CLASS_NAME = "SuperMap.Geometry.MultiPolygon";
  7703. _this.geometryType = "MultiPolygon";
  7704. return _this;
  7705. }
  7706. return MultiPolygon;
  7707. }(Collection_Collection);
  7708. SuperMap.Geometry.MultiPolygon = MultiPolygon;
  7709. // CONCATENATED MODULE: ./src/common/commontypes/geometry/Polygon.js
  7710. 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); }
  7711. function Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7712. 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); } }
  7713. function Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) Polygon_defineProperties(Constructor, staticProps); return Constructor; }
  7714. 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); }
  7715. function Polygon_setPrototypeOf(o, p) { Polygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Polygon_setPrototypeOf(o, p); }
  7716. 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); }; }
  7717. function Polygon_possibleConstructorReturn(self, call) { if (call && (Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } return Polygon_assertThisInitialized(self); }
  7718. function Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7719. 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; } }
  7720. function Polygon_getPrototypeOf(o) { Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Polygon_getPrototypeOf(o); }
  7721. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  7722. * This program are made available under the terms of the Apache License, Version 2.0
  7723. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7724. /**
  7725. * @class SuperMap.Geometry.Polygon
  7726. * @classdesc 多边形几何对象类。
  7727. * @category BaseTypes Geometry
  7728. * @extends {SuperMap.Geometry.Collection}
  7729. * @param {Array.<SuperMap.Geometry.LinearRing>} components - 用来生成多边形的线环数组。
  7730. * @example
  7731. * var points =[new SuperMap.Geometry.Point(0,4010338),
  7732. * new SuperMap.Geometry.Point(1063524,4010338),
  7733. * new SuperMap.Geometry.Point(1063524,3150322),
  7734. * new SuperMap.Geometry.Point(0,3150322)
  7735. * ],
  7736. * var linearRings = new SuperMap.Geometry.LinearRing(points),
  7737. * var region = new SuperMap.Geometry.Polygon([linearRings]);
  7738. */
  7739. var Polygon = /*#__PURE__*/function (_Collection) {
  7740. Polygon_inherits(Polygon, _Collection);
  7741. var _super = Polygon_createSuper(Polygon);
  7742. function Polygon(components) {
  7743. var _this;
  7744. Polygon_classCallCheck(this, Polygon);
  7745. _this = _super.call(this, components);
  7746. /**
  7747. * @member {Array.<string>} [SuperMap.Geometry.Polygon.prototype.componentTypes=["SuperMap.Geometry.LinearRing"]]
  7748. * @description components 存储的的几何对象所支持的几何类型数组。
  7749. * @readonly
  7750. */
  7751. _this.componentTypes = ["SuperMap.Geometry.LinearRing"];
  7752. _this.CLASS_NAME = "SuperMap.Geometry.Polygon";
  7753. _this.geometryType = "Polygon";
  7754. return _this;
  7755. }
  7756. /**
  7757. * @function SuperMap.Geometry.Polygon.prototype.getArea
  7758. * @description 获得区域面积,从区域的外部口径减去计此区域内部口径算所得的面积。
  7759. * @returns {float} 几何对象的面积。
  7760. */
  7761. Polygon_createClass(Polygon, [{
  7762. key: "getArea",
  7763. value: function getArea() {
  7764. var area = 0.0;
  7765. if (this.components && this.components.length > 0) {
  7766. area += Math.abs(this.components[0].getArea());
  7767. for (var i = 1, len = this.components.length; i < len; i++) {
  7768. area -= Math.abs(this.components[i].getArea());
  7769. }
  7770. }
  7771. return area;
  7772. }
  7773. }]);
  7774. return Polygon;
  7775. }(Collection_Collection);
  7776. SuperMap.Geometry.Polygon = Polygon;
  7777. // CONCATENATED MODULE: ./src/common/commontypes/geometry/Rectangle.js
  7778. 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); }
  7779. function Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7780. 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); } }
  7781. function Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Rectangle_defineProperties(Constructor, staticProps); return Constructor; }
  7782. 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); }
  7783. function Rectangle_setPrototypeOf(o, p) { Rectangle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Rectangle_setPrototypeOf(o, p); }
  7784. 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); }; }
  7785. function Rectangle_possibleConstructorReturn(self, call) { if (call && (Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return Rectangle_assertThisInitialized(self); }
  7786. function Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7787. 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; } }
  7788. function Rectangle_getPrototypeOf(o) { Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Rectangle_getPrototypeOf(o); }
  7789. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  7790. * This program are made available under the terms of the Apache License, Version 2.0
  7791. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7792. /**
  7793. * @class SuperMap.Geometry.Rectangle
  7794. * @classdesc 矩形几何对象类。
  7795. * @category BaseTypes Geometry
  7796. * @param {float} x - 矩形左下角点的横坐标。
  7797. * @param {float} y - 矩形左下角点的纵坐标。
  7798. * @param {float} width - 矩形的宽度。
  7799. * @param {float} height - 矩形的高度。
  7800. * @extends {SuperMap.Geometry}
  7801. * @example
  7802. * //x 为矩形左下角点的横坐标;y 为矩形左下角点的纵坐标;w 为矩形的宽度;h 为矩形的高度
  7803. * var x = 1;
  7804. * var y = 2;
  7805. * var w = 10;
  7806. * var h = 20;
  7807. * var recttangle = new SuperMap.Geometry.Rectangle(x, y, w, h);
  7808. */
  7809. var Rectangle_Rectangle = /*#__PURE__*/function (_Geometry) {
  7810. Rectangle_inherits(Rectangle, _Geometry);
  7811. var _super = Rectangle_createSuper(Rectangle);
  7812. function Rectangle(x, y, width, height) {
  7813. var _this;
  7814. Rectangle_classCallCheck(this, Rectangle);
  7815. _this = _super.call(this, x, y, width, height);
  7816. /**
  7817. * @member {float} SuperMap.Geometry.Rectangle.prototype.x
  7818. * @description 矩形左下角点的横坐标。
  7819. */
  7820. _this.x = x;
  7821. /**
  7822. * @member {float} SuperMap.Geometry.Rectangle.prototype.y
  7823. * @description 矩形左下角点的纵坐标。
  7824. */
  7825. _this.y = y;
  7826. /**
  7827. * @member {float} SuperMap.Geometry.Rectangle.prototype.width
  7828. * @description 矩形的宽度。
  7829. */
  7830. _this.width = width;
  7831. /**
  7832. * @member {float} SuperMap.Geometry.Rectangle.prototype.height
  7833. * @description 矩形的高度。
  7834. */
  7835. _this.height = height;
  7836. _this.CLASS_NAME = "SuperMap.Geometry.Rectangle";
  7837. _this.geometryType = "Rectangle";
  7838. return _this;
  7839. }
  7840. /**
  7841. * @function SuperMap.Geometry.Rectangle.prototype.calculateBounds
  7842. * @description 计算出此矩形对象的 bounds。
  7843. */
  7844. Rectangle_createClass(Rectangle, [{
  7845. key: "calculateBounds",
  7846. value: function calculateBounds() {
  7847. this.bounds = new Bounds_Bounds(this.x, this.y, this.x + this.width, this.y + this.height);
  7848. }
  7849. /**
  7850. * @function SuperMap.Geometry.Rectangle.prototype.getArea
  7851. * @description 获取矩形对象的面积。
  7852. * @returns {float} 矩形对象面积。
  7853. */
  7854. }, {
  7855. key: "getArea",
  7856. value: function getArea() {
  7857. var area = this.width * this.height;
  7858. return area;
  7859. }
  7860. }]);
  7861. return Rectangle;
  7862. }(Geometry_Geometry);
  7863. SuperMap.Geometry.Rectangle = Rectangle_Rectangle;
  7864. // CONCATENATED MODULE: ./src/common/commontypes/geometry/index.js
  7865. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  7866. * This program are made available under the terms of the Apache License, Version 2.0
  7867. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7868. // CONCATENATED MODULE: ./src/common/commontypes/Credential.js
  7869. function Credential_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7870. 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); } }
  7871. function Credential_createClass(Constructor, protoProps, staticProps) { if (protoProps) Credential_defineProperties(Constructor.prototype, protoProps); if (staticProps) Credential_defineProperties(Constructor, staticProps); return Constructor; }
  7872. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  7873. * This program are made available under the terms of the Apache License, Version 2.0
  7874. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7875. /**
  7876. * @class SuperMap.Credential
  7877. * @category Security
  7878. * @classdesc SuperMap 的安全证书类,其中包括 token 等安全验证信息。</br>
  7879. * 需要使用用户名和密码在:"http://localhost:8090/iserver/services/security/tokens" 下申请 value。</br>
  7880. * 获得形如:"2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.." 的 value。</br>
  7881. * 目前支持的功能包括:地图服务、专题图、量算、查询、公交换乘、空间分析、网络分析,不支持轮询功能。</br>
  7882. * @param {string} value - 访问受安全限制的服务时用于通过安全认证的验证信息。
  7883. * @param {string} [name='token'] - 验证信息前缀,name=value 部分的 name 部分。
  7884. * @example
  7885. * var pixcel = new SuperMap.Credential("valueString","token");
  7886. * pixcel.destroy();
  7887. */
  7888. var Credential = /*#__PURE__*/function () {
  7889. function Credential(value, name) {
  7890. Credential_classCallCheck(this, Credential);
  7891. /**
  7892. * @member {string} SuperMap.Bounds.prototype.value
  7893. * @description 访问受安全限制的服务时用于通过安全认证的验证信息。
  7894. */
  7895. this.value = value ? value : "";
  7896. /**
  7897. * @member {string} [SuperMap.Bounds.prototype.name='token']
  7898. * @description 验证信息前缀,name=value 部分的 name 部分。
  7899. */
  7900. this.name = name ? name : "token";
  7901. this.CLASS_NAME = "SuperMap.Credential";
  7902. }
  7903. /**
  7904. * @function SuperMap.Credential.prototype.getUrlParameters
  7905. * @example
  7906. * var credential = new SuperMap.Credential("valueString","token");
  7907. * //这里 str = "token=valueString";
  7908. * var str = credential.getUrlParameters();
  7909. * @returns {string} 返回安全信息组成的 url 片段。
  7910. */
  7911. Credential_createClass(Credential, [{
  7912. key: "getUrlParameters",
  7913. value: function getUrlParameters() {
  7914. //当需要其他安全信息的时候,则需要return this.name + "=" + this.value + "&" + "...";的形式添加。
  7915. return this.name + "=" + this.value;
  7916. }
  7917. /**
  7918. * @function SuperMap.Bounds.prototype.getValue
  7919. * @description 获取 value。
  7920. * @example
  7921. * var credential = new SuperMap.Credential("2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..","token");
  7922. * //这里 str = "2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..";
  7923. * var str = credential.getValue();
  7924. * @returns {string} 返回 value 字符串,在 iServer 服务下该 value 值即为 token 值。
  7925. */
  7926. }, {
  7927. key: "getValue",
  7928. value: function getValue() {
  7929. return this.value;
  7930. }
  7931. /**
  7932. *
  7933. * @function SuperMap.Credential.prototype.destroy
  7934. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  7935. * @example
  7936. * var credential = new SuperMap.Credential("valueString","token");
  7937. * credential.destroy();
  7938. */
  7939. }, {
  7940. key: "destroy",
  7941. value: function destroy() {
  7942. this.value = null;
  7943. this.name = null;
  7944. }
  7945. }]);
  7946. return Credential;
  7947. }();
  7948. /**
  7949. * @member {SuperMap.Credential} SuperMap.Credential.CREDENTIAL
  7950. * @description 这个对象保存一个安全类的实例,在服务端需要安全验证的时候必须进行设置。
  7951. * @constant
  7952. * @example
  7953. * 代码实例:
  7954. * // 当iServer启用服务安全的时候,下边的代码是必须的。安全证书类能够接收一个value和一个name参数。
  7955. * var value = "(以iServer为例,这里是申请的token值)";
  7956. * var name = "token";
  7957. * // 默认name参数为token,所以当使用iServer服务的时候可以不进行设置。
  7958. * SuperMap.Credential.CREDENTIAL = new SuperMap.Credential(value, name);
  7959. *
  7960. */
  7961. Credential.CREDENTIAL = null;
  7962. SuperMap.Credential = Credential;
  7963. // CONCATENATED MODULE: ./src/common/commontypes/Date.js
  7964. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  7965. * This program are made available under the terms of the Apache License, Version 2.0
  7966. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7967. /**
  7968. * @name Date
  7969. * @memberOf SuperMap
  7970. * @namespace
  7971. * @category BaseTypes Util
  7972. * @description 包含 parse、toISOString 方法的实现,两个方法用来解析 RFC 3339 日期,遵循 ECMAScript 5 规范。
  7973. */
  7974. var DateExt = SuperMap.Date = {
  7975. /**
  7976. * @description 生成代表一个具体的日期字符串,该日期遵循 ISO 8601 标准(详情查看{@link http://tools.ietf.org/html/rfc3339})。
  7977. * @example
  7978. * var dateString = SuperMap.Date.toISOString(new Date());
  7979. * @param {Date} date - 日期对象。
  7980. * @returns {string} 一个代表日期的字符串。(例如 "2010-08-07T16:58:23.123Z")。
  7981. */
  7982. toISOString: function () {
  7983. //标准的Date会存在toISOString方法,可以直接调用
  7984. if ("toISOString" in Date.prototype) {
  7985. return function (date) {
  7986. return date.toISOString();
  7987. };
  7988. } else {
  7989. // 部分浏览器没有,就得自己组合,组合后的字符串规则不变
  7990. var pad = function pad(num, len) {
  7991. var str = num + "";
  7992. while (str.length < len) {
  7993. str = "0" + str;
  7994. }
  7995. return str;
  7996. };
  7997. return function (date) {
  7998. var str;
  7999. if (isNaN(date.getTime())) {
  8000. // ECMA-262 says throw RangeError, Firefox returns
  8001. // "Invalid Date"
  8002. str = "Invalid Date";
  8003. } else {
  8004. 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";
  8005. }
  8006. return str;
  8007. };
  8008. }
  8009. }(),
  8010. /**
  8011. * @description 从一个字符串生成一个日期对象。
  8012. * @example
  8013. * var date = SuperMap.Date.parse("2010-08-07");
  8014. * @param {string} str - 代表日期的字符串。(例如: "2010", "2010-08", "2010-08-07", "2010-08-07T16:58:23.123Z","2010-08-07T11:58:23.123-06")。
  8015. * @returns {Date} 日期对象,如果字符串无法被解析,则返回一个无效的日期。(例如 isNaN(date.getTime()))。
  8016. */
  8017. parse: function parse(str) {
  8018. var date;
  8019. 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)?$/);
  8020. if (match && (match[1] || match[7])) {
  8021. // must have at least year or time
  8022. var year = parseInt(match[1], 10) || 0;
  8023. var month = parseInt(match[2], 10) - 1 || 0;
  8024. var day = parseInt(match[3], 10) || 1;
  8025. date = new Date(Date.UTC(year, month, day)); // optional time
  8026. var type = match[7];
  8027. if (type) {
  8028. var hours = parseInt(match[4], 10);
  8029. var minutes = parseInt(match[5], 10);
  8030. var secFrac = parseFloat(match[6]);
  8031. var seconds = secFrac | 0;
  8032. var milliseconds = Math.round(1000 * (secFrac - seconds));
  8033. date.setUTCHours(hours, minutes, seconds, milliseconds); // check offset
  8034. if (type !== "Z") {
  8035. var hoursOffset = parseInt(type, 10);
  8036. var minutesOffset = parseInt(match[8], 10) || 0;
  8037. var offset = -1000 * (60 * (hoursOffset * 60) + minutesOffset * 60);
  8038. date = new Date(date.getTime() + offset);
  8039. }
  8040. }
  8041. } else {
  8042. date = new Date("invalid");
  8043. }
  8044. return date;
  8045. }
  8046. };
  8047. // CONCATENATED MODULE: ./src/common/commontypes/Event.js
  8048. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  8049. * This program are made available under the terms of the Apache License, Version 2.0
  8050. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8051. /**
  8052. * @name Event
  8053. * @memberOf SuperMap
  8054. * @namespace
  8055. * @description 事件处理函数.
  8056. */
  8057. var Event = SuperMap.Event = {
  8058. /**
  8059. * @description A hash table cache of the event observers. Keyed by element._eventCacheID
  8060. * @type {boolean}
  8061. * @default false
  8062. */
  8063. observers: false,
  8064. /**
  8065. * @description KEY_SPACE
  8066. * @type {number}
  8067. * @default 32
  8068. */
  8069. KEY_SPACE: 32,
  8070. /**
  8071. * @description KEY_BACKSPACE
  8072. * @type {number}
  8073. * @default 8
  8074. */
  8075. KEY_BACKSPACE: 8,
  8076. /**
  8077. * @description KEY_TAB
  8078. * @type {number}
  8079. * @default 9
  8080. */
  8081. KEY_TAB: 9,
  8082. /**
  8083. * @description KEY_RETURN
  8084. * @type {number}
  8085. * @default 13
  8086. */
  8087. KEY_RETURN: 13,
  8088. /**
  8089. * @description KEY_ESC
  8090. * @type {number}
  8091. * @default 27
  8092. */
  8093. KEY_ESC: 27,
  8094. /**
  8095. * @description KEY_LEFT
  8096. * @type {number}
  8097. * @default 37
  8098. */
  8099. KEY_LEFT: 37,
  8100. /**
  8101. * @description KEY_UP
  8102. * @type {number}
  8103. * @default 38
  8104. */
  8105. KEY_UP: 38,
  8106. /**
  8107. * @description KEY_RIGHT
  8108. * @type {number}
  8109. * @default 39
  8110. */
  8111. KEY_RIGHT: 39,
  8112. /**
  8113. * @description KEY_DOWN
  8114. * @type {number}
  8115. * @default 40
  8116. */
  8117. KEY_DOWN: 40,
  8118. /**
  8119. * @description KEY_DELETE
  8120. * @type {number}
  8121. * @default 46
  8122. */
  8123. KEY_DELETE: 46,
  8124. /**
  8125. * @description Cross browser event element detection.
  8126. * @param {Event} event - The event
  8127. * @returns {HTMLElement} The element that caused the event
  8128. */
  8129. element: function element(event) {
  8130. return event.target || event.srcElement;
  8131. },
  8132. /**
  8133. * @description Determine whether event was caused by a single touch
  8134. * @param {Event} event - The event
  8135. * @returns {boolean}
  8136. */
  8137. isSingleTouch: function isSingleTouch(event) {
  8138. return event.touches && event.touches.length === 1;
  8139. },
  8140. /**
  8141. * @description Determine whether event was caused by a multi touch
  8142. * @param {Event} event - The event
  8143. * @returns {boolean}
  8144. */
  8145. isMultiTouch: function isMultiTouch(event) {
  8146. return event.touches && event.touches.length > 1;
  8147. },
  8148. /**
  8149. * @description Determine whether event was caused by a left click.
  8150. * @param {Event} event - The event
  8151. * @returns {boolean}
  8152. */
  8153. isLeftClick: function isLeftClick(event) {
  8154. return event.which && event.which === 1 || event.button && event.button === 1;
  8155. },
  8156. /**
  8157. * @description Determine whether event was caused by a right mouse click.
  8158. * @param {Event} event - The event
  8159. * @returns {boolean}
  8160. */
  8161. isRightClick: function isRightClick(event) {
  8162. return event.which && event.which === 3 || event.button && event.button === 2;
  8163. },
  8164. /**
  8165. * @description Stops an event from propagating.
  8166. * @param {Event} event - The event
  8167. * @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
  8168. */
  8169. stop: function stop(event, allowDefault) {
  8170. if (!allowDefault) {
  8171. if (event.preventDefault) {
  8172. event.preventDefault();
  8173. } else {
  8174. event.returnValue = false;
  8175. }
  8176. }
  8177. if (event.stopPropagation) {
  8178. event.stopPropagation();
  8179. } else {
  8180. event.cancelBubble = true;
  8181. }
  8182. },
  8183. /**
  8184. * @param {Event} event - The event。
  8185. * @param {string} tagName - html 标签名。
  8186. * @returns {HTMLElement} The first node with the given tagName, starting from the node the event was triggered on and traversing the DOM upwards
  8187. */
  8188. findElement: function findElement(event, tagName) {
  8189. var element = SuperMap.Event.element(event);
  8190. while (element.parentNode && (!element.tagName || element.tagName.toUpperCase() != tagName.toUpperCase())) {
  8191. element = element.parentNode;
  8192. }
  8193. return element;
  8194. },
  8195. /**
  8196. * @description 监听事件,注册事件处理方法。
  8197. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  8198. * @param {string} name - 监听事件的类别名称。
  8199. * @param {function} observer - 注册的事件处理方法。
  8200. * @param {boolean} [useCapture=false] - 是否捕获。
  8201. */
  8202. observe: function observe(elementParam, name, observer, useCapture) {
  8203. var element = Util_Util.getElement(elementParam);
  8204. useCapture = useCapture || false;
  8205. if (name === 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) {
  8206. name = 'keydown';
  8207. } //if observers cache has not yet been created, create it
  8208. if (!this.observers) {
  8209. this.observers = {};
  8210. } //if not already assigned, make a new unique cache ID
  8211. if (!element._eventCacheID) {
  8212. var idPrefix = "eventCacheID_";
  8213. if (element.id) {
  8214. idPrefix = element.id + "_" + idPrefix;
  8215. }
  8216. element._eventCacheID = Util_Util.createUniqueID(idPrefix);
  8217. }
  8218. var cacheID = element._eventCacheID; //if there is not yet a hash entry for this element, add one
  8219. if (!this.observers[cacheID]) {
  8220. this.observers[cacheID] = [];
  8221. } //add a new observer to this element's list
  8222. this.observers[cacheID].push({
  8223. 'element': element,
  8224. 'name': name,
  8225. 'observer': observer,
  8226. 'useCapture': useCapture
  8227. }); //add the actual browser event listener
  8228. if (element.addEventListener) {
  8229. if (name === 'mousewheel') {
  8230. // https://www.chromestatus.com/features/6662647093133312
  8231. element.addEventListener(name, observer, {
  8232. useCapture: useCapture,
  8233. passive: false
  8234. });
  8235. } else {
  8236. element.addEventListener(name, observer, useCapture);
  8237. }
  8238. } else if (element.attachEvent) {
  8239. element.attachEvent('on' + name, observer);
  8240. }
  8241. },
  8242. /**
  8243. * @description Given the id of an element to stop observing, cycle through the
  8244. * element's cached observers, calling stopObserving on each one,
  8245. * skipping those entries which can no longer be removed.
  8246. *
  8247. * @param {(HTMLElement|string)} elementParam -
  8248. */
  8249. stopObservingElement: function stopObservingElement(elementParam) {
  8250. var element = Util_Util.getElement(elementParam);
  8251. var cacheID = element._eventCacheID;
  8252. this._removeElementObservers(SuperMap.Event.observers[cacheID]);
  8253. },
  8254. /**
  8255. * @param {Array.<Object>} elementObservers - Array of (element, name,
  8256. * observer, usecapture) objects,
  8257. * taken directly from hashtable
  8258. */
  8259. _removeElementObservers: function _removeElementObservers(elementObservers) {
  8260. if (elementObservers) {
  8261. for (var i = elementObservers.length - 1; i >= 0; i--) {
  8262. var entry = elementObservers[i];
  8263. var args = new Array(entry.element, entry.name, entry.observer, entry.useCapture);
  8264. SuperMap.Event.stopObserving.apply(this, args);
  8265. }
  8266. }
  8267. },
  8268. /**
  8269. * @description 移除事件监听和注册的事件处理方法。注意:事件的移除和监听相对应,移除时的各属性信息必须监听时
  8270. * 保持一致才能确保事件移除成功。
  8271. * @param {(HTMLElement|string)} elementParam - 被监听的 DOM 元素或者其 ID。
  8272. * @param {string} name - 需要移除的被监听事件名称。
  8273. * @param {function} observer - 需要移除的事件处理方法。
  8274. * @param {boolean} [useCapture=false] - 是否捕获。
  8275. * @returns {boolean} Whether or not the event observer was removed
  8276. */
  8277. stopObserving: function stopObserving(elementParam, name, observer, useCapture) {
  8278. useCapture = useCapture || false;
  8279. var element = Util_Util.getElement(elementParam);
  8280. var cacheID = element._eventCacheID;
  8281. if (name === 'keypress') {
  8282. if (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent) {
  8283. name = 'keydown';
  8284. }
  8285. } // find element's entry in this.observers cache and remove it
  8286. var foundEntry = false;
  8287. var elementObservers = SuperMap.Event.observers[cacheID];
  8288. if (elementObservers) {
  8289. // find the specific event type in the element's list
  8290. var i = 0;
  8291. while (!foundEntry && i < elementObservers.length) {
  8292. var cacheEntry = elementObservers[i];
  8293. if (cacheEntry.name === name && cacheEntry.observer === observer && cacheEntry.useCapture === useCapture) {
  8294. elementObservers.splice(i, 1);
  8295. if (elementObservers.length == 0) {
  8296. delete SuperMap.Event.observers[cacheID];
  8297. }
  8298. foundEntry = true;
  8299. break;
  8300. }
  8301. i++;
  8302. }
  8303. } //actually remove the event listener from browser
  8304. if (foundEntry) {
  8305. if (element.removeEventListener) {
  8306. element.removeEventListener(name, observer, useCapture);
  8307. } else if (element && element.detachEvent) {
  8308. element.detachEvent('on' + name, observer);
  8309. }
  8310. }
  8311. return foundEntry;
  8312. },
  8313. /**
  8314. * @description Cycle through all the element entries in the events cache and call
  8315. * stopObservingElement on each.
  8316. */
  8317. unloadCache: function unloadCache() {
  8318. // check for SuperMap.Event before checking for observers, because
  8319. // SuperMap.Event may be undefined in IE if no map instance was
  8320. // created
  8321. if (SuperMap.Event && SuperMap.Event.observers) {
  8322. for (var cacheID in SuperMap.Event.observers) {
  8323. var elementObservers = SuperMap.Event.observers[cacheID];
  8324. SuperMap.Event._removeElementObservers.apply(this, [elementObservers]);
  8325. }
  8326. SuperMap.Event.observers = false;
  8327. }
  8328. },
  8329. CLASS_NAME: "SuperMap.Event"
  8330. };
  8331. SuperMap.Event = Event;
  8332. /* prevent memory leaks in IE */
  8333. SuperMap.Event.observe(window, 'unload', SuperMap.Event.unloadCache, false);
  8334. // CONCATENATED MODULE: ./src/common/commontypes/Events.js
  8335. 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); }
  8336. function Events_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8337. 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); } }
  8338. function Events_createClass(Constructor, protoProps, staticProps) { if (protoProps) Events_defineProperties(Constructor.prototype, protoProps); if (staticProps) Events_defineProperties(Constructor, staticProps); return Constructor; }
  8339. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  8340. * This program are made available under the terms of the Apache License, Version 2.0
  8341. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8342. /**
  8343. * @class SuperMap.Events
  8344. * @classdesc 事件类。
  8345. * @param {Object} object - 当前事件对象被添加到的 JS 对象。
  8346. * @param {HTMLElement} element - 响应浏览器事件的 DOM 元素。
  8347. * @param {Array.<string>} eventTypes - 自定义应用事件的数组。
  8348. * @param {boolean} [fallThrough=false] - 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  8349. * @param {Object} options - 事件对象选项。
  8350. */
  8351. var Events_Events = /*#__PURE__*/function () {
  8352. function Events(object, element, eventTypes, fallThrough, options) {
  8353. Events_classCallCheck(this, Events);
  8354. /**
  8355. * @member {Array.<string>} SuperMap.Events.prototype.BROWSER_EVENTS
  8356. * @description 支持的事件。
  8357. * @constant
  8358. * @default [
  8359. "mouseover", "mouseout","mousedown", "mouseup", "mousemove",
  8360. "click", "dblclick", "rightclick", "dblrightclick","resize",
  8361. "focus", "blur","touchstart", "touchmove", "touchend","keydown",
  8362. "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup",
  8363. "MSGestureStart", "MSGestureChange", "MSGestureEnd","contextmenu"
  8364. ]
  8365. */
  8366. 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"];
  8367. /**
  8368. * @member {Object} SuperMap.Events.prototype.listeners
  8369. * @description Hashtable of Array(function): events listener functions
  8370. */
  8371. this.listeners = {};
  8372. /**
  8373. * @member {Object} SuperMap.Events.prototype.object
  8374. * @description 发布应用程序事件的对象。
  8375. */
  8376. this.object = object;
  8377. /**
  8378. * @member {HTMLElement} SuperMap.Events.prototype.element
  8379. * @description 接受浏览器事件的 DOM 节点。
  8380. */
  8381. this.element = null;
  8382. /**
  8383. * @member {Array.<string>} SuperMap.Events.prototype.eventTypes
  8384. * @description 支持的事件类型列表。
  8385. */
  8386. this.eventTypes = [];
  8387. /**
  8388. * @member {function} SuperMap.Events.prototype.eventHandler
  8389. * @description 绑定在元素上的事件处理器对象。
  8390. */
  8391. this.eventHandler = null;
  8392. /**
  8393. * @member {boolean} [SuperMap.Events.prototype.fallThrough=false]
  8394. * @description 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  8395. */
  8396. this.fallThrough = fallThrough;
  8397. /**
  8398. * @member {boolean} [SuperMap.Events.prototype.includeXY=false]
  8399. * @description 判断是否让 xy 属性自动创建到浏览器上的鼠标事件,一般设置为 false,如果设置为 true,鼠标事件将会在事件传递过程中自动产生 xy 属性。
  8400. * 可根据事件对象的 'evt.object' 属性在相关的事件句柄上调用 getMousePosition 函数。这个选项习惯默认为 false 的原因在于,当创建一个
  8401. * 事件对象,其主要目的是管理。在一个 div 的相对定位的鼠标事件,将其设为 true 也是有意义的。这个选项也可以用来控制是否抵消缓存。如果
  8402. * 设为 false 不抵消,如果设为 true,用 this.clearMouseCache() 清除缓存偏移(边界元素偏移,元素在页面的位置偏移)。
  8403. * @example
  8404. * function named(evt) {
  8405. * this.xy = this.object.events.getMousePosition(evt);
  8406. * }
  8407. */
  8408. this.includeXY = false;
  8409. /**
  8410. * @member {Object} SuperMap.Events.prototype.extensions
  8411. * @description 事件扩展。Keys 代表事件类型,values 代表事件对象。
  8412. * @example
  8413. * 以扩展 "foostart" 和 "fooend" 事件为例。展示替换 css 属性为 foo 的元素的 click 事件。
  8414. *
  8415. * SuperMap.Events.foostart = SuperMap.Class({
  8416. * initialize: function(target) {
  8417. * this.target = target;
  8418. * this.target.register("click", this, this.doStuff, {extension: true});
  8419. * // only required if extension provides more than one event type
  8420. * this.target.extensions["foostart"] = true;
  8421. * this.target.extensions["fooend"] = true;
  8422. * },
  8423. * destroy: function() {
  8424. * var target = this.target;
  8425. * target.unregister("click", this, this.doStuff);
  8426. * delete this.target;
  8427. * // only required if extension provides more than one event type
  8428. * delete target.extensions["foostart"];
  8429. * delete target.extensions["fooend"];
  8430. * },
  8431. * doStuff: function(evt) {
  8432. * var propagate = true;
  8433. * if (SuperMap.Event.element(evt).className === "foo") {
  8434. * propagate = false;
  8435. * var target = this.target;
  8436. * target.triggerEvent("foostart");
  8437. * window.setTimeout(function() {
  8438. * target.triggerEvent("fooend");
  8439. * }, 1000);
  8440. * }
  8441. * return propagate;
  8442. * }
  8443. * });
  8444. * // only required if extension provides more than one event type
  8445. * SuperMap.Events.fooend = SuperMap.Events.foostart;
  8446. */
  8447. this.extensions = {};
  8448. /**
  8449. * @member {Object} SuperMap.Events.prototype.extensionCount
  8450. */
  8451. this.extensionCount = {};
  8452. /**
  8453. * @member {Object} SuperMap.Events.prototype.clearMouseListener
  8454. */
  8455. this.clearMouseListener = null;
  8456. Util_Util.extend(this, options);
  8457. if (eventTypes != null) {
  8458. for (var i = 0, len = eventTypes.length; i < len; i++) {
  8459. this.addEventType(eventTypes[i]);
  8460. }
  8461. }
  8462. if (element != null) {
  8463. this.attachToElement(element);
  8464. }
  8465. this.CLASS_NAME = "SuperMap.Events";
  8466. }
  8467. /**
  8468. * @function SuperMap.Events.prototype.destroy
  8469. * @description 移除当前要素 element 上的所有事件监听和处理。
  8470. */
  8471. Events_createClass(Events, [{
  8472. key: "destroy",
  8473. value: function destroy() {
  8474. for (var e in this.extensions) {
  8475. if (typeof this.extensions[e] !== "boolean") {
  8476. this.extensions[e].destroy();
  8477. }
  8478. }
  8479. this.extensions = null;
  8480. if (this.element) {
  8481. Event.stopObservingElement(this.element);
  8482. if (this.element.hasScrollEvent) {
  8483. Event.stopObserving(window, "scroll", this.clearMouseListener);
  8484. }
  8485. }
  8486. this.element = null;
  8487. this.listeners = null;
  8488. this.object = null;
  8489. this.eventTypes = null;
  8490. this.fallThrough = null;
  8491. this.eventHandler = null;
  8492. }
  8493. /**
  8494. * @function SuperMap.Events.prototype.addEventType
  8495. * @description 在此事件对象中添加新的事件类型,如果这个事件类型已经添加过了,则不做任何事情。
  8496. * @param {string} eventName - 事件名。
  8497. */
  8498. }, {
  8499. key: "addEventType",
  8500. value: function addEventType(eventName) {
  8501. if (!this.listeners[eventName]) {
  8502. this.eventTypes.push(eventName);
  8503. this.listeners[eventName] = [];
  8504. }
  8505. }
  8506. /**
  8507. * @function SuperMap.Events.prototype.attachToElement
  8508. * @description 给 DOM 元素绑定浏览器事件。
  8509. * @param {HTMLDOMElement} element - 绑定浏览器事件的 DOM 元素。
  8510. */
  8511. }, {
  8512. key: "attachToElement",
  8513. value: function attachToElement(element) {
  8514. if (this.element) {
  8515. Event.stopObservingElement(this.element);
  8516. } else {
  8517. // keep a bound copy of handleBrowserEvent() so that we can
  8518. // pass the same function to both Event.observe() and .stopObserving()
  8519. this.eventHandler = FunctionExt.bindAsEventListener(this.handleBrowserEvent, this); // to be used with observe and stopObserving
  8520. this.clearMouseListener = FunctionExt.bind(this.clearMouseCache, this);
  8521. }
  8522. this.element = element;
  8523. for (var i = 0, len = this.BROWSER_EVENTS.length; i < len; i++) {
  8524. var eventType = this.BROWSER_EVENTS[i]; // every browser event has a corresponding application event
  8525. // (whether it's listened for or not).
  8526. this.addEventType(eventType); // use Prototype to register the event cross-browser
  8527. Event.observe(element, eventType, this.eventHandler);
  8528. } // disable dragstart in IE so that mousedown/move/up works normally
  8529. Event.observe(element, "dragstart", Event.stop);
  8530. }
  8531. /**
  8532. * @function SuperMap.Events.prototype.on
  8533. * @description 在一个相同的范围内注册监听器的方法,此方法调用 register 函数。
  8534. * @example
  8535. * // 注册一个 "loadstart" 监听事件
  8536. * events.on({"loadstart": loadStartListener});
  8537. *
  8538. * // 同样注册一个 "loadstart" 监听事件
  8539. * events.register("loadstart", undefined, loadStartListener);
  8540. *
  8541. * // 同时为对象注册多个监听事件
  8542. * events.on({
  8543. * "loadstart": loadStartListener,
  8544. * "loadend": loadEndListener,
  8545. * scope: object
  8546. * });
  8547. *
  8548. * // 同时为对象注册多个监听事件,多次调用 register 方法
  8549. * events.register("loadstart", object, loadStartListener);
  8550. * events.register("loadend", object, loadEndListener);
  8551. *
  8552. *
  8553. * @param {Object} object - 添加监听的对象。
  8554. */
  8555. }, {
  8556. key: "on",
  8557. value: function on(object) {
  8558. for (var type in object) {
  8559. if (type !== "scope" && object.hasOwnProperty(type)) {
  8560. this.register(type, object.scope, object[type]);
  8561. }
  8562. }
  8563. }
  8564. /**
  8565. * @function SuperMap.Events.prototype.register
  8566. * @description 在事件对象上注册一个事件。当事件被触发时,'func' 函数被调用,假设我们触发一个事件,
  8567. * 指定 SuperMap.Bounds 作为 "obj",当事件被触发时,回调函数的上下文作为 Bounds 对象。
  8568. * @param {string} type - 事件注册者的名字。
  8569. * @param {Object} [obj=this.object] - 对象绑定的回调。
  8570. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  8571. * @param {(boolean|Object)} [priority] - 当为 true 时将新的监听加在事件队列的前面。
  8572. */
  8573. }, {
  8574. key: "register",
  8575. value: function register(type, obj, func, priority) {
  8576. if (type in Events && !this.extensions[type]) {
  8577. this.extensions[type] = new Events[type](this);
  8578. }
  8579. if (func != null && Util_Util.indexOf(this.eventTypes, type) !== -1) {
  8580. if (obj == null) {
  8581. obj = this.object;
  8582. }
  8583. var listeners = this.listeners[type];
  8584. if (!listeners) {
  8585. listeners = [];
  8586. this.listeners[type] = listeners;
  8587. this.extensionCount[type] = 0;
  8588. }
  8589. var listener = {
  8590. obj: obj,
  8591. func: func
  8592. };
  8593. if (priority) {
  8594. listeners.splice(this.extensionCount[type], 0, listener);
  8595. if (Events_typeof(priority) === "object" && priority.extension) {
  8596. this.extensionCount[type]++;
  8597. }
  8598. } else {
  8599. listeners.push(listener);
  8600. }
  8601. }
  8602. }
  8603. /**
  8604. * @function SuperMap.Events.prototype.registerPriority
  8605. * @description 相同的注册方法,但是在前面增加新的监听者事件查询而代替到方法的结束。
  8606. * @param {string} type - 事件注册者的名字。
  8607. * @param {Object} [obj=this.object] - 对象绑定方面的回调。
  8608. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  8609. */
  8610. }, {
  8611. key: "registerPriority",
  8612. value: function registerPriority(type, obj, func) {
  8613. this.register(type, obj, func, true);
  8614. }
  8615. /**
  8616. * @function SuperMap.Events.prototype.un
  8617. * @description 在一个相同的范围内取消注册监听器的方法,此方法调用 unregister 函数。
  8618. * @example
  8619. * // 移除 "loadstart" 事件监听
  8620. * events.un({"loadstart": loadStartListener});
  8621. *
  8622. * // 使用 "unregister" 方法移除 "loadstart" 事件监听
  8623. * events.unregister("loadstart", undefined, loadStartListener);
  8624. *
  8625. * // 取消对象多个事件监听
  8626. * events.un({
  8627. * "loadstart": loadStartListener,
  8628. * "loadend": loadEndListener,
  8629. * scope: object
  8630. * });
  8631. *
  8632. * // 取消对象多个事件监听,多次调用unregister方法。
  8633. * events.unregister("loadstart", object, loadStartListener);
  8634. * events.unregister("loadend", object, loadEndListener);
  8635. *
  8636. * @param {Object} object - 移除监听的对象。
  8637. */
  8638. }, {
  8639. key: "un",
  8640. value: function un(object) {
  8641. for (var type in object) {
  8642. if (type !== "scope" && object.hasOwnProperty(type)) {
  8643. this.unregister(type, object.scope, object[type]);
  8644. }
  8645. }
  8646. }
  8647. /**
  8648. * @function SuperMap.Events.prototype.unregister
  8649. * @description 取消注册。
  8650. * @param {string} type - 事件类型。
  8651. * @param {Object} [obj=this.object] - 对象绑定方面的回调。
  8652. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  8653. */
  8654. }, {
  8655. key: "unregister",
  8656. value: function unregister(type, obj, func) {
  8657. if (obj == null) {
  8658. obj = this.object;
  8659. }
  8660. var listeners = this.listeners[type];
  8661. if (listeners != null) {
  8662. for (var i = 0, len = listeners.length; i < len; i++) {
  8663. if (listeners[i].obj === obj && listeners[i].func === func) {
  8664. listeners.splice(i, 1);
  8665. break;
  8666. }
  8667. }
  8668. }
  8669. }
  8670. /**
  8671. * @function SuperMap.Events.prototype.remove
  8672. * @description 删除某个事件类型的所有监听,如果该事件类型没有注册,则不做任何操作。
  8673. * @param {string} type - 事件类型。
  8674. */
  8675. }, {
  8676. key: "remove",
  8677. value: function remove(type) {
  8678. if (this.listeners[type] != null) {
  8679. this.listeners[type] = [];
  8680. }
  8681. }
  8682. /**
  8683. * @function SuperMap.Events.prototype.triggerEvent
  8684. * @description 触发一个特定的注册事件。
  8685. * @param {string} type - 触发事件类型。
  8686. * @param {Event} evt - 事件对象。
  8687. * @returns {boolean} 返回监听对象,如果返回是 false,则停止监听。
  8688. */
  8689. }, {
  8690. key: "triggerEvent",
  8691. value: function triggerEvent(type, evt) {
  8692. var listeners = this.listeners[type]; // fast path
  8693. if (!listeners || listeners.length == 0) {
  8694. return undefined;
  8695. } // prep evt object with object & div references
  8696. if (evt == null) {
  8697. evt = {};
  8698. }
  8699. evt.object = this.object;
  8700. evt.element = this.element;
  8701. if (!evt.type) {
  8702. evt.type = type;
  8703. } // execute all callbacks registered for specified type
  8704. // get a clone of the listeners array to
  8705. // allow for splicing during callbacks
  8706. listeners = listeners.slice();
  8707. var continueChain;
  8708. for (var i = 0, len = listeners.length; i < len; i++) {
  8709. var callback = listeners[i]; // bind the context to callback.obj
  8710. continueChain = callback.func.apply(callback.obj, [evt]);
  8711. if (continueChain != undefined && continueChain === false) {
  8712. // if callback returns false, execute no more callbacks.
  8713. break;
  8714. }
  8715. } // don't fall through to other DOM elements
  8716. if (!this.fallThrough) {
  8717. Event.stop(evt, true);
  8718. }
  8719. return continueChain;
  8720. }
  8721. /**
  8722. * @function SuperMap.Events.prototype.handleBrowserEvent
  8723. * @description 对 triggerEvent 函数的包装,给事件对象设置了 xy 属性(即当前鼠标点的 xy 坐标)。
  8724. * @param {Event} evt - 事件对象。
  8725. */
  8726. }, {
  8727. key: "handleBrowserEvent",
  8728. value: function handleBrowserEvent(evt) {
  8729. var type = evt.type,
  8730. listeners = this.listeners[type];
  8731. if (!listeners || listeners.length == 0) {
  8732. // noone's listening, bail out
  8733. return;
  8734. } // add clientX & clientY to all events - corresponds to average x, y
  8735. var touches = evt.touches;
  8736. if (touches && touches[0]) {
  8737. var x = 0;
  8738. var y = 0;
  8739. var num = touches.length;
  8740. var touch;
  8741. for (var i = 0; i < num; ++i) {
  8742. touch = touches[i];
  8743. x += touch.clientX;
  8744. y += touch.clientY;
  8745. }
  8746. evt.clientX = x / num;
  8747. evt.clientY = y / num;
  8748. }
  8749. if (this.includeXY) {
  8750. evt.xy = this.getMousePosition(evt);
  8751. }
  8752. this.triggerEvent(type, evt);
  8753. }
  8754. /**
  8755. * @function SuperMap.Events.prototype.clearMouseCache
  8756. * @description 清除鼠标缓存。
  8757. */
  8758. }, {
  8759. key: "clearMouseCache",
  8760. value: function clearMouseCache() {
  8761. this.element.scrolls = null;
  8762. this.element.lefttop = null;
  8763. var body = document.body;
  8764. if (body && !((body.scrollTop != 0 || body.scrollLeft != 0) && navigator.userAgent.match(/iPhone/i))) {
  8765. this.element.offsets = null;
  8766. }
  8767. }
  8768. /**
  8769. * @function SuperMap.Events.prototype.getMousePosition
  8770. * @param {Event} evt - 事件对象。
  8771. * @returns {SuperMap.Pixel} 当前的鼠标的 xy 坐标点。
  8772. */
  8773. }, {
  8774. key: "getMousePosition",
  8775. value: function getMousePosition(evt) {
  8776. if (!this.includeXY) {
  8777. this.clearMouseCache();
  8778. } else if (!this.element.hasScrollEvent) {
  8779. Event.observe(window, "scroll", this.clearMouseListener);
  8780. this.element.hasScrollEvent = true;
  8781. }
  8782. if (!this.element.scrolls) {
  8783. var viewportElement = Util_Util.getViewportElement();
  8784. this.element.scrolls = [viewportElement.scrollLeft, viewportElement.scrollTop];
  8785. }
  8786. if (!this.element.lefttop) {
  8787. this.element.lefttop = [document.documentElement.clientLeft || 0, document.documentElement.clientTop || 0];
  8788. }
  8789. if (!this.element.offsets) {
  8790. this.element.offsets = Util_Util.pagePosition(this.element);
  8791. }
  8792. return new Pixel_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]);
  8793. }
  8794. }]);
  8795. return Events;
  8796. }();
  8797. SuperMap.Events = Events_Events;
  8798. 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"];
  8799. // CONCATENATED MODULE: ./src/common/commontypes/Feature.js
  8800. function Feature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8801. 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); } }
  8802. function Feature_createClass(Constructor, protoProps, staticProps) { if (protoProps) Feature_defineProperties(Constructor.prototype, protoProps); if (staticProps) Feature_defineProperties(Constructor, staticProps); return Constructor; }
  8803. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  8804. * This program are made available under the terms of the Apache License, Version 2.0
  8805. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8806. /**
  8807. * @class SuperMap.Feature
  8808. * @category BaseTypes Geometry
  8809. * @classdesc 要素类组合了地理和属性,Feature 类同时具有 marker 和 lonlat 属性。
  8810. * @param {SuperMap.Layer} layer - 图层。
  8811. * @param {SuperMap.LonLat} lonlat - 经纬度。
  8812. * @param {Object} data - 数据对象。
  8813. */
  8814. var Feature_Feature = /*#__PURE__*/function () {
  8815. function Feature(layer, lonlat, data) {
  8816. Feature_classCallCheck(this, Feature);
  8817. this.CLASS_NAME = "SuperMap.Feature";
  8818. /**
  8819. * @deprecated
  8820. * @member {SuperMap.Layer} SuperMap.Feature.prototype.layer
  8821. * @description 图层。
  8822. */
  8823. this.layer = layer;
  8824. /**
  8825. * @member {string} SuperMap.Feature.prototype.id
  8826. * @description 要素 ID。
  8827. */
  8828. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  8829. /**
  8830. * @member {SuperMap.LonLat} SuperMap.Feature.prototype.lonlat
  8831. * @description 经纬度。
  8832. *
  8833. */
  8834. this.lonlat = lonlat;
  8835. /**
  8836. * @member {Object} SuperMap.Feature.prototype.data
  8837. * @description 数据对象。
  8838. */
  8839. this.data = data != null ? data : {};
  8840. }
  8841. /**
  8842. * @function SuperMap.Feature.prototype.destroy
  8843. * @description 释放相关资源。
  8844. */
  8845. Feature_createClass(Feature, [{
  8846. key: "destroy",
  8847. value: function destroy() {
  8848. this.id = null;
  8849. this.lonlat = null;
  8850. this.data = null;
  8851. }
  8852. }]);
  8853. return Feature;
  8854. }();
  8855. SuperMap.Feature = Feature_Feature;
  8856. // CONCATENATED MODULE: ./src/common/commontypes/Vector.js
  8857. 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); }
  8858. function Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8859. 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); } }
  8860. function Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Vector_defineProperties(Constructor, staticProps); return Constructor; }
  8861. 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); }
  8862. function Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  8863. 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); }
  8864. function Vector_setPrototypeOf(o, p) { Vector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Vector_setPrototypeOf(o, p); }
  8865. 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); }; }
  8866. function Vector_possibleConstructorReturn(self, call) { if (call && (Vector_typeof(call) === "object" || typeof call === "function")) { return call; } return Vector_assertThisInitialized(self); }
  8867. function Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8868. 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; } }
  8869. function Vector_getPrototypeOf(o) { Vector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Vector_getPrototypeOf(o); }
  8870. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  8871. * This program are made available under the terms of the Apache License, Version 2.0
  8872. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8873. /**
  8874. * @class SuperMap.Feature.Vector
  8875. * @category BaseTypes Geometry
  8876. * @classdesc 矢量要素类。该类具有 Geometry 属性存放几何信息,
  8877. * attributes 属性存放非几何信息,另外还包含了 style 属性,用来定义矢量要素的样式,
  8878. * 其中,默认的样式在 {@link SuperMap.Feature.Vector.style} 类中定义,如果没有特别的指定将使用默认的样式。
  8879. * @extends {SuperMap.Feature}
  8880. * @param {SuperMap.Geometry} geometry - 代表要素的几何形状。
  8881. * @param {Object} [attributes] - 描述要素的任意的可序列化属性,将要映射到 attributes 属性中的对象。
  8882. * @param {Object} [style] - 样式对象。
  8883. * @example
  8884. * var geometry = new SuperMap.Geometry.Point(-115,10);
  8885. * var style = {
  8886. * strokeColor:"#339933",
  8887. * strokeOpacity:1,
  8888. * strokeWidth:3,
  8889. * pointRadius:6
  8890. * }
  8891. * var pointFeature = new SuperMap.Feature.Vector(geometry,null,style);
  8892. * vectorLayer.addFeatures(pointFeature);
  8893. */
  8894. var Vector_Vector = /*#__PURE__*/function (_Feature) {
  8895. Vector_inherits(Vector, _Feature);
  8896. var _super = Vector_createSuper(Vector);
  8897. function Vector(geometry, attributes, style) {
  8898. var _this;
  8899. Vector_classCallCheck(this, Vector);
  8900. _this = _super.call(this, null, null, attributes);
  8901. /**
  8902. * @member {string} SuperMap.Feature.Vector.prototype.fid
  8903. * @description fid
  8904. */
  8905. _this.fid = null;
  8906. /**
  8907. * @member {SuperMap.Geometry} SuperMap.Feature.Vector.prototype.geometry
  8908. * @description 该属性用于存放几何信息。
  8909. */
  8910. _this.geometry = geometry ? geometry : null;
  8911. /**
  8912. * @member {Object} SuperMap.Feature.Vector.prototype.attributes
  8913. * @description 描述要素的任意的可序列化属性。
  8914. */
  8915. _this.attributes = {};
  8916. if (attributes) {
  8917. _this.attributes = Util_Util.extend(_this.attributes, attributes);
  8918. }
  8919. /**
  8920. * @member {SuperMap.Bounds} SuperMap.Feature.Vector.prototype.bounds
  8921. * @description The box bounding that feature's geometry, that
  8922. * property can be set by an <SuperMap.Format> object when
  8923. * deserializing the feature, so in most cases it represents an
  8924. * information set by the server.
  8925. */
  8926. _this.bounds = null;
  8927. /**
  8928. * @member {string} SuperMap.Feature.Vector.prototype.state
  8929. * @description state
  8930. */
  8931. _this.state = null;
  8932. /**
  8933. * @member {Object} SuperMap.Feature.Vector.prototype.style
  8934. * @description 要素的样式属性,地图查询返回的 feature 的 style,8C 变为null。
  8935. */
  8936. _this.style = style ? style : null;
  8937. /**
  8938. * @member {string} SuperMap.Feature.Vector.prototype.url
  8939. * @description 如果设置了这个属性,在更新或者删除要素时需要考虑 {@link SuperMap.HTTP} 。
  8940. */
  8941. _this.url = null;
  8942. _this.lonlat = null;
  8943. _this.CLASS_NAME = "SuperMap.Feature.Vector"; // TRASH THIS
  8944. SuperMap.State = {
  8945. /** states */
  8946. UNKNOWN: 'Unknown',
  8947. INSERT: 'Insert',
  8948. UPDATE: 'Update',
  8949. DELETE: 'Delete'
  8950. };
  8951. Vector.style = {
  8952. 'default': {
  8953. fillColor: "#ee9900",
  8954. fillOpacity: 0.4,
  8955. hoverFillColor: "white",
  8956. hoverFillOpacity: 0.8,
  8957. strokeColor: "#ee9900",
  8958. strokeOpacity: 1,
  8959. strokeWidth: 1,
  8960. strokeLinecap: "round",
  8961. strokeDashstyle: "solid",
  8962. hoverStrokeColor: "red",
  8963. hoverStrokeOpacity: 1,
  8964. hoverStrokeWidth: 0.2,
  8965. pointRadius: 6,
  8966. hoverPointRadius: 1,
  8967. hoverPointUnit: "%",
  8968. pointerEvents: "visiblePainted",
  8969. cursor: "inherit",
  8970. fontColor: "#000000",
  8971. labelAlign: "cm",
  8972. labelOutlineColor: "white",
  8973. labelOutlineWidth: 3
  8974. },
  8975. 'select': {
  8976. fillColor: "blue",
  8977. fillOpacity: 0.4,
  8978. hoverFillColor: "white",
  8979. hoverFillOpacity: 0.8,
  8980. strokeColor: "blue",
  8981. strokeOpacity: 1,
  8982. strokeWidth: 2,
  8983. strokeLinecap: "round",
  8984. strokeDashstyle: "solid",
  8985. hoverStrokeColor: "red",
  8986. hoverStrokeOpacity: 1,
  8987. hoverStrokeWidth: 0.2,
  8988. pointRadius: 6,
  8989. hoverPointRadius: 1,
  8990. hoverPointUnit: "%",
  8991. pointerEvents: "visiblePainted",
  8992. cursor: "pointer",
  8993. fontColor: "#000000",
  8994. labelAlign: "cm",
  8995. labelOutlineColor: "white",
  8996. labelOutlineWidth: 3
  8997. },
  8998. 'temporary': {
  8999. fillColor: "#66cccc",
  9000. fillOpacity: 0.2,
  9001. hoverFillColor: "white",
  9002. hoverFillOpacity: 0.8,
  9003. strokeColor: "#66cccc",
  9004. strokeOpacity: 1,
  9005. strokeLinecap: "round",
  9006. strokeWidth: 2,
  9007. strokeDashstyle: "solid",
  9008. hoverStrokeColor: "red",
  9009. hoverStrokeOpacity: 1,
  9010. hoverStrokeWidth: 0.2,
  9011. pointRadius: 6,
  9012. hoverPointRadius: 1,
  9013. hoverPointUnit: "%",
  9014. pointerEvents: "visiblePainted",
  9015. //cursor:"inherit",
  9016. cursor: "default",
  9017. fontColor: "#000000",
  9018. labelAlign: "cm",
  9019. labelOutlineColor: "white",
  9020. labelOutlineWidth: 3
  9021. },
  9022. 'delete': {
  9023. display: "none"
  9024. }
  9025. };
  9026. return _this;
  9027. }
  9028. /**
  9029. * @function SuperMap.Feature.Vector.prototype.destroy
  9030. * @description nullify references to prevent circular references and memory leaks
  9031. */
  9032. Vector_createClass(Vector, [{
  9033. key: "destroy",
  9034. value: function destroy() {
  9035. if (this.layer) {
  9036. this.layer.removeFeatures(this);
  9037. this.layer = null;
  9038. }
  9039. this.geometry = null;
  9040. Vector_get(Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  9041. }
  9042. /**
  9043. * @function SuperMap.Feature.Vector.prototype.clone
  9044. * @description Create a clone of this vector feature. Does not set any non-standard
  9045. * properties.
  9046. * @returns {SuperMap.Feature.Vector} An exact clone of this vector feature.
  9047. */
  9048. }, {
  9049. key: "clone",
  9050. value: function clone() {
  9051. return new Vector(this.geometry ? this.geometry.clone() : null, this.attributes, this.style);
  9052. }
  9053. /**
  9054. * @function SuperMap.Feature.Vector.prototype.toState
  9055. * @description 设置新状态。
  9056. * @param {string} state - 状态。
  9057. */
  9058. }, {
  9059. key: "toState",
  9060. value: function toState(state) {
  9061. if (state === SuperMap.State.UPDATE) {
  9062. switch (this.state) {
  9063. case SuperMap.State.UNKNOWN:
  9064. case SuperMap.State.DELETE:
  9065. this.state = state;
  9066. break;
  9067. case SuperMap.State.UPDATE:
  9068. case SuperMap.State.INSERT:
  9069. break;
  9070. }
  9071. } else if (state === SuperMap.State.INSERT) {
  9072. switch (this.state) {
  9073. case SuperMap.State.UNKNOWN:
  9074. break;
  9075. default:
  9076. this.state = state;
  9077. break;
  9078. }
  9079. } else if (state === SuperMap.State.DELETE) {
  9080. switch (this.state) {
  9081. case SuperMap.State.INSERT:
  9082. // the feature should be destroyed
  9083. break;
  9084. case SuperMap.State.DELETE:
  9085. break;
  9086. case SuperMap.State.UNKNOWN:
  9087. case SuperMap.State.UPDATE:
  9088. this.state = state;
  9089. break;
  9090. }
  9091. } else if (state === SuperMap.State.UNKNOWN) {
  9092. this.state = state;
  9093. }
  9094. }
  9095. }]);
  9096. return Vector;
  9097. }(Feature_Feature);
  9098. /**
  9099. *
  9100. * @typedef {Object} SuperMap.Feature.Vector.style
  9101. * @description SuperMap.features 有大量的样式属性,如果没有特别的指定将使用默认的样式,
  9102. * 大部分样式通过 SVG 标准定义属性。
  9103. * - fill properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#FillProperties}
  9104. * - stroke properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#StrokeProperties}
  9105. * @property {boolean} [fill] - 不需要填充则设置为 false。
  9106. * @property {string} [fillColor='#ee9900'] - 十六进制填充颜色。
  9107. * @property {number} [fillOpacity=0.4] - 填充不透明度。
  9108. * @property {boolean} [stroke] - 不需要描边则设为 false。
  9109. * @property {string} [strokeColor='#ee9900'] - 十六进制描边颜色。
  9110. * @property {number} [strokeOpacity=0.4] - 描边的不透明度(0-1)。
  9111. * @property {number} [strokeWidth=1] - 像素描边宽度。
  9112. * @property {string} [strokeLinecap='round'] - strokeLinecap 有三种类型 butt,round,square。
  9113. * @property {string} [strokeDashstyle='solid'] - 有 dot,dash,dashdot,longdash,longdashdot,solid 几种样式。
  9114. * @property {boolean} [graphic] - 不需要则设置为 false。
  9115. * @property {number} [pointRadius=6] - 像素点半径。
  9116. * @property {string} [pointerEvents='visiblePainted'] - pointerEvents。
  9117. * @property {string} [cursor] - cursor。
  9118. * @property {boolean} [allowRotate='false'] - 是否允许图标随着运行方向旋转。用于时空数据图层。
  9119. * @property {string} [externalGraphic] - 连接到用来渲染点的外部的图形。
  9120. * @property {number} [graphicWidth] - 外部图表的像素宽度。
  9121. * @property {number} [graphicHeight] - 外部图表的高宽度。
  9122. * @property {number} [graphicOpacity] - 外部图表的不透明度(0-1)。
  9123. * @property {number} [graphicXOffset] - 外部图表沿着x方向的偏移量。
  9124. * @property {number} [graphicYOffset] - 外部图表沿着y方向的偏移量 Pixel。
  9125. * @property {number} [rotation] - 一个图表沿着其中心点(或者偏移中心指定点)在顺时针方向旋转。
  9126. * @property {number} [graphicZIndex] - 渲染时使用的索引值。
  9127. * @property {string} [graphicName='circle'] - 渲染点时图标使用的名字。支持"circle" , "square", "star", "x", "cross", "triangle"。
  9128. * @property {string} [graphicTitle] - 外部图表的提示框。
  9129. * @property {string} [backgroundGraphic] - 外部图表的背景。
  9130. * @property {number} [backgroundGraphicZIndex] - 背景图渲染时使用的索引值。
  9131. * @property {number} [backgroundXOffset] - 背景图在 x 轴的偏移量。
  9132. * @property {number} [backgroundYOffset] - 背景图在 y 轴的偏移量。
  9133. * @property {number} [backgroundHeight] - 背景图的高度。如果没有设置,将用 graphicHeight。
  9134. * @property {number} [backgroundWidth] - 背景图的宽度。如果没有设置,将用 graphicWidth。
  9135. * @property {boolean} [isUnicode=false] - 这个属性要配合 label 属性来用,当为 true时,label 就可以使用 unicode 编码,
  9136. * 比如 "a" 的 unicode 十六进制编码为 61,则 label 属性可以为 "&#x61;",其中 "&#" 为前缀,标志这个为 unicode 编码,
  9137. * "x" 是指 16 进制,这时页面显示的是 "a";当此值为 false 的时候,label 的内容会被直接输出,
  9138. * 比如,label 为 "&#x61;",这时页面显示的也是 "&#x61;"。
  9139. * @property {string} [label] - 可选的标签文本。
  9140. * @property {string} [labelAlign='cm'] - 标签对齐,是由两个字符组成的字符串,如:"lt", "cm", "rb",
  9141. * 其中第一个字符代表水平方向上的对齐,"l"=left, "c"=center, "r"=right;
  9142. * 第二个字符代表垂直方向上的对齐,"t"=top, "m"=middle, "b"=bottom。
  9143. * @property {number} [labelXOffset] - 标签在 x 轴方向的偏移量。
  9144. * @property {number} [labelYOffset] - 标签在 y 轴方向的偏移量。
  9145. * @property {boolean} [labelSelect=false] - 如果设为 true,标签可以选用 SelectFeature 或者 similar 控件。
  9146. * @property {string} [fontColor='#000000'] - 标签字体颜色。
  9147. * @property {number} [fontOpacity] - 标签透明度 (0-1)。
  9148. * @property {string} [fontFamily] - 标签的字体类型。
  9149. * @property {string} [fontSize] - 标签的字体大小。
  9150. * @property {string} [fontStyle] - 标签的字体样式。
  9151. * @property {string} [fontWeight] - 标签的字体粗细。
  9152. * @property {string} [display] - 如果 display 属性设置为 “none”,符号将没有任何效果。
  9153. * @example
  9154. * // label的用法如下:
  9155. * function addGeoTest(){
  9156. * var geometry = new SuperMap.Geometry.Point(105, 35);
  9157. * var pointFeature = new SuperMap.Feature.Vector(geometry);
  9158. * var styleTest = {
  9159. * label:"supermap",
  9160. * fontColor:"#0000ff",
  9161. * fontOpacity:"0.5",
  9162. * fontFamily:"隶书",
  9163. * fontSize:"8em",
  9164. * fontWeight:"bold",
  9165. * fontStyle:"italic",
  9166. * labelSelect:"true",
  9167. * }
  9168. * pointFeature.style = styleTest;
  9169. * vectorLayer.addFeatures([pointFeature]);
  9170. * }
  9171. */
  9172. SuperMap.Feature.Vector = Vector_Vector;
  9173. // CONCATENATED MODULE: ./src/common/commontypes/index.js
  9174. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  9175. * This program are made available under the terms of the Apache License, Version 2.0
  9176. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9177. // CONCATENATED MODULE: ./src/common/format/Format.js
  9178. function Format_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9179. 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); } }
  9180. function Format_createClass(Constructor, protoProps, staticProps) { if (protoProps) Format_defineProperties(Constructor.prototype, protoProps); if (staticProps) Format_defineProperties(Constructor, staticProps); return Constructor; }
  9181. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  9182. * This program are made available under the terms of the Apache License, Version 2.0
  9183. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9184. /**
  9185. * @class SuperMap.Format
  9186. * @classdesc 读写各种格式的格式类基类。其子类应该包含并实现 read 和 write 方法。
  9187. * @category BaseTypes Format
  9188. * @param {Object} options - 可选参数。
  9189. * @param {boolean} [options.keepData=false] - 如果设置为 true, data 属性会指向被解析的对象(例如 JSON 或 xml 数据对象)。
  9190. * @param {Object} [options.data] - 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  9191. */
  9192. var Format_Format = /*#__PURE__*/function () {
  9193. function Format(options) {
  9194. Format_classCallCheck(this, Format);
  9195. /**
  9196. * @member {Object} SuperMap.Format.prototype.data
  9197. * @description 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  9198. */
  9199. this.data = null;
  9200. /**
  9201. * APIProperty: keepData
  9202. * @member {Object} [SuperMap.Format.prototype.keepData=false]
  9203. * @description 保持最近读到的数据的引用(通过 <data> 属性)。
  9204. */
  9205. this.keepData = false;
  9206. Util_Util.extend(this, options);
  9207. this.options = options;
  9208. this.CLASS_NAME = "SuperMap.Format";
  9209. }
  9210. /**
  9211. * @function SuperMap.Format.prototype.destroy
  9212. * @description 销毁该格式类,释放相关资源。
  9213. */
  9214. Format_createClass(Format, [{
  9215. key: "destroy",
  9216. value: function destroy() {//用来销毁该格式类,释放相关资源
  9217. }
  9218. /**
  9219. * @function SuperMap.Format.prototype.read
  9220. * @description 来从字符串中读取数据。
  9221. * @param {string} data - 读取的数据。
  9222. */
  9223. }, {
  9224. key: "read",
  9225. value: function read(data) {// eslint-disable-line no-unused-vars
  9226. //用来从字符串中读取数据
  9227. }
  9228. /**
  9229. * @function SuperMap.Format.prototype.write
  9230. * @description 将对象写成字符串。
  9231. * @param {Object} object - 可序列化的对象。
  9232. * @returns {string} 对象被写成字符串。
  9233. */
  9234. }, {
  9235. key: "write",
  9236. value: function write(object) {// eslint-disable-line no-unused-vars
  9237. //用来写字符串
  9238. }
  9239. }]);
  9240. return Format;
  9241. }();
  9242. SuperMap.Format = SuperMap.Format || Format_Format;
  9243. // CONCATENATED MODULE: ./src/common/format/JSON.js
  9244. 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); }
  9245. function JSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9246. 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); } }
  9247. function JSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) JSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) JSON_defineProperties(Constructor, staticProps); return Constructor; }
  9248. 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); }
  9249. function JSON_setPrototypeOf(o, p) { JSON_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return JSON_setPrototypeOf(o, p); }
  9250. 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); }; }
  9251. function JSON_possibleConstructorReturn(self, call) { if (call && (JSON_typeof(call) === "object" || typeof call === "function")) { return call; } return JSON_assertThisInitialized(self); }
  9252. function JSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9253. 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; } }
  9254. function JSON_getPrototypeOf(o) { JSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return JSON_getPrototypeOf(o); }
  9255. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  9256. * This program are made available under the terms of the Apache License, Version 2.0
  9257. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9258. /**
  9259. * @class SuperMap.Format.JSON
  9260. * @classdesc 安全的读写 JSON 的解析类。使用 {@link SuperMap.Format.JSON} 构造函数创建新实例。
  9261. * @category BaseTypes Format
  9262. * @param {Object} [options] - 参数。
  9263. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  9264. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  9265. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  9266. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  9267. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  9268. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  9269. * @extends {SuperMap.Format}
  9270. */
  9271. var JSONFormat = /*#__PURE__*/function (_Format) {
  9272. JSON_inherits(JSONFormat, _Format);
  9273. var _super = JSON_createSuper(JSONFormat);
  9274. function JSONFormat(options) {
  9275. var _this;
  9276. JSON_classCallCheck(this, JSONFormat);
  9277. _this = _super.call(this, options);
  9278. /**
  9279. * @member {string} [SuperMap.Format.JSON.prototype.indent=" "]
  9280. * @description 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  9281. */
  9282. _this.indent = " ";
  9283. /**
  9284. * @member {string} [SuperMap.Format.JSON.prototype.space=" "]
  9285. * @description 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  9286. */
  9287. _this.space = " ";
  9288. /**
  9289. * @member {string} [SuperMap.Format.JSON.prototype.newline="\n"]
  9290. * @description 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  9291. */
  9292. _this.newline = "\n";
  9293. /**
  9294. * @member {integer} [SuperMap.Format.JSON.prototype.level=0]
  9295. * @description 用于格式化输出, 表示的是缩进级别。
  9296. */
  9297. _this.level = 0;
  9298. /**
  9299. * @member {boolean} [SuperMap.Format.JSON.prototype.pretty=false]
  9300. * @description 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  9301. */
  9302. _this.pretty = false;
  9303. /**
  9304. * @member {boolean} SuperMap.Format.JSON.prototype.nativeJSON
  9305. * @description 判断浏览器是否原生支持 JSON 格式数据。
  9306. */
  9307. _this.nativeJSON = function () {
  9308. return !!(window.JSON && typeof JSON.parse === "function" && typeof JSON.stringify === "function");
  9309. }();
  9310. _this.CLASS_NAME = "SuperMap.Format.JSON";
  9311. /**
  9312. * @member SuperMap.Format.JSON.prototype.serialize
  9313. * @description 提供一些类型对象转 JSON 字符串的方法。
  9314. */
  9315. _this.serialize = {
  9316. /**
  9317. * @function SuperMap.Format.JSON.serialize.object
  9318. * @description 把对象转换为 JSON 字符串。
  9319. * @param {Object} object - 可序列化的对象。
  9320. * @returns {string} JSON 字符串。
  9321. */
  9322. 'object': function object(_object) {
  9323. // three special objects that we want to treat differently
  9324. if (_object == null) {
  9325. return "null";
  9326. }
  9327. if (_object.constructor === Date) {
  9328. return this.serialize.date.apply(this, [_object]);
  9329. }
  9330. if (_object.constructor === Array) {
  9331. return this.serialize.array.apply(this, [_object]);
  9332. }
  9333. var pieces = ['{'];
  9334. this.level += 1;
  9335. var key, keyJSON, valueJSON;
  9336. var addComma = false;
  9337. for (key in _object) {
  9338. if (_object.hasOwnProperty(key)) {
  9339. // recursive calls need to allow for sub-classing
  9340. keyJSON = this.write.apply(this, [key, this.pretty]);
  9341. valueJSON = this.write.apply(this, [_object[key], this.pretty]);
  9342. if (keyJSON != null && valueJSON != null) {
  9343. if (addComma) {
  9344. pieces.push(',');
  9345. }
  9346. pieces.push(this.writeNewline(), this.writeIndent(), keyJSON, ':', this.writeSpace(), valueJSON);
  9347. addComma = true;
  9348. }
  9349. }
  9350. }
  9351. this.level -= 1;
  9352. pieces.push(this.writeNewline(), this.writeIndent(), '}');
  9353. return pieces.join('');
  9354. },
  9355. /**
  9356. * @function SuperMap.Format.JSON.serialize.array
  9357. * @description 把数组转换成 JSON 字符串。
  9358. * @param {Array} array - 可序列化的数组。
  9359. * @returns {string} JSON 字符串。
  9360. */
  9361. 'array': function array(_array) {
  9362. var json;
  9363. var pieces = ['['];
  9364. this.level += 1;
  9365. for (var i = 0, len = _array.length; i < len; ++i) {
  9366. // recursive calls need to allow for sub-classing
  9367. json = this.write.apply(this, [_array[i], this.pretty]);
  9368. if (json != null) {
  9369. if (i > 0) {
  9370. pieces.push(',');
  9371. }
  9372. pieces.push(this.writeNewline(), this.writeIndent(), json);
  9373. }
  9374. }
  9375. this.level -= 1;
  9376. pieces.push(this.writeNewline(), this.writeIndent(), ']');
  9377. return pieces.join('');
  9378. },
  9379. /**
  9380. * @function SuperMap.Format.JSON.serialize.string
  9381. * @description 把字符串转换成 JSON 字符串。
  9382. * @param {string} string - 可序列化的字符串。
  9383. * @returns {string} JSON 字符串。
  9384. */
  9385. 'string': function string(_string) {
  9386. // If the string contains no control characters, no quote characters, and no
  9387. // backslash characters, then we can simply slap some quotes around it.
  9388. // Otherwise we must also replace the offending characters with safe
  9389. // sequences.
  9390. var m = {
  9391. '\b': '\\b',
  9392. '\t': '\\t',
  9393. '\n': '\\n',
  9394. '\f': '\\f',
  9395. '\r': '\\r',
  9396. '"': '\\"',
  9397. '\\': '\\\\'
  9398. };
  9399. /*eslint-disable no-control-regex*/
  9400. if (/["\\\x00-\x1f]/.test(_string)) {
  9401. return '"' + _string.replace(/([\x00-\x1f\\"])/g, function (a, b) {
  9402. var c = m[b];
  9403. if (c) {
  9404. return c;
  9405. }
  9406. c = b.charCodeAt();
  9407. return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
  9408. }) + '"';
  9409. }
  9410. return '"' + _string + '"';
  9411. },
  9412. /**
  9413. * @function SuperMap.Format.JSON.serialize.number
  9414. * @description 把数字转换成 JSON 字符串。
  9415. * @param {number} number - 可序列化的数字。
  9416. * @returns {string} JSON 字符串。
  9417. */
  9418. 'number': function number(_number) {
  9419. return isFinite(_number) ? String(_number) : "null";
  9420. },
  9421. /**
  9422. * @function SuperMap.Format.JSON.serialize.boolean
  9423. * @description Transform a boolean into a JSON string.
  9424. * @param {boolean} bool - The boolean to be serialized.
  9425. * @returns {string} A JSON string representing the boolean.
  9426. */
  9427. 'boolean': function boolean(bool) {
  9428. return String(bool);
  9429. },
  9430. /**
  9431. * @function SuperMap.Format.JSON.serialize.object
  9432. * @description 将日期对象转换成 JSON 字符串。
  9433. * @param {Date} date - 可序列化的日期对象。
  9434. * @returns {string} JSON 字符串。
  9435. */
  9436. 'date': function date(_date) {
  9437. function format(number) {
  9438. // Format integers to have at least two digits.
  9439. return number < 10 ? '0' + number : number;
  9440. }
  9441. return '"' + _date.getFullYear() + '-' + format(_date.getMonth() + 1) + '-' + format(_date.getDate()) + 'T' + format(_date.getHours()) + ':' + format(_date.getMinutes()) + ':' + format(_date.getSeconds()) + '"';
  9442. }
  9443. };
  9444. return _this;
  9445. }
  9446. /**
  9447. * @function SuperMap.Format.JSON.prototype.read
  9448. * @description 将一个符合 JSON 结构的字符串进行解析。
  9449. * @param {string} json - 符合 JSON 结构的字符串。
  9450. * @param {function} filter - 过滤方法,最终结果的每一个键值对都会调用该过滤方法,并在对应的值的位置替换成该方法返回的值。
  9451. * @returns {Object} 对象,数组,字符串或数字。
  9452. */
  9453. JSON_createClass(JSONFormat, [{
  9454. key: "read",
  9455. value: function read(json, filter) {
  9456. var object;
  9457. if (this.nativeJSON) {
  9458. try {
  9459. object = JSON.parse(json, filter);
  9460. } catch (e) {// Fall through if the regexp test fails.
  9461. }
  9462. }
  9463. if (this.keepData) {
  9464. this.data = object;
  9465. }
  9466. return object;
  9467. }
  9468. /**
  9469. * @function SuperMap.Format.JSON.prototype.write
  9470. * @description 序列化一个对象到一个符合 JSON 格式的字符串。
  9471. * @param {(object|string|Array|number|boolean)} value - 需要被序列化的对象,数组,字符串,数字,布尔值。
  9472. * @param {boolean} [pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  9473. * @returns {string} 符合 JSON 格式的字符串。
  9474. *
  9475. */
  9476. }, {
  9477. key: "write",
  9478. value: function write(value, pretty) {
  9479. this.pretty = !!pretty;
  9480. var json = null;
  9481. var type = JSON_typeof(value);
  9482. if (this.serialize[type]) {
  9483. try {
  9484. json = !this.pretty && this.nativeJSON ? JSON.stringify(value) : this.serialize[type].apply(this, [value]);
  9485. } catch (err) {//SuperMap.Console.error("Trouble serializing: " + err);
  9486. }
  9487. }
  9488. return json;
  9489. }
  9490. /**
  9491. * @function SuperMap.Format.JSON.prototype.writeIndent
  9492. * @description 根据缩进级别输出一个缩进字符串。
  9493. * @private
  9494. * @returns {string} 一个适当的缩进字符串。
  9495. */
  9496. }, {
  9497. key: "writeIndent",
  9498. value: function writeIndent() {
  9499. var pieces = [];
  9500. if (this.pretty) {
  9501. for (var i = 0; i < this.level; ++i) {
  9502. pieces.push(this.indent);
  9503. }
  9504. }
  9505. return pieces.join('');
  9506. }
  9507. /**
  9508. * @function SuperMap.Format.JSON.prototype.writeNewline
  9509. * @description 在格式化输出模式情况下输出代表新一行的字符串。
  9510. * @private
  9511. * @returns {string} 代表新的一行的字符串。
  9512. */
  9513. }, {
  9514. key: "writeNewline",
  9515. value: function writeNewline() {
  9516. return this.pretty ? this.newline : '';
  9517. }
  9518. /**
  9519. * @function SuperMap.Format.JSON.prototype.writeSpace
  9520. * @private
  9521. * @description 在格式化输出模式情况下输出一个代表空格的字符串。
  9522. * @returns {string} 一个空格。
  9523. */
  9524. }, {
  9525. key: "writeSpace",
  9526. value: function writeSpace() {
  9527. return this.pretty ? this.space : '';
  9528. }
  9529. }]);
  9530. return JSONFormat;
  9531. }(Format_Format);
  9532. SuperMap.Format.JSON = JSONFormat;
  9533. // CONCATENATED MODULE: ./src/common/iServer/ServerColor.js
  9534. function ServerColor_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9535. 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); } }
  9536. function ServerColor_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerColor_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerColor_defineProperties(Constructor, staticProps); return Constructor; }
  9537. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  9538. * This program are made available under the terms of the Apache License, Version 2.0
  9539. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9540. /**
  9541. * @class SuperMap.ServerColor
  9542. * @category iServer Map Theme
  9543. * @classdesc 颜色类。该类使用三原色( RGB )来表达颜色。
  9544. * @param {Object} options - 参数。
  9545. * @param {number} [options.red=255] - 获取或设置红色值。
  9546. * @param {number} [options.green=0] - 获取或设置绿色值。
  9547. * @param {number} [options.blue=0] - 获取或设置蓝色值。
  9548. */
  9549. var ServerColor = /*#__PURE__*/function () {
  9550. function ServerColor(red, green, blue) {
  9551. ServerColor_classCallCheck(this, ServerColor);
  9552. /**
  9553. * @member {number} [SuperMap.ServerColor.prototype.red=255]
  9554. * @description 获取或设置红色值。
  9555. */
  9556. this.red = !red && red != 0 ? 255 : red;
  9557. /**
  9558. * @member {number} [SuperMap.ServerColor.prototype.green=0]
  9559. * @description 获取或设置绿色值。
  9560. */
  9561. this.green = green || 0;
  9562. /**
  9563. * @member {number} [SuperMap.ServerColor.prototype.blue=0]
  9564. * @description 获取或设置蓝色值。
  9565. */
  9566. this.blue = blue || 0;
  9567. this.CLASS_NAME = "SuperMap.ServerColor";
  9568. }
  9569. /**
  9570. * @function SuperMap.ServerColor.prototype.destroy
  9571. * @description 释放资源,将引用资源的属性置空。
  9572. */
  9573. ServerColor_createClass(ServerColor, [{
  9574. key: "destroy",
  9575. value: function destroy() {
  9576. var me = this;
  9577. me.red = null;
  9578. me.green = null;
  9579. me.blue = null;
  9580. }
  9581. /**
  9582. * @function SuperMap.ServerColor.formJson
  9583. * @description 将 JSON 对象转化为 ServerColor 对象。
  9584. * @param {Object} jsonObject - 要转换的 JSON 对象。
  9585. * @returns {SuperMap.ServerColor} 转化后的 ServerColor 对象。
  9586. */
  9587. }], [{
  9588. key: "fromJson",
  9589. value: function fromJson(jsonObject) {
  9590. if (!jsonObject) {
  9591. return;
  9592. }
  9593. var color = new ServerColor();
  9594. var red = 255;
  9595. if (jsonObject.red !== null) {
  9596. red = Number(jsonObject.red);
  9597. }
  9598. color.red = red;
  9599. var green = 0;
  9600. if (jsonObject.green !== null) {
  9601. green = Number(jsonObject.green);
  9602. }
  9603. color.green = green;
  9604. var blue = 0;
  9605. if (jsonObject.blue !== null) {
  9606. blue = Number(jsonObject.blue);
  9607. }
  9608. color.blue = blue;
  9609. return color;
  9610. }
  9611. }]);
  9612. return ServerColor;
  9613. }();
  9614. SuperMap.ServerColor = ServerColor;
  9615. // CONCATENATED MODULE: ./src/common/iServer/ServerStyle.js
  9616. function ServerStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9617. 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); } }
  9618. function ServerStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerStyle_defineProperties(Constructor, staticProps); return Constructor; }
  9619. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  9620. * This program are made available under the terms of the Apache License, Version 2.0
  9621. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9622. /**
  9623. * @class SuperMap.ServerStyle
  9624. * @category iServer Map Theme
  9625. * @classdesc 服务端矢量要素风格类。
  9626. * @description 该类用于定义点状符号、线状符号、填充符号风格及其相关属性。
  9627. * @param {Object} options - 参数。
  9628. * @param {SuperMap.FillGradientMode} options.fillGradientMode - 渐变填充风格的渐变类型。
  9629. * @param {SuperMap.ServerColor} [options.fillBackColor=[255,255,255]] - 填充背景颜色。
  9630. * @param {boolean} [options.fillBackOpaque=false] - 背景是否不透明。
  9631. * @param {SuperMap.ServerColor} [options.fillForeColor=[255,0,0]] - 填充颜色。
  9632. * @param {number} [options.fillGradientAngle=0] - 渐变填充的旋转角度。
  9633. * @param {number} [options.fillGradientOffsetRatioX=0] - 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。
  9634. * @param {number} [options.fillGradientOffsetRatioY=0] - 填充中心点相对于填充区域范围中心点的垂直偏移百分比。
  9635. * @param {number} [options.fillOpaqueRate=100] - 填充不透明度。
  9636. * @param {number} [options.fillSymbolID=0] - 填充符号的编码。
  9637. * @param {SuperMap.ServerColor} [options.lineColor] - 矢量要素的边线颜色。默认 lineColor = new ServerColor(0, 0, 0)。
  9638. * @param {number} [options.lineSymbolID=0] - 线状符号的编码。
  9639. * @param {number} [options.lineWidth=1] - 边线的宽度。
  9640. * @param {number} [options.markerAngle=0] - 点状符号的旋转角度。
  9641. * @param {number} [options.markerSize=1] - 点状符号的大小。
  9642. * @param {number} [options.markerSymbolID=-1] - 点状符号的编码。
  9643. */
  9644. var ServerStyle_ServerStyle = /*#__PURE__*/function () {
  9645. function ServerStyle(options) {
  9646. ServerStyle_classCallCheck(this, ServerStyle);
  9647. /**
  9648. * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.fillBackColor
  9649. * @description 填充背景颜色。当填充模式为渐变填充时,该颜色为填充终止色。
  9650. */
  9651. this.fillBackColor = new ServerColor(255, 255, 255);
  9652. /**
  9653. * @member {boolean} [SuperMap.ServerStyle.prototype.fillBackOpaque=false]
  9654. * @description 背景是否不透明。false 表示透明。
  9655. */
  9656. this.fillBackOpaque = false;
  9657. /**
  9658. * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.fillForeColor
  9659. * @description 填充颜色。当填充模式为渐变填充时,该颜色为填充起始颜色。
  9660. */
  9661. this.fillForeColor = new ServerColor(255, 0, 0);
  9662. /**
  9663. * @member {SuperMap.FillGradientMode} SuperMap.ServerStyle.prototype.fillGradientMode
  9664. * @description 渐变填充风格的渐变类型。
  9665. */
  9666. this.fillGradientMode = null;
  9667. /**
  9668. * @member {number} SuperMap.ServerStyle.prototype.fillGradientAngle -
  9669. * @description 渐变填充的旋转角度。单位为度,精确到 0.1 度,逆时针方向为正方向。
  9670. */
  9671. this.fillGradientAngle = 0;
  9672. /**
  9673. * @member {number} SuperMap.ServerStyle.prototype.fillGradientOffsetRatioX
  9674. * @description 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。它们的关系如下:设填充区域范围中心点的坐标为(x0, y0),
  9675. * 填充中心点的坐标为(x, y),填充区域范围的宽度为 a,水平偏移百分比为 dx,则 x=x0 + a*dx/100。
  9676. */
  9677. this.fillGradientOffsetRatioX = 0;
  9678. /**
  9679. * @member {number} SuperMap.ServerStyle.prototype.fillGradientOffsetRatioY
  9680. * @description 填充中心点相对于填充区域范围中心点的垂直偏移百分比。它们的关系如下:<br>
  9681. * 设填充区域范围中心点的坐标为(x0, y0),填充中心点的坐标为(x, y),填充区域范围的高度为 b,垂直偏移百分比为 dy,则 y=y0 + b*dx/100。
  9682. */
  9683. this.fillGradientOffsetRatioY = 0;
  9684. /**
  9685. * @member {number} [SuperMap.ServerStyle.prototype.fillOpaqueRate=100]
  9686. * @description 填充不透明度。合法值为 0 - 100 的数值。其中为 0 表示完全透明;
  9687. * 100 表示完全不透明。赋值小于 0 时按照 0 处理,大于 100 时按照 100 处理。
  9688. */
  9689. this.fillOpaqueRate = 100;
  9690. /**
  9691. * @member {number} SuperMap.ServerStyle.prototype.fillSymbolID
  9692. * @description 填充符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  9693. * 关于填充符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  9694. */
  9695. this.fillSymbolID = 0;
  9696. /**
  9697. * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.lineColor
  9698. * @description 矢量要素的边线颜色。如果等级符号是点符号,点符号的颜色由 lineColor 控制。
  9699. */
  9700. this.lineColor = new ServerColor(0, 0, 0);
  9701. /**
  9702. * @member {number} [SuperMap.ServerStyle.prototype.lineSymbolID=0]
  9703. * @description 线状符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  9704. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  9705. */
  9706. this.lineSymbolID = 0;
  9707. /**
  9708. * @member {number} [SuperMap.ServerStyle.prototype.lineWidth=1.0]
  9709. * @description 边线的宽度。单位为毫米,精度到 0.1。
  9710. */
  9711. this.lineWidth = 1;
  9712. /**
  9713. * @member {number} [SuperMap.ServerStyle.prototype.markerAngle=0]
  9714. * @description 点状符号的旋转角度。以度为单位,精确到 0.1 度,逆时针方向为正方向。
  9715. */
  9716. this.markerAngle = 0;
  9717. /**
  9718. * @member {number} [SuperMap.ServerStyle.prototype.markerSize=1.0]
  9719. * @description 点状符号的大小。单位为毫米,精度为 0.1。当该属性设置为0时,采用符号默认大小 1.0 显示。
  9720. * 当该属性设置为非法值时,交由服务器默认处理。
  9721. */
  9722. this.markerSize = 1;
  9723. /**
  9724. * @member {number} [SuperMap.ServerStyle.prototype.markerSymbolID=-1]
  9725. * @description 点状符号的编码。此编码用于唯一标识各点状符号。
  9726. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  9727. */
  9728. this.markerSymbolID = -1;
  9729. if (options) {
  9730. Util_Util.extend(this, options);
  9731. }
  9732. this.CLASS_NAME = "SuperMap.ServerStyle";
  9733. }
  9734. /**
  9735. * @function SuperMap.ServerStyle.prototype.destroy
  9736. * @description 释放资源,将引用资源的属性置空。
  9737. */
  9738. ServerStyle_createClass(ServerStyle, [{
  9739. key: "destroy",
  9740. value: function destroy() {
  9741. var me = this;
  9742. if (me.fillBackColor) {
  9743. me.fillBackColor.destroy();
  9744. me.fillBackColor = null;
  9745. }
  9746. me.fillBackOpaque = null;
  9747. if (me.fillForeColor) {
  9748. me.fillForeColor.destroy();
  9749. me.fillForeColor = null;
  9750. }
  9751. me.fillGradientMode = null;
  9752. me.fillGradientAngle = null;
  9753. me.fillGradientOffsetRatioX = null;
  9754. me.fillGradientOffsetRatioY = null;
  9755. me.fillOpaqueRate = null;
  9756. me.fillSymbolID = null;
  9757. if (me.lineColor) {
  9758. me.lineColor.destroy();
  9759. me.lineColor = null;
  9760. }
  9761. me.lineSymbolID = null;
  9762. me.lineWidth = null;
  9763. me.markerAngle = null;
  9764. me.markerSize = null;
  9765. me.markerSymbolID = null;
  9766. }
  9767. /**
  9768. * @function SuperMap.ServerStyle.prototype.toServerJSONObject
  9769. * @description 转换成对应的 JSON 格式对象。
  9770. * @returns {Object} 对应的 JSON 格式对象.
  9771. */
  9772. }, {
  9773. key: "toServerJSONObject",
  9774. value: function toServerJSONObject() {
  9775. var styleObj = {};
  9776. styleObj = Util_Util.copyAttributes(styleObj, this); //暂时先忽略serverColor往Json的转换
  9777. return styleObj;
  9778. }
  9779. /**
  9780. * @function SuperMap.ServerStyle.fromJson
  9781. * @description 将JSON对象转换为 SuperMap.ServerStyle 对象。
  9782. * @param jsonObject - {Object} 要转换的 JSON 对象。
  9783. * @returns {SuperMap.ServerStyle} 转化后的 SuperMap.ServerStyle 对象。
  9784. */
  9785. }], [{
  9786. key: "fromJson",
  9787. value: function fromJson(jsonObject) {
  9788. if (!jsonObject) {
  9789. return;
  9790. }
  9791. return new ServerStyle({
  9792. fillBackColor: ServerColor.fromJson(jsonObject.fillBackColor),
  9793. fillBackOpaque: jsonObject.fillBackOpaque,
  9794. fillForeColor: ServerColor.fromJson(jsonObject.fillForeColor),
  9795. fillGradientMode: jsonObject.fillGradientMode,
  9796. fillGradientAngle: jsonObject.fillGradientAngle,
  9797. fillGradientOffsetRatioX: jsonObject.fillGradientOffsetRatioX,
  9798. fillGradientOffsetRatioY: jsonObject.fillGradientOffsetRatioY,
  9799. fillOpaqueRate: jsonObject.fillOpaqueRate,
  9800. fillSymbolID: jsonObject.fillSymbolID,
  9801. lineColor: ServerColor.fromJson(jsonObject.lineColor),
  9802. lineSymbolID: jsonObject.lineSymbolID,
  9803. lineWidth: jsonObject.lineWidth,
  9804. markerAngle: jsonObject.markerAngle,
  9805. markerSize: jsonObject.markerSize,
  9806. markerSymbolID: jsonObject.markerSymbolID
  9807. });
  9808. }
  9809. }]);
  9810. return ServerStyle;
  9811. }();
  9812. SuperMap.ServerStyle = ServerStyle_ServerStyle;
  9813. // CONCATENATED MODULE: ./src/common/iServer/PointWithMeasure.js
  9814. 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); }
  9815. function PointWithMeasure_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9816. 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); } }
  9817. function PointWithMeasure_createClass(Constructor, protoProps, staticProps) { if (protoProps) PointWithMeasure_defineProperties(Constructor.prototype, protoProps); if (staticProps) PointWithMeasure_defineProperties(Constructor, staticProps); return Constructor; }
  9818. 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); }
  9819. function PointWithMeasure_setPrototypeOf(o, p) { PointWithMeasure_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PointWithMeasure_setPrototypeOf(o, p); }
  9820. 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); }; }
  9821. function PointWithMeasure_possibleConstructorReturn(self, call) { if (call && (PointWithMeasure_typeof(call) === "object" || typeof call === "function")) { return call; } return PointWithMeasure_assertThisInitialized(self); }
  9822. function PointWithMeasure_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9823. 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; } }
  9824. function PointWithMeasure_getPrototypeOf(o) { PointWithMeasure_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PointWithMeasure_getPrototypeOf(o); }
  9825. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  9826. * This program are made available under the terms of the Apache License, Version 2.0
  9827. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9828. /**
  9829. * @class SuperMap.PointWithMeasure
  9830. * @category iServer SpatialAnalyst
  9831. * @classdesc 路由点类。路由点是指具有线性度量值 (Measure) 的二维地理坐标点。
  9832. * @param {Object} options - 参数。
  9833. * @param {number} options.measure - 度量值,即路由对象属性值 M。
  9834. * @param {number} options.x - 获取当前点对象在地理坐标系下的 X 坐标值。
  9835. * @param {number} options.y - 获取当前点对象在地理坐标系下的 Y 坐标值。
  9836. * @extends {SuperMap.Geometry.Point}
  9837. */
  9838. var PointWithMeasure_PointWithMeasure = /*#__PURE__*/function (_Point) {
  9839. PointWithMeasure_inherits(PointWithMeasure, _Point);
  9840. var _super = PointWithMeasure_createSuper(PointWithMeasure);
  9841. function PointWithMeasure(options) {
  9842. var _this;
  9843. PointWithMeasure_classCallCheck(this, PointWithMeasure);
  9844. _this = _super.call(this, options);
  9845. /**
  9846. * @member {number} SuperMap.PointWithMeasure.prototype.measure
  9847. * @description 度量值,即路由对象属性值 M。
  9848. */
  9849. _this.measure = null;
  9850. if (options) {
  9851. Util_Util.extend(PointWithMeasure_assertThisInitialized(_this), options);
  9852. }
  9853. _this.CLASS_NAME = "SuperMap.PointWithMeasure";
  9854. return _this;
  9855. }
  9856. /**
  9857. * @function SuperMap.PointWithMeasure.prototype.equals
  9858. * @description 判断两个路由点对象是否相等。如果两个路由点对象具有相同的坐标以及度量值,则认为是相等的。
  9859. * @param {SuperMap.PointWithMeasure} geom - 需要判断的路由点对象。
  9860. * @returns {boolean} 两个路由点对象是否相等(true 为相等,false 为不等)。
  9861. */
  9862. PointWithMeasure_createClass(PointWithMeasure, [{
  9863. key: "equals",
  9864. value: function equals(geom) {
  9865. var equals = false;
  9866. if (geom != null) {
  9867. var isValueEquals = this.x === geom.x && this.y === geom.y && this.measure === geom.measure;
  9868. var isNaNValue = isNaN(this.x) && isNaN(this.y) && isNaN(this.measure);
  9869. var isNaNGeometry = isNaN(geom.x) && isNaN(geom.y) && isNaN(geom.measure);
  9870. equals = isValueEquals || isNaNValue && isNaNGeometry;
  9871. }
  9872. return equals;
  9873. }
  9874. /**
  9875. * @function SuperMap.PointWithMeasure.prototype.toJson
  9876. * @description 转换为 JSON 对象。
  9877. * */
  9878. }, {
  9879. key: "toJson",
  9880. value: function toJson() {
  9881. var result = "{";
  9882. if (this.measure != null && this.measure != undefined) {
  9883. result += "\"measure\":" + this.measure + ",";
  9884. }
  9885. result += "\"x\":" + this.x + ",";
  9886. result += "\"y\":" + this.y;
  9887. result += "}";
  9888. return result;
  9889. }
  9890. /**
  9891. * @function SuperMap.PointWithMeasure.prototype.destroy
  9892. * @description 释放资源,将引用资源的属性置空。
  9893. */
  9894. }, {
  9895. key: "destroy",
  9896. value: function destroy() {
  9897. var me = this;
  9898. me.measure = null;
  9899. me.x = null;
  9900. me.y = null;
  9901. }
  9902. /**
  9903. * @function SuperMap.PointWithMeasure.fromJson
  9904. * @description 将 JSON 对象转换为{@link SuperMap.PointWithMeasure} 对象。
  9905. * @param {Object} jsonObject - JSON 对象表示的路由点。
  9906. * @returns {SuperMap.PointWithMeasure} 转化后的 PointWithMeasure 对象。
  9907. */
  9908. }], [{
  9909. key: "fromJson",
  9910. value: function fromJson(jsonObject) {
  9911. if (!jsonObject) {
  9912. return;
  9913. }
  9914. return new PointWithMeasure({
  9915. x: jsonObject.x,
  9916. y: jsonObject.y,
  9917. measure: jsonObject.measure
  9918. });
  9919. }
  9920. }]);
  9921. return PointWithMeasure;
  9922. }(Point_Point);
  9923. SuperMap.PointWithMeasure = PointWithMeasure_PointWithMeasure;
  9924. // CONCATENATED MODULE: ./src/common/iServer/Route.js
  9925. 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); }
  9926. function Route_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9927. 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); } }
  9928. function Route_createClass(Constructor, protoProps, staticProps) { if (protoProps) Route_defineProperties(Constructor.prototype, protoProps); if (staticProps) Route_defineProperties(Constructor, staticProps); return Constructor; }
  9929. 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); }
  9930. function Route_setPrototypeOf(o, p) { Route_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Route_setPrototypeOf(o, p); }
  9931. 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); }; }
  9932. function Route_possibleConstructorReturn(self, call) { if (call && (Route_typeof(call) === "object" || typeof call === "function")) { return call; } return Route_assertThisInitialized(self); }
  9933. function Route_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9934. 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; } }
  9935. function Route_getPrototypeOf(o) { Route_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Route_getPrototypeOf(o); }
  9936. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  9937. * This program are made available under the terms of the Apache License, Version 2.0
  9938. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9939. /**
  9940. * @class SuperMap.Route
  9941. * @category iServer SpatialAnalyst
  9942. * @classdesc 路由对象类。路由对象为一系列有序的带有属性值 M 的 x,y 坐标对,其中 M 值为该结点的距离属性(到已知点的距离)。
  9943. * @param {Array.<SuperMap.Geometry>} points - 形成路由对象的线数组。
  9944. * @param {Object} options - 参数。
  9945. * @param {number} options.id - 路由对象在数据库中的 id。
  9946. * @param {number} options.length - 路由对象的长度。单位与数据集的单位相同。
  9947. * @param {number} [options.maxM] - 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  9948. * @param {number} [options.minM] - 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  9949. * @param {string} [options.type] - 数据类型,如:"LINEM"。
  9950. * @extends {SuperMap.Geometry.Collection}
  9951. */
  9952. var Route_Route = /*#__PURE__*/function (_Collection) {
  9953. Route_inherits(Route, _Collection);
  9954. var _super = Route_createSuper(Route);
  9955. function Route(points, options) {
  9956. var _this;
  9957. Route_classCallCheck(this, Route);
  9958. _this = _super.call(this, points, options);
  9959. /**
  9960. * @member {number} SuperMap.Route.prototype.id
  9961. * @description 路由对象在数据库中的 ID。
  9962. */
  9963. _this.id = null;
  9964. /**
  9965. * @member {number} SuperMap.Route.prototype.center
  9966. * @description 路由对象的中心点。
  9967. */
  9968. _this.center = null;
  9969. /**
  9970. * @member {string} SuperMap.Route.prototype.style
  9971. * @description 路由对象的样式。
  9972. */
  9973. _this.style = null;
  9974. /**
  9975. * @member {number} SuperMap.Route.prototype.length
  9976. * @description 路由对象的长度。单位与数据集的单位相同。
  9977. */
  9978. _this.length = null;
  9979. /**
  9980. * @member {number} SuperMap.Route.prototype.maxM
  9981. * @description 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  9982. */
  9983. _this.maxM = null;
  9984. /**
  9985. * @member {number} SuperMap.Route.prototype.minM
  9986. * @description 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  9987. */
  9988. _this.minM = null;
  9989. /**
  9990. * @member {Array.<number>} SuperMap.Route.prototype.parts
  9991. * @description 服务端几何对象中各个子对象所包含的节点个数。
  9992. */
  9993. _this.parts = null;
  9994. /**
  9995. * @member {Array.<Object>} SuperMap.Route.prototype.points
  9996. * @description 路由对象的所有路由点。
  9997. * @example
  9998. * (start code)
  9999. * [
  10000. * {
  10001. * "measure": 0,
  10002. * "y": -4377.027184298267,
  10003. * "x": 4020.0045221720466
  10004. * },
  10005. * {
  10006. * "measure": 37.33288381391519,
  10007. * "y": -4381.569363260499,
  10008. * "x": 4057.0600591960642
  10009. * }
  10010. * ]
  10011. * (end)
  10012. */
  10013. _this.points = null;
  10014. /**
  10015. * @member {string} SuperMap.Route.prototype.type
  10016. * @description 服务端几何对象类型。
  10017. */
  10018. _this.type = null;
  10019. /**
  10020. * @member {Array.<string>} [SuperMap.Route.prototype.componentTypes=SuperMap.Geometry.LineString]
  10021. * @description components 存储的的几何对象所支持的几何类型数组。
  10022. */
  10023. _this.componentTypes = ["SuperMap.Geometry.LinearRing", "SuperMap.Geometry.LineString"];
  10024. if (options) {
  10025. Util_Util.extend(Route_assertThisInitialized(_this), options);
  10026. }
  10027. _this.CLASS_NAME = "SuperMap.Route";
  10028. _this.geometryType = "LINEM";
  10029. return _this;
  10030. }
  10031. /**
  10032. *
  10033. * @function SuperMap.Route.prototype.toJson
  10034. * @description 转换为 JSON 对象。
  10035. * @returns {Object} JSON 对象。
  10036. */
  10037. Route_createClass(Route, [{
  10038. key: "toJson",
  10039. value: function toJson() {
  10040. var result = "{";
  10041. if (this.id != null && this.id != undefined) {
  10042. result += "\"id\":" + this.id + ",";
  10043. }
  10044. if (this.center != null && this.center != undefined) {
  10045. result += "\"center\":" + this.center + ",";
  10046. }
  10047. if (this.style != null && this.style != undefined) {
  10048. result += "\"style\":" + this.style + ",";
  10049. }
  10050. if (this.length != null && this.length != undefined) {
  10051. result += "\"length\":" + this.length + ",";
  10052. }
  10053. if (this.maxM != null && this.maxM != undefined) {
  10054. result += "\"maxM\":" + this.maxM + ",";
  10055. }
  10056. if (this.minM != null && this.minM != undefined) {
  10057. result += "\"minM\":" + this.minM + ",";
  10058. }
  10059. if (this.type != null && this.type != undefined) {
  10060. result += "\"type\":\"" + this.type + "\",";
  10061. }
  10062. if (this.parts != null && this.parts != undefined) {
  10063. result += "\"parts\":[" + this.parts[0];
  10064. for (var i = 1; i < this.parts.length; i++) {
  10065. result += "," + this.parts[i];
  10066. }
  10067. result += "],";
  10068. }
  10069. if (this.components != null && this.components.length > 0) {
  10070. result += "\"points\":[";
  10071. for (var j = 0, len = this.components.length; j < len; j++) {
  10072. for (var k = 0, len2 = this.components[j].components.length; k < len2; k++) {
  10073. result += this.components[j].components[k].toJson() + ",";
  10074. }
  10075. }
  10076. result = result.replace(/,$/g, '');
  10077. result += "]";
  10078. }
  10079. result = result.replace(/,$/g, '');
  10080. result += "}";
  10081. return result;
  10082. }
  10083. /**
  10084. * @function SuperMap.Route.prototype.destroy
  10085. * @override
  10086. */
  10087. }, {
  10088. key: "destroy",
  10089. value: function destroy() {
  10090. var me = this;
  10091. me.id = null;
  10092. me.center = null;
  10093. me.style = null;
  10094. me.length = null;
  10095. me.maxM = null;
  10096. me.minM = null;
  10097. me.type = null;
  10098. me.parts = null;
  10099. me.components.length = 0;
  10100. me.components = null;
  10101. me.componentTypes = null;
  10102. }
  10103. /**
  10104. * @function SuperMap.Route.fromJson
  10105. * @description 将 JSON 对象转换为 SuperMap.Route 对象。
  10106. * @param {Object} [jsonObject] - JSON 对象表示的路由对象。
  10107. * @returns {SuperMap.Route} 转化后的 Route 对象。
  10108. */
  10109. }], [{
  10110. key: "fromJson",
  10111. value: function fromJson(jsonObject) {
  10112. if (!jsonObject) {
  10113. return;
  10114. }
  10115. var geoParts = jsonObject.parts || [],
  10116. geoPoints = jsonObject.points || [],
  10117. len = geoParts.length,
  10118. lineList = [];
  10119. if (len > 0) {
  10120. for (var i = 0, pointIndex = 0, pointList = []; i < len; i++) {
  10121. for (var j = 0; j < geoParts[i]; j++) {
  10122. pointList.push(PointWithMeasure_PointWithMeasure.fromJson(geoPoints[pointIndex + j]));
  10123. }
  10124. pointIndex += geoParts[i]; //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  10125. if (pointList[0].equals(pointList[geoParts[i] - 1])) {
  10126. lineList.push(new LinearRing(pointList));
  10127. } else {
  10128. lineList.push(new LineString_LineString(pointList));
  10129. }
  10130. pointList = [];
  10131. }
  10132. } else {
  10133. return null;
  10134. }
  10135. return new Route(lineList, {
  10136. id: jsonObject.id,
  10137. center: jsonObject.center,
  10138. style: jsonObject.style,
  10139. length: jsonObject.length,
  10140. maxM: jsonObject.maxM,
  10141. minM: jsonObject.minM,
  10142. type: jsonObject.type,
  10143. parts: jsonObject.parts
  10144. });
  10145. }
  10146. }]);
  10147. return Route;
  10148. }(Collection_Collection);
  10149. SuperMap.Route = Route_Route;
  10150. // CONCATENATED MODULE: ./src/common/iServer/ServerGeometry.js
  10151. function ServerGeometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10152. 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); } }
  10153. function ServerGeometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerGeometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerGeometry_defineProperties(Constructor, staticProps); return Constructor; }
  10154. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  10155. * This program are made available under the terms of the Apache License, Version 2.0
  10156. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10157. /**
  10158. * @class SuperMap.ServerGeometry
  10159. * @category iServer
  10160. * @classdesc 服务端几何对象类。该类描述几何对象(矢量)的特征数据(坐标点对、几何对象的类型等)。基于服务端的空间分析、空间关系运算、查询等 GIS 服务功能使用服务端几何对象。
  10161. * @param {Object} options - 参数。
  10162. * @param {string} options.id - 服务端几何对象唯一标识符。
  10163. * @param {Array.<number>} options.parts - 服务端几何对象中各个子对象所包含的节点个数。
  10164. * @param {Array.<SuperMap.Geometry.Point>} options.points - 组成几何对象的节点的坐标对数组。
  10165. * @param {SuperMap.GeometryType} options.type - 几何对象的类型。
  10166. * @param {SuperMap.ServerStyle} [options.style] - 服务端几何对象的风格。
  10167. */
  10168. var ServerGeometry_ServerGeometry = /*#__PURE__*/function () {
  10169. function ServerGeometry(options) {
  10170. ServerGeometry_classCallCheck(this, ServerGeometry);
  10171. /**
  10172. * @member {string} SuperMap.ServerGeometry.prototype.id
  10173. * @description 服务端几何对象唯一标识符。
  10174. */
  10175. this.id = 0;
  10176. /**
  10177. * @member {SuperMap.ServerStyle} [SuperMap.ServerGeometry.prototype.style]
  10178. * @description 服务端几何对象的风格(ServerStyle)。
  10179. */
  10180. this.style = null;
  10181. /**
  10182. * @member {Array.<number>} SuperMap.ServerGeometry.prototype.parts
  10183. * @description 服务端几何对象中各个子对象所包含的节点个数。<br>
  10184. * 1.几何对象从结构上可以分为简单几何对象和复杂几何对象。
  10185. * 简单几何对象与复杂几何对象的区别:简单的几何对象一般为单一对象,
  10186. * 而复杂的几何对象由多个简单对象组成或经过一定的空间运算之后产生,
  10187. * 如:矩形为简单的区域对象,而中空的矩形为复杂的区域对象。<br>
  10188. * 2.通常情况,一个简单几何对象的子对象就是它本身,
  10189. * 因此对于简单对象来说的该字段为长度为1的整型数组,
  10190. * 该字段的值就是这个简单对象节点的个数。
  10191. * 如果一个几何对象是由几个简单对象组合而成的,
  10192. * 例如,一个岛状几何对象由 3 个简单的多边形组成而成,
  10193. * 那么这个岛状的几何对象的 Parts 字段值就是一个长度为 3 的整型数组,
  10194. * 数组中每个成员的值分别代表这三个多边形所包含的节点个数。
  10195. */
  10196. this.parts = null;
  10197. /**
  10198. * @member {Array.<SuperMap.Geometry.Point>} SuperMap.ServerGeometry.prototype.points
  10199. * @description 组成几何对象的节点的坐标对数组。<br>
  10200. * 1.所有几何对象(点、线、面)都是由一些简单的点坐标组成的,
  10201. * 该字段存放了组成几何对象的点坐标的数组。
  10202. * 对于简单的面对象,他的起点和终点的坐标点相同。<br>
  10203. * 2.对于复杂的几何对象,根据 Parts 属性来确定每一个组成复杂几何对象的简单对象所对应的节点的个数,
  10204. * 从而确定 Points 字段中坐标对的分配归属问题。
  10205. */
  10206. this.points = null;
  10207. /**
  10208. * @member {SuperMap.GeometryType} SuperMap.ServerGeometry.prototype.type
  10209. * @description 几何对象的类型(GeometryType)。
  10210. */
  10211. this.type = null;
  10212. /**
  10213. * @member {Object} SuperMap.ServerGeometry.prototype.prjCoordSys
  10214. * @description 投影坐标参数,现仅在缓冲区分析中有效。
  10215. */
  10216. this.prjCoordSys = null;
  10217. if (options) {
  10218. Util_Util.extend(this, options);
  10219. }
  10220. this.CLASS_NAME = 'SuperMap.ServerGeometry';
  10221. }
  10222. /**
  10223. * @function SuperMap.ServerGeometry.prototype.destroy
  10224. * @description 释放资源,将引用资源的属性置空。
  10225. */
  10226. ServerGeometry_createClass(ServerGeometry, [{
  10227. key: "destroy",
  10228. value: function destroy() {
  10229. var me = this;
  10230. me.id = null;
  10231. me.style = null;
  10232. me.parts = null;
  10233. me.partTopo = null;
  10234. me.points = null;
  10235. me.type = null;
  10236. me.prjCoordSys = null;
  10237. }
  10238. /**
  10239. * @function SuperMap.ServerGeometry.prototype.toGeometry
  10240. * @description 将服务端几何对象 ServerGeometry 转换为客户端几何对象 Geometry。
  10241. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  10242. */
  10243. }, {
  10244. key: "toGeometry",
  10245. value: function toGeometry() {
  10246. var me = this,
  10247. geoType = me.type;
  10248. switch (geoType.toUpperCase()) {
  10249. case GeometryType.POINT:
  10250. return me.toGeoPoint();
  10251. case GeometryType.LINE:
  10252. return me.toGeoLine();
  10253. case GeometryType.LINEM:
  10254. return me.toGeoLinem();
  10255. case GeometryType.REGION:
  10256. return me.toGeoRegion();
  10257. case GeometryType.POINTEPS:
  10258. return me.toGeoPoint();
  10259. case GeometryType.LINEEPS:
  10260. return me.toGeoLineEPS();
  10261. case GeometryType.REGIONEPS:
  10262. return me.toGeoRegionEPS();
  10263. case GeometryType.GEOCOMPOUND:
  10264. return me.transformGeoCompound();
  10265. }
  10266. }
  10267. /**
  10268. * @function SuperMap.ServerGeometry.prototype.toGeoPoint
  10269. * @description 将服务端的点几何对象转换为客户端几何对象。包括 Point、MultiPoint。
  10270. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  10271. */
  10272. }, {
  10273. key: "toGeoPoint",
  10274. value: function toGeoPoint() {
  10275. var me = this,
  10276. geoParts = me.parts || [],
  10277. geoPoints = me.points || [],
  10278. len = geoParts.length;
  10279. if (len > 0) {
  10280. if (len === 1) {
  10281. return new Point_Point(geoPoints[0].x, geoPoints[0].y);
  10282. } else {
  10283. var pointList = [];
  10284. for (var i = 0; i < len; i++) {
  10285. pointList.push(new Point_Point(geoPoints[i].x, geoPoints[i].y));
  10286. }
  10287. return new MultiPoint(pointList);
  10288. }
  10289. } else {
  10290. return null;
  10291. }
  10292. }
  10293. /**
  10294. * @function SuperMap.ServerGeometry.prototype.toGeoLine
  10295. * @description 将服务端的线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  10296. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  10297. */
  10298. }, {
  10299. key: "toGeoLine",
  10300. value: function toGeoLine() {
  10301. var me = this,
  10302. geoParts = me.parts || [],
  10303. geoPoints = me.points || [],
  10304. len = geoParts.length;
  10305. if (len > 0) {
  10306. if (len === 1) {
  10307. var pointList = [];
  10308. for (var i = 0; i < geoParts[0]; i++) {
  10309. pointList.push(new Point_Point(geoPoints[i].x, geoPoints[i].y));
  10310. } //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  10311. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  10312. return new LinearRing(pointList);
  10313. } else {
  10314. return new LineString_LineString(pointList);
  10315. }
  10316. } else {
  10317. var lineList = [];
  10318. for (var _i = 0; _i < len; _i++) {
  10319. var _pointList = [];
  10320. for (var j = 0; j < geoParts[_i]; j++) {
  10321. _pointList.push(new Point_Point(geoPoints[j].x, geoPoints[j].y));
  10322. }
  10323. lineList.push(new LineString_LineString(_pointList));
  10324. geoPoints.splice(0, geoParts[_i]);
  10325. }
  10326. return new MultiLineString(lineList);
  10327. }
  10328. } else {
  10329. return null;
  10330. }
  10331. }
  10332. /**
  10333. * @function SuperMap.ServerGeometry.prototype.toGeoLineEPS
  10334. * @description 将服务端的线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  10335. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  10336. */
  10337. }, {
  10338. key: "toGeoLineEPS",
  10339. value: function toGeoLineEPS() {
  10340. var me = this,
  10341. geoParts = me.parts || [],
  10342. geoPoints = me.points || [],
  10343. i,
  10344. j,
  10345. pointList,
  10346. lineList,
  10347. lineEPS,
  10348. len = geoParts.length;
  10349. if (len > 0) {
  10350. if (len === 1) {
  10351. for (i = 0, pointList = []; i < geoParts[0]; i++) {
  10352. pointList.push(new Point_Point(geoPoints[i].x, geoPoints[i].y, geoPoints[i].type));
  10353. } //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  10354. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  10355. lineEPS = LineString_LineString.createLineEPS(pointList);
  10356. return new LinearRing(lineEPS);
  10357. } else {
  10358. lineEPS = LineString_LineString.createLineEPS(pointList);
  10359. return new LineString_LineString(lineEPS);
  10360. }
  10361. } else {
  10362. for (i = 0, lineList = []; i < len; i++) {
  10363. for (j = 0, pointList = []; j < geoParts[i]; j++) {
  10364. pointList.push(new Point_Point(geoPoints[j].x, geoPoints[j].y));
  10365. }
  10366. lineEPS = LineString_LineString.createLineEPS(pointList);
  10367. lineList.push(new LineString_LineString(lineEPS));
  10368. geoPoints.splice(0, geoParts[i]);
  10369. }
  10370. return new MultiLineString(lineList);
  10371. }
  10372. } else {
  10373. return null;
  10374. }
  10375. }
  10376. /**
  10377. * @function SuperMap.ServerGeometry.prototype.toGeoLine
  10378. * @description 将服务端的路由线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  10379. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  10380. */
  10381. }, {
  10382. key: "toGeoLinem",
  10383. value: function toGeoLinem() {
  10384. var me = this;
  10385. return Route_Route.fromJson(me);
  10386. }
  10387. /**
  10388. * @function SuperMap.ServerGeometry.prototype.toGeoRegion
  10389. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。
  10390. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  10391. */
  10392. }, {
  10393. key: "toGeoRegion",
  10394. value: function toGeoRegion() {
  10395. var me = this,
  10396. geoParts = me.parts || [],
  10397. geoTopo = me.partTopo || [],
  10398. geoPoints = me.points || [],
  10399. len = geoParts.length;
  10400. if (len <= 0) {
  10401. return null;
  10402. }
  10403. var polygonArray = [];
  10404. var pointList = [];
  10405. if (len == 1) {
  10406. for (var i = 0; i < geoPoints.length; i++) {
  10407. pointList.push(new Point_Point(geoPoints[i].x, geoPoints[i].y));
  10408. }
  10409. polygonArray.push(new Polygon([new LinearRing(pointList)]));
  10410. return new MultiPolygon(polygonArray);
  10411. } //处理复杂面
  10412. var CCWArray = [];
  10413. var areaArray = [];
  10414. var polygonArrayTemp = [];
  10415. var polygonBounds = []; //polyon岛洞标识数组,初始都是岛。
  10416. var CCWIdent = [];
  10417. for (var _i2 = 0, pointIndex = 0; _i2 < len; _i2++) {
  10418. for (var j = 0; j < geoParts[_i2]; j++) {
  10419. pointList.push(new Point_Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  10420. }
  10421. pointIndex += geoParts[_i2];
  10422. var polygon = new Polygon([new LinearRing(pointList)]);
  10423. pointList = [];
  10424. polygonArrayTemp.push(polygon);
  10425. if (geoTopo.length === 0) {
  10426. polygonBounds.push(polygon.getBounds());
  10427. }
  10428. CCWIdent.push(1);
  10429. areaArray.push(polygon.getArea());
  10430. } //根据面积排序
  10431. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds); //iServer 9D新增字段
  10432. if (geoTopo.length === 0) {
  10433. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  10434. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  10435. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  10436. //目标polygon索引列表 -1标示没有被任何polygon包含,
  10437. var targetArray = [];
  10438. for (var _i3 = 1; _i3 < polygonArrayTemp.length; _i3++) {
  10439. for (var _j = _i3 - 1; _j >= 0; _j--) {
  10440. targetArray[_i3] = -1;
  10441. if (polygonBounds[_j].containsBounds(polygonBounds[_i3])) {
  10442. CCWIdent[_i3] = CCWIdent[_j] * -1;
  10443. if (CCWIdent[_i3] < 0) {
  10444. targetArray[_i3] = _j;
  10445. }
  10446. break;
  10447. }
  10448. }
  10449. }
  10450. for (var _i4 = 0; _i4 < polygonArrayTemp.length; _i4++) {
  10451. if (CCWIdent[_i4] > 0) {
  10452. polygonArray.push(polygonArrayTemp[_i4]);
  10453. } else {
  10454. polygonArray[targetArray[_i4]].components = polygonArray[targetArray[_i4]].components.concat(polygonArrayTemp[_i4].components); //占位
  10455. polygonArray.push('');
  10456. }
  10457. }
  10458. } else {
  10459. //根据面积排序
  10460. //ServerGeometry.bubbleSort(areaArray, polygonArrayTemp,geoTopo);
  10461. polygonArray = new Array();
  10462. for (var _i5 = 0; _i5 < polygonArrayTemp.length; _i5++) {
  10463. if (geoTopo[_i5] && geoTopo[_i5] == -1) {
  10464. CCWArray = CCWArray.concat(polygonArrayTemp[_i5].components);
  10465. } else {
  10466. if (CCWArray.length > 0 && polygonArray.length > 0) {
  10467. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  10468. CCWArray = [];
  10469. }
  10470. polygonArray.push(polygonArrayTemp[_i5]);
  10471. }
  10472. if (_i5 == len - 1) {
  10473. var polyLength = polygonArray.length;
  10474. if (polyLength) {
  10475. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  10476. } else {
  10477. for (var k = 0, length = CCWArray.length; k < length; k++) {
  10478. polygonArray.push(new Polygon(CCWArray));
  10479. }
  10480. }
  10481. }
  10482. }
  10483. }
  10484. return new MultiPolygon(polygonArray);
  10485. }
  10486. /**
  10487. * @function SuperMap.ServerGeometry.prototype.toGeoRegionEPS
  10488. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。
  10489. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  10490. */
  10491. }, {
  10492. key: "toGeoRegionEPS",
  10493. value: function toGeoRegionEPS() {
  10494. var me = this,
  10495. geoParts = me.parts || [],
  10496. geoTopo = me.partTopo || [],
  10497. geoPoints = me.points || [],
  10498. len = geoParts.length;
  10499. if (len <= 0) {
  10500. return null;
  10501. }
  10502. var polygonArray = [];
  10503. var pointList = [];
  10504. var lineEPS;
  10505. if (len == 1) {
  10506. for (var i = 0; i < geoPoints.length; i++) {
  10507. pointList.push(new Point_Point(geoPoints[i].x, geoPoints[i].y));
  10508. }
  10509. lineEPS = LineString_LineString.createLineEPS(pointList);
  10510. polygonArray.push(new Polygon([new LinearRing(lineEPS)]));
  10511. return new MultiPolygon(polygonArray);
  10512. } //处理复杂面
  10513. var CCWArray = [];
  10514. var areaArray = [];
  10515. var polygonArrayTemp = [];
  10516. var polygonBounds = []; //polyon岛洞标识数组,初始都是岛。
  10517. var CCWIdent = [];
  10518. for (var _i6 = 0, pointIndex = 0; _i6 < len; _i6++) {
  10519. for (var j = 0; j < geoParts[_i6]; j++) {
  10520. pointList.push(new Point_Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  10521. }
  10522. pointIndex += geoParts[_i6];
  10523. lineEPS = LineString_LineString.createLineEPS(pointList);
  10524. var polygon = new Polygon([new LinearRing(lineEPS)]);
  10525. pointList = [];
  10526. polygonArrayTemp.push(polygon);
  10527. if (geoTopo.length === 0) {
  10528. polygonBounds.push(polygon.getBounds());
  10529. }
  10530. CCWIdent.push(1);
  10531. areaArray.push(polygon.getArea());
  10532. } //根据面积排序
  10533. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds); //iServer 9D新增字段
  10534. if (geoTopo.length === 0) {
  10535. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  10536. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  10537. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  10538. //目标polygon索引列表 -1标示没有被任何polygon包含,
  10539. var targetArray = [];
  10540. for (var _i7 = 1; _i7 < polygonArrayTemp.length; _i7++) {
  10541. for (var _j2 = _i7 - 1; _j2 >= 0; _j2--) {
  10542. targetArray[_i7] = -1;
  10543. if (polygonBounds[_j2].containsBounds(polygonBounds[_i7])) {
  10544. CCWIdent[_i7] = CCWIdent[_j2] * -1;
  10545. if (CCWIdent[_i7] < 0) {
  10546. targetArray[_i7] = _j2;
  10547. }
  10548. break;
  10549. }
  10550. }
  10551. }
  10552. for (var _i8 = 0; _i8 < polygonArrayTemp.length; _i8++) {
  10553. if (CCWIdent[_i8] > 0) {
  10554. polygonArray.push(polygonArrayTemp[_i8]);
  10555. } else {
  10556. polygonArray[targetArray[_i8]].components = polygonArray[targetArray[_i8]].components.concat(polygonArrayTemp[_i8].components); //占位
  10557. polygonArray.push('');
  10558. }
  10559. }
  10560. } else {
  10561. //根据面积排序
  10562. polygonArray = new Array();
  10563. for (var _i9 = 0; _i9 < polygonArrayTemp.length; _i9++) {
  10564. if (geoTopo[_i9] && geoTopo[_i9] == -1) {
  10565. CCWArray = CCWArray.concat(polygonArrayTemp[_i9].components);
  10566. } else {
  10567. if (CCWArray.length > 0 && polygonArray.length > 0) {
  10568. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  10569. CCWArray = [];
  10570. }
  10571. polygonArray.push(polygonArrayTemp[_i9]);
  10572. }
  10573. if (_i9 == len - 1) {
  10574. var polyLength = polygonArray.length;
  10575. if (polyLength) {
  10576. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  10577. } else {
  10578. for (var k = 0, length = CCWArray.length; k < length; k++) {
  10579. polygonArray.push(new Polygon(CCWArray));
  10580. }
  10581. }
  10582. }
  10583. }
  10584. }
  10585. return new MultiPolygon(polygonArray);
  10586. }
  10587. }, {
  10588. key: "transformGeoCompound",
  10589. value: function transformGeoCompound() {
  10590. var me = this,
  10591. geoParts = me.geoParts || [],
  10592. len = geoParts.length;
  10593. if (len <= 0) {
  10594. return null;
  10595. }
  10596. var geometryList = [];
  10597. for (var index = 0; index < len; index++) {
  10598. var geometry = geoParts[index];
  10599. geometryList.push(new ServerGeometry(geometry).toGeometry());
  10600. }
  10601. return new Collection_Collection(geometryList);
  10602. }
  10603. /**
  10604. * @function SuperMap.ServerGeometry.prototype.fromJson
  10605. * @description 将 JSON 对象表示服务端几何对象转换为 ServerGeometry。
  10606. * @param {Object} jsonObject - 要转换的 JSON 对象。
  10607. * @returns {SuperMap.ServerGeometry} 转换后的 ServerGeometry 对象。
  10608. */
  10609. }], [{
  10610. key: "fromJson",
  10611. value: function fromJson(jsonObject) {
  10612. if (!jsonObject) {
  10613. return;
  10614. }
  10615. return new ServerGeometry({
  10616. id: jsonObject.id,
  10617. style: ServerStyle_ServerStyle.fromJson(jsonObject.style),
  10618. parts: jsonObject.parts,
  10619. partTopo: jsonObject.partTopo,
  10620. points: jsonObject.points,
  10621. center: jsonObject.center,
  10622. length: jsonObject.length,
  10623. maxM: jsonObject.maxM,
  10624. minM: jsonObject.minM,
  10625. type: jsonObject.type
  10626. });
  10627. }
  10628. /**
  10629. * @function SuperMap.ServerGeometry.prototype.fromGeometry
  10630. * @description 将客户端 Geometry 转换成服务端 ServerGeometry。
  10631. * @param {SuperMap.Geometry} geometry - 要转换的客户端 Geometry 对象。
  10632. * @returns {SuperMap.ServerGeometry} 转换后的 ServerGeometry 对象。
  10633. */
  10634. }, {
  10635. key: "fromGeometry",
  10636. value: function fromGeometry(geometry) {
  10637. if (!geometry) {
  10638. return;
  10639. }
  10640. var id = 0,
  10641. parts = [],
  10642. points = [],
  10643. type = null,
  10644. icomponents = geometry.components,
  10645. className = geometry.CLASS_NAME,
  10646. prjCoordSys = {
  10647. epsgCode: geometry.SRID
  10648. };
  10649. if (!isNaN(geometry.id)) {
  10650. id = geometry.id;
  10651. } //坑爹的改法,没法,为了支持态势标绘,有时间就得全改
  10652. if (className != 'SuperMap.Geometry.LinearRing' && className != 'SuperMap.Geometry.LineString' && (geometry instanceof MultiPoint || geometry instanceof MultiLineString)) {
  10653. var ilen = icomponents.length;
  10654. for (var i = 0; i < ilen; i++) {
  10655. var partPointsCount = icomponents[i].getVertices().length;
  10656. parts.push(partPointsCount);
  10657. for (var j = 0; j < partPointsCount; j++) {
  10658. points.push(new Point_Point(icomponents[i].getVertices()[j].x, icomponents[i].getVertices()[j].y));
  10659. }
  10660. } //这里className不是多点就全部是算线
  10661. type = className == 'SuperMap.Geometry.MultiPoint' ? GeometryType.POINT : GeometryType.LINE;
  10662. } else if (geometry instanceof MultiPolygon) {
  10663. var _ilen = icomponents.length;
  10664. for (var _i10 = 0; _i10 < _ilen; _i10++) {
  10665. var polygon = icomponents[_i10],
  10666. linearRingOfPolygon = polygon.components,
  10667. linearRingOfPolygonLen = linearRingOfPolygon.length;
  10668. for (var _j3 = 0; _j3 < linearRingOfPolygonLen; _j3++) {
  10669. var _partPointsCount = linearRingOfPolygon[_j3].getVertices().length + 1;
  10670. parts.push(_partPointsCount);
  10671. for (var k = 0; k < _partPointsCount - 1; k++) {
  10672. points.push(new Point_Point(linearRingOfPolygon[_j3].getVertices()[k].x, linearRingOfPolygon[_j3].getVertices()[k].y));
  10673. }
  10674. points.push(new Point_Point(linearRingOfPolygon[_j3].getVertices()[0].x, linearRingOfPolygon[_j3].getVertices()[0].y));
  10675. }
  10676. }
  10677. type = GeometryType.REGION;
  10678. } else if (geometry instanceof Polygon) {
  10679. var _ilen2 = icomponents.length;
  10680. for (var _i11 = 0; _i11 < _ilen2; _i11++) {
  10681. var _partPointsCount2 = icomponents[_i11].getVertices().length + 1;
  10682. parts.push(_partPointsCount2);
  10683. for (var _j4 = 0; _j4 < _partPointsCount2 - 1; _j4++) {
  10684. points.push(new Point_Point(icomponents[_i11].getVertices()[_j4].x, icomponents[_i11].getVertices()[_j4].y));
  10685. }
  10686. points.push(new Point_Point(icomponents[_i11].getVertices()[0].x, icomponents[_i11].getVertices()[0].y));
  10687. }
  10688. type = GeometryType.REGION;
  10689. } else {
  10690. var geometryVerticesCount = geometry.getVertices().length;
  10691. for (var _j5 = 0; _j5 < geometryVerticesCount; _j5++) {
  10692. points.push(new Point_Point(geometry.getVertices()[_j5].x, geometry.getVertices()[_j5].y));
  10693. }
  10694. if (geometry instanceof LinearRing) {
  10695. points.push(new Point_Point(geometry.getVertices()[0].x, geometry.getVertices()[0].y));
  10696. geometryVerticesCount++;
  10697. }
  10698. parts.push(geometryVerticesCount);
  10699. type = geometry instanceof Point_Point ? GeometryType.POINT : GeometryType.LINE;
  10700. }
  10701. return new ServerGeometry({
  10702. id: id,
  10703. style: null,
  10704. parts: parts,
  10705. points: points,
  10706. type: type,
  10707. prjCoordSys: prjCoordSys
  10708. });
  10709. }
  10710. /**
  10711. * @function SuperMap.ServerGeometry.prototype.IsClockWise
  10712. * @description 判断 linearRing 中的点的顺序。返回值大于 0,逆时针;小于 0,顺时针。
  10713. * @param {SuperMap.Geometry} geometry - 要转换的客户端 Geometry 对象。
  10714. * @returns {number} 返回值大于 0,逆时针;小于 0,顺时针。
  10715. */
  10716. }, {
  10717. key: "IsClockWise",
  10718. value: function IsClockWise(points) {
  10719. var length = points.length;
  10720. if (length < 3) {
  10721. return 0.0;
  10722. }
  10723. var s = points[0].y * (points[length - 1].x - points[1].x);
  10724. points.push(points[0]);
  10725. for (var i = 1; i < length; i++) {
  10726. s += points[i].y * (points[i - 1].x - points[i + 1].x);
  10727. }
  10728. return s * 0.5;
  10729. }
  10730. }, {
  10731. key: "bubbleSort",
  10732. value: function bubbleSort(areaArray, pointList, geoTopo, polygonBounds) {
  10733. for (var i = 0; i < areaArray.length; i++) {
  10734. for (var j = 0; j < areaArray.length; j++) {
  10735. if (areaArray[i] > areaArray[j]) {
  10736. var d = areaArray[j];
  10737. areaArray[j] = areaArray[i];
  10738. areaArray[i] = d;
  10739. var b = pointList[j];
  10740. pointList[j] = pointList[i];
  10741. pointList[i] = b;
  10742. if (geoTopo && geoTopo.length > 0) {
  10743. var c = geoTopo[j];
  10744. geoTopo[j] = geoTopo[i];
  10745. geoTopo[i] = c;
  10746. }
  10747. if (polygonBounds && polygonBounds.length > 0) {
  10748. var f = polygonBounds[j];
  10749. polygonBounds[j] = polygonBounds[i];
  10750. polygonBounds[i] = f;
  10751. }
  10752. }
  10753. }
  10754. }
  10755. }
  10756. }]);
  10757. return ServerGeometry;
  10758. }();
  10759. SuperMap.ServerGeometry = ServerGeometry_ServerGeometry;
  10760. // CONCATENATED MODULE: ./src/common/format/GeoJSON.js
  10761. 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); }
  10762. function GeoJSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10763. 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); } }
  10764. function GeoJSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoJSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoJSON_defineProperties(Constructor, staticProps); return Constructor; }
  10765. 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); }
  10766. function GeoJSON_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoJSON_getPrototypeOf(object); if (object === null) break; } return object; }
  10767. 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); }
  10768. function GeoJSON_setPrototypeOf(o, p) { GeoJSON_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoJSON_setPrototypeOf(o, p); }
  10769. 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); }; }
  10770. function GeoJSON_possibleConstructorReturn(self, call) { if (call && (GeoJSON_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoJSON_assertThisInitialized(self); }
  10771. function GeoJSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  10772. 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; } }
  10773. function GeoJSON_getPrototypeOf(o) { GeoJSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoJSON_getPrototypeOf(o); }
  10774. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  10775. * This program are made available under the terms of the Apache License, Version 2.0
  10776. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10777. /**
  10778. * @class SuperMap.Format.GeoJSON
  10779. * @classdesc GeoJSON 的读和写。使用 {@link SuperMap.Format.GeoJSON} 构造器创建一个 GeoJSON 解析器。
  10780. * @category BaseTypes Format
  10781. * @param {Object} [options] - 参数。
  10782. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  10783. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  10784. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  10785. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  10786. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  10787. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  10788. * @param {boolean} [options.ignoreExtraDims=true] - 忽略维度超过 2 的几何要素。
  10789. * @extends {SuperMap.Format.JSON}
  10790. */
  10791. var GeoJSON_GeoJSON = /*#__PURE__*/function (_JSONFormat) {
  10792. GeoJSON_inherits(GeoJSON, _JSONFormat);
  10793. var _super = GeoJSON_createSuper(GeoJSON);
  10794. function GeoJSON(options) {
  10795. var _this;
  10796. GeoJSON_classCallCheck(this, GeoJSON);
  10797. _this = _super.call(this, options);
  10798. /**
  10799. * @member {boolean} [SuperMap.Format.GeoJSON.prototype.ignoreExtraDims=true]
  10800. * @description 忽略维度超过 2 的几何要素。
  10801. */
  10802. _this.ignoreExtraDims = true;
  10803. _this.CLASS_NAME = "SuperMap.Format.GeoJSON";
  10804. /**
  10805. * @member {Object} SuperMap.Format.GeoJSON.prototype.parseCoords
  10806. * @private
  10807. * @description 一个属性名对应着 GeoJSON 对象的几何类型的对象。每个属性其实都是一个实际上做解析用的方法。
  10808. */
  10809. _this.parseCoords = {
  10810. /**
  10811. * @function SuperMap.Format.GeoJSON.parseCoords.point
  10812. * @description 将一组坐标转成一个 {@link SuperMap.Geometry} 对象。
  10813. * @param {Object} array - GeoJSON 片段中的一组坐标。
  10814. * @returns {SuperMap.Geometry} 一个几何对象。
  10815. */
  10816. "point": function point(array) {
  10817. if (this.ignoreExtraDims === false && array.length != 2) {
  10818. throw "Only 2D points are supported: " + array;
  10819. }
  10820. return new Point_Point(array[0], array[1]);
  10821. },
  10822. /**
  10823. * @function SuperMap.Format.GeoJSON.parseCoords.multipoint
  10824. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10825. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  10826. * @returns {SuperMap.Geometry} 一个几何对象。
  10827. */
  10828. "multipoint": function multipoint(array) {
  10829. var points = [];
  10830. var p = null;
  10831. for (var i = 0, len = array.length; i < len; ++i) {
  10832. try {
  10833. p = this.parseCoords["point"].apply(this, [array[i]]);
  10834. } catch (err) {
  10835. throw err;
  10836. }
  10837. points.push(p);
  10838. }
  10839. return new MultiPoint(points);
  10840. },
  10841. /**
  10842. * @function SuperMap.Format.GeoJSON.parseCoords.linestring
  10843. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10844. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  10845. * @returns {SuperMap.Geometry} 一个几何对象。
  10846. */
  10847. "linestring": function linestring(array) {
  10848. var points = [];
  10849. var p = null;
  10850. for (var i = 0, len = array.length; i < len; ++i) {
  10851. try {
  10852. p = this.parseCoords["point"].apply(this, [array[i]]);
  10853. } catch (err) {
  10854. throw err;
  10855. }
  10856. points.push(p);
  10857. }
  10858. return new LineString_LineString(points);
  10859. },
  10860. /**
  10861. * @function SuperMap.Format.GeoJSON.parseCoords.multilinestring
  10862. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10863. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  10864. * @returns {SuperMap.Geometry} 一个几何对象。
  10865. */
  10866. "multilinestring": function multilinestring(array) {
  10867. var lines = [];
  10868. var l = null;
  10869. for (var i = 0, len = array.length; i < len; ++i) {
  10870. try {
  10871. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  10872. } catch (err) {
  10873. throw err;
  10874. }
  10875. lines.push(l);
  10876. }
  10877. return new MultiLineString(lines);
  10878. },
  10879. /**
  10880. * @function SuperMap.Format.GeoJSON.parseCoords.polygon
  10881. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10882. * @returns {SuperMap.Geometry} 一个几何对象。
  10883. */
  10884. "polygon": function polygon(array) {
  10885. var rings = [];
  10886. var r, l;
  10887. for (var i = 0, len = array.length; i < len; ++i) {
  10888. try {
  10889. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  10890. } catch (err) {
  10891. throw err;
  10892. }
  10893. r = new LinearRing(l.components);
  10894. rings.push(r);
  10895. }
  10896. return new Polygon(rings);
  10897. },
  10898. /**
  10899. * @function SuperMap.Format.GeoJSON.parseCoords.multipolygon
  10900. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10901. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  10902. * @returns {SuperMap.Geometry} 一个几何对象。
  10903. */
  10904. "multipolygon": function multipolygon(array) {
  10905. var polys = [];
  10906. var p = null;
  10907. for (var i = 0, len = array.length; i < len; ++i) {
  10908. try {
  10909. p = this.parseCoords["polygon"].apply(this, [array[i]]);
  10910. } catch (err) {
  10911. throw err;
  10912. }
  10913. polys.push(p);
  10914. }
  10915. return new MultiPolygon(polys);
  10916. },
  10917. /**
  10918. * @function SuperMap.Format.GeoJSON.parseCoords.box
  10919. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10920. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  10921. * @returns {SuperMap.Geometry} 一个几何对象。
  10922. */
  10923. "box": function box(array) {
  10924. if (array.length != 2) {
  10925. throw "GeoJSON box coordinates must have 2 elements";
  10926. }
  10927. return new Polygon([new LinearRing([new Point_Point(array[0][0], array[0][1]), new Point_Point(array[1][0], array[0][1]), new Point_Point(array[1][0], array[1][1]), new Point_Point(array[0][0], array[1][1]), new Point_Point(array[0][0], array[0][1])])]);
  10928. }
  10929. };
  10930. /**
  10931. * @member {Object} SuperMap.Format.GeoJSON.prototype.extract
  10932. * @private
  10933. * @description 一个属性名对应着GeoJSON类型的对象。其值为相应的实际的解析方法。
  10934. */
  10935. _this.extract = {
  10936. /**
  10937. * @function SuperMap.Format.GeoJSON.extract.feature
  10938. * @description 返回一个表示单个要素对象的 GeoJSON 的一部分。
  10939. * @param {SuperMap.ServerFeature} feature - iServer 要素对象。
  10940. * @returns {Object} 一个表示点的对象。
  10941. */
  10942. 'feature': function feature(_feature) {
  10943. var geom = this.extract.geometry.apply(this, [_feature.geometry]);
  10944. var json = {
  10945. "type": "Feature",
  10946. "properties": this.createAttributes(_feature),
  10947. "geometry": geom
  10948. };
  10949. if (_feature.geometry && _feature.geometry.type === 'TEXT') {
  10950. json.properties.texts = _feature.geometry.texts;
  10951. json.properties.textStyle = _feature.geometry.textStyle;
  10952. }
  10953. if (_feature.fid) {
  10954. json.id = _feature.fid;
  10955. }
  10956. if (_feature.ID) {
  10957. json.id = _feature.ID;
  10958. }
  10959. return json;
  10960. },
  10961. /**
  10962. * @function SuperMap.Format.GeoJSON.extract.geometry
  10963. * @description 返回一个表示单个几何对象的 GeoJSON 的一部分。
  10964. * @param {Object} geometry - iServer 几何对象。
  10965. * @returns {Object} 一个表示几何体的对象。
  10966. */
  10967. 'geometry': function geometry(_geometry) {
  10968. if (_geometry == null) {
  10969. return null;
  10970. }
  10971. if (!_geometry.parts && _geometry.points) {
  10972. _geometry.parts = [_geometry.points.length];
  10973. }
  10974. var geo = _geometry.hasOwnProperty('geometryType') ? _geometry : new ServerGeometry_ServerGeometry(_geometry).toGeometry() || _geometry;
  10975. var geometryType = geo.geometryType || geo.type;
  10976. var data;
  10977. if (geometryType === "LinearRing") {
  10978. geometryType = "LineString";
  10979. }
  10980. if (geometryType === "LINEM") {
  10981. geometryType = "MultiLineString";
  10982. }
  10983. data = this.extract[geometryType.toLowerCase()].apply(this, [geo]);
  10984. geometryType = geometryType === 'TEXT' ? 'Point' : geometryType;
  10985. var json;
  10986. if (geometryType === "Collection") {
  10987. json = {
  10988. "type": "GeometryCollection",
  10989. "geometries": data
  10990. };
  10991. } else {
  10992. json = {
  10993. "type": geometryType,
  10994. "coordinates": data
  10995. };
  10996. }
  10997. return json;
  10998. },
  10999. /**
  11000. * @function SuperMap.Format.GeoJSON.extract.point
  11001. * @description 从一个点对象中返回一个坐标组。
  11002. * @param {SuperMap.Geometry.Point} point - 一个点对象。
  11003. * @returns {Array} 一个表示一个点的坐标组。
  11004. */
  11005. 'point': function point(_point) {
  11006. var p = [_point.x, _point.y];
  11007. for (var name in _point) {
  11008. if (name !== "x" && name !== "y" && _point[name] !== null && !isNaN(_point[name])) {
  11009. p.push(_point[name]);
  11010. }
  11011. }
  11012. return p;
  11013. },
  11014. /**
  11015. * @function SuperMap.Format.GeoJSON.extract.point
  11016. * @description 从一个文本对象中返回一个坐标组。
  11017. * @param {Object} geo - 一个文本对象。
  11018. * @returns {Array} 一个表示一个点的坐标组。
  11019. */
  11020. 'text': function text(geo) {
  11021. return [geo.points[0].x, geo.points[0].y];
  11022. },
  11023. /**
  11024. * @function SuperMap.Format.GeoJSON.extract.multipoint
  11025. * @description 从一个多点对象中返一个坐标组数组。
  11026. * @param {SuperMap.Geometry.MultiPoint} multipoint - 多点对象。
  11027. * @returns {Array} 一个表示多点的坐标组数组。
  11028. */
  11029. 'multipoint': function multipoint(_multipoint) {
  11030. var array = [];
  11031. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  11032. array.push(this.extract.point.apply(this, [_multipoint.components[i]]));
  11033. }
  11034. return array;
  11035. },
  11036. /**
  11037. * @function SuperMap.Format.GeoJSON.extract.linestring
  11038. * @description 从一个线对象中返回一个坐标组数组。
  11039. * @param {SuperMap.Geometry.Linestring} linestring - 线对象。
  11040. * @returns {Array} 一个表示线对象的坐标组数组。
  11041. */
  11042. 'linestring': function linestring(_linestring) {
  11043. var array = [];
  11044. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  11045. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  11046. }
  11047. return array;
  11048. },
  11049. /**
  11050. * @function SuperMap.Format.GeoJSON.extract.multilinestring
  11051. * @description 从一个多线对象中返回一个线数组。
  11052. * @param {SuperMap.Geometry.MultiLinestring} multilinestring - 多线对象。
  11053. *
  11054. * @returns {Array} 一个表示多线的线数组。
  11055. */
  11056. 'multilinestring': function multilinestring(_multilinestring) {
  11057. var array = [];
  11058. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  11059. array.push(this.extract.linestring.apply(this, [_multilinestring.components[i]]));
  11060. }
  11061. return array;
  11062. },
  11063. /**
  11064. * @function SuperMap.Format.GeoJSON.extract.polygon
  11065. * @description 从一个面对象中返回一组线环。
  11066. * @param {SuperMap.Geometry.Polygon} polygon - 面对象。
  11067. * @returns {Array} 一组表示面的线环。
  11068. */
  11069. 'polygon': function polygon(_polygon) {
  11070. var array = [];
  11071. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  11072. array.push(this.extract.linestring.apply(this, [_polygon.components[i]]));
  11073. }
  11074. return array;
  11075. },
  11076. /**
  11077. * @function SuperMap.Format.GeoJSON.extract.multipolygon
  11078. * @description 从一个多面对象中返回一组面。
  11079. * @param {SuperMap.Geometry.MultiPolygon} multipolygon - 多面对象。
  11080. * @returns {Array} 一组表示多面的面。
  11081. */
  11082. 'multipolygon': function multipolygon(_multipolygon) {
  11083. var array = [];
  11084. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  11085. array.push(this.extract.polygon.apply(this, [_multipolygon.components[i]]));
  11086. }
  11087. return array;
  11088. },
  11089. /**
  11090. * @function SuperMap.Format.GeoJSON.extract.collection
  11091. * @description 从一个几何要素集合中一组几何要素数组。
  11092. * @param {SuperMap.Geometry.Collection} collection - 几何要素集合。
  11093. * @returns {Array} 一组表示几何要素集合的几何要素数组。
  11094. */
  11095. 'collection': function collection(_collection) {
  11096. var len = _collection.components.length;
  11097. var array = new Array(len);
  11098. for (var i = 0; i < len; ++i) {
  11099. array[i] = this.extract.geometry.apply(this, [_collection.components[i]]);
  11100. }
  11101. return array;
  11102. }
  11103. };
  11104. return _this;
  11105. }
  11106. /**
  11107. * @function SuperMap.Format.GeoJSON.prototype.read
  11108. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为 SuperMap Feature 对象。
  11109. * @param {GeoJSONObject} json - GeoJSON 对象。
  11110. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  11111. * @param {Function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  11112. * @returns {Object} 返回值依赖于 type 参数的值。
  11113. * -如果 type 等于 "FeatureCollection",返回值将会是 {@link SuperMap.Feature.Vector} 数组。
  11114. * -如果 type 为 "Geometry",输入的 JSON 对象必须表示一个唯一的几何体,然后返回值就会是 {@link SuperMap.Feature.Geometry}。
  11115. * -如果 type 为 "Feature",输入的 JSON 对象也必须表示的一个要素,这样返回值才会是 {@link SuperMap.Feature.Vector}。
  11116. */
  11117. GeoJSON_createClass(GeoJSON, [{
  11118. key: "read",
  11119. value: function read(json, type, filter) {
  11120. type = type ? type : "FeatureCollection";
  11121. var results = null;
  11122. var obj = null;
  11123. if (typeof json == "string") {
  11124. obj = GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "read", this).call(this, json, filter);
  11125. } else {
  11126. obj = json;
  11127. }
  11128. if (!obj) {//SuperMap.Console.error("Bad JSON: " + json);
  11129. } else if (typeof obj.type != "string") {//SuperMap.Console.error("Bad GeoJSON - no type: " + json);
  11130. } else if (this.isValidType(obj, type)) {
  11131. switch (type) {
  11132. case "Geometry":
  11133. try {
  11134. results = this.parseGeometry(obj);
  11135. } catch (err) {//SuperMap.Console.error(err);
  11136. }
  11137. break;
  11138. case "Feature":
  11139. try {
  11140. results = this.parseFeature(obj);
  11141. results.type = "Feature";
  11142. } catch (err) {//SuperMap.Console.error(err);
  11143. }
  11144. break;
  11145. case "FeatureCollection":
  11146. // for type FeatureCollection, we allow input to be any type
  11147. results = [];
  11148. switch (obj.type) {
  11149. case "Feature":
  11150. try {
  11151. results.push(this.parseFeature(obj));
  11152. } catch (err) {
  11153. results = null; //SuperMap.Console.error(err);
  11154. }
  11155. break;
  11156. case "FeatureCollection":
  11157. for (var i = 0, len = obj.features.length; i < len; ++i) {
  11158. try {
  11159. results.push(this.parseFeature(obj.features[i]));
  11160. } catch (err) {
  11161. results = null; // SuperMap.Console.error(err);
  11162. }
  11163. }
  11164. break;
  11165. default:
  11166. try {
  11167. var geom = this.parseGeometry(obj);
  11168. results.push(new Vector_Vector(geom));
  11169. } catch (err) {
  11170. results = null; //SuperMap.Console.error(err);
  11171. }
  11172. }
  11173. break;
  11174. default:
  11175. break;
  11176. }
  11177. }
  11178. return results;
  11179. }
  11180. /**
  11181. * @function SuperMap.Format.GeoJSON.prototype.write
  11182. * @description iServer Geometry JSON 对象 转 GeoJSON对象字符串。
  11183. * @param {Object} obj - iServer Geometry JSON 对象。
  11184. * @param {boolean} [pretty=false] - 是否使用换行和缩进来控制输出。
  11185. * @returns {GeoJSONObject} 一个 GeoJSON 字符串,它表示了输入的几何对象,要素对象,或者要素对象数组。
  11186. */
  11187. }, {
  11188. key: "write",
  11189. value: function write(obj, pretty) {
  11190. return GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "write", this).call(this, this.toGeoJSON(obj), pretty);
  11191. }
  11192. /**
  11193. * @function SuperMap.Format.GeoJSON.prototype.fromGeoJSON
  11194. * @version 9.1.1
  11195. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为iServer Feature JSON。
  11196. * @param {GeoJSONObject} json - GeoJSON 对象。
  11197. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  11198. * @param {Function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  11199. * @returns {Object} iServer Feature JSON。
  11200. */
  11201. }, {
  11202. key: "fromGeoJSON",
  11203. value: function fromGeoJSON(json, type, filter) {
  11204. var _this2 = this;
  11205. var feature = this.read(json, type, filter);
  11206. if (!Util_Util.isArray(feature)) {
  11207. return this._toiSevrerFeature(feature);
  11208. }
  11209. return feature.map(function (element) {
  11210. return _this2._toiSevrerFeature(element);
  11211. });
  11212. }
  11213. /**
  11214. * @function SuperMap.Format.GeoJSON.prototype.toGeoJSON
  11215. * @version 9.1.1
  11216. * @description 将 iServer Feature JSON 对象转换为 GeoJSON 对象。
  11217. * @param {Object} obj - iServer Feature JSON。
  11218. * @returns {GeoJSONObject} GeoJSON 对象。
  11219. */
  11220. }, {
  11221. key: "toGeoJSON",
  11222. value: function toGeoJSON(obj) {
  11223. var geojson = {
  11224. "type": null
  11225. };
  11226. if (Util_Util.isArray(obj)) {
  11227. geojson.type = "FeatureCollection";
  11228. var numFeatures = obj.length;
  11229. geojson.features = new Array(numFeatures);
  11230. for (var i = 0; i < numFeatures; ++i) {
  11231. var element = obj[i];
  11232. if (isGeometry(element)) {
  11233. var feature = {};
  11234. feature.geometry = element;
  11235. geojson.features[i] = this.extract.feature.apply(this, [feature]);
  11236. } else {
  11237. geojson.features[i] = this.extract.feature.apply(this, [element]);
  11238. }
  11239. }
  11240. } else if (isGeometry(obj)) {
  11241. var _feature2 = {};
  11242. _feature2.geometry = obj;
  11243. geojson = this.extract.feature.apply(this, [_feature2]);
  11244. } else {
  11245. geojson = this.extract.feature.apply(this, [obj]);
  11246. }
  11247. function isGeometry(input) {
  11248. return input.hasOwnProperty("parts") && input.hasOwnProperty("points") || input.hasOwnProperty("geoParts");
  11249. }
  11250. return geojson;
  11251. }
  11252. /**
  11253. * @function SuperMap.Format.GeoJSON.prototype.isValidType
  11254. * @description 检查一个 GeoJSON 对象是否和给定的类型相符的合法的对象。
  11255. * @returns {boolean} GeoJSON 是否是给定类型的合法对象。
  11256. * @private
  11257. */
  11258. }, {
  11259. key: "isValidType",
  11260. value: function isValidType(obj, type) {
  11261. var valid = false;
  11262. switch (type) {
  11263. case "Geometry":
  11264. if (Util_Util.indexOf(["Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection"], obj.type) == -1) {// unsupported geometry type
  11265. //SuperMap.Console.error("Unsupported geometry type: " +
  11266. // obj.type);
  11267. } else {
  11268. valid = true;
  11269. }
  11270. break;
  11271. case "FeatureCollection":
  11272. // allow for any type to be converted to a feature collection
  11273. valid = true;
  11274. break;
  11275. default:
  11276. // for Feature types must match
  11277. if (obj.type == type) {
  11278. valid = true;
  11279. } else {//SuperMap.Console.error("Cannot convert types from " +
  11280. //obj.type + " to " + type);
  11281. }
  11282. }
  11283. return valid;
  11284. }
  11285. /**
  11286. * @function SuperMap.Format.GeoJSON.prototype.parseFeature
  11287. * @description 将一个 GeoJSON 中的 feature 转化成 {@link SuperMap.Feature.Vector}> 对象。
  11288. * @private
  11289. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  11290. * @returns {SuperMap.Feature.Vector} 一个要素。
  11291. */
  11292. }, {
  11293. key: "parseFeature",
  11294. value: function parseFeature(obj) {
  11295. var feature, geometry, attributes, bbox;
  11296. attributes = obj.properties ? obj.properties : {};
  11297. bbox = obj.geometry && obj.geometry.bbox || obj.bbox;
  11298. try {
  11299. geometry = this.parseGeometry(obj.geometry);
  11300. } catch (err) {
  11301. // deal with bad geometries
  11302. throw err;
  11303. }
  11304. feature = new Vector_Vector(geometry, attributes);
  11305. if (bbox) {
  11306. feature.bounds = Bounds_Bounds.fromArray(bbox);
  11307. }
  11308. if (obj.id) {
  11309. feature.fid = obj.id;
  11310. }
  11311. return feature;
  11312. }
  11313. /**
  11314. * @function SuperMap.Format.GeoJSON.prototype.parseGeometry
  11315. * @description 将一个 GeoJSON 中的几何要素转化成 {@link SuperMap.Geometry} 对象。
  11316. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  11317. * @returns {SuperMap.Geometry} 一个几何要素。
  11318. * @private
  11319. */
  11320. }, {
  11321. key: "parseGeometry",
  11322. value: function parseGeometry(obj) {
  11323. if (obj == null) {
  11324. return null;
  11325. }
  11326. var geometry;
  11327. if (obj.type == "GeometryCollection") {
  11328. if (!Util_Util.isArray(obj.geometries)) {
  11329. throw "GeometryCollection must have geometries array: " + obj;
  11330. }
  11331. var numGeom = obj.geometries.length;
  11332. var components = new Array(numGeom);
  11333. for (var i = 0; i < numGeom; ++i) {
  11334. components[i] = this.parseGeometry.apply(this, [obj.geometries[i]]);
  11335. }
  11336. geometry = new Collection_Collection(components);
  11337. } else {
  11338. if (!Util_Util.isArray(obj.coordinates)) {
  11339. throw "Geometry must have coordinates array: " + obj;
  11340. }
  11341. if (!this.parseCoords[obj.type.toLowerCase()]) {
  11342. throw "Unsupported geometry type: " + obj.type;
  11343. }
  11344. try {
  11345. geometry = this.parseCoords[obj.type.toLowerCase()].apply(this, [obj.coordinates]);
  11346. } catch (err) {
  11347. // deal with bad coordinates
  11348. throw err;
  11349. }
  11350. }
  11351. return geometry;
  11352. }
  11353. /**
  11354. * @function SuperMap.Format.GeoJSON.prototype.createCRSObject
  11355. * @description 从一个要素对象中创建一个坐标参考系对象。
  11356. * @param {SuperMap.Feature.Vector} object - 要素对象。
  11357. * @private
  11358. * @returns {GeoJSONObject} 一个可作为 GeoJSON 对象的 CRS 属性使用的对象。
  11359. */
  11360. }, {
  11361. key: "createCRSObject",
  11362. value: function createCRSObject(object) {
  11363. var proj = object.layer.projection.toString();
  11364. var crs = {};
  11365. if (proj.match(/epsg:/i)) {
  11366. var code = parseInt(proj.substring(proj.indexOf(":") + 1));
  11367. if (code == 4326) {
  11368. crs = {
  11369. "type": "name",
  11370. "properties": {
  11371. "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
  11372. }
  11373. };
  11374. } else {
  11375. crs = {
  11376. "type": "name",
  11377. "properties": {
  11378. "name": "EPSG:" + code
  11379. }
  11380. };
  11381. }
  11382. }
  11383. return crs;
  11384. }
  11385. }, {
  11386. key: "_toiSevrerFeature",
  11387. value: function _toiSevrerFeature(feature) {
  11388. var attributes = feature.attributes;
  11389. var attrNames = [];
  11390. var attrValues = [];
  11391. for (var attr in attributes) {
  11392. attrNames.push(attr);
  11393. attrValues.push(attributes[attr]);
  11394. }
  11395. var newFeature = {
  11396. fieldNames: attrNames,
  11397. fieldValues: attrValues,
  11398. geometry: ServerGeometry_ServerGeometry.fromGeometry(feature.geometry)
  11399. };
  11400. newFeature.geometry.id = feature.fid;
  11401. return newFeature;
  11402. }
  11403. }, {
  11404. key: "createAttributes",
  11405. value: function createAttributes(feature) {
  11406. if (!feature) {
  11407. return null;
  11408. }
  11409. var attr = {};
  11410. processFieldsAttributes(feature, attr);
  11411. var exceptKeys = ["fieldNames", "fieldValues", "geometry", "stringID", "ID"];
  11412. for (var key in feature) {
  11413. if (exceptKeys.indexOf(key) > -1) {
  11414. continue;
  11415. }
  11416. attr[key] = feature[key];
  11417. }
  11418. function processFieldsAttributes(feature, attributes) {
  11419. if (!(feature.hasOwnProperty("fieldNames") && feature.hasOwnProperty("fieldValues"))) {
  11420. return;
  11421. }
  11422. var names = feature.fieldNames,
  11423. values = feature.fieldValues;
  11424. for (var i in names) {
  11425. attributes[names[i]] = values[i];
  11426. }
  11427. }
  11428. return attr;
  11429. }
  11430. }]);
  11431. return GeoJSON;
  11432. }(JSONFormat);
  11433. SuperMap.Format.GeoJSON = GeoJSON_GeoJSON;
  11434. // CONCATENATED MODULE: ./src/common/format/WKT.js
  11435. 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); }
  11436. function WKT_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11437. 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); } }
  11438. function WKT_createClass(Constructor, protoProps, staticProps) { if (protoProps) WKT_defineProperties(Constructor.prototype, protoProps); if (staticProps) WKT_defineProperties(Constructor, staticProps); return Constructor; }
  11439. 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); }
  11440. function WKT_setPrototypeOf(o, p) { WKT_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WKT_setPrototypeOf(o, p); }
  11441. 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); }; }
  11442. function WKT_possibleConstructorReturn(self, call) { if (call && (WKT_typeof(call) === "object" || typeof call === "function")) { return call; } return WKT_assertThisInitialized(self); }
  11443. function WKT_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11444. 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; } }
  11445. function WKT_getPrototypeOf(o) { WKT_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WKT_getPrototypeOf(o); }
  11446. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  11447. * This program are made available under the terms of the Apache License, Version 2.0
  11448. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11449. /**
  11450. * @class SuperMap.Format.WKT
  11451. * @classdesc 用于读写常见文本的类。通过 {@link SuperMap.Format.WKT} 构造器来创建一个新的实例。
  11452. * @category BaseTypes Format
  11453. * @extends {SuperMap.Format}
  11454. * @param {Object} options - 可选的选项对象,其属性将被设置到实例。option 具体配置项继承自 {@link SuperMap.Format}。
  11455. */
  11456. var WKT_WKT = /*#__PURE__*/function (_Format) {
  11457. WKT_inherits(WKT, _Format);
  11458. var _super = WKT_createSuper(WKT);
  11459. function WKT(options) {
  11460. var _this;
  11461. WKT_classCallCheck(this, WKT);
  11462. _this = _super.call(this, options);
  11463. _this.regExes = {
  11464. 'typeStr': /^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,
  11465. 'spaces': /\s+/,
  11466. 'parenComma': /\)\s*,\s*\(/,
  11467. 'doubleParenComma': /\)\s*\)\s*,\s*\(\s*\(/,
  11468. // can't use {2} here
  11469. 'trimParens': /^\s*\(?(.*?)\)?\s*$/
  11470. };
  11471. _this.CLASS_NAME = "SuperMap.Format.WKT";
  11472. /**
  11473. * @private
  11474. * @description Object with properties corresponding to the geometry types.
  11475. * Property values are functions that do the actual data extraction.
  11476. */
  11477. _this.extract = {
  11478. /**
  11479. * @description Return a space delimited string of point coordinates.
  11480. * @param {SuperMap.Geometry.Point} point
  11481. * @returns {string} A string of coordinates representing the point
  11482. */
  11483. 'point': function point(_point) {
  11484. return _point.x + ' ' + _point.y;
  11485. },
  11486. /**
  11487. * @description Return a comma delimited string of point coordinates from a multipoint.
  11488. * @param {SuperMap.Geometry.MultiPoint} multipoint
  11489. * @returns {string} A string of point coordinate strings representing
  11490. * the multipoint
  11491. */
  11492. 'multipoint': function multipoint(_multipoint) {
  11493. var array = [];
  11494. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  11495. array.push('(' + this.extract.point.apply(this, [_multipoint.components[i]]) + ')');
  11496. }
  11497. return array.join(',');
  11498. },
  11499. /**
  11500. * @description Return a comma delimited string of point coordinates from a line.
  11501. * @param {SuperMap.Geometry.LineString} linestring
  11502. * @returns {string} A string of point coordinate strings representing
  11503. * the linestring
  11504. */
  11505. 'linestring': function linestring(_linestring) {
  11506. var array = [];
  11507. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  11508. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  11509. }
  11510. return array.join(',');
  11511. },
  11512. /**
  11513. * @description Return a comma delimited string of linestring strings from a multilinestring.
  11514. * @param {SuperMap.Geometry.MultiLineString} multilinestring
  11515. * @returns {string} A string of of linestring strings representing
  11516. * the multilinestring
  11517. */
  11518. 'multilinestring': function multilinestring(_multilinestring) {
  11519. var array = [];
  11520. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  11521. array.push('(' + this.extract.linestring.apply(this, [_multilinestring.components[i]]) + ')');
  11522. }
  11523. return array.join(',');
  11524. },
  11525. /**
  11526. * @description Return a comma delimited string of linear ring arrays from a polygon.
  11527. * @param {SuperMap.Geometry.Polygon} polygon
  11528. * @returns {string} An array of linear ring arrays representing the polygon
  11529. */
  11530. 'polygon': function polygon(_polygon) {
  11531. var array = [];
  11532. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  11533. array.push('(' + this.extract.linestring.apply(this, [_polygon.components[i]]) + ')');
  11534. }
  11535. return array.join(',');
  11536. },
  11537. /**
  11538. * @description Return an array of polygon arrays from a multipolygon.
  11539. * @param {SuperMap.Geometry.MultiPolygon} multipolygon
  11540. * @returns {string} An array of polygon arrays representing
  11541. * the multipolygon
  11542. */
  11543. 'multipolygon': function multipolygon(_multipolygon) {
  11544. var array = [];
  11545. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  11546. array.push('(' + this.extract.polygon.apply(this, [_multipolygon.components[i]]) + ')');
  11547. }
  11548. return array.join(',');
  11549. },
  11550. /**
  11551. * @description Return the WKT portion between 'GEOMETRYCOLLECTION(' and ')' for an <SuperMap.Geometry.Collection>
  11552. * @param {SuperMap.Geometry.Collection} collection
  11553. * @returns {string} internal WKT representation of the collection
  11554. */
  11555. 'collection': function collection(_collection) {
  11556. var array = [];
  11557. for (var i = 0, len = _collection.components.length; i < len; ++i) {
  11558. array.push(this.extractGeometry.apply(this, [_collection.components[i]]));
  11559. }
  11560. return array.join(',');
  11561. }
  11562. };
  11563. /**
  11564. * @private
  11565. * @description Object with properties corresponding to the geometry types.
  11566. * Property values are functions that do the actual parsing.
  11567. */
  11568. _this.parse = {
  11569. /**
  11570. * @private
  11571. * @description Return point feature given a point WKT fragment.
  11572. * @param {string} str A WKT fragment representing the point
  11573. * @returns {SuperMap.Feature.Vector} A point feature
  11574. *
  11575. */
  11576. 'point': function point(str) {
  11577. var coords = StringExt.trim(str).split(this.regExes.spaces);
  11578. return new Vector_Vector(new Point_Point(coords[0], coords[1]));
  11579. },
  11580. /**
  11581. * @description Return a multipoint feature given a multipoint WKT fragment.
  11582. * @param {string} A WKT fragment representing the multipoint
  11583. * @returns {SuperMap.Feature.Vector} A multipoint feature
  11584. * @private
  11585. */
  11586. 'multipoint': function multipoint(str) {
  11587. var point;
  11588. var points = StringExt.trim(str).split(',');
  11589. var components = [];
  11590. for (var i = 0, len = points.length; i < len; ++i) {
  11591. point = points[i].replace(this.regExes.trimParens, '$1');
  11592. components.push(this.parse.point.apply(this, [point]).geometry);
  11593. }
  11594. return new Vector_Vector(new MultiPoint(components));
  11595. },
  11596. /**
  11597. * @description Return a linestring feature given a linestring WKT fragment.
  11598. * @param {string} A WKT fragment representing the linestring
  11599. * @returns {SuperMap.Feature.Vector} A linestring feature
  11600. * @private
  11601. */
  11602. 'linestring': function linestring(str) {
  11603. var points = StringExt.trim(str).split(',');
  11604. var components = [];
  11605. for (var i = 0, len = points.length; i < len; ++i) {
  11606. components.push(this.parse.point.apply(this, [points[i]]).geometry);
  11607. }
  11608. return new Vector_Vector(new LineString_LineString(components));
  11609. },
  11610. /**
  11611. * @description Return a multilinestring feature given a multilinestring WKT fragment.
  11612. * @param {string} A WKT fragment representing the multilinestring
  11613. * @returns {SuperMap.Feature.Vector} A multilinestring feature
  11614. * @private
  11615. */
  11616. 'multilinestring': function multilinestring(str) {
  11617. var line;
  11618. var lines = StringExt.trim(str).split(this.regExes.parenComma);
  11619. var components = [];
  11620. for (var i = 0, len = lines.length; i < len; ++i) {
  11621. line = lines[i].replace(this.regExes.trimParens, '$1');
  11622. components.push(this.parse.linestring.apply(this, [line]).geometry);
  11623. }
  11624. return new Vector_Vector(new MultiLineString(components));
  11625. },
  11626. /**
  11627. * @description Return a polygon feature given a polygon WKT fragment.
  11628. * @param {string} A WKT fragment representing the polygon
  11629. * @returns {SuperMap.Feature.Vector} A polygon feature
  11630. * @private
  11631. */
  11632. 'polygon': function polygon(str) {
  11633. var ring, linestring, linearring;
  11634. var rings = StringExt.trim(str).split(this.regExes.parenComma);
  11635. var components = [];
  11636. for (var i = 0, len = rings.length; i < len; ++i) {
  11637. ring = rings[i].replace(this.regExes.trimParens, '$1');
  11638. linestring = this.parse.linestring.apply(this, [ring]).geometry;
  11639. linearring = new LinearRing(linestring.components);
  11640. components.push(linearring);
  11641. }
  11642. return new Vector_Vector(new Polygon(components));
  11643. },
  11644. /**
  11645. * @private
  11646. * @description Return a multipolygon feature given a multipolygon WKT fragment.
  11647. * @param {string} A WKT fragment representing the multipolygon
  11648. * @returns {SuperMap.Feature.Vector} A multipolygon feature
  11649. *
  11650. */
  11651. 'multipolygon': function multipolygon(str) {
  11652. var polygon;
  11653. var polygons = StringExt.trim(str).split(this.regExes.doubleParenComma);
  11654. var components = [];
  11655. for (var i = 0, len = polygons.length; i < len; ++i) {
  11656. polygon = polygons[i].replace(this.regExes.trimParens, '$1');
  11657. components.push(this.parse.polygon.apply(this, [polygon]).geometry);
  11658. }
  11659. return new Vector_Vector(new MultiPolygon(components));
  11660. },
  11661. /**
  11662. * @description Return an array of features given a geometrycollection WKT fragment.
  11663. * @param {string} A WKT fragment representing the geometrycollection
  11664. * @returns {Array} An array of SuperMap.Feature.Vector
  11665. * @private
  11666. */
  11667. 'geometrycollection': function geometrycollection(str) {
  11668. // separate components of the collection with |
  11669. str = str.replace(/,\s*([A-Za-z])/g, '|$1');
  11670. var wktArray = StringExt.trim(str).split('|');
  11671. var components = [];
  11672. for (var i = 0, len = wktArray.length; i < len; ++i) {
  11673. components.push(this.read(wktArray[i]));
  11674. }
  11675. return components;
  11676. }
  11677. };
  11678. return _this;
  11679. }
  11680. /**
  11681. * @function SuperMap.Format.WKT.prototype.read
  11682. * @description Deserialize a WKT string and return a vector feature or an
  11683. * array of vector features. Supports WKT for POINT, MULTIPOINT,
  11684. * LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, and
  11685. * GEOMETRYCOLLECTION.
  11686. * @param {string} wkt - A WKT string
  11687. * @returns {SuperMap.Feature.Vector|Array} A feature or array of features for
  11688. * GEOMETRYCOLLECTION WKT.
  11689. */
  11690. WKT_createClass(WKT, [{
  11691. key: "read",
  11692. value: function read(wkt) {
  11693. var features, type, str;
  11694. wkt = wkt.replace(/[\n\r]/g, " ");
  11695. var matches = this.regExes.typeStr.exec(wkt);
  11696. if (matches) {
  11697. type = matches[1].toLowerCase();
  11698. str = matches[2];
  11699. if (this.parse[type]) {
  11700. features = this.parse[type].apply(this, [str]);
  11701. }
  11702. }
  11703. return features;
  11704. }
  11705. /**
  11706. * @function SuperMap.Format.WKT.prototype.write
  11707. * @description Serialize a feature or array of features into a WKT string.
  11708. * @param {(SuperMap.Feature.Vector|Array)} features - A feature or array of features
  11709. * @returns {string} The WKT string representation of the input geometries
  11710. */
  11711. }, {
  11712. key: "write",
  11713. value: function write(features) {
  11714. var collection, geometry, isCollection;
  11715. if (features.constructor === Array) {
  11716. collection = features;
  11717. isCollection = true;
  11718. } else {
  11719. collection = [features];
  11720. isCollection = false;
  11721. }
  11722. var pieces = [];
  11723. if (isCollection) {
  11724. pieces.push('GEOMETRYCOLLECTION(');
  11725. }
  11726. for (var i = 0, len = collection.length; i < len; ++i) {
  11727. if (isCollection && i > 0) {
  11728. pieces.push(',');
  11729. }
  11730. geometry = collection[i].geometry;
  11731. pieces.push(this.extractGeometry(geometry));
  11732. }
  11733. if (isCollection) {
  11734. pieces.push(')');
  11735. }
  11736. return pieces.join('');
  11737. }
  11738. /**
  11739. * @function SuperMap.Format.WKT.prototype.extractGeometry
  11740. * @description Entry point to construct the WKT for a single Geometry object.
  11741. * @param {SuperMap.Geometry} geometry
  11742. * @returns {string} A WKT string of representing the geometry
  11743. */
  11744. }, {
  11745. key: "extractGeometry",
  11746. value: function extractGeometry(geometry) {
  11747. var type = geometry.CLASS_NAME.split('.')[2].toLowerCase();
  11748. if (!this.extract[type]) {
  11749. return null;
  11750. }
  11751. var wktType = type === 'collection' ? 'GEOMETRYCOLLECTION' : type.toUpperCase();
  11752. var data = wktType + '(' + this.extract[type].apply(this, [geometry]) + ')';
  11753. return data;
  11754. }
  11755. }]);
  11756. return WKT;
  11757. }(Format_Format);
  11758. SuperMap.Format.WKT = WKT_WKT;
  11759. // CONCATENATED MODULE: ./src/common/format/index.js
  11760. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  11761. * This program are made available under the terms of the Apache License, Version 2.0
  11762. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11763. // CONCATENATED MODULE: ./src/common/control/img/Logo.js
  11764. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  11765. * This program are made available under the terms of the Apache License, Version 2.0
  11766. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11767. 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=";
  11768. // CONCATENATED MODULE: ./src/common/control/TimeControlBase.js
  11769. function TimeControlBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11770. 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); } }
  11771. function TimeControlBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeControlBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeControlBase_defineProperties(Constructor, staticProps); return Constructor; }
  11772. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  11773. * This program are made available under the terms of the Apache License, Version 2.0
  11774. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11775. /**
  11776. * @class SuperMap.TimeControlBase
  11777. * @classdesc 时间控制基类类。
  11778. * @category Control
  11779. * @param {Object} options - 该类开放的可选属性。
  11780. * @param {number} [options.speed=1] - 速度。不能小于 0,(每帧渲染的数据之间的间隔为1),设置越大速度越快。
  11781. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms),服务器刷新的时间间隔。
  11782. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  11783. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时以当前时间进行设置,建议设置。
  11784. * @param {boolean} [options.repeat=true] - 是否重复循环。
  11785. * @param {boolean} [options.reverse=false] - 是否反向。
  11786. */
  11787. var TimeControlBase_TimeControlBase = /*#__PURE__*/function () {
  11788. function TimeControlBase(options) {
  11789. TimeControlBase_classCallCheck(this, TimeControlBase);
  11790. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  11791. var me = this;
  11792. options = options || {};
  11793. /**
  11794. * @member {number} [SuperMap.TimeControlBase.prototype.speed=1]
  11795. * @description 步长,必须为非负数,默认为1(表示前后两次渲染的数据之间的间隔为1)
  11796. */
  11797. this.speed = options.speed && options.speed >= 0 ? options.speed : 1;
  11798. /**
  11799. * @member {number} [SuperMap.TimeControlBase.prototype.frequency=1000]
  11800. * @description 刷新频率(单位ms),服务器刷新的时间间隔。
  11801. */
  11802. this.frequency = options.speed && options.frequency >= 0 ? options.frequency : 1000;
  11803. /**
  11804. * @member {number} [SuperMap.TimeControlBase.prototype.startTime=0]
  11805. * @description 记录的起始时间,必须为数字,
  11806. * 如果不设置,初始化时为0,建议设置
  11807. */
  11808. this.startTime = options.startTime && options.startTime != null ? options.startTime : 0;
  11809. /**
  11810. * @member {number} SuperMap.TimeControlBase.prototype.endTime
  11811. * @description 记录的结束时间,必须为数字,
  11812. * 如果不设置,初始化时以当前时间进行设置,建议设置
  11813. */
  11814. this.endTime = options.endTime && options.endTime != null && options.endTime >= me.startTime ? options.endTime : +new Date();
  11815. /**
  11816. * @member {boolean} [SuperMap.TimeControlBase.prototype.repeat=true]
  11817. * @description 是否重复循环。
  11818. */
  11819. this.repeat = options.repeat !== undefined ? options.repeat : true;
  11820. /**
  11821. * @member {boolean} [SuperMap.TimeControlBase.prototype.reverse=false]
  11822. * @description 是否反向。
  11823. */
  11824. this.reverse = options.reverse !== undefined ? options.reverse : false;
  11825. /**
  11826. * @member {number} SuperMap.TimeControlBase.prototype.currentTime
  11827. * @description 记录近期的时间,也就是当前帧运行到的时间。
  11828. */
  11829. this.currentTime = null;
  11830. /**
  11831. * @member {number} SuperMap.TimeControlBase.prototype.oldTime
  11832. * @description 记录上一帧的时间,也就是之前运行到的时间。
  11833. */
  11834. this.oldTime = null;
  11835. /**
  11836. * @member {boolean} [SuperMap.TimeControlBase.prototype.running=false]
  11837. * @description 记录当前是否处于运行中。
  11838. */
  11839. this.running = false;
  11840. /**
  11841. * @private
  11842. * @member {Array.<string>} SuperMap.TimeControlBase.prototype.EVENT_TYPES
  11843. * @description 此类支持的事件类型。
  11844. *
  11845. */
  11846. this.EVENT_TYPES = ["start", "pause", "stop"];
  11847. /**
  11848. * @private
  11849. * @member {SuperMap.Events} SuperMap.TimeControlBase.prototype.events
  11850. * @description 事件
  11851. */
  11852. me.events = new Events_Events(this, null, this.EVENT_TYPES);
  11853. me.speed = Number(me.speed);
  11854. me.frequency = Number(me.frequency);
  11855. me.startTime = Number(me.startTime);
  11856. me.endTime = Number(me.endTime);
  11857. me.startTime = Date.parse(new Date(me.startTime));
  11858. me.endTime = Date.parse(new Date(me.endTime)); //初始化当前时间
  11859. me.currentTime = me.startTime;
  11860. this.CLASS_NAME = "SuperMap.TimeControlBase";
  11861. }
  11862. /**
  11863. * @function SuperMap.TimeControlBase.prototype.updateOptions
  11864. * @param {Object} options - 设置参数得可选参数。设置步长,刷新频率、开始结束时间、是否循环、是否反向。
  11865. */
  11866. TimeControlBase_createClass(TimeControlBase, [{
  11867. key: "updateOptions",
  11868. value: function updateOptions(options) {
  11869. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  11870. var me = this;
  11871. options = options || {};
  11872. if (options.speed && options.speed >= 0) {
  11873. me.speed = options.speed;
  11874. me.speed = Number(me.speed);
  11875. }
  11876. if (options.speed && options.frequency >= 0) {
  11877. me.frequency = options.frequency;
  11878. me.frequency = Number(me.frequency);
  11879. }
  11880. if (options.startTime && options.startTime != null) {
  11881. me.startTime = options.startTime;
  11882. me.startTime = Date.parse(new Date(me.startTime));
  11883. }
  11884. if (options.endTime && options.endTime != null && options.endTime >= me.startTime) {
  11885. me.endTime = options.endTime;
  11886. me.endTime = Date.parse(new Date(me.endTime));
  11887. }
  11888. if (options.repeat != null) {
  11889. me.repeat = options.repeat;
  11890. }
  11891. if (options.reverse != null) {
  11892. me.reverse = options.reverse;
  11893. }
  11894. }
  11895. /**
  11896. * @function SuperMap.TimeControlBase.prototype.start
  11897. * @description 开始。
  11898. */
  11899. }, {
  11900. key: "start",
  11901. value: function start() {
  11902. var me = this;
  11903. if (!me.running) {
  11904. me.running = true;
  11905. me.tick();
  11906. me.events.triggerEvent('start', me.currentTime);
  11907. }
  11908. }
  11909. /**
  11910. * @function SuperMap.TimeControlBase.prototype.pause
  11911. * @description 暂停。
  11912. */
  11913. }, {
  11914. key: "pause",
  11915. value: function pause() {
  11916. var me = this;
  11917. me.running = false;
  11918. me.events.triggerEvent('pause', me.currentTime);
  11919. }
  11920. /**
  11921. * @function SuperMap.TimeControlBase.prototype.stop
  11922. * @description 停止,停止后返回起始状态。
  11923. */
  11924. }, {
  11925. key: "stop",
  11926. value: function stop() {
  11927. var me = this; //停止时 时间设置为开始时间
  11928. me.currentTime = me.startTime; //如果正在运行,修改为初始时间即可绘制一帧
  11929. if (me.running) {
  11930. me.running = false;
  11931. }
  11932. me.events.triggerEvent('stop', me.currentTime);
  11933. }
  11934. /**
  11935. * @function SuperMap.TimeControlBase.prototype.toggle
  11936. * @description 开关切换,切换的是开始和暂停。
  11937. */
  11938. }, {
  11939. key: "toggle",
  11940. value: function toggle() {
  11941. var me = this;
  11942. if (me.running) {
  11943. me.pause();
  11944. } else {
  11945. me.start();
  11946. }
  11947. }
  11948. /**
  11949. * @function SuperMap.TimeControlBase.prototype.setSpeed
  11950. * @description 设置步长。
  11951. * @param {number} [speed=1] - 步长,必须为非负数。
  11952. * @returns {boolean} true 代表设置成功,false 设置失败(speed 小于 0 时失败)。
  11953. */
  11954. }, {
  11955. key: "setSpeed",
  11956. value: function setSpeed(speed) {
  11957. var me = this;
  11958. if (speed >= 0) {
  11959. me.speed = speed;
  11960. return true;
  11961. }
  11962. return false;
  11963. }
  11964. /**
  11965. * @function SuperMap.TimeControlBase.prototype.getSpeed
  11966. * @description 获取步长。
  11967. * @returns {number} 返回当前的步长
  11968. */
  11969. }, {
  11970. key: "getSpeed",
  11971. value: function getSpeed() {
  11972. return this.speed;
  11973. }
  11974. /**
  11975. * @function SuperMap.TimeControlBase.prototype.setFrequency
  11976. * @description 设置刷新频率。
  11977. * @param {number} [frequency=1000] - 刷新频率,单位为 ms。
  11978. * @returns {boolean} true 代表设置成功,false 设置失败(frequency 小于 0 时失败)。
  11979. */
  11980. }, {
  11981. key: "setFrequency",
  11982. value: function setFrequency(frequency) {
  11983. var me = this;
  11984. if (frequency >= 0) {
  11985. me.frequency = frequency;
  11986. return true;
  11987. }
  11988. return false;
  11989. }
  11990. /**
  11991. * @function SuperMap.TimeControlBase.prototype.getFrequency
  11992. * @description 获取刷新频率。
  11993. * @returns {number} 返回当前的刷新频率。
  11994. */
  11995. }, {
  11996. key: "getFrequency",
  11997. value: function getFrequency() {
  11998. return this.frequency;
  11999. }
  12000. /**
  12001. * @function SuperMap.TimeControlBase.prototype.setStartTime
  12002. * @description 设置起始时间,设置完成后如果当前时间小于起始时间,则从起始时间开始。
  12003. * @param {number} startTime - 需要设置的起始时间。
  12004. * @returns {boolean} true 代表设置成功,false 设置失败(startTime 大于结束时间时失败)。
  12005. */
  12006. }, {
  12007. key: "setStartTime",
  12008. value: function setStartTime(startTime) {
  12009. var me = this;
  12010. startTime = Date.parse(new Date(startTime)); //起始时间不得大于结束时间
  12011. if (startTime > me.endTime) {
  12012. return false;
  12013. }
  12014. me.startTime = startTime; //如果当前时间小于了起始时间,则从当前起始时间开始
  12015. if (me.currentTime < me.startTime) {
  12016. me.currentTime = me.startTime;
  12017. me.tick();
  12018. }
  12019. return true;
  12020. }
  12021. /**
  12022. * @function SuperMap.TimeControlBase.prototype.getStartTime
  12023. * @description 获取起始时间。
  12024. * @returns {number} 返回当前的起始时间。
  12025. */
  12026. }, {
  12027. key: "getStartTime",
  12028. value: function getStartTime() {
  12029. return this.startTime;
  12030. }
  12031. /**
  12032. * @function SuperMap.TimeControlBase.prototype.setEndTime
  12033. * @description 设置结束时间,设置完成后如果当前时间大于结束,则从起始时间开始。
  12034. * @param {number} endTime - 需要设置的结束时间。
  12035. * @returns {boolean} true 代表设置成功,false 设置失败(endTime 小于开始时间时失败)。
  12036. */
  12037. }, {
  12038. key: "setEndTime",
  12039. value: function setEndTime(endTime) {
  12040. var me = this;
  12041. me.endTime = Date.parse(new Date(me.endTime)); //结束时间不得小于开始时间
  12042. if (endTime < me.startTime) {
  12043. return false;
  12044. }
  12045. me.endTime = endTime; //如果当前时间大于了结束时间,则从起始时间开始
  12046. if (me.currentTime >= me.endTime) {
  12047. me.currentTime = me.startTime;
  12048. me.tick();
  12049. }
  12050. return true;
  12051. }
  12052. /**
  12053. * @function SuperMap.TimeControlBase.prototype.getEndTime
  12054. * @description 获取结束时间。
  12055. * @returns {number} 返回当前的结束时间。
  12056. */
  12057. }, {
  12058. key: "getEndTime",
  12059. value: function getEndTime() {
  12060. return this.endTime;
  12061. }
  12062. /**
  12063. * @function SuperMap.TimeControlBase.prototype.setCurrentTime
  12064. * @description 设置当前时间。
  12065. * @param {number} currentTime - 需要设置的当前时间。
  12066. * @returns {boolean} true 代表设置成功,false 设置失败。
  12067. */
  12068. }, {
  12069. key: "setCurrentTime",
  12070. value: function setCurrentTime(currentTime) {
  12071. var me = this;
  12072. me.currentTime = Date.parse(new Date(me.currentTime)); //结束时间不得小于开始时间
  12073. if (currentTime >= me.startTime && currentTime <= me.endTime) {
  12074. me.currentTime = currentTime;
  12075. me.startTime = me.currentTime;
  12076. me.tick();
  12077. return true;
  12078. }
  12079. return false;
  12080. }
  12081. /**
  12082. * @function SuperMap.TimeControlBase.prototype.getCurrentTime
  12083. * @description 获取当前时间。
  12084. * @returns {number} 返回当前时间。
  12085. */
  12086. }, {
  12087. key: "getCurrentTime",
  12088. value: function getCurrentTime() {
  12089. return this.currentTime;
  12090. }
  12091. /**
  12092. * @function SuperMap.TimeControlBase.prototype.setRepeat
  12093. * @description 设置是否重复循环。
  12094. * @param {boolean} [repeat=true] - 是否重复循环。
  12095. */
  12096. }, {
  12097. key: "setRepeat",
  12098. value: function setRepeat(repeat) {
  12099. this.repeat = repeat;
  12100. }
  12101. /**
  12102. * @function SuperMap.TimeControlBase.prototype.getRepeat
  12103. * @description 获取是否重复循环,默认是 true。
  12104. * @returns {boolean} 返回是否重复循环。
  12105. */
  12106. }, {
  12107. key: "getRepeat",
  12108. value: function getRepeat() {
  12109. return this.repeat;
  12110. }
  12111. /**
  12112. * @function SuperMap.TimeControlBase.prototype.setReverse
  12113. * @description 设置是否反向。
  12114. * @param {boolean} [reverse=false] - 是否反向。
  12115. */
  12116. }, {
  12117. key: "setReverse",
  12118. value: function setReverse(reverse) {
  12119. this.reverse = reverse;
  12120. }
  12121. /**
  12122. * @function SuperMap.TimeControlBase.prototype.getReverse
  12123. * @description 获取是否反向,默认是false。
  12124. * @returns {boolean} 返回是否反向。
  12125. */
  12126. }, {
  12127. key: "getReverse",
  12128. value: function getReverse() {
  12129. return this.reverse;
  12130. }
  12131. /**
  12132. * @function SuperMap.TimeControlBase.prototype.getRunning
  12133. * @description 获取运行状态。
  12134. * @returns {boolean} true 代表正在运行,false 发表没有运行。
  12135. */
  12136. }, {
  12137. key: "getRunning",
  12138. value: function getRunning() {
  12139. return this.running;
  12140. }
  12141. /**
  12142. * @function SuperMap.TimeControlBase.prototype.destroy
  12143. * @description 销毁 Animator 对象,释放资源。
  12144. */
  12145. }, {
  12146. key: "destroy",
  12147. value: function destroy() {
  12148. var me = this;
  12149. me.speed = null;
  12150. me.frequency = null;
  12151. me.startTime = null;
  12152. me.endTime = null;
  12153. me.currentTime = null;
  12154. me.repeat = null;
  12155. me.running = false;
  12156. me.reverse = null;
  12157. }
  12158. }, {
  12159. key: "tick",
  12160. value: function tick() {//TODO 每次刷新执行的操作。子类实现
  12161. }
  12162. }]);
  12163. return TimeControlBase;
  12164. }();
  12165. SuperMap.TimeControlBase = TimeControlBase_TimeControlBase;
  12166. // CONCATENATED MODULE: ./src/common/control/TimeFlowControl.js
  12167. 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); }
  12168. function TimeFlowControl_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12169. 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); } }
  12170. function TimeFlowControl_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeFlowControl_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeFlowControl_defineProperties(Constructor, staticProps); return Constructor; }
  12171. 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); }
  12172. function TimeFlowControl_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TimeFlowControl_getPrototypeOf(object); if (object === null) break; } return object; }
  12173. 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); }
  12174. function TimeFlowControl_setPrototypeOf(o, p) { TimeFlowControl_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TimeFlowControl_setPrototypeOf(o, p); }
  12175. 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); }; }
  12176. function TimeFlowControl_possibleConstructorReturn(self, call) { if (call && (TimeFlowControl_typeof(call) === "object" || typeof call === "function")) { return call; } return TimeFlowControl_assertThisInitialized(self); }
  12177. function TimeFlowControl_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  12178. 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; } }
  12179. function TimeFlowControl_getPrototypeOf(o) { TimeFlowControl_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TimeFlowControl_getPrototypeOf(o); }
  12180. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  12181. * This program are made available under the terms of the Apache License, Version 2.0
  12182. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12183. /**
  12184. * @class SuperMap.TimeFlowControl
  12185. * @classdesc 时间管理类。
  12186. * @category Control
  12187. * @description 此类只负责时间上的控制,具体执行的操作需要用户在初始化时的回调函数内部进行实现。
  12188. * 如设置起始时间为 1000,结束时间是 2000,步长设置为 1,
  12189. * 那么表示按照每次1年(可以通过 setSpeed 进行修改)的变化从公元 1000 年开始到公元 2000 年为止,默认每 1 秒会 1 次(通过 setFrequency 修改)
  12190. * @extends {SuperMap.TimeControlBase}
  12191. * @param {function} callback - 每次刷新回调函数。具体的效果需要用户在此回调函数里面实现。
  12192. * @param {Object} options - 该类开放的可选属性。
  12193. * @param {number} [options.speed=1] - 步长(单位 ms)。不能小于 0,(每次刷新的数据之间的间隔为 1ms)。
  12194. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms)。
  12195. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  12196. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时使用 new Date() 以当前时间进行设置,建议设置。
  12197. * @param {boolean} [options.repeat=true] - 是否重复循环。
  12198. * @param {boolean} [options.reverse=false] - 是否反向。
  12199. */
  12200. var TimeFlowControl = /*#__PURE__*/function (_TimeControlBase) {
  12201. TimeFlowControl_inherits(TimeFlowControl, _TimeControlBase);
  12202. var _super = TimeFlowControl_createSuper(TimeFlowControl);
  12203. function TimeFlowControl(callback, options) {
  12204. var _this;
  12205. TimeFlowControl_classCallCheck(this, TimeFlowControl);
  12206. _this = _super.call(this, options);
  12207. var me = TimeFlowControl_assertThisInitialized(_this);
  12208. /**
  12209. * @member SuperMap.TimeFlowControl.prototype.callback -{function}
  12210. * @description 每次刷新执行的回调函数。
  12211. */
  12212. me.callback = callback; //先让IE下支持bind方法
  12213. if (!Function.prototype.bind) {
  12214. Function.prototype.bind = function (oThis) {
  12215. if (typeof this !== "function") {
  12216. throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  12217. }
  12218. var aArgs = Array.prototype.slice.call(arguments, 1),
  12219. fToBind = this,
  12220. fNOP = function fNOP() {//empty Function
  12221. },
  12222. fBound = function fBound() {
  12223. return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
  12224. };
  12225. fNOP.prototype = this.prototype;
  12226. fBound.prototype = new fNOP();
  12227. return fBound;
  12228. };
  12229. } //保证 this.tick 的上下文还是 TimeControl 这个对象
  12230. me.update = me.update.bind(me);
  12231. me.oldTime = me.currentTime;
  12232. me.CLASS_NAME = "SuperMap.TimeFlowControl";
  12233. return _this;
  12234. }
  12235. /**
  12236. * @function SuperMap.TimeFlowControl.prototype.updateOptions
  12237. * @override
  12238. */
  12239. TimeFlowControl_createClass(TimeFlowControl, [{
  12240. key: "updateOptions",
  12241. value: function updateOptions(options) {
  12242. options = options || {};
  12243. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "updateOptions", this).call(this, options);
  12244. }
  12245. /**
  12246. * @function SuperMap.TimeFlowControl.prototype.start
  12247. * @override
  12248. */
  12249. }, {
  12250. key: "start",
  12251. value: function start() {
  12252. var me = this;
  12253. if (me.running) {
  12254. return;
  12255. }
  12256. me.running = true;
  12257. if (me.reverse) {
  12258. if (me.currentTime === me.startTime) {
  12259. me.oldTime = me.endTime;
  12260. me.currentTime = me.oldTime;
  12261. }
  12262. } else {
  12263. if (me.oldTime === me.endTime) {
  12264. me.currentTime = me.startTime;
  12265. me.oldTime = me.currentTime;
  12266. }
  12267. }
  12268. me.tick();
  12269. }
  12270. /**
  12271. * @function SuperMap.TimeFlowControl.prototype.stop
  12272. * @override
  12273. */
  12274. }, {
  12275. key: "stop",
  12276. value: function stop() {
  12277. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "stop", this).call(this);
  12278. var me = this;
  12279. me.oldTime = me.currentTime;
  12280. if (me.running) {
  12281. me.running = false;
  12282. } //清除定时tick
  12283. me.intervalId && window.clearTimeout(me.intervalId);
  12284. }
  12285. /**
  12286. * @function SuperMap.TimeFlowControl.prototype.destroy
  12287. * @override
  12288. */
  12289. }, {
  12290. key: "destroy",
  12291. value: function destroy() {
  12292. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "destroy", this).call(this);
  12293. var me = this;
  12294. me.oldTime = null;
  12295. me.callback = null;
  12296. }
  12297. /**
  12298. * @function SuperMap.TimeFlowControl.prototype.tick
  12299. * @description 定时刷新。
  12300. */
  12301. }, {
  12302. key: "tick",
  12303. value: function tick() {
  12304. var me = this;
  12305. me.intervalId && window.clearInterval(me.intervalId);
  12306. me.intervalId = null;
  12307. me.update();
  12308. me.intervalId = window.setInterval(me.update, me.frequency);
  12309. }
  12310. /**
  12311. * @function SuperMap.TimeFlowControl.prototype.update
  12312. * @override
  12313. */
  12314. }, {
  12315. key: "update",
  12316. value: function update() {
  12317. var me = this; //判定是否还需要继续
  12318. if (!me.running) {
  12319. return;
  12320. } //调用回调函数
  12321. me.callback && me.callback(me.currentTime); //destroy之后callback就为空,所以需要判定一下
  12322. if (!me.reverse) {
  12323. //如果相等,则代表上一帧已经运行到了最后,下一帧运行初始化的状态
  12324. if (me.currentTime === me.endTime) {
  12325. //不循环时
  12326. if (!me.repeat) {
  12327. me.running = false;
  12328. me.stop();
  12329. return null;
  12330. }
  12331. me.stop();
  12332. me.currentTime = me.startTime;
  12333. me.oldTime = me.currentTime;
  12334. me.start();
  12335. } else {
  12336. //否则时间递增
  12337. me.oldTime = me.currentTime;
  12338. me.currentTime += me.speed;
  12339. }
  12340. if (me.currentTime >= me.endTime) {
  12341. me.currentTime = me.endTime;
  12342. }
  12343. } else {
  12344. //如果相等,则代表上一帧已经运行到了最前,下一帧运行结束的状态
  12345. if (me.currentTime === me.startTime) {
  12346. //不循环时
  12347. if (!me.repeat) {
  12348. me.running = false;
  12349. return null;
  12350. }
  12351. me.oldTime = me.endTime;
  12352. me.currentTime = me.oldTime;
  12353. } else {
  12354. //否则时间递减
  12355. me.currentTime = me.oldTime;
  12356. me.oldTime -= me.speed;
  12357. }
  12358. if (me.oldTime <= me.startTime) {
  12359. me.oldTime = me.startTime;
  12360. }
  12361. }
  12362. }
  12363. }]);
  12364. return TimeFlowControl;
  12365. }(TimeControlBase_TimeControlBase);
  12366. SuperMap.TimeFlowControl = TimeFlowControl;
  12367. // CONCATENATED MODULE: ./src/common/control/index.js
  12368. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  12369. * This program are made available under the terms of the Apache License, Version 2.0
  12370. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12371. // EXTERNAL MODULE: ./node_modules/promise-polyfill/dist/polyfill.js
  12372. var polyfill = __webpack_require__(12);
  12373. // EXTERNAL MODULE: ./node_modules/fetch-ie8/fetch.js
  12374. var fetch = __webpack_require__(16);
  12375. // EXTERNAL MODULE: ./node_modules/fetch-jsonp/build/fetch-jsonp.js
  12376. var fetch_jsonp = __webpack_require__(4);
  12377. var fetch_jsonp_default = /*#__PURE__*/__webpack_require__.n(fetch_jsonp);
  12378. // CONCATENATED MODULE: ./src/common/util/FetchRequest.js
  12379. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  12380. * This program are made available under the terms of the Apache License, Version 2.0
  12381. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12382. var FetchRequest_fetch = window.fetch;
  12383. var setFetch = function setFetch(newFetch) {
  12384. FetchRequest_fetch = newFetch;
  12385. };
  12386. /**
  12387. * @function SuperMap.setCORS
  12388. * @description 设置是否允许跨域请求,全局配置,优先级低于 service 下的 crossOring 参数。
  12389. * @param {boolean} cors - 是否允许跨域请求。
  12390. */
  12391. var setCORS = SuperMap.setCORS = function (cors) {
  12392. SuperMap.CORS = cors;
  12393. };
  12394. /**
  12395. * @function SuperMap.isCORS
  12396. * @description 是是否允许跨域请求。
  12397. * @returns {boolean} 是否允许跨域请求。
  12398. */
  12399. var isCORS = SuperMap.isCORS = function () {
  12400. if (SuperMap.CORS != undefined) {
  12401. return SuperMap.CORS;
  12402. }
  12403. return window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest();
  12404. };
  12405. /**
  12406. * @function SuperMap.setRequestTimeout
  12407. * @description 设置请求超时时间。
  12408. * @param {number} [timeout=45] - 请求超时时间,单位秒。
  12409. */
  12410. var setRequestTimeout = SuperMap.setRequestTimeout = function (timeout) {
  12411. return SuperMap.RequestTimeout = timeout;
  12412. };
  12413. /**
  12414. * @function SuperMap.getRequestTimeout
  12415. * @description 获取请求超时时间。
  12416. * @returns {number} 请求超时时间。
  12417. */
  12418. var getRequestTimeout = SuperMap.getRequestTimeout = function () {
  12419. return SuperMap.RequestTimeout || 45000;
  12420. };
  12421. var FetchRequest = SuperMap.FetchRequest = {
  12422. commit: function commit(method, url, params, options) {
  12423. method = method ? method.toUpperCase() : method;
  12424. switch (method) {
  12425. case 'GET':
  12426. return this.get(url, params, options);
  12427. case 'POST':
  12428. return this.post(url, params, options);
  12429. case 'PUT':
  12430. return this.put(url, params, options);
  12431. case 'DELETE':
  12432. return this["delete"](url, params, options);
  12433. default:
  12434. return this.get(url, params, options);
  12435. }
  12436. },
  12437. supportDirectRequest: function supportDirectRequest(url, options) {
  12438. if (Util_Util.isInTheSameDomain(url)) {
  12439. return true;
  12440. }
  12441. if (options.crossOrigin != undefined) {
  12442. return options.crossOrigin;
  12443. } else {
  12444. return isCORS() || options.proxy;
  12445. }
  12446. },
  12447. get: function get(url, params, options) {
  12448. options = options || {};
  12449. var type = 'GET';
  12450. url = Util_Util.urlAppend(url, this._getParameterString(params || {}));
  12451. url = this._processUrl(url, options);
  12452. if (!this.supportDirectRequest(url, options)) {
  12453. url = url.replace('.json', '.jsonp');
  12454. var config = {
  12455. url: url,
  12456. data: params
  12457. };
  12458. return SuperMap.Util.RequestJSONPPromise.GET(config);
  12459. }
  12460. if (!this.urlIsLong(url)) {
  12461. return this._fetch(url, params, options, type);
  12462. } else {
  12463. return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
  12464. }
  12465. },
  12466. "delete": function _delete(url, params, options) {
  12467. options = options || {};
  12468. var type = 'DELETE';
  12469. url = Util_Util.urlAppend(url, this._getParameterString(params || {}));
  12470. url = this._processUrl(url, options);
  12471. if (!this.supportDirectRequest(url, options)) {
  12472. url = url.replace('.json', '.jsonp');
  12473. var config = {
  12474. url: url += "&_method=DELETE",
  12475. data: params
  12476. };
  12477. return SuperMap.Util.RequestJSONPPromise.DELETE(config);
  12478. }
  12479. if (this.urlIsLong(url)) {
  12480. return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
  12481. }
  12482. return this._fetch(url, params, options, type);
  12483. },
  12484. post: function post(url, params, options) {
  12485. options = options || {};
  12486. if (!this.supportDirectRequest(url, options)) {
  12487. url = url.replace('.json', '.jsonp');
  12488. var config = {
  12489. url: url += "&_method=POST",
  12490. data: params
  12491. };
  12492. return SuperMap.Util.RequestJSONPPromise.POST(config);
  12493. }
  12494. return this._fetch(this._processUrl(url, options), params, options, 'POST');
  12495. },
  12496. put: function put(url, params, options) {
  12497. options = options || {};
  12498. url = this._processUrl(url, options);
  12499. if (!this.supportDirectRequest(url, options)) {
  12500. url = url.replace('.json', '.jsonp');
  12501. var config = {
  12502. url: url += "&_method=PUT",
  12503. data: params
  12504. };
  12505. return SuperMap.Util.RequestJSONPPromise.PUT(config);
  12506. }
  12507. return this._fetch(url, params, options, 'PUT');
  12508. },
  12509. urlIsLong: function urlIsLong(url) {
  12510. //当前url的字节长度。
  12511. var totalLength = 0,
  12512. charCode = null;
  12513. for (var i = 0, len = url.length; i < len; i++) {
  12514. //转化为Unicode编码
  12515. charCode = url.charCodeAt(i);
  12516. if (charCode < 0x007f) {
  12517. totalLength++;
  12518. } else if (0x0080 <= charCode && charCode <= 0x07ff) {
  12519. totalLength += 2;
  12520. } else if (0x0800 <= charCode && charCode <= 0xffff) {
  12521. totalLength += 3;
  12522. }
  12523. }
  12524. return totalLength < 2000 ? false : true;
  12525. },
  12526. _postSimulatie: function _postSimulatie(type, url, params, options) {
  12527. var separator = url.indexOf('?') > -1 ? '&' : '?';
  12528. url += separator + '_method=' + type;
  12529. if (typeof params !== 'string') {
  12530. params = JSON.stringify(params);
  12531. }
  12532. return this.post(url, params, options);
  12533. },
  12534. _processUrl: function _processUrl(url, options) {
  12535. if (this._isMVTRequest(url)) {
  12536. return url;
  12537. }
  12538. if (url.indexOf('.json') === -1 && !options.withoutFormatSuffix) {
  12539. if (url.indexOf('?') < 0) {
  12540. url += '.json';
  12541. } else {
  12542. var urlArrays = url.split('?');
  12543. if (urlArrays.length === 2) {
  12544. url = urlArrays[0] + '.json?' + urlArrays[1];
  12545. }
  12546. }
  12547. }
  12548. if (options && options.proxy) {
  12549. if (typeof options.proxy === 'function') {
  12550. url = options.proxy(url);
  12551. } else {
  12552. url = decodeURIComponent(url);
  12553. url = options.proxy + encodeURIComponent(url);
  12554. }
  12555. }
  12556. return url;
  12557. },
  12558. _fetch: function _fetch(url, params, options, type) {
  12559. options = options || {};
  12560. options.headers = options.headers || {};
  12561. if (!options.headers['Content-Type']) {
  12562. options.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
  12563. }
  12564. if (options.timeout) {
  12565. return this._timeout(options.timeout, FetchRequest_fetch(url, {
  12566. method: type,
  12567. headers: options.headers,
  12568. body: type === 'PUT' || type === 'POST' ? params : undefined,
  12569. credentials: this._getWithCredentials(options),
  12570. mode: 'cors',
  12571. timeout: getRequestTimeout()
  12572. }).then(function (response) {
  12573. return response;
  12574. }));
  12575. }
  12576. return FetchRequest_fetch(url, {
  12577. method: type,
  12578. body: type === 'PUT' || type === 'POST' ? params : undefined,
  12579. headers: options.headers,
  12580. credentials: this._getWithCredentials(options),
  12581. mode: 'cors',
  12582. timeout: getRequestTimeout()
  12583. }).then(function (response) {
  12584. return response;
  12585. });
  12586. },
  12587. _getWithCredentials: function _getWithCredentials(options) {
  12588. if (options.withCredentials === true) {
  12589. return 'include';
  12590. }
  12591. if (options.withCredentials === false) {
  12592. return 'omit';
  12593. }
  12594. return 'same-origin';
  12595. },
  12596. _fetchJsonp: function _fetchJsonp(url, options) {
  12597. options = options || {};
  12598. return fetch_jsonp_default()(url, {
  12599. method: 'GET',
  12600. timeout: options.timeout
  12601. }).then(function (response) {
  12602. return response;
  12603. });
  12604. },
  12605. _timeout: function _timeout(seconds, promise) {
  12606. return new Promise(function (resolve, reject) {
  12607. setTimeout(function () {
  12608. reject(new Error('timeout'));
  12609. }, seconds);
  12610. promise.then(resolve, reject);
  12611. });
  12612. },
  12613. _getParameterString: function _getParameterString(params) {
  12614. var paramsArray = [];
  12615. for (var key in params) {
  12616. var value = params[key];
  12617. if (value != null && typeof value !== 'function') {
  12618. var encodedValue;
  12619. if (Array.isArray(value) || value.toString() === '[object Object]') {
  12620. encodedValue = encodeURIComponent(JSON.stringify(value));
  12621. } else {
  12622. encodedValue = encodeURIComponent(value);
  12623. }
  12624. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  12625. }
  12626. }
  12627. return paramsArray.join('&');
  12628. },
  12629. _isMVTRequest: function _isMVTRequest(url) {
  12630. return url.indexOf('.mvt') > -1 || url.indexOf('.pbf') > -1;
  12631. }
  12632. };
  12633. SuperMap.Util.RequestJSONPPromise = {
  12634. limitLength: 1500,
  12635. queryKeys: [],
  12636. queryValues: [],
  12637. supermap_callbacks: {},
  12638. addQueryStrings: function addQueryStrings(values) {
  12639. var me = this;
  12640. for (var key in values) {
  12641. me.queryKeys.push(key);
  12642. if (typeof values[key] !== 'string') {
  12643. values[key] = SuperMap.Util.toJSON(values[key]);
  12644. }
  12645. var tempValue = encodeURIComponent(values[key]);
  12646. me.queryValues.push(tempValue);
  12647. }
  12648. },
  12649. issue: function issue(config) {
  12650. var me = this,
  12651. uid = me.getUid(),
  12652. url = config.url,
  12653. splitQuestUrl = [];
  12654. var p = new Promise(function (resolve) {
  12655. me.supermap_callbacks[uid] = function (response) {
  12656. delete me.supermap_callbacks[uid];
  12657. resolve(response);
  12658. };
  12659. }); // me.addQueryStrings({
  12660. // callback: "SuperMap.Util.RequestJSONPPromise.supermap_callbacks[" + uid + "]"
  12661. // });
  12662. var sectionURL = url,
  12663. keysCount = 0; //此次sectionURL中有多少个key
  12664. var length = me.queryKeys ? me.queryKeys.length : 0;
  12665. for (var i = 0; i < length; i++) {
  12666. if (sectionURL.length + me.queryKeys[i].length + 2 >= me.limitLength) {
  12667. //+2 for ("&"or"?")and"="
  12668. if (keysCount == 0) {
  12669. return false;
  12670. }
  12671. splitQuestUrl.push(sectionURL);
  12672. sectionURL = url;
  12673. keysCount = 0;
  12674. i--;
  12675. } else {
  12676. if (sectionURL.length + me.queryKeys[i].length + 2 + me.queryValues[i].length > me.limitLength) {
  12677. var leftValue = me.queryValues[i];
  12678. while (leftValue.length > 0) {
  12679. var leftLength = me.limitLength - sectionURL.length - me.queryKeys[i].length - 2; //+2 for ("&"or"?")and"="
  12680. if (sectionURL.indexOf('?') > -1) {
  12681. sectionURL += '&';
  12682. } else {
  12683. sectionURL += '?';
  12684. }
  12685. var tempLeftValue = leftValue.substring(0, leftLength); //避免 截断sectionURL时,将类似于%22这样的符号截成两半,从而导致服务端组装sectionURL时发生错误
  12686. if (tempLeftValue.substring(leftLength - 1, leftLength) === '%') {
  12687. leftLength -= 1;
  12688. tempLeftValue = leftValue.substring(0, leftLength);
  12689. } else if (tempLeftValue.substring(leftLength - 2, leftLength - 1) === '%') {
  12690. leftLength -= 2;
  12691. tempLeftValue = leftValue.substring(0, leftLength);
  12692. }
  12693. sectionURL += me.queryKeys[i] + '=' + tempLeftValue;
  12694. leftValue = leftValue.substring(leftLength);
  12695. if (tempLeftValue.length > 0) {
  12696. splitQuestUrl.push(sectionURL);
  12697. sectionURL = url;
  12698. keysCount = 0;
  12699. }
  12700. }
  12701. } else {
  12702. keysCount++;
  12703. if (sectionURL.indexOf('?') > -1) {
  12704. sectionURL += '&';
  12705. } else {
  12706. sectionURL += '?';
  12707. }
  12708. sectionURL += me.queryKeys[i] + '=' + me.queryValues[i];
  12709. }
  12710. }
  12711. }
  12712. splitQuestUrl.push(sectionURL);
  12713. me.send(splitQuestUrl, 'SuperMap.Util.RequestJSONPPromise.supermap_callbacks[' + uid + ']', config && config.proxy);
  12714. return p;
  12715. },
  12716. getUid: function getUid() {
  12717. var uid = new Date().getTime(),
  12718. random = Math.floor(Math.random() * 1e17);
  12719. return uid * 1000 + random;
  12720. },
  12721. send: function send(splitQuestUrl, callback, proxy) {
  12722. var len = splitQuestUrl.length;
  12723. if (len > 0) {
  12724. var jsonpUserID = new Date().getTime();
  12725. for (var i = 0; i < len; i++) {
  12726. var url = splitQuestUrl[i];
  12727. if (url.indexOf('?') > -1) {
  12728. url += '&';
  12729. } else {
  12730. url += '?';
  12731. }
  12732. url += 'sectionCount=' + len;
  12733. url += '&sectionIndex=' + i;
  12734. url += '&jsonpUserID=' + jsonpUserID;
  12735. if (proxy) {
  12736. url = decodeURIComponent(url);
  12737. url = proxy + encodeURIComponent(url);
  12738. }
  12739. fetch_jsonp_default()(url, {
  12740. jsonpCallbackFunction: callback,
  12741. timeout: 30000
  12742. });
  12743. }
  12744. }
  12745. },
  12746. GET: function GET(config) {
  12747. var me = this;
  12748. me.queryKeys.length = 0;
  12749. me.queryValues.length = 0;
  12750. me.addQueryStrings(config.params);
  12751. return me.issue(config);
  12752. },
  12753. POST: function POST(config) {
  12754. var me = this;
  12755. me.queryKeys.length = 0;
  12756. me.queryValues.length = 0;
  12757. me.addQueryStrings({
  12758. requestEntity: config.data
  12759. });
  12760. return me.issue(config);
  12761. },
  12762. PUT: function PUT(config) {
  12763. var me = this;
  12764. me.queryKeys.length = 0;
  12765. me.queryValues.length = 0;
  12766. me.addQueryStrings({
  12767. requestEntity: config.data
  12768. });
  12769. return me.issue(config);
  12770. },
  12771. DELETE: function DELETE(config) {
  12772. var me = this;
  12773. me.queryKeys.length = 0;
  12774. me.queryValues.length = 0;
  12775. me.addQueryStrings({
  12776. requestEntity: config.data
  12777. });
  12778. return me.issue(config);
  12779. }
  12780. };
  12781. // CONCATENATED MODULE: ./src/common/security/SecurityManager.js
  12782. function SecurityManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12783. 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); } }
  12784. function SecurityManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) SecurityManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) SecurityManager_defineProperties(Constructor, staticProps); return Constructor; }
  12785. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  12786. * This program are made available under the terms of the Apache License, Version 2.0
  12787. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12788. /**
  12789. * @name SecurityManager
  12790. * @memberOf SuperMap
  12791. * @namespace
  12792. * @category Security
  12793. * @description 安全管理中心,提供 iServer,iPortal,Online 统一权限认证管理。
  12794. * > 使用说明:
  12795. * > 创建任何一个服务之前调用 {@link SuperMap.SecurityManager.registerToken}或
  12796. * > {@link SuperMap.SecurityManager.registerKey}注册凭据。
  12797. * > 发送请求时根据 url 或者服务 id 获取相应的 key 或者 token 并自动添加到服务地址中。
  12798. */
  12799. var SecurityManager_SecurityManager = /*#__PURE__*/function () {
  12800. function SecurityManager() {
  12801. SecurityManager_classCallCheck(this, SecurityManager);
  12802. }
  12803. SecurityManager_createClass(SecurityManager, null, [{
  12804. key: "generateToken",
  12805. /**
  12806. * @description 从服务器获取一个token,在此之前要注册服务器信息。
  12807. * @function SuperMap.SecurityManager.generateToken
  12808. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  12809. * @param {SuperMap.TokenServiceParameter} tokenParam - token 申请参数。
  12810. * @returns {Promise} 返回包含 token 信息的 Promise 对象。
  12811. */
  12812. value: function generateToken(url, tokenParam) {
  12813. var serverInfo = this.servers[url];
  12814. if (!serverInfo) {
  12815. return;
  12816. }
  12817. return FetchRequest.post(serverInfo.tokenServiceUrl, JSON.stringify(tokenParam.toJSON())).then(function (response) {
  12818. return response.text();
  12819. });
  12820. }
  12821. /**
  12822. * @description 注册安全服务器相关信息。
  12823. * @function SuperMap.SecurityManager.registerServers
  12824. * @param {SuperMap.ServerInfo} serverInfos - 服务器信息。
  12825. */
  12826. }, {
  12827. key: "registerServers",
  12828. value: function registerServers(serverInfos) {
  12829. this.servers = this.servers || {};
  12830. if (!Util_Util.isArray(serverInfos)) {
  12831. serverInfos = [serverInfos];
  12832. }
  12833. for (var i = 0; i < serverInfos.length; i++) {
  12834. var serverInfo = serverInfos[i];
  12835. this.servers[serverInfo.server] = serverInfo;
  12836. }
  12837. }
  12838. /**
  12839. * @description 服务请求都会自动带上这个 token。
  12840. * @function SuperMap.SecurityManager.registerToken
  12841. * @param {string} url -服务器域名+端口:如http://localhost:8090。
  12842. * @param {string} token - token
  12843. */
  12844. }, {
  12845. key: "registerToken",
  12846. value: function registerToken(url, token) {
  12847. this.tokens = this.tokens || {};
  12848. if (!url || !token) {
  12849. return;
  12850. }
  12851. var domain = this._getTokenStorageKey(url);
  12852. this.tokens[domain] = token;
  12853. }
  12854. /**
  12855. * @description 注册 key,ids 为数组(存在一个 key 对应多个服务)。
  12856. * @function SuperMap.SecurityManager.registerKey
  12857. * @param {Array} ids - 可以是服务 id 数组或者 url 地址数组或者 webAPI 类型数组。
  12858. * @param {string} key - key
  12859. */
  12860. }, {
  12861. key: "registerKey",
  12862. value: function registerKey(ids, key) {
  12863. this.keys = this.keys || {};
  12864. if (!ids || ids.length < 1 || !key) {
  12865. return;
  12866. }
  12867. ids = Util_Util.isArray(ids) ? ids : [ids];
  12868. for (var i = 0; i < ids.length; i++) {
  12869. var id = this._getUrlRestString(ids[0]) || ids[0];
  12870. this.keys[id] = key;
  12871. }
  12872. }
  12873. /**
  12874. * @description 获取服务器信息。
  12875. * @function SuperMap.SecurityManager.getServerInfo
  12876. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  12877. * @returns {SuperMap.ServerInfo} 服务器信息。
  12878. */
  12879. }, {
  12880. key: "getServerInfo",
  12881. value: function getServerInfo(url) {
  12882. this.servers = this.servers || {};
  12883. return this.servers[url];
  12884. }
  12885. /**
  12886. * @description 根据 Url 获取token。
  12887. * @function SuperMap.SecurityManager.getToken
  12888. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  12889. * @returns {string} token
  12890. */
  12891. }, {
  12892. key: "getToken",
  12893. value: function getToken(url) {
  12894. if (!url) {
  12895. return;
  12896. }
  12897. this.tokens = this.tokens || {};
  12898. var domain = this._getTokenStorageKey(url);
  12899. return this.tokens[domain];
  12900. }
  12901. /**
  12902. * @description 根据 Url 获取 key。
  12903. * @function SuperMap.SecurityManager.getKey
  12904. * @param {string} id - id
  12905. * @returns {string} key
  12906. */
  12907. }, {
  12908. key: "getKey",
  12909. value: function getKey(id) {
  12910. this.keys = this.keys || {};
  12911. var key = this._getUrlRestString(id) || id;
  12912. return this.keys[key];
  12913. }
  12914. /**
  12915. * @description iServer 登录验证。
  12916. * @function SuperMap.SecurityManager.loginiServer
  12917. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  12918. * @param {string} username - 用户名。
  12919. * @param {string} password - 密码。
  12920. * @param {boolean} [rememberme=false] - 是否记住。
  12921. * @returns {Promise} 返回包含 iServer 登录请求结果的 Promise 对象。
  12922. */
  12923. }, {
  12924. key: "loginiServer",
  12925. value: function loginiServer(url, username, password, rememberme) {
  12926. url = Util_Util.urlPathAppend(url, 'services/security/login');
  12927. var loginInfo = {
  12928. username: username && username.toString(),
  12929. password: password && password.toString(),
  12930. rememberme: rememberme
  12931. };
  12932. loginInfo = JSON.stringify(loginInfo);
  12933. var requestOptions = {
  12934. headers: {
  12935. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  12936. }
  12937. };
  12938. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  12939. return response.json();
  12940. });
  12941. }
  12942. /**
  12943. * @description iServer登出。
  12944. * @function SuperMap.SecurityManager.logoutiServer
  12945. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  12946. * @returns {Promise} 是否登出成功。
  12947. */
  12948. }, {
  12949. key: "logoutiServer",
  12950. value: function logoutiServer(url) {
  12951. url = Util_Util.urlPathAppend(url, 'services/security/logout');
  12952. var requestOptions = {
  12953. headers: {
  12954. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  12955. },
  12956. withoutFormatSuffix: true
  12957. };
  12958. return FetchRequest.get(url, "", requestOptions).then(function () {
  12959. return true;
  12960. })["catch"](function () {
  12961. return false;
  12962. });
  12963. }
  12964. /**
  12965. * @description Online 登录验证。
  12966. * @function SuperMap.SecurityManager.loginOnline
  12967. * @param {string} callbackLocation - 跳转位置。
  12968. * @param {boolean} [newTab=true] - 是否新窗口打开。
  12969. */
  12970. }, {
  12971. key: "loginOnline",
  12972. value: function loginOnline(callbackLocation, newTab) {
  12973. var loginUrl = SecurityManager.SSO + "/login?service=" + callbackLocation;
  12974. this._open(loginUrl, newTab);
  12975. }
  12976. /**
  12977. * @description iPortal登录验证。
  12978. * @function SuperMap.SecurityManager.loginiPortal
  12979. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  12980. * @param {string} username - 用户名。
  12981. * @param {string} password - 密码。
  12982. * @returns {Promise} 返回包含 iPortal 登录请求结果的 Promise 对象。
  12983. */
  12984. }, {
  12985. key: "loginiPortal",
  12986. value: function loginiPortal(url, username, password) {
  12987. url = Util_Util.urlPathAppend(url, 'web/login');
  12988. var loginInfo = {
  12989. username: username && username.toString(),
  12990. password: password && password.toString()
  12991. };
  12992. loginInfo = JSON.stringify(loginInfo);
  12993. var requestOptions = {
  12994. headers: {
  12995. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  12996. },
  12997. withCredentials: true
  12998. };
  12999. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  13000. return response.json();
  13001. });
  13002. }
  13003. /**
  13004. * @description iPortal 登出。
  13005. * @function SuperMap.SecurityManager.logoutiPortal
  13006. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  13007. * @returns {Promise} 如果登出成功,返回 true;否则返回 false。
  13008. */
  13009. }, {
  13010. key: "logoutiPortal",
  13011. value: function logoutiPortal(url) {
  13012. url = Util_Util.urlPathAppend(url, 'services/security/logout');
  13013. var requestOptions = {
  13014. headers: {
  13015. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  13016. },
  13017. withCredentials: true,
  13018. withoutFormatSuffix: true
  13019. };
  13020. return FetchRequest.get(url, "", requestOptions).then(function () {
  13021. return true;
  13022. })["catch"](function () {
  13023. return false;
  13024. });
  13025. }
  13026. /**
  13027. * @description iManager 登录验证。
  13028. * @function SuperMap.SecurityManager.loginManager
  13029. * @param {string} url - iManager 地址。地址参数为 iManager 首页地址,如: http://localhost:8390/imanager。
  13030. * @param {Object} [loginInfoParams] - iManager 登录参数。
  13031. * @param {string} loginInfoParams.userName - 用户名。
  13032. * @param {string} loginInfoParams.password - 密码。
  13033. * @param {Object} options
  13034. * @param {boolean} [options.isNewTab=true] - 不同域时是否在新窗口打开登录页面。
  13035. * @returns {Promise} 返回包含 iManager 登录请求结果的 Promise 对象。
  13036. */
  13037. }, {
  13038. key: "loginManager",
  13039. value: function loginManager(url, loginInfoParams, options) {
  13040. if (!Util_Util.isInTheSameDomain(url)) {
  13041. var isNewTab = options ? options.isNewTab : true;
  13042. this._open(url, isNewTab);
  13043. return;
  13044. }
  13045. var requestUrl = Util_Util.urlPathAppend(url, 'icloud/security/tokens');
  13046. var params = loginInfoParams || {};
  13047. var loginInfo = {
  13048. username: params.userName && params.userName.toString(),
  13049. password: params.password && params.password.toString()
  13050. };
  13051. loginInfo = JSON.stringify(loginInfo);
  13052. var requestOptions = {
  13053. headers: {
  13054. 'Accept': '*/*',
  13055. 'Content-Type': 'application/json'
  13056. }
  13057. };
  13058. var me = this;
  13059. return FetchRequest.post(requestUrl, loginInfo, requestOptions).then(function (response) {
  13060. response.text().then(function (result) {
  13061. me.imanagerToken = result;
  13062. return result;
  13063. });
  13064. });
  13065. }
  13066. /**
  13067. * @description 清空全部验证信息。
  13068. * @function SuperMap.SecurityManager.destroyAllCredentials
  13069. */
  13070. }, {
  13071. key: "destroyAllCredentials",
  13072. value: function destroyAllCredentials() {
  13073. this.keys = null;
  13074. this.tokens = null;
  13075. this.servers = null;
  13076. }
  13077. /**
  13078. * @description 清空令牌信息。
  13079. * @function SuperMap.SecurityManager.destroyToken
  13080. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  13081. */
  13082. }, {
  13083. key: "destroyToken",
  13084. value: function destroyToken(url) {
  13085. if (!url) {
  13086. return;
  13087. }
  13088. var domain = this._getTokenStorageKey(url);
  13089. this.tokens = this.tokens || {};
  13090. if (this.tokens[domain]) {
  13091. delete this.tokens[domain];
  13092. }
  13093. }
  13094. /**
  13095. * @description 清空服务授权码。
  13096. * @function SuperMap.SecurityManager.destroyKey
  13097. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  13098. */
  13099. }, {
  13100. key: "destroyKey",
  13101. value: function destroyKey(url) {
  13102. if (!url) {
  13103. return;
  13104. }
  13105. this.keys = this.keys || {};
  13106. var key = this._getUrlRestString(url) || url;
  13107. if (this.keys[key]) {
  13108. delete this.keys[key];
  13109. }
  13110. }
  13111. }, {
  13112. key: "_open",
  13113. value: function _open(url, newTab) {
  13114. newTab = newTab != null ? newTab : true;
  13115. var offsetX = window.screen.availWidth / 2 - this.INNER_WINDOW_WIDTH / 2;
  13116. var offsetY = window.screen.availHeight / 2 - this.INNER_WINDOW_HEIGHT / 2;
  13117. 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";
  13118. if (newTab) {
  13119. window.open(url, 'login');
  13120. } else {
  13121. window.open(url, 'login', options);
  13122. }
  13123. }
  13124. }, {
  13125. key: "_getTokenStorageKey",
  13126. value: function _getTokenStorageKey(url) {
  13127. var patten = /(.*?):\/\/([^\/]+)/i;
  13128. var result = url.match(patten);
  13129. if (!result) {
  13130. return url;
  13131. }
  13132. return result[0];
  13133. }
  13134. }, {
  13135. key: "_getUrlRestString",
  13136. value: function _getUrlRestString(url) {
  13137. if (!url) {
  13138. return url;
  13139. } // var patten = /http:\/\/(.*\/rest)/i;
  13140. var patten = /(http|https):\/\/(.*\/rest)/i;
  13141. var result = url.match(patten);
  13142. if (!result) {
  13143. return url;
  13144. }
  13145. return result[0];
  13146. }
  13147. }]);
  13148. return SecurityManager;
  13149. }();
  13150. SecurityManager_SecurityManager.INNER_WINDOW_WIDTH = 600;
  13151. SecurityManager_SecurityManager.INNER_WINDOW_HEIGHT = 600;
  13152. SecurityManager_SecurityManager.SSO = "https://sso.supermap.com";
  13153. SecurityManager_SecurityManager.ONLINE = "https://www.supermapol.com";
  13154. SuperMap.SecurityManager = SecurityManager_SecurityManager;
  13155. // CONCATENATED MODULE: ./src/common/iManager/iManagerServiceBase.js
  13156. function iManagerServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13157. 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); } }
  13158. function iManagerServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManagerServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManagerServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  13159. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13160. * This program are made available under the terms of the Apache License, Version 2.0
  13161. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13162. /**
  13163. * @class SuperMap.iManagerServiceBase
  13164. * @classdesc iManager 服务基类(有权限限制的类需要实现此类)。
  13165. * @category iManager
  13166. * @param {string} url - iManager 首页地址,如:http://localhost:8390/imanager。
  13167. * @param {Object} options - 服务参数。
  13168. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  13169. * @param {Object} [options.headers] - 请求头。
  13170. */
  13171. var iManagerServiceBase_IManagerServiceBase = /*#__PURE__*/function () {
  13172. function IManagerServiceBase(url, options) {
  13173. iManagerServiceBase_classCallCheck(this, IManagerServiceBase);
  13174. if (url) {
  13175. var end = url.substr(url.length - 1, 1);
  13176. this.serviceUrl = end === "/" ? url.substr(0, url.length - 2) : url;
  13177. }
  13178. this.options = options || {};
  13179. this.CLASS_NAME = "SuperMap.iManagerServiceBase";
  13180. }
  13181. /**
  13182. * @function SuperMap.iManagerServiceBase.prototype.request
  13183. * @description 子类统一通过该方法发送请求。
  13184. * @param {string} url - 请求 URL。
  13185. * @param {string} [method='GET'] - 请求类型。
  13186. * @param {Object} [requestOptions] - 请求选项。
  13187. * @param {Object} param - 请求参数。
  13188. * @description 发送请求。
  13189. * @returns {Promise} Promise 对象。
  13190. */
  13191. iManagerServiceBase_createClass(IManagerServiceBase, [{
  13192. key: "request",
  13193. value: function request(method, url, param, requestOptions) {
  13194. requestOptions = requestOptions || {
  13195. headers: {
  13196. 'Accept': '*/*',
  13197. 'Content-Type': 'application/json'
  13198. }
  13199. };
  13200. if (!requestOptions.hasOwnProperty("withCredentials")) {
  13201. requestOptions['withCredentials'] = true;
  13202. }
  13203. requestOptions['crossOrigin'] = this.options.crossOrigin;
  13204. requestOptions['headers'] = this.options.headers;
  13205. var token = SecurityManager_SecurityManager.imanagerToken;
  13206. if (token) {
  13207. if (!requestOptions.headers) {
  13208. requestOptions.headers = [];
  13209. }
  13210. requestOptions.headers['X-Auth-Token'] = token;
  13211. }
  13212. if (param) {
  13213. param = JSON.stringify(param);
  13214. }
  13215. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  13216. return response.json();
  13217. });
  13218. }
  13219. }]);
  13220. return IManagerServiceBase;
  13221. }();
  13222. SuperMap.iManagerServiceBase = iManagerServiceBase_IManagerServiceBase;
  13223. // CONCATENATED MODULE: ./src/common/iManager/iManagerCreateNodeParam.js
  13224. function iManagerCreateNodeParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13225. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13226. * This program are made available under the terms of the Apache License, Version 2.0
  13227. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13228. /**
  13229. * @class SuperMap.iManagerCreateNodeParam
  13230. * @classdesc iManager 创建节点参数。
  13231. * @category iManager
  13232. * @param {Object} [params] - iManager 创建节点参数。
  13233. *
  13234. */
  13235. var iManagerCreateNodeParam_IManagerCreateNodeParam = function IManagerCreateNodeParam(params) {
  13236. iManagerCreateNodeParam_classCallCheck(this, IManagerCreateNodeParam);
  13237. params = params || {};
  13238. this.nodeSpec = 'SMALL'; //取值范围: ['SMALL','MEDIUM','LARGE'] 以及自定义的环境规格名称
  13239. this.nodeCount = 1; //要创建vm的个数
  13240. this.nodeName = ''; //vm名称
  13241. this.password = ''; //vm的密码,空表示随机分配
  13242. this.description = ''; //描述信息
  13243. this.physicalMachineName = ''; //vm所属的物理机名称.
  13244. this.ips = []; //vm的ip,空数组表示随机分配
  13245. this.userName = ''; //vm所属用户
  13246. Util_Util.extend(this, params);
  13247. };
  13248. SuperMap.iManagerCreateNodeParam = iManagerCreateNodeParam_IManagerCreateNodeParam;
  13249. // CONCATENATED MODULE: ./src/common/iManager/iManager.js
  13250. 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); }
  13251. function iManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13252. 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); } }
  13253. function iManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManager_defineProperties(Constructor, staticProps); return Constructor; }
  13254. 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); }
  13255. function iManager_setPrototypeOf(o, p) { iManager_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iManager_setPrototypeOf(o, p); }
  13256. 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); }; }
  13257. function iManager_possibleConstructorReturn(self, call) { if (call && (iManager_typeof(call) === "object" || typeof call === "function")) { return call; } return iManager_assertThisInitialized(self); }
  13258. function iManager_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  13259. 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; } }
  13260. function iManager_getPrototypeOf(o) { iManager_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iManager_getPrototypeOf(o); }
  13261. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13262. * This program are made available under the terms of the Apache License, Version 2.0
  13263. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13264. /**
  13265. * @class SuperMap.iManager
  13266. * @classdesc iManager 服务类。
  13267. * @category iManager
  13268. * @param {string} serviceUrl - iManager 首页地址。
  13269. *
  13270. */
  13271. var iManager_IManager = /*#__PURE__*/function (_IManagerServiceBase) {
  13272. iManager_inherits(IManager, _IManagerServiceBase);
  13273. var _super = iManager_createSuper(IManager);
  13274. function IManager(iManagerUrl) {
  13275. iManager_classCallCheck(this, IManager);
  13276. return _super.call(this, iManagerUrl);
  13277. }
  13278. /**
  13279. * @function SuperMap.iManager.prototype.load
  13280. * @description 获取所有服务接口,验证是否已登录授权。
  13281. * @returns {Promise} Promise 对象。
  13282. */
  13283. iManager_createClass(IManager, [{
  13284. key: "load",
  13285. value: function load() {
  13286. return this.request("GET", this.serviceUrl + '/web/api/service.json');
  13287. }
  13288. /**
  13289. * @function SuperMap.iManager.prototype.createIServer
  13290. * @param {SuperMap.iManagerCreateNodeParam} createParam - 创建参数。
  13291. * @description 创建 iServer。
  13292. * @returns {Promise} Promise 对象。
  13293. */
  13294. }, {
  13295. key: "createIServer",
  13296. value: function createIServer(createParam) {
  13297. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/server.json', new iManagerCreateNodeParam_IManagerCreateNodeParam(createParam));
  13298. }
  13299. /**
  13300. * @function SuperMap.iManager.prototype.createIPortal
  13301. * @param {SuperMap.iManagerCreateNodeParam} createParam - 创建参数。
  13302. * @description 创建 iPortal。
  13303. * @returns {Promise} Promise 对象。
  13304. */
  13305. }, {
  13306. key: "createIPortal",
  13307. value: function createIPortal(createParam) {
  13308. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/portal.json', new iManagerCreateNodeParam_IManagerCreateNodeParam(createParam));
  13309. }
  13310. /**
  13311. * @function SuperMap.iManager.prototype.iServerList
  13312. * @description 获取所有创建的 iServer。
  13313. * @returns {Promise} Promise 对象。
  13314. */
  13315. }, {
  13316. key: "iServerList",
  13317. value: function iServerList() {
  13318. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/server.json');
  13319. }
  13320. /**
  13321. * @function SuperMap.iManager.prototype.iPortalList
  13322. * @description 获取所有创建的 iPortal。
  13323. * @returns {Promise} Promise 对象。
  13324. */
  13325. }, {
  13326. key: "iPortalList",
  13327. value: function iPortalList() {
  13328. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/portal.json');
  13329. }
  13330. /**
  13331. * @function SuperMap.iManager.prototype.startNodes
  13332. * @param {Array} ids - 需要启动节点的 ID 数组。e.g:['1']。
  13333. * @description 启动节点。
  13334. * @returns {Promise} Promise 对象。
  13335. */
  13336. }, {
  13337. key: "startNodes",
  13338. value: function startNodes(ids) {
  13339. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/started.json', ids);
  13340. }
  13341. /**
  13342. * @function SuperMap.iManager.prototype.stopNodes
  13343. * @param {Array} ids - 需要停止节点的 ID 数组。e.g:['1']。
  13344. * @description 停止节点。
  13345. * @returns {Promise} Promise 对象。
  13346. */
  13347. }, {
  13348. key: "stopNodes",
  13349. value: function stopNodes(ids) {
  13350. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/stopped.json', ids);
  13351. }
  13352. }]);
  13353. return IManager;
  13354. }(iManagerServiceBase_IManagerServiceBase);
  13355. SuperMap.iManager = iManager_IManager;
  13356. // CONCATENATED MODULE: ./src/common/iManager/index.js
  13357. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13358. * This program are made available under the terms of the Apache License, Version 2.0
  13359. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13360. // CONCATENATED MODULE: ./src/common/iPortal/iPortalServiceBase.js
  13361. function iPortalServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13362. 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); } }
  13363. function iPortalServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  13364. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13365. * This program are made available under the terms of the Apache License, Version 2.0
  13366. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13367. /**
  13368. * @class SuperMap.iPortalServiceBase
  13369. * @classdesc iPortal 服务基类(有权限限制的类需要实现此类)。
  13370. * @category iPortal/Online
  13371. * @param {string} url - iPortal 服务地址。
  13372. * @param {Object} options - 可选参数。
  13373. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  13374. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  13375. * @param {Object} [options.headers] - 请求头。
  13376. */
  13377. var iPortalServiceBase_IPortalServiceBase = /*#__PURE__*/function () {
  13378. function IPortalServiceBase(url, options) {
  13379. iPortalServiceBase_classCallCheck(this, IPortalServiceBase);
  13380. options = options || {};
  13381. this.serviceUrl = url;
  13382. this.serverType = ServerType.iPortal;
  13383. this.CLASS_NAME = "SuperMap.iPortalServiceBase";
  13384. this.withCredentials = options.withCredentials || false;
  13385. this.crossOrigin = options.crossOrigin;
  13386. this.headers = options.headers;
  13387. }
  13388. /**
  13389. * @function SuperMap.iPortalServiceBase.prototype.request
  13390. * @description 子类统一通过该方法发送请求。
  13391. * @param {string} [method='GET'] - 请求类型。
  13392. * @param {string} url - 服务地址。
  13393. * @param {Object} param - 请求参数。
  13394. * @param {Object} [requestOptions] - fetch 请求配置项。
  13395. * @returns {Promise} 返回包含请求结果的 Promise 对象。
  13396. */
  13397. iPortalServiceBase_createClass(IPortalServiceBase, [{
  13398. key: "request",
  13399. value: function request(method, url, param) {
  13400. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
  13401. headers: this.headers,
  13402. crossOrigin: this.crossOrigin,
  13403. withCredentials: this.withCredentials
  13404. };
  13405. url = this.createCredentialUrl(url);
  13406. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  13407. return response.json();
  13408. });
  13409. }
  13410. /**
  13411. * @function SuperMap.iPortalServiceBase.prototype.createCredentialUrl
  13412. * @description 追加授权信息。
  13413. * @param {string} url - 创建证书 URL 地址。
  13414. * @returns {string} 携带 token 或 key 的新地址。
  13415. */
  13416. }, {
  13417. key: "createCredentialUrl",
  13418. value: function createCredentialUrl(url) {
  13419. var newUrl = url,
  13420. credential = this.getCredential();
  13421. if (credential) {
  13422. var endStr = newUrl.substring(newUrl.length - 1, newUrl.length);
  13423. if (newUrl.indexOf("?") > -1 && endStr === "?") {
  13424. newUrl += credential.getUrlParameters();
  13425. } else if (newUrl.indexOf("?") > -1 && endStr !== "?") {
  13426. newUrl += "&" + credential.getUrlParameters();
  13427. } else {
  13428. newUrl += "?" + credential.getUrlParameters();
  13429. }
  13430. }
  13431. return newUrl;
  13432. }
  13433. /**
  13434. * @function SuperMap.iPortalServiceBase.prototype.getCredential
  13435. * @description 获取 token。
  13436. * @returns {string} 返回获取的 token。
  13437. *
  13438. */
  13439. }, {
  13440. key: "getCredential",
  13441. value: function getCredential() {
  13442. var credential,
  13443. value = SecurityManager_SecurityManager.getToken(this.serviceUrl);
  13444. credential = value ? new Credential(value, "token") : null;
  13445. if (!credential) {
  13446. value = this.getKey();
  13447. credential = value ? new Credential(value, "key") : null;
  13448. }
  13449. return credential;
  13450. }
  13451. /**
  13452. * @function SuperMap.iPortalServiceBase.prototype.getKey
  13453. * @description 其子类需要重写该方法,修改其中获取 key 的字段,存储 key 可能是服务 ID 字段,可能是 URL。
  13454. */
  13455. }, {
  13456. key: "getKey",
  13457. value: function getKey() {//return SuperMap.SecurityManager.getKey(this.id);
  13458. //或
  13459. //return SuperMap.SecurityManager.getKey(this.serviceUrl);
  13460. }
  13461. }]);
  13462. return IPortalServiceBase;
  13463. }();
  13464. SuperMap.iPortalServiceBase = iPortalServiceBase_IPortalServiceBase;
  13465. // CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryParam.js
  13466. function iPortalQueryParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13467. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13468. * This program are made available under the terms of the Apache License, Version 2.0
  13469. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13470. /**
  13471. * @class SuperMap.iPortalQueryParam
  13472. * @classdesc iPortal 资源查询参数。
  13473. * @version 10.0.1
  13474. * @category iPortal/Online
  13475. * @param {Object} params - iPortal 资源查询具体参数。
  13476. * @param {SuperMap.ResourceType} [params.resourceType] - 资源类型
  13477. * @param {number} [params.pageSize] - 分页中每页大小。
  13478. * @param {number} [params.currentPage] - 分页页码。
  13479. * @param {SuperMap.OrderBy} [params.orderBy] - 排序字段。
  13480. * @param {SuperMap.OrderType} [params.orderType] - 根据升序还是降序过滤。
  13481. * @param {SuperMap.SearchType} [params.searchType] - 根据查询的范围进行过滤。
  13482. * @param {Array} [params.tags] - 标签。
  13483. * @param {Array} [params.dirIds] - 目录 id
  13484. * @param {Array} [params.resourceSubTypes] - 根据资源的子类型进行过滤。
  13485. * @param {SuperMap.AggregationTypes} [params.aggregationTypes] - 聚合查询的类型。
  13486. * @param {string} [params.text] - 搜索的关键词。
  13487. * @param {Array} [params.groupIds] - 根据群组进行过滤。
  13488. * @param {Array} [params.departmentIds] - 根据部门进行过滤。
  13489. */
  13490. var iPortalQueryParam_IPortalQueryParam = function IPortalQueryParam(params) {
  13491. iPortalQueryParam_classCallCheck(this, IPortalQueryParam);
  13492. params = params || {};
  13493. this.resourceType = ""; // 空为全部 MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  13494. this.pageSize = 12; // 每页多少条
  13495. this.currentPage = 1; // 第几页
  13496. this.orderBy = "UPDATETIME"; // UPDATETIME HEATLEVEL
  13497. this.orderType = "DESC"; // DESC ASC
  13498. this.searchType = "PUBLIC"; // PUBLIC SHARETOME_RES MYDEPARTMENT_RES MYGROUP_RES MY_RES
  13499. this.tags = []; // 标签
  13500. this.dirIds = []; // 类别
  13501. this.resourceSubTypes = []; // 类型
  13502. this.aggregationTypes = []; // TAG TYPE SUBTYPE
  13503. this.text = ""; // 搜索字段
  13504. this.groupIds = []; // 群组Id过滤
  13505. this.departmentIds = []; // 部门Id过滤
  13506. Util_Util.extend(this, params);
  13507. };
  13508. SuperMap.iPortalQueryParam = iPortalQueryParam_IPortalQueryParam;
  13509. // CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryResult.js
  13510. function iPortalQueryResult_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13511. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13512. * This program are made available under the terms of the Apache License, Version 2.0
  13513. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13514. /**
  13515. * @class SuperMap.iPortalQueryResult
  13516. * @classdesc iPortal 资源结果集封装类。
  13517. * @version 10.0.1
  13518. * @category iPortal/Online
  13519. * @param {Object} queryResult - 资源参数。
  13520. * @param {Array} [queryResult.content] - 页面内容。
  13521. * @param {number} [queryResult.total] - 总记录数。
  13522. * @param {number} [queryResult.currentPage] - 当前第几页。
  13523. * @param {number} [queryResult.pageSize] - 每页大小。
  13524. * @param {Object} [queryResult.aggregations] - 聚合查询的结果。
  13525. */
  13526. var iPortalQueryResult_IPortalQueryResult = function IPortalQueryResult(queryResult) {
  13527. iPortalQueryResult_classCallCheck(this, IPortalQueryResult);
  13528. queryResult = queryResult || {};
  13529. this.content = [];
  13530. this.total = 0;
  13531. this.currentPage = 1;
  13532. this.pageSize = 12;
  13533. this.aggregations = null;
  13534. Util_Util.extend(this, queryResult);
  13535. };
  13536. SuperMap.iPortalQueryResult = iPortalQueryResult_IPortalQueryResult;
  13537. // CONCATENATED MODULE: ./src/common/iPortal/iPortalResource.js
  13538. 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); }
  13539. function iPortalResource_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13540. 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); } }
  13541. function iPortalResource_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalResource_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalResource_defineProperties(Constructor, staticProps); return Constructor; }
  13542. 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); }
  13543. function iPortalResource_setPrototypeOf(o, p) { iPortalResource_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalResource_setPrototypeOf(o, p); }
  13544. 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); }; }
  13545. function iPortalResource_possibleConstructorReturn(self, call) { if (call && (iPortalResource_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortalResource_assertThisInitialized(self); }
  13546. function iPortalResource_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  13547. 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; } }
  13548. function iPortalResource_getPrototypeOf(o) { iPortalResource_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalResource_getPrototypeOf(o); }
  13549. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13550. * This program are made available under the terms of the Apache License, Version 2.0
  13551. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13552. /**
  13553. * @class SuperMap.iPortalResource
  13554. * @classdesc iPortal 资源详情类。
  13555. * @version 10.0.1
  13556. * @category iPortal/Online
  13557. * @param {string} portalUrl - 资源地址。
  13558. * @param {Object} resourceInfo - 资源详情参数。
  13559. * @param {Array} [resourceInfo.authorizeSetting] - 资源的授权信息
  13560. * @param {string} [resourceInfo.bounds] - 资源的坐标范围
  13561. * @param {string} [resourceInfo.bounds4326] - 资源的坐标范围,转换为EPSG 4326坐标系统后的地理范围。
  13562. * @param {string} [resourceInfo.checkStatus] - 资源的审核状态,可以是:空,SUCCESSFUL,UNCHECKED,FAILED
  13563. * @param {Date} [resourceInfo.createTime] - 资源的创建时间
  13564. * @param {string} [resourceInfo.description] - 资源描述
  13565. * @param {number} [resourceInfo.dirId] - 资源所在的门户目录的id
  13566. * @param {number} [resourceInfo.epsgCode] - 门户资源基于的坐标系的EPSG值。
  13567. * @param {number} [resourceInfo.heatLevel] - 记录资源的访问量或下载量。
  13568. * @param {string} [resourceInfo.id] - 资源存储到ElasticSearch中的文档id
  13569. * @param {string} [resourceInfo.name] - 资源名称
  13570. * @param {number} [resourceInfo.personalDirId] - 资源所在的个人目录的id
  13571. * @param {number} [resourceInfo.resourceId] - 资源表(maps,services等)里的id
  13572. * @param {string} [resourceInfo.resourceSubType] - 某类资源的具体子类型。
  13573. * @param {SuperMap.ResourceType} [resourceInfo.resourceType] - 资源类型
  13574. * @param {number} [resourceInfo.serviceRootUrlId] - 批量注册服务时,服务根地址的ID
  13575. * @param {Array} [resourceInfo.tags] - 资源的标签
  13576. * @param {string} [resourceInfo.thumbnail] - 资源的缩略图
  13577. * @param {Date} [resourceInfo.updateTime] - 资源的更新时间
  13578. * @param {string} [resourceInfo.userName] - 搜索的关键词
  13579. * @param {Object} [resourceInfo.sourceJSON] - 提供了门户项目返回的所有信息。
  13580. * @extends {SuperMap.iPortalServiceBase}
  13581. */
  13582. var iPortalResource_IPortalResource = /*#__PURE__*/function (_IPortalServiceBase) {
  13583. iPortalResource_inherits(IPortalResource, _IPortalServiceBase);
  13584. var _super = iPortalResource_createSuper(IPortalResource);
  13585. function IPortalResource(portalUrl, resourceInfo) {
  13586. var _this;
  13587. iPortalResource_classCallCheck(this, IPortalResource);
  13588. _this = _super.call(this, portalUrl);
  13589. resourceInfo = resourceInfo || {};
  13590. _this.authorizeSetting = [];
  13591. _this.bounds = "";
  13592. _this.bounds4326 = "";
  13593. _this.checkStatus = "";
  13594. _this.createTime = 0;
  13595. _this.description = null;
  13596. _this.dirId = null;
  13597. _this.epsgCode = 0;
  13598. _this.heatLevel = 0;
  13599. _this.id = 0;
  13600. _this.name = "";
  13601. _this.personalDirId = null;
  13602. _this.resourceId = 0;
  13603. _this.resourceSubType = null;
  13604. _this.resourceType = null;
  13605. _this.serviceRootUrlId = null;
  13606. _this.tags = null;
  13607. _this.thumbnail = null;
  13608. _this.updateTime = 0;
  13609. _this.userName = "";
  13610. _this.sourceJSON = {}; //返回门户资源详细信息
  13611. Util_Util.extend(iPortalResource_assertThisInitialized(_this), resourceInfo); // INSIGHTS_WORKSPACE MAP_DASHBOARD
  13612. _this.resourceUrl = portalUrl + "/web/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  13613. if (_this.withCredentials) {
  13614. _this.resourceUrl = portalUrl + "/web/mycontent/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  13615. } // if (this.id) {
  13616. // this.mapUrl = mapUrl + "/" + this.id;
  13617. // }
  13618. return _this;
  13619. }
  13620. /**
  13621. * @function SuperMap.iPortalResource.prototype.load
  13622. * @description 加载资源信息。
  13623. * @returns {Promise} 返回 Promise 对象。如果成功,Promise 没有返回值,请求返回结果自动填充到该类的属性中;如果失败,Promise 返回值包含错误信息。
  13624. */
  13625. iPortalResource_createClass(IPortalResource, [{
  13626. key: "load",
  13627. value: function load() {
  13628. var me = this;
  13629. return me.request("GET", me.resourceUrl + ".json").then(function (resourceInfo) {
  13630. if (resourceInfo.error) {
  13631. return resourceInfo;
  13632. }
  13633. me.sourceJSON = resourceInfo;
  13634. });
  13635. }
  13636. /**
  13637. * @function SuperMap.iPortalResource.prototype.update
  13638. * @description 更新资源属性信息。
  13639. * @returns {Promise} 返回包含更新操作状态的 Promise 对象。
  13640. */
  13641. }, {
  13642. key: "update",
  13643. value: function update() {
  13644. var resourceName = this.resourceType.replace("_", "").toLowerCase();
  13645. var options = {
  13646. headers: {
  13647. 'Content-Type': 'application/x-www-form-urlencoded'
  13648. }
  13649. };
  13650. if (resourceName === 'data') {
  13651. this.resourceUrl = this.resourceUrl + "/attributes.json";
  13652. }
  13653. var entity = JSON.stringify(this.sourceJSON); //对服务资源进行编辑时,请求体内容只留关键字字段(目前如果是全部字段 更新返回成功 但其实没有真正的更新)
  13654. if (resourceName === 'service') {
  13655. var serviceInfo = {
  13656. authorizeSetting: this.sourceJSON.authorizeSetting,
  13657. metadata: this.sourceJSON.metadata,
  13658. tags: this.sourceJSON.tags,
  13659. thumbnail: this.sourceJSON.thumbnail,
  13660. tokenRefreshUrl: this.sourceJSON.tokenRefreshUrl
  13661. };
  13662. entity = JSON.stringify(serviceInfo);
  13663. }
  13664. return this.request("PUT", this.resourceUrl, entity, options);
  13665. }
  13666. }]);
  13667. return IPortalResource;
  13668. }(iPortalServiceBase_IPortalServiceBase);
  13669. SuperMap.iPortalResource = iPortalResource_IPortalResource;
  13670. // CONCATENATED MODULE: ./src/common/iPortal/iPortalShareParam.js
  13671. function iPortalShareParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13672. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13673. * This program are made available under the terms of the Apache License, Version 2.0
  13674. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13675. /**
  13676. * @class SuperMap.iPortalShareParam
  13677. * @classdesc iPortal 资源共享参数。
  13678. * @version 10.0.1
  13679. * @category iPortal/Online
  13680. * @param {Object} params - iPortal 资源共享具体参数。
  13681. * @param {SuperMap.ResourceType} [params.resourceType] - 资源类型。
  13682. * @param {Array} [params.ids] - 资源的id数组。
  13683. * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
  13684. */
  13685. var iPortalShareParam_IPortalShareParam = function IPortalShareParam(params) {
  13686. iPortalShareParam_classCallCheck(this, IPortalShareParam);
  13687. params = params || {};
  13688. this.ids = [];
  13689. this.entities = [];
  13690. this.resourceType = ""; // MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  13691. Util_Util.extend(this, params);
  13692. };
  13693. SuperMap.iPortalShareParam = iPortalShareParam_IPortalShareParam;
  13694. // CONCATENATED MODULE: ./src/common/iPortal/iPortal.js
  13695. 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); }
  13696. function iPortal_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13697. 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); } }
  13698. function iPortal_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortal_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortal_defineProperties(Constructor, staticProps); return Constructor; }
  13699. 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); }
  13700. function iPortal_setPrototypeOf(o, p) { iPortal_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortal_setPrototypeOf(o, p); }
  13701. 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); }; }
  13702. function iPortal_possibleConstructorReturn(self, call) { if (call && (iPortal_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortal_assertThisInitialized(self); }
  13703. function iPortal_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  13704. 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; } }
  13705. function iPortal_getPrototypeOf(o) { iPortal_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortal_getPrototypeOf(o); }
  13706. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13707. * This program are made available under the terms of the Apache License, Version 2.0
  13708. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13709. /**
  13710. * @class SuperMap.iPortal
  13711. * @classdesc 对接 SuperMap iPortal 基础服务。
  13712. * @category iPortal/Online
  13713. * @extends {SuperMap.iPortalServiceBase}
  13714. * @param {string} iportalUrl - 地址。
  13715. * @param {Object} options - 参数。
  13716. * @param {boolean} [options.withCredentials] - 请求是否携带 cookie。
  13717. */
  13718. var iPortal_IPortal = /*#__PURE__*/function (_IPortalServiceBase) {
  13719. iPortal_inherits(IPortal, _IPortalServiceBase);
  13720. var _super = iPortal_createSuper(IPortal);
  13721. function IPortal(iportalUrl, options) {
  13722. var _this;
  13723. iPortal_classCallCheck(this, IPortal);
  13724. _this = _super.call(this, iportalUrl, options);
  13725. _this.iportalUrl = iportalUrl;
  13726. options = options || {};
  13727. _this.withCredentials = options.withCredentials || false;
  13728. return _this;
  13729. }
  13730. /**
  13731. * @function SuperMap.iPortal.prototype.load
  13732. * @description 加载页面。
  13733. * @returns {Promise} 返回包含 iportal web 资源信息的 Promise 对象。
  13734. */
  13735. iPortal_createClass(IPortal, [{
  13736. key: "load",
  13737. value: function load() {
  13738. return FetchRequest.get(this.iportalUrl + "/web");
  13739. }
  13740. /**
  13741. * @function SuperMap.iPortal.prototype.queryResources
  13742. * @description 查询资源。
  13743. * @version 10.0.1
  13744. * @param {SuperMap.iPortalQueryParam} queryParams - 查询参数。
  13745. * @returns {Promise} 返回包含所有资源结果的 Promise 对象。
  13746. */
  13747. }, {
  13748. key: "queryResources",
  13749. value: function queryResources(queryParams) {
  13750. if (!(queryParams instanceof iPortalQueryParam_IPortalQueryParam)) {
  13751. return new Promise(function (resolve) {
  13752. resolve("queryParams is not instanceof iPortalQueryParam !");
  13753. });
  13754. }
  13755. var me = this;
  13756. var resourceUrl = this.iportalUrl + "/gateway/catalog/resource/search.json";
  13757. queryParams.t = new Date().getTime();
  13758. return this.request("GET", resourceUrl, queryParams).then(function (result) {
  13759. var content = [];
  13760. result.content.forEach(function (item) {
  13761. content.push(new iPortalResource_IPortalResource(me.iportalUrl, item));
  13762. });
  13763. var queryResult = new iPortalQueryResult_IPortalQueryResult();
  13764. queryResult.content = content;
  13765. queryResult.total = result.total;
  13766. queryResult.currentPage = result.currentPage;
  13767. queryResult.pageSize = result.pageSize;
  13768. queryResult.aggregations = result.aggregations;
  13769. return queryResult;
  13770. });
  13771. }
  13772. /**
  13773. * @function SuperMap.iPortal.prototype.updateResourcesShareSetting
  13774. * @description 更新共享设置。
  13775. * @version 10.0.1
  13776. * @param {SuperMap.iPortalShareParam} shareParams - 共享的参数。
  13777. * @returns {Promise} 返回包含共享资源结果的 Promise 对象。
  13778. */
  13779. }, {
  13780. key: "updateResourcesShareSetting",
  13781. value: function updateResourcesShareSetting(shareParams) {
  13782. if (!(shareParams instanceof iPortalShareParam_IPortalShareParam)) {
  13783. return new Promise(function (resolve) {
  13784. resolve("shareParams is not instanceof iPortalShareParam !");
  13785. });
  13786. }
  13787. var resourceUrlName = shareParams.resourceType.replace("_", "").toLowerCase() + "s";
  13788. if (resourceUrlName === "datas") {
  13789. resourceUrlName = "mycontent/" + resourceUrlName;
  13790. }
  13791. var cloneShareParams = {
  13792. ids: shareParams.ids,
  13793. entities: shareParams.entities
  13794. };
  13795. var shareUrl = this.iportalUrl + "/web/" + resourceUrlName + "/sharesetting.json";
  13796. return this.request("PUT", shareUrl, JSON.stringify(cloneShareParams)).then(function (result) {
  13797. return result;
  13798. });
  13799. }
  13800. }]);
  13801. return IPortal;
  13802. }(iPortalServiceBase_IPortalServiceBase);
  13803. SuperMap.iPortal = iPortal_IPortal;
  13804. // CONCATENATED MODULE: ./src/common/iPortal/iPortalShareEntity.js
  13805. function iPortalShareEntity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13806. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13807. * This program are made available under the terms of the Apache License, Version 2.0
  13808. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13809. /**
  13810. * @class SuperMap.iPortalShareEntity
  13811. * @classdesc iPortal 资源共享实体参数。
  13812. * @version 10.0.1
  13813. * @category iPortal/Online
  13814. * @param {Object} shareEntity - iPortal 资源共享实体具体参数。
  13815. * @param {SuperMap.PermissionType} [shareEntity.permissionType] - 权限类型。
  13816. * @param {SuperMap.EntityType} [shareEntity.entityType] - 实体类型
  13817. * @param {string} [shareEntity.entityName] - 实体 Name。对应的 USER(用户)、 ROLE(角色)、GROUP(用户组)、IPORTALGROUP(群组)的名称。
  13818. * @param {number} [shareEntity.entityId] - 实体的 id。用于群组的授权。
  13819. */
  13820. var iPortalShareEntity_IPortalShareEntity = function IPortalShareEntity(shareEntity) {
  13821. iPortalShareEntity_classCallCheck(this, IPortalShareEntity);
  13822. shareEntity = shareEntity || {};
  13823. this.permissionType = ""; // SEARCH READ READWRITE DOWNLOAD
  13824. this.entityType = ""; // USER DEPARTMENT IPORTALGROUP
  13825. this.entityName = "GUEST"; // GUEST or 具体用户 name
  13826. this.entityId = null;
  13827. Util_Util.extend(this, shareEntity);
  13828. };
  13829. SuperMap.iPortalShareEntity = iPortalShareEntity_IPortalShareEntity;
  13830. // CONCATENATED MODULE: ./src/common/iPortal/iPortalAddResourceParam.js
  13831. function iPortalAddResourceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13832. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13833. * This program are made available under the terms of the Apache License, Version 2.0
  13834. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13835. /**
  13836. * @class SuperMap.iPortalAddResourceParam
  13837. * @classdesc iPortal 添加资源参数。
  13838. * @version 10.0.1
  13839. * @category iPortal/Online
  13840. * @param {Object} params - iPortal 添加资源具体参数。
  13841. * @param {String} [params.rootUrl] - 服务地址。
  13842. * @param {Array} [params.tags] - 标签。
  13843. * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
  13844. */
  13845. var iPortalAddResourceParam_IPortalAddResourceParam = function IPortalAddResourceParam(params) {
  13846. iPortalAddResourceParam_classCallCheck(this, IPortalAddResourceParam);
  13847. params = params || {};
  13848. this.rootUrl = "";
  13849. this.tags = [];
  13850. this.entities = [];
  13851. Util_Util.extend(this, params);
  13852. };
  13853. SuperMap.iPortalAddResourceParam = iPortalAddResourceParam_IPortalAddResourceParam;
  13854. // CONCATENATED MODULE: ./src/common/iPortal/iPortalRegisterServiceParam.js
  13855. function iPortalRegisterServiceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13856. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13857. * This program are made available under the terms of the Apache License, Version 2.0
  13858. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13859. /**
  13860. * @class SuperMap.iPortalRegisterServiceParam
  13861. * @classdesc iPortal 注册服务参数。
  13862. * @version 10.0.1
  13863. * @category iPortal/Online
  13864. * @param {Object} params - iPortal 注册服务具体参数。
  13865. * @param {String} [params.type] - 服务类型。
  13866. * @param {Array} [params.tags] - 服务标签。
  13867. * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
  13868. * @param {Object} [params.metadata] - 服务元信息。
  13869. * @param {Array} [params.addedMapNames] - 地图服务列表。
  13870. * @param {Array} [params.addedSceneNames] - 场景服务列表。
  13871. */
  13872. var iPortalRegisterServiceParam_IPortalRegisterServiceParam = function IPortalRegisterServiceParam(params) {
  13873. iPortalRegisterServiceParam_classCallCheck(this, IPortalRegisterServiceParam);
  13874. params = params || {};
  13875. this.type = ""; // SUPERMAP_REST ARCGIS_REST WMS WFS WCS WPS WMTS OTHERS
  13876. this.tags = [];
  13877. this.entities = [];
  13878. this.metadata = {};
  13879. this.addedMapNames = [];
  13880. this.addedSceneNames = [];
  13881. Util_Util.extend(this, params);
  13882. };
  13883. SuperMap.iPortalRegisterServiceParam = iPortalRegisterServiceParam_IPortalRegisterServiceParam;
  13884. // CONCATENATED MODULE: ./src/common/iPortal/iPortalAddDataParam.js
  13885. function iPortalAddDataParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13886. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13887. * This program are made available under the terms of the Apache License, Version 2.0
  13888. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13889. /**
  13890. * @class SuperMap.iPortalAddDataParam
  13891. * @classdesc iPortal 上传/注册数据所需的参数。
  13892. * @version 10.0.1
  13893. * @category iPortal/Online
  13894. * @param {Object} params - iPortal 上传/注册数据所需的具体参数。
  13895. * @param {string} params.fileName - 文件名称
  13896. * @param {SuperMap.DataItemType} params.type - 数据类型。
  13897. * @param {Array} [params.tags] - 数据的标签
  13898. * @param {SuperMap.iPortalDataMetaInfoParam} [params.dataMetaInfo] - 数据元信息
  13899. */
  13900. var iPortalAddDataParam_IPortalAddDataParam = function IPortalAddDataParam(params) {
  13901. iPortalAddDataParam_classCallCheck(this, IPortalAddDataParam);
  13902. params = params || {};
  13903. this.fileName = "";
  13904. this.type = "";
  13905. this.tags = [];
  13906. this.dataMetaInfo = {};
  13907. Util_Util.extend(this, params);
  13908. };
  13909. SuperMap.iPortalAddDataParam = iPortalAddDataParam_IPortalAddDataParam;
  13910. // CONCATENATED MODULE: ./src/common/iPortal/iPortalDataMetaInfoParam.js
  13911. function iPortalDataMetaInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13912. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13913. * This program are made available under the terms of the Apache License, Version 2.0
  13914. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13915. /**
  13916. * @class SuperMap.iPortalDataMetaInfoParam
  13917. * @classdesc iPortal 上传数据/注册数据元信息所需的参数。
  13918. * @version 10.0.1
  13919. * @category iPortal/Online
  13920. * @param {Object} params - iPortal 获取数据项id excel csv类型的数据所需数据元信息具体参数。
  13921. * @param {string} params.xField - X 坐标字段
  13922. * @param {string} params.yField - Y 坐标字段
  13923. * @param {number} params.xIndex - x所在列(关系型存储下CSV或EXCEL数据时必填)
  13924. * @param {number} params.yIndex - y所在列(关系型存储下CSV或EXCEL数据时必填)
  13925. * @param {array} [params.fieldTypes] - 设置字段类型(关系型存储下CSV或EXCEL数据时可选填)。默认类型为:WTEXT。该参数按照CSV文件字段顺序从左到右依次设置,其中默认字段类型可省略不设置。例如,CSV文件中有10个字段,如果只需设定第1,2,4个字段,可设置为[a,b,,c]。
  13926. * @param {string} params.separator - 分隔符(关系型存储下CSV数据时必填)
  13927. * @param {boolean} params.firstRowIsHead - 是否带表头(关系型存储下CSV数据时必填)
  13928. * @param {boolean} params.url - HDFS注册目录地址
  13929. * @param {SuperMap.iPortalDataStoreInfoParam} params.dataStoreInfo - 注册数据时的数据存储信息
  13930. */
  13931. var iPortalDataMetaInfoParam_IPortalDataMetaInfoParam = function IPortalDataMetaInfoParam(params) {
  13932. iPortalDataMetaInfoParam_classCallCheck(this, IPortalDataMetaInfoParam);
  13933. params = params || {};
  13934. this.xField = "";
  13935. this.yField = "";
  13936. this.fileEncoding = "UTF-8";
  13937. this.xIndex = 1;
  13938. this.yIndex = 1;
  13939. this.fieldTypes = [];
  13940. this.separator = "";
  13941. this.firstRowIsHead = true;
  13942. this.url = "";
  13943. this.dataStoreInfo = {};
  13944. Util_Util.extend(this, params);
  13945. };
  13946. SuperMap.iPortalDataMetaInfoParam = iPortalDataMetaInfoParam_IPortalDataMetaInfoParam;
  13947. // CONCATENATED MODULE: ./src/common/iPortal/iPortalDataStoreInfoParam.js
  13948. function iPortalDataStoreInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13949. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13950. * This program are made available under the terms of the Apache License, Version 2.0
  13951. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13952. /**
  13953. * @class SuperMap.iPortalDataStoreInfoParam
  13954. * @classdesc iPortal 注册一个HBASE HDFS数据存储类。
  13955. * @version 10.0.1
  13956. * @category iPortal/Online
  13957. * @param {Object} params - iPortal 注册一个HBASE HDFS数据存储类具体参数。
  13958. * @param {string} params.type - 大数据文件共享类型和空间数据库类型,包括大数据文件共享HDFS 目录(HDFS)和空间数据库HBASE
  13959. * @param {string} params.url - HDFS数据存储目录地址
  13960. * @param {SuperMap.iPortalDataConnectionInfoParam} [params.connectionInfo] - HBASE空间数据库服务的连接信息
  13961. */
  13962. var iPortalDataStoreInfoParam_IPortalDataStoreInfoParam = function IPortalDataStoreInfoParam(params) {
  13963. iPortalDataStoreInfoParam_classCallCheck(this, IPortalDataStoreInfoParam);
  13964. params = params || {};
  13965. this.type = "";
  13966. this.url = "";
  13967. this.connectionInfo = {};
  13968. Util_Util.extend(this, params);
  13969. };
  13970. SuperMap.iPortalDataStoreInfoParam = iPortalDataStoreInfoParam_IPortalDataStoreInfoParam;
  13971. // CONCATENATED MODULE: ./src/common/iPortal/iPortalDataConnectionInfoParam.js
  13972. function iPortalDataConnectionInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13973. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  13974. * This program are made available under the terms of the Apache License, Version 2.0
  13975. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13976. /**
  13977. * @class SuperMap.iPortalDataConnectionInfoParam
  13978. * @classdesc iPortal HBASE数据源连接信息类。
  13979. * @version 10.0.1
  13980. * @category iPortal/Online
  13981. * @param {Object} params - iPortal HBASE数据源连接信息类具体参数。
  13982. * @param {string} params.dataBase - 数据源连接的数据库名。
  13983. * @param {string} params.server - 服务地址。
  13984. */
  13985. var iPortalDataConnectionInfoParam_IPortalDataConnectionInfoParam = function IPortalDataConnectionInfoParam(params) {
  13986. iPortalDataConnectionInfoParam_classCallCheck(this, IPortalDataConnectionInfoParam);
  13987. params = params || {};
  13988. this.dataBase = "";
  13989. this.server = "";
  13990. Util_Util.extend(this, params);
  13991. };
  13992. SuperMap.iPortalDataConnectionInfoParam = iPortalDataConnectionInfoParam_IPortalDataConnectionInfoParam;
  13993. // CONCATENATED MODULE: ./src/common/iPortal/iPortalUser.js
  13994. 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); }
  13995. function iPortalUser_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13996. 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); } }
  13997. function iPortalUser_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalUser_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalUser_defineProperties(Constructor, staticProps); return Constructor; }
  13998. 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); }
  13999. function iPortalUser_setPrototypeOf(o, p) { iPortalUser_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalUser_setPrototypeOf(o, p); }
  14000. 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); }; }
  14001. function iPortalUser_possibleConstructorReturn(self, call) { if (call && (iPortalUser_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortalUser_assertThisInitialized(self); }
  14002. function iPortalUser_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  14003. 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; } }
  14004. function iPortalUser_getPrototypeOf(o) { iPortalUser_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalUser_getPrototypeOf(o); }
  14005. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  14006. * This program are made available under the terms of the Apache License, Version 2.0
  14007. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14008. /**
  14009. * @class SuperMap.iPortalUser
  14010. * @classdesc iPortal 门户中用户信息的封装类。用于管理用户资源,包括可删除,添加资源。
  14011. * @version 10.0.1
  14012. * @category iPortal/Online
  14013. * @param {string} iportalUrl - iportal根地址。
  14014. * @extends {SuperMap.iPortalServiceBase}
  14015. *
  14016. */
  14017. var iPortalUser_IPortalUser = /*#__PURE__*/function (_IPortalServiceBase) {
  14018. iPortalUser_inherits(IPortalUser, _IPortalServiceBase);
  14019. var _super = iPortalUser_createSuper(IPortalUser);
  14020. function IPortalUser(iportalUrl) {
  14021. var _this;
  14022. iPortalUser_classCallCheck(this, IPortalUser);
  14023. _this = _super.call(this, iportalUrl);
  14024. _this.iportalUrl = iportalUrl;
  14025. return _this;
  14026. }
  14027. /**
  14028. * @function SuperMap.iPortalUser.prototype.deleteResources
  14029. * @description 删除资源。
  14030. * @param {Object} params - 删除资源所需的参数对象:{ids,resourceType}。
  14031. * @returns {Promise} 返回包含删除操作状态的 Promise 对象。
  14032. */
  14033. iPortalUser_createClass(IPortalUser, [{
  14034. key: "deleteResources",
  14035. value: function deleteResources(params) {
  14036. var resourceName = params.resourceType.replace("_", "").toLowerCase();
  14037. var deleteResourceUrl = this.iportalUrl + "/web/" + resourceName + "s.json?ids=" + encodeURI(JSON.stringify(params.ids));
  14038. if (resourceName === 'data') {
  14039. deleteResourceUrl = this.iportalUrl + "/web/mycontent/datas/delete.json";
  14040. return this.request("POST", deleteResourceUrl, JSON.stringify(params.ids));
  14041. }
  14042. return this.request("DELETE", deleteResourceUrl);
  14043. }
  14044. /**
  14045. * @function SuperMap.iPortalUser.prototype.addMap
  14046. * @description 添加地图。
  14047. * @version 10.1.0
  14048. * @param {SuperMap.iPortalAddResourceParam} addMapParams - 添加地图的参数。
  14049. * @returns {Promise} 返回包含添加地图结果的 Promise 对象。
  14050. */
  14051. }, {
  14052. key: "addMap",
  14053. value: function addMap(addMapParams) {
  14054. if (!(addMapParams instanceof iPortalAddResourceParam_IPortalAddResourceParam)) {
  14055. return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");
  14056. }
  14057. var cloneAddMapParams = {
  14058. rootUrl: addMapParams.rootUrl,
  14059. tags: addMapParams.tags,
  14060. authorizeSetting: addMapParams.entities
  14061. };
  14062. var addMapUrl = this.iportalUrl + "/web/maps/batchaddmaps.json";
  14063. return this.request("POST", addMapUrl, JSON.stringify(cloneAddMapParams)).then(function (result) {
  14064. return result;
  14065. });
  14066. }
  14067. /**
  14068. * @function SuperMap.iPortalUser.prototype.addScene
  14069. * @description 添加场景。
  14070. * @version 10.1.0
  14071. * @param {SuperMap.iPortalAddResourceParam} addSceneParams - 添加场景的参数。
  14072. * @returns {Promise} 返回包含添加场景结果的 Promise 对象。
  14073. */
  14074. }, {
  14075. key: "addScene",
  14076. value: function addScene(addSceneParams) {
  14077. if (!(addSceneParams instanceof iPortalAddResourceParam_IPortalAddResourceParam)) {
  14078. return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");
  14079. }
  14080. var cloneAddSceneParams = {
  14081. rootUrl: addSceneParams.rootUrl,
  14082. tags: addSceneParams.tags,
  14083. authorizeSetting: addSceneParams.entities
  14084. };
  14085. var addSceneUrl = this.iportalUrl + "/web/scenes/batchaddscenes.json";
  14086. return this.request("POST", addSceneUrl, JSON.stringify(cloneAddSceneParams)).then(function (result) {
  14087. return result;
  14088. });
  14089. }
  14090. /**
  14091. * @function SuperMap.iPortalUser.prototype.registerService
  14092. * @description 注册服务。
  14093. * @version 10.1.0
  14094. * @param {SuperMap.iPortalRegisterServiceParam} registerParams - 注册服务的参数。
  14095. * @returns {Promise} 返回包含注册服务结果的 Promise 对象。
  14096. */
  14097. }, {
  14098. key: "registerService",
  14099. value: function registerService(registerParams) {
  14100. if (!(registerParams instanceof iPortalRegisterServiceParam_IPortalRegisterServiceParam)) {
  14101. return this.getErrMsgPromise("registerParams is not instanceof IPortalRegisterServiceParam !");
  14102. }
  14103. var cloneRegisterParams = {
  14104. type: registerParams.type,
  14105. tags: registerParams.tags,
  14106. authorizeSetting: registerParams.entities,
  14107. metadata: registerParams.metadata,
  14108. addedMapNames: registerParams.addedMapNames,
  14109. addedSceneNames: registerParams.addedSceneNames
  14110. };
  14111. var registerUrl = this.iportalUrl + "/web/services.json";
  14112. return this.request("POST", registerUrl, JSON.stringify(cloneRegisterParams)).then(function (result) {
  14113. return result;
  14114. });
  14115. }
  14116. /**
  14117. * @function SuperMap.iPortalUser.prototype.getErrMsgPromise
  14118. * @description 获取包含错误信息的Promise对象。
  14119. * @version 10.1.0
  14120. * @param {String} errMsg - 传入的错误信息。
  14121. * @returns {Promise} 返回包含错误信息的 Promise 对象。
  14122. */
  14123. }, {
  14124. key: "getErrMsgPromise",
  14125. value: function getErrMsgPromise(errMsg) {
  14126. return new Promise(function (resolve) {
  14127. resolve(errMsg);
  14128. });
  14129. }
  14130. /**
  14131. * @function SuperMap.iPortalUser.prototype.uploadDataRequest
  14132. * @description 上传数据。
  14133. * @version 10.1.0
  14134. * @param {number} id - 上传数据的资源id。
  14135. * @param {Object} formData - 请求体为文本数据流。
  14136. * @returns {Promise} 返回包含上传数据操作的 Promise 对象。
  14137. */
  14138. }, {
  14139. key: "uploadDataRequest",
  14140. value: function uploadDataRequest(id, formData) {
  14141. var uploadDataUrl = this.iportalUrl + "/web/mycontent/datas/" + id + "/upload.json";
  14142. return this.request("POST", uploadDataUrl, formData);
  14143. }
  14144. /**
  14145. * @function SuperMap.iPortalUser.prototype.addData
  14146. * @description 上传/注册数据。
  14147. * @version 10.1.0
  14148. * @param {SuperMap.iPortalAddDataParam} params - 上传/注册数据所需的参数。
  14149. * @param {Object} [formData] - 请求体为文本数据流(上传数据时传入)。
  14150. * @returns {Promise} 返回上传/注册数据的 Promise 对象。
  14151. */
  14152. }, {
  14153. key: "addData",
  14154. value: function addData(params, formData) {
  14155. var _this2 = this;
  14156. if (!(params instanceof iPortalAddDataParam_IPortalAddDataParam)) {
  14157. return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");
  14158. }
  14159. var datasUrl = this.iportalUrl + "/web/mycontent/datas.json";
  14160. var entity = {
  14161. fileName: params.fileName,
  14162. tags: params.tags,
  14163. type: params.type
  14164. };
  14165. var type = params.type.toLowerCase();
  14166. var dataMetaInfo;
  14167. if (type === "excel" || type === "csv") {
  14168. if (!(params.dataMetaInfo instanceof iPortalDataMetaInfoParam_IPortalDataMetaInfoParam)) {
  14169. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  14170. }
  14171. dataMetaInfo = {
  14172. xField: params.dataMetaInfo.xField,
  14173. yField: params.dataMetaInfo.yField
  14174. };
  14175. if (type === 'csv') {
  14176. dataMetaInfo.fileEncoding = params.dataMetaInfo.fileEncoding;
  14177. }
  14178. entity.coordType = "WGS84";
  14179. entity.dataMetaInfo = dataMetaInfo;
  14180. } else if (type === "hdfs" || type === "hbase") {
  14181. if (!(params.dataMetaInfo instanceof iPortalDataMetaInfoParam_IPortalDataMetaInfoParam)) {
  14182. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  14183. }
  14184. if (!(params.dataMetaInfo.dataStoreInfo instanceof iPortalDataStoreInfoParam_IPortalDataStoreInfoParam)) {
  14185. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo is not instanceof iPortalDataStoreInfoParam !");
  14186. }
  14187. var dataStoreInfo = {
  14188. type: params.dataMetaInfo.dataStoreInfo.type
  14189. };
  14190. switch (type) {
  14191. case "hdfs":
  14192. dataStoreInfo.url = params.dataMetaInfo.dataStoreInfo.url;
  14193. dataMetaInfo = {
  14194. url: params.dataMetaInfo.url,
  14195. dataStoreInfo: dataStoreInfo
  14196. };
  14197. break;
  14198. case "hbase":
  14199. if (!(params.dataMetaInfo.dataStoreInfo.connectionInfo instanceof iPortalDataConnectionInfoParam_IPortalDataConnectionInfoParam)) {
  14200. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo.connectionInfo is not instanceof iPortalDataConnectionInfoParam !");
  14201. }
  14202. dataStoreInfo.connectionInfo = {
  14203. dataBase: params.dataMetaInfo.dataStoreInfo.connectionInfo.dataBase,
  14204. server: params.dataMetaInfo.dataStoreInfo.connectionInfo.server,
  14205. engineType: 'HBASE'
  14206. };
  14207. dataStoreInfo.datastoreType = "SPATIAL"; //该字段SPATIAL表示HBASE注册
  14208. dataMetaInfo = {
  14209. dataStoreInfo: dataStoreInfo
  14210. };
  14211. break;
  14212. }
  14213. entity.dataMetaInfo = dataMetaInfo;
  14214. }
  14215. return this.request("POST", datasUrl, JSON.stringify(entity)).then(function (res) {
  14216. if (type === "hdfs" || type === "hbase") {
  14217. return res;
  14218. } else {
  14219. if (res.childID) {
  14220. return _this2.uploadDataRequest(res.childID, formData);
  14221. } else {
  14222. return res.customResult;
  14223. }
  14224. }
  14225. });
  14226. }
  14227. /**
  14228. * @function SuperMap.iPortalUser.prototype.publishOrUnpublish
  14229. * @description 发布/取消发布。
  14230. * @version 10.1.0
  14231. * @param {object} options - 发布/取消发布数据服务所需的参数。
  14232. * @param {object} options.dataId - 数据项id。
  14233. * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  14234. * @param {object} [options.dataServiceId] - 发布的服务 id。
  14235. * @param {boolean} forPublish - 是否取消发布。
  14236. * @returns {Promise} 返回发布/取消发布数据服务的 Promise 对象。
  14237. */
  14238. }, {
  14239. key: "publishOrUnpublish",
  14240. value: function publishOrUnpublish(option, forPublish) {
  14241. if (!option.dataId || !option.serviceType) {
  14242. return this.getErrMsgPromise("option.dataID and option.serviceType are Required!");
  14243. }
  14244. var dataId = option.dataId;
  14245. var dataServiceId = option.dataServiceId;
  14246. var serviceType = option.serviceType;
  14247. var publishUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?serviceType=" + serviceType;
  14248. if (dataServiceId) {
  14249. publishUrl += "&dataServiceId=" + dataServiceId;
  14250. }
  14251. return this.request("PUT", publishUrl, JSON.stringify(forPublish)).then(function (res) {
  14252. // 发起服务状态查询
  14253. if (forPublish) {
  14254. // 发布服务的结果异步处理
  14255. // var publishStateUrl = this.iportalUrl + "web/mycontent/datas/" + dataId + "/publishstatus.rjson";
  14256. if (!dataServiceId) {
  14257. // 发布服务时会回传serviceIDs,发布服务之前serviceIDs为空
  14258. dataServiceId = res.customResult;
  14259. }
  14260. return dataServiceId;
  14261. } else {
  14262. // 取消发布的结果同步处理
  14263. return res;
  14264. }
  14265. });
  14266. }
  14267. /**
  14268. * @function SuperMap.iPortalUser.prototype.getDataPublishedStatus
  14269. * @description 查询服务状态,发起服务状态查询。
  14270. * @version 10.1.0
  14271. * @param {number} dataId - 查询服务状态的数据项id。
  14272. * @param {string} dataServiceId - 发布的服务id。
  14273. * @returns {Promise} 返回查询服务状态的 Promise 对象。
  14274. */
  14275. }, {
  14276. key: "getDataPublishedStatus",
  14277. value: function getDataPublishedStatus(dataId, dataServiceId) {
  14278. var publishStateUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?dataServiceId=" + dataServiceId + "&forPublish=true";
  14279. return this.request("GET", publishStateUrl);
  14280. }
  14281. /**
  14282. * @function SuperMap.iPortalUser.prototype.unPublishedDataService
  14283. * @description 取消发布。
  14284. * @version 10.1.0
  14285. * @param {object} options - 取消发布服务具体参数。
  14286. * @param {object} options.dataId - 数据项id。
  14287. * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  14288. * @param {object} [options.dataServiceId] - 发布的服务 id。
  14289. * @returns {Promise} 返回取消发布数据服务的 Promise 对象。
  14290. */
  14291. }, {
  14292. key: "unPublishDataService",
  14293. value: function unPublishDataService(option) {
  14294. return this.publishOrUnpublish(option, false);
  14295. }
  14296. /**
  14297. * @function SuperMap.iPortalUser.prototype.publishedDataService
  14298. * @description 发布数据服务。
  14299. * @version 10.1.0
  14300. * @param {object} options - 发布数据服务具体参数。
  14301. * @param {object} options.dataId - 数据项id。
  14302. * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  14303. * @param {object} [options.dataServiceId] - 发布的服务 id。
  14304. * @returns {Promise} 返回发布数据服务的 Promise 对象。
  14305. */
  14306. }, {
  14307. key: "publishDataService",
  14308. value: function publishDataService(option) {
  14309. return this.publishOrUnpublish(option, true);
  14310. }
  14311. }]);
  14312. return IPortalUser;
  14313. }(iPortalServiceBase_IPortalServiceBase);
  14314. SuperMap.iPortalUser = iPortalUser_IPortalUser;
  14315. // CONCATENATED MODULE: ./src/common/iPortal/index.js
  14316. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  14317. * This program are made available under the terms of the Apache License, Version 2.0
  14318. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14319. // CONCATENATED MODULE: ./src/common/iServer/CommonServiceBase.js
  14320. function CommonServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14321. 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); } }
  14322. function CommonServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  14323. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  14324. * This program are made available under the terms of the Apache License, Version 2.0
  14325. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14326. /**
  14327. * @class SuperMap.CommonServiceBase
  14328. * @category iServer
  14329. * @classdesc 对接 iServer 各种服务的 Service 的基类。
  14330. * @param {string} url - 服务地址。
  14331. * @param {Object} options - 参数。
  14332. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  14333. * @param {string} [options.proxy] - 服务代理地址。
  14334. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  14335. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  14336. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  14337. * @param {Object} [options.headers] - 请求头。
  14338. */
  14339. var CommonServiceBase_CommonServiceBase = /*#__PURE__*/function () {
  14340. function CommonServiceBase(url, options) {
  14341. CommonServiceBase_classCallCheck(this, CommonServiceBase);
  14342. var me = this;
  14343. this.EVENT_TYPES = ["processCompleted", "processFailed"];
  14344. this.events = null;
  14345. this.eventListeners = null;
  14346. this.url = null;
  14347. this.urls = null;
  14348. this.proxy = null;
  14349. this.serverType = null;
  14350. this.index = null;
  14351. this.length = null;
  14352. this.options = null;
  14353. this.totalTimes = null;
  14354. this.POLLING_TIMES = 3;
  14355. this._processSuccess = null;
  14356. this._processFailed = null;
  14357. this.isInTheSameDomain = null;
  14358. this.withCredentials = false;
  14359. if (Util_Util.isArray(url)) {
  14360. me.urls = url;
  14361. me.length = url.length;
  14362. me.totalTimes = me.length;
  14363. if (me.length === 1) {
  14364. me.url = url[0];
  14365. } else {
  14366. me.index = parseInt(Math.random() * me.length);
  14367. me.url = url[me.index];
  14368. }
  14369. } else {
  14370. me.totalTimes = 1;
  14371. me.url = url;
  14372. }
  14373. if (Util_Util.isArray(url) && !me.isServiceSupportPolling()) {
  14374. me.url = url[0];
  14375. me.totalTimes = 1;
  14376. }
  14377. me.serverType = me.serverType || ServerType.ISERVER;
  14378. options = options || {};
  14379. this.crossOrigin = options.crossOrigin;
  14380. this.headers = options.headers;
  14381. Util_Util.extend(this, options);
  14382. me.isInTheSameDomain = Util_Util.isInTheSameDomain(me.url);
  14383. me.events = new Events_Events(me, null, me.EVENT_TYPES, true);
  14384. if (me.eventListeners instanceof Object) {
  14385. me.events.on(me.eventListeners);
  14386. }
  14387. this.CLASS_NAME = "SuperMap.CommonServiceBase";
  14388. }
  14389. /**
  14390. * @function SuperMap.CommonServiceBase.prototype.destroy
  14391. * @description 释放资源,将引用的资源属性置空。
  14392. */
  14393. CommonServiceBase_createClass(CommonServiceBase, [{
  14394. key: "destroy",
  14395. value: function destroy() {
  14396. var me = this;
  14397. if (Util_Util.isArray(me.urls)) {
  14398. me.urls = null;
  14399. me.index = null;
  14400. me.length = null;
  14401. me.totalTimes = null;
  14402. }
  14403. me.url = null;
  14404. me.options = null;
  14405. me._processSuccess = null;
  14406. me._processFailed = null;
  14407. me.isInTheSameDomain = null;
  14408. me.EVENT_TYPES = null;
  14409. if (me.events) {
  14410. me.events.destroy();
  14411. me.events = null;
  14412. }
  14413. if (me.eventListeners) {
  14414. me.eventListeners = null;
  14415. }
  14416. }
  14417. /**
  14418. * @function SuperMap.CommonServiceBase.prototype.request
  14419. * @description: 该方法用于向服务发送请求。
  14420. * @param {Object} options - 参数。
  14421. * @param {string} [options.method='GET'] - 请求方式,包括 "GET","POST","PUT","DELETE"。
  14422. * @param {string} [options.url] - 发送请求的地址。
  14423. * @param {Object} [options.params] - 作为查询字符串添加到 URL 中的一组键值对,此参数只适用于 GET 方式发送的请求。
  14424. * @param {string} [options.data] - 发送到服务器的数据。
  14425. * @param {function} options.success - 请求成功后的回调函数。
  14426. * @param {function} options.failure - 请求失败后的回调函数。
  14427. * @param {Object} [options.scope] - 如果回调函数是对象的一个公共方法,设定该对象的范围。
  14428. * @param {boolean} [options.isInTheSameDomain] - 请求是否在当前域中。
  14429. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  14430. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  14431. * @param {Object} [options.headers] - 请求头。
  14432. */
  14433. }, {
  14434. key: "request",
  14435. value: function request(options) {
  14436. var me = this;
  14437. options.url = options.url || me.url;
  14438. options.proxy = options.proxy || me.proxy;
  14439. options.withCredentials = options.withCredentials != undefined ? options.withCredentials : me.withCredentials;
  14440. options.crossOrigin = options.crossOrigin != undefined ? options.crossOrigin : me.crossOrigin;
  14441. options.headers = options.headers || me.headers;
  14442. options.isInTheSameDomain = me.isInTheSameDomain; //为url添加安全认证信息片段
  14443. var credential = this.getCredential(options.url);
  14444. if (credential) {
  14445. options.url = Util_Util.urlAppend(options.url, credential.getUrlParameters());
  14446. }
  14447. me.calculatePollingTimes();
  14448. me._processSuccess = options.success;
  14449. me._processFailed = options.failure;
  14450. options.scope = me;
  14451. options.success = me.getUrlCompleted;
  14452. options.failure = me.getUrlFailed;
  14453. me.options = options;
  14454. me._commit(me.options);
  14455. }
  14456. /**
  14457. * @function SuperMap.CommonServiceBase.prototype.getCredential
  14458. * @description 获取凭据信息
  14459. * @param {string} url - 服务地址。
  14460. * @returns {SuperMap.Credential} 凭据信息对象。
  14461. */
  14462. }, {
  14463. key: "getCredential",
  14464. value: function getCredential(url) {
  14465. var keyUrl = url,
  14466. credential,
  14467. value;
  14468. switch (this.serverType) {
  14469. case ServerType.IPORTAL:
  14470. value = SecurityManager_SecurityManager.getToken(keyUrl);
  14471. credential = value ? new Credential(value, "token") : null;
  14472. if (!credential) {
  14473. value = SecurityManager_SecurityManager.getKey(keyUrl);
  14474. credential = value ? new Credential(value, "key") : null;
  14475. }
  14476. break;
  14477. case ServerType.ONLINE:
  14478. value = SecurityManager_SecurityManager.getKey(keyUrl);
  14479. credential = value ? new Credential(value, "key") : null;
  14480. break;
  14481. default:
  14482. //iServer or others
  14483. value = SecurityManager_SecurityManager.getToken(keyUrl);
  14484. credential = value ? new Credential(value, "token") : null;
  14485. break;
  14486. }
  14487. return credential;
  14488. }
  14489. /**
  14490. * @function SuperMap.CommonServiceBase.prototype.getUrlCompleted
  14491. * @description 请求成功后执行此方法。
  14492. * @param {Object} result - 服务器返回的结果对象。
  14493. */
  14494. }, {
  14495. key: "getUrlCompleted",
  14496. value: function getUrlCompleted(result) {
  14497. var me = this;
  14498. me._processSuccess(result);
  14499. }
  14500. /**
  14501. * @function SuperMap.CommonServiceBase.prototype.getUrlFailed
  14502. * @description 请求失败后执行此方法。
  14503. * @param {Object} result - 服务器返回的结果对象。
  14504. */
  14505. }, {
  14506. key: "getUrlFailed",
  14507. value: function getUrlFailed(result) {
  14508. var me = this;
  14509. if (me.totalTimes > 0) {
  14510. me.totalTimes--;
  14511. me.ajaxPolling();
  14512. } else {
  14513. me._processFailed(result);
  14514. }
  14515. }
  14516. /**
  14517. *
  14518. * @function SuperMap.CommonServiceBase.prototype.ajaxPolling
  14519. * @description 请求失败后,如果剩余请求失败次数不为 0,重新获取 URL 发送请求
  14520. */
  14521. }, {
  14522. key: "ajaxPolling",
  14523. value: function ajaxPolling() {
  14524. var me = this,
  14525. url = me.options.url,
  14526. re = /^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;
  14527. me.index = parseInt(Math.random() * me.length);
  14528. me.url = me.urls[me.index];
  14529. url = url.replace(re, re.exec(me.url)[0]);
  14530. me.options.url = url;
  14531. me.options.isInTheSameDomain = Util_Util.isInTheSameDomain(url);
  14532. me._commit(me.options);
  14533. }
  14534. /**
  14535. * @function SuperMap.CommonServiceBase.prototype.calculatePollingTimes
  14536. * @description 计算剩余请求失败执行次数。
  14537. */
  14538. }, {
  14539. key: "calculatePollingTimes",
  14540. value: function calculatePollingTimes() {
  14541. var me = this;
  14542. if (me.times) {
  14543. if (me.totalTimes > me.POLLING_TIMES) {
  14544. if (me.times > me.POLLING_TIMES) {
  14545. me.totalTimes = me.POLLING_TIMES;
  14546. } else {
  14547. me.totalTimes = me.times;
  14548. }
  14549. } else {
  14550. if (me.times < me.totalTimes) {
  14551. me.totalTimes = me.times;
  14552. }
  14553. }
  14554. } else {
  14555. if (me.totalTimes > me.POLLING_TIMES) {
  14556. me.totalTimes = me.POLLING_TIMES;
  14557. }
  14558. }
  14559. me.totalTimes--;
  14560. }
  14561. /**
  14562. * @function SuperMap.CommonServiceBase.prototype.isServiceSupportPolling
  14563. * @description 判断服务是否支持轮询。
  14564. */
  14565. }, {
  14566. key: "isServiceSupportPolling",
  14567. value: function isServiceSupportPolling() {
  14568. var me = this;
  14569. return !(me.CLASS_NAME === "SuperMap.REST.ThemeService" || me.CLASS_NAME === "SuperMap.REST.EditFeaturesService");
  14570. }
  14571. /**
  14572. * @function SuperMap.CommonServiceBase.prototype.serviceProcessCompleted
  14573. * @description 状态完成,执行此方法。
  14574. * @param {Object} result - 服务器返回的结果对象。
  14575. */
  14576. }, {
  14577. key: "serviceProcessCompleted",
  14578. value: function serviceProcessCompleted(result) {
  14579. result = Util_Util.transformResult(result);
  14580. this.events.triggerEvent("processCompleted", {
  14581. result: result
  14582. });
  14583. }
  14584. /**
  14585. * @function SuperMap.CommonServiceBase.prototype.serviceProcessFailed
  14586. * @description 状态失败,执行此方法。
  14587. * @param {Object} result - 服务器返回的结果对象。
  14588. */
  14589. }, {
  14590. key: "serviceProcessFailed",
  14591. value: function serviceProcessFailed(result) {
  14592. result = Util_Util.transformResult(result);
  14593. var error = result.error || result;
  14594. this.events.triggerEvent("processFailed", {
  14595. error: error
  14596. });
  14597. }
  14598. }, {
  14599. key: "_commit",
  14600. value: function _commit(options) {
  14601. if (options.method === "POST" || options.method === "PUT") {
  14602. if (options.params) {
  14603. options.url = Util_Util.urlAppend(options.url, Util_Util.getParameterString(options.params || {}));
  14604. }
  14605. options.params = options.data;
  14606. }
  14607. FetchRequest.commit(options.method, options.url, options.params, {
  14608. headers: options.headers,
  14609. withCredentials: options.withCredentials,
  14610. crossOrigin: options.crossOrigin,
  14611. timeout: options.async ? 0 : null,
  14612. proxy: options.proxy
  14613. }).then(function (response) {
  14614. if (response.text) {
  14615. return response.text();
  14616. }
  14617. if (response.json) {
  14618. return response.json();
  14619. }
  14620. return response;
  14621. }).then(function (text) {
  14622. var result = text;
  14623. if (typeof text === "string") {
  14624. result = new JSONFormat().read(text);
  14625. }
  14626. if (!result || result.error || result.code >= 300 && result.code !== 304) {
  14627. if (result && result.error) {
  14628. result = {
  14629. error: result.error
  14630. };
  14631. } else {
  14632. result = {
  14633. error: result
  14634. };
  14635. }
  14636. }
  14637. if (result.error) {
  14638. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  14639. failure(result);
  14640. } else {
  14641. result.succeed = result.succeed == undefined ? true : result.succeed;
  14642. var success = options.scope ? FunctionExt.bind(options.success, options.scope) : options.success;
  14643. success(result);
  14644. }
  14645. })["catch"](function (e) {
  14646. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  14647. failure(e);
  14648. });
  14649. }
  14650. }]);
  14651. return CommonServiceBase;
  14652. }();
  14653. SuperMap.CommonServiceBase = CommonServiceBase_CommonServiceBase;
  14654. /**
  14655. * 服务器请求回调函数
  14656. * @callback RequestCallback
  14657. * @example
  14658. * var requestCallback = function (serviceResult){
  14659. * console.log(serviceResult.result);
  14660. * }
  14661. * new QueryService(url).queryByBounds(param, requestCallback);
  14662. * @param {Object} serviceResult
  14663. * @param {Object} serviceResult.result 服务器返回结果。
  14664. * @param {Object} serviceResult.object 发布应用程序事件的对象。
  14665. * @param {Object} serviceResult.type 事件类型。
  14666. * @param {Object} serviceResult.element 接受浏览器事件的 DOM 节点。
  14667. */
  14668. // CONCATENATED MODULE: ./src/common/iServer/GeoCodingParameter.js
  14669. function GeoCodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14670. 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); } }
  14671. function GeoCodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoCodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoCodingParameter_defineProperties(Constructor, staticProps); return Constructor; }
  14672. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  14673. * This program are made available under the terms of the Apache License, Version 2.0
  14674. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14675. /**
  14676. * @class SuperMap.GeoCodingParameter
  14677. * @category iServer AddressMatch
  14678. * @classdesc 地理正向匹配参数类。
  14679. * @param {Object} options - 参数。
  14680. * @param {string} options.address - 地点关键词。
  14681. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  14682. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  14683. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  14684. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  14685. * @param {number} [options.maxReturn] - 最大返回结果数。
  14686. */
  14687. var GeoCodingParameter_GeoCodingParameter = /*#__PURE__*/function () {
  14688. function GeoCodingParameter(options) {
  14689. GeoCodingParameter_classCallCheck(this, GeoCodingParameter);
  14690. if (options.filters && typeof options.filters === 'string') {
  14691. options.filters = options.filters.split(',');
  14692. }
  14693. /**
  14694. * @member {string} SuperMap.GeoCodingParameter.prototype.address
  14695. * @description 地点关键词。
  14696. */
  14697. this.address = null;
  14698. /**
  14699. * @member {number} [SuperMap.GeoCodingParameter.prototype.fromIndex]
  14700. * @description 设置返回对象的起始索引值。
  14701. */
  14702. this.fromIndex = null;
  14703. /**
  14704. * @member {number} [SuperMap.GeoCodingParameter.prototype.toIndex]
  14705. * @description 设置返回对象的结束索引值。
  14706. */
  14707. this.toIndex = null;
  14708. /**
  14709. * @member {Array.<string>} [SuperMap.GeoCodingParameter.prototype.filters]
  14710. * @description 过滤字段,限定查询区域。
  14711. */
  14712. this.filters = null;
  14713. /**
  14714. * @member {string} [SuperMap.GeoCodingParameter.prototype.prjCoordSys]
  14715. * @description 查询结果的坐标系。
  14716. */
  14717. this.prjCoordSys = null;
  14718. /**
  14719. * @member {number} [SuperMap.GeoCodingParameter.prototype.maxReturn]
  14720. * @description 最大返回结果数。
  14721. */
  14722. this.maxReturn = null;
  14723. Util_Util.extend(this, options);
  14724. }
  14725. /**
  14726. * @function SuperMap.GeoCodingParameter.prototype.destroy
  14727. * @description 释放资源,将引用资源的属性置空。
  14728. */
  14729. GeoCodingParameter_createClass(GeoCodingParameter, [{
  14730. key: "destroy",
  14731. value: function destroy() {
  14732. this.address = null;
  14733. this.fromIndex = null;
  14734. this.toIndex = null;
  14735. this.filters = null;
  14736. this.prjCoordSys = null;
  14737. this.maxReturn = null;
  14738. }
  14739. }]);
  14740. return GeoCodingParameter;
  14741. }();
  14742. SuperMap.GeoCodingParameter = GeoCodingParameter_GeoCodingParameter;
  14743. // CONCATENATED MODULE: ./src/common/iServer/GeoDecodingParameter.js
  14744. function GeoDecodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14745. 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); } }
  14746. function GeoDecodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoDecodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoDecodingParameter_defineProperties(Constructor, staticProps); return Constructor; }
  14747. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  14748. * This program are made available under the terms of the Apache License, Version 2.0
  14749. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14750. /**
  14751. * @class SuperMap.GeoDecodingParameter
  14752. * @category iServer AddressMatch
  14753. * @classdesc 地理反向匹配参数类。
  14754. * @param {Object} options - 参数。
  14755. * @param {number} options.x - 查询位置的横坐标。
  14756. * @param {number} options.y - 查询位置的纵坐标。
  14757. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  14758. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  14759. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  14760. * @param {number} [options.maxReturn] - 最大返回结果数。
  14761. * @param {number} [options.geoDecodingRadius] - 查询半径。
  14762. */
  14763. var GeoDecodingParameter_GeoDecodingParameter = /*#__PURE__*/function () {
  14764. function GeoDecodingParameter(options) {
  14765. GeoDecodingParameter_classCallCheck(this, GeoDecodingParameter);
  14766. if (options.filters) {
  14767. options.filters = options.filters.split(',');
  14768. }
  14769. /**
  14770. * @member {number} SuperMap.GeoDecodingParameter.prototype.x
  14771. * @description 查询位置的横坐标。
  14772. */
  14773. this.x = null;
  14774. /**
  14775. * @member {number} SuperMap.GeoDecodingParameter.prototype.y
  14776. * @description 查询位置的纵坐标。
  14777. */
  14778. this.y = null;
  14779. /**
  14780. * @member {number} [SuperMap.GeoDecodingParameter.prototype.fromIndex]
  14781. * @description 设置返回对象的起始索引值。
  14782. */
  14783. this.fromIndex = null;
  14784. /**
  14785. * @member {number} [SuperMap.GeoDecodingParameter.prototype.toIndex]
  14786. * @description 设置返回对象的结束索引值。
  14787. */
  14788. this.toIndex = null;
  14789. /**
  14790. * @member {Array.<string>} [SuperMap.GeoDecodingParameter.prototype.filters]
  14791. * @description 过滤字段,限定查询区域。
  14792. */
  14793. this.filters = null;
  14794. /**
  14795. * @member {string} [SuperMap.GeoDecodingParameter.prototype.prjCoordSys]
  14796. * @description 查询结果的坐标系。
  14797. */
  14798. this.prjCoordSys = null;
  14799. /**
  14800. * @member {number} [SuperMap.GeoDecodingParameter.prototype.maxReturn]
  14801. * @description 最大返回结果数。
  14802. */
  14803. this.maxReturn = null;
  14804. /**
  14805. * @member {number} SuperMap.GeoDecodingParameter.prototype.geoDecodingRadius
  14806. * @description 查询半径。
  14807. */
  14808. this.geoDecodingRadius = null;
  14809. Util_Util.extend(this, options);
  14810. }
  14811. /**
  14812. * @function SuperMap.GeoDecodingParameter.prototype.destroy
  14813. * @description 释放资源,将引用资源的属性置空。
  14814. */
  14815. GeoDecodingParameter_createClass(GeoDecodingParameter, [{
  14816. key: "destroy",
  14817. value: function destroy() {
  14818. this.x = null;
  14819. this.y = null;
  14820. this.fromIndex = null;
  14821. this.toIndex = null;
  14822. this.filters = null;
  14823. this.prjCoordSys = null;
  14824. this.maxReturn = null;
  14825. this.geoDecodingRadius = null;
  14826. }
  14827. }]);
  14828. return GeoDecodingParameter;
  14829. }();
  14830. SuperMap.GeoDecodingParameter = GeoDecodingParameter_GeoDecodingParameter;
  14831. // CONCATENATED MODULE: ./src/common/iServer/AddressMatchService.js
  14832. 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); }
  14833. function AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14834. 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); } }
  14835. function AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AddressMatchService_defineProperties(Constructor, staticProps); return Constructor; }
  14836. 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); }
  14837. function AddressMatchService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AddressMatchService_getPrototypeOf(object); if (object === null) break; } return object; }
  14838. 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); }
  14839. function AddressMatchService_setPrototypeOf(o, p) { AddressMatchService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AddressMatchService_setPrototypeOf(o, p); }
  14840. 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); }; }
  14841. function AddressMatchService_possibleConstructorReturn(self, call) { if (call && (AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } return AddressMatchService_assertThisInitialized(self); }
  14842. function AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  14843. 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; } }
  14844. function AddressMatchService_getPrototypeOf(o) { AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AddressMatchService_getPrototypeOf(o); }
  14845. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  14846. * This program are made available under the terms of the Apache License, Version 2.0
  14847. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14848. /**
  14849. * @class SuperMap.AddressMatchService
  14850. * @category iServer AddressMatch
  14851. * @classdesc 地址匹配服务,包括正向匹配和反向匹配。
  14852. * @param {string} url - 地址匹配服务地址。
  14853. * @param {Object} options - 参数。
  14854. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  14855. * @param {Object} [options.headers] - 请求头。
  14856. */
  14857. var AddressMatchService_AddressMatchService = /*#__PURE__*/function (_CommonServiceBase) {
  14858. AddressMatchService_inherits(AddressMatchService, _CommonServiceBase);
  14859. var _super = AddressMatchService_createSuper(AddressMatchService);
  14860. function AddressMatchService(url, options) {
  14861. var _this;
  14862. AddressMatchService_classCallCheck(this, AddressMatchService);
  14863. _this = _super.call(this, url, options);
  14864. _this.options = options || {};
  14865. _this.CLASS_NAME = 'SuperMap.AddressMatchService';
  14866. return _this;
  14867. }
  14868. /**
  14869. * @function SuperMap.AddressMatchService.prototype.destroy
  14870. * @override
  14871. */
  14872. AddressMatchService_createClass(AddressMatchService, [{
  14873. key: "destroy",
  14874. value: function destroy() {
  14875. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "destroy", this).call(this);
  14876. }
  14877. /**
  14878. * @function SuperMap.AddressMatchService.prototype.code
  14879. * @param {string} url - 正向地址匹配服务地址。
  14880. * @param {SuperMap.GeoCodingParameter} params - 正向地址匹配服务参数。
  14881. */
  14882. }, {
  14883. key: "code",
  14884. value: function code(url, params) {
  14885. if (!(params instanceof GeoCodingParameter_GeoCodingParameter)) {
  14886. return;
  14887. }
  14888. this.processAsync(url, params);
  14889. }
  14890. /**
  14891. * @function SuperMap.AddressMatchService.prototype.decode
  14892. * @param {string} url - 反向地址匹配服务地址。
  14893. * @param {SuperMap.GeoDecodingParameter} params - 反向地址匹配服务参数。
  14894. */
  14895. }, {
  14896. key: "decode",
  14897. value: function decode(url, params) {
  14898. if (!(params instanceof GeoDecodingParameter_GeoDecodingParameter)) {
  14899. return;
  14900. }
  14901. this.processAsync(url, params);
  14902. }
  14903. /**
  14904. * @function SuperMap.AddressMatchService.prototype.processAsync
  14905. * @description 负责将客户端的动态分段服务参数传递到服务端。
  14906. * @param {string} url - 服务地址。
  14907. * @param {Object} params - 参数。
  14908. */
  14909. }, {
  14910. key: "processAsync",
  14911. value: function processAsync(url, params) {
  14912. this.request({
  14913. method: 'GET',
  14914. url: url,
  14915. params: params,
  14916. scope: this,
  14917. success: this.serviceProcessCompleted,
  14918. failure: this.serviceProcessFailed
  14919. });
  14920. }
  14921. /**
  14922. * @function SuperMap.AddressMatchService.prototype.serviceProcessCompleted
  14923. * @param {Object} result - 服务器返回的结果对象。
  14924. * @description 服务流程是否完成
  14925. */
  14926. }, {
  14927. key: "serviceProcessCompleted",
  14928. value: function serviceProcessCompleted(result) {
  14929. if (result.succeed) {
  14930. delete result.succeed;
  14931. }
  14932. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessCompleted", this).call(this, result);
  14933. }
  14934. /**
  14935. * @function SuperMap.AddressMatchService.prototype.serviceProcessCompleted
  14936. * @param {Object} result - 服务器返回的结果对象。
  14937. * @description 服务流程是否失败
  14938. */
  14939. }, {
  14940. key: "serviceProcessFailed",
  14941. value: function serviceProcessFailed(result) {
  14942. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessFailed", this).call(this, result);
  14943. }
  14944. }]);
  14945. return AddressMatchService;
  14946. }(CommonServiceBase_CommonServiceBase);
  14947. SuperMap.AddressMatchService = AddressMatchService_AddressMatchService;
  14948. // CONCATENATED MODULE: ./src/common/iServer/AggQueryBuilderParameter.js
  14949. function AggQueryBuilderParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14950. 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); } }
  14951. function AggQueryBuilderParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) AggQueryBuilderParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) AggQueryBuilderParameter_defineProperties(Constructor, staticProps); return Constructor; }
  14952. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  14953. * This program are made available under the terms of the Apache License, Version 2.0
  14954. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14955. /**
  14956. * @class SuperMap.AggQueryBuilderParameter
  14957. * @classdesc 聚合查询 QueryBuilder 参数基类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  14958. * @category iServer Data FeatureResults
  14959. * @param {Object} option - 初始化参数。
  14960. * @param {string} option.name - 查询结果名称。
  14961. * @param {SuperMap.AggregationQueryBuilderType} option.queryType - 查询类型。
  14962. */
  14963. var AggQueryBuilderParameter_AggQueryBuilderParameter = /*#__PURE__*/function () {
  14964. function AggQueryBuilderParameter(option) {
  14965. AggQueryBuilderParameter_classCallCheck(this, AggQueryBuilderParameter);
  14966. /**
  14967. * @member {string} SuperMap.AggQueryBuilderParameter.prototype.name
  14968. * @description 查询结果名称。
  14969. */
  14970. this.name = null;
  14971. /**
  14972. * @member {SuperMap.AggregationQueryBuilderType} SuperMap.AggQueryBuilderParameter.prototype.queryType
  14973. * @description 查询类型。
  14974. */
  14975. this.queryType = null;
  14976. this.CLASS_NAME = "SuperMap.AggQueryBuilderParameter";
  14977. Util_Util.extend(this, option);
  14978. }
  14979. AggQueryBuilderParameter_createClass(AggQueryBuilderParameter, [{
  14980. key: "destroy",
  14981. value: function destroy() {
  14982. var me = this;
  14983. me.name = null;
  14984. me.queryType = null;
  14985. }
  14986. }]);
  14987. return AggQueryBuilderParameter;
  14988. }();
  14989. SuperMap.AggQueryBuilderParameter = AggQueryBuilderParameter_AggQueryBuilderParameter;
  14990. // CONCATENATED MODULE: ./src/common/iServer/AggregationParameter.js
  14991. function AggregationParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14992. 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); } }
  14993. function AggregationParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) AggregationParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) AggregationParameter_defineProperties(Constructor, staticProps); return Constructor; }
  14994. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  14995. * This program are made available under the terms of the Apache License, Version 2.0
  14996. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14997. /**
  14998. * @class SuperMap.AggregationParameter
  14999. * @classdesc 聚合查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  15000. * @category iServer Data FeatureResults
  15001. * @param {Object} options - 初始化参数。
  15002. * @param {string} options.aggName - 聚合名称。
  15003. * @param {SuperMap.AggregationType} options.aggType - 聚合类型设置。
  15004. * @param {string} options.aggFieldName - 聚合字段。
  15005. * @param {SuperMap.AggregationParameter} options.subAgg - 子聚合类。
  15006. *
  15007. */
  15008. var AggregationParameter_AggregationParameter = /*#__PURE__*/function () {
  15009. function AggregationParameter(options) {
  15010. AggregationParameter_classCallCheck(this, AggregationParameter);
  15011. /**
  15012. * @member {string} SuperMap.AggregationParameter.prototype.aggName
  15013. * @description 聚合名称。
  15014. */
  15015. this.aggName = null;
  15016. /**
  15017. * @member {SuperMap.AggregationType} SuperMap.AggregationParameter.prototype.aggType
  15018. * @description 聚合类型设置类。
  15019. */
  15020. this.aggType = null;
  15021. /**
  15022. * @member {string} SuperMap.AggregationParameter.prototype.aggFieldName
  15023. * @description 聚合字段。
  15024. */
  15025. this.aggFieldName = null;
  15026. /**
  15027. * @member {SuperMap.AggregationParameter} SuperMap.AggregationParameter.prototype.subAgg
  15028. * @description 子聚合。
  15029. */
  15030. this.subAgg = null;
  15031. this.CLASS_NAME = "SuperMap.AggregationParameter";
  15032. Util_Util.extend(this, options);
  15033. }
  15034. AggregationParameter_createClass(AggregationParameter, [{
  15035. key: "destroy",
  15036. value: function destroy() {
  15037. var me = this;
  15038. me.aggName = null;
  15039. me.aggFieldName = null;
  15040. me.aggType = null;
  15041. if (me.subAgg) {
  15042. me.subAgg = null;
  15043. }
  15044. }
  15045. }]);
  15046. return AggregationParameter;
  15047. }();
  15048. SuperMap.AggregationParameter = AggregationParameter_AggregationParameter;
  15049. // CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationParameters.js
  15050. function AreaSolarRadiationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15051. 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); } }
  15052. function AreaSolarRadiationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationParameters_defineProperties(Constructor, staticProps); return Constructor; }
  15053. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  15054. * This program are made available under the terms of the Apache License, Version 2.0
  15055. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15056. /**
  15057. * @class SuperMap.AreaSolarRadiationParameters
  15058. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  15059. * @classdesc 地区太阳辐射参数类。
  15060. * @param {Object} options - 参数。
  15061. * @param {string} options.dataset - 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"的形式来表示,例如:JingjinTerrain@Jingjin。
  15062. * @param {string} options.targetDatasourceName - 指定的存储结果数据集的数据源名称, 例如:"Jingjin"。
  15063. * @param {string} options.totalGridName - 指定地区太阳辐射总辐射量数据集的名称。
  15064. * @param {string} options.diffuseDatasetGridName - 指定地区太阳辐射散射辐射量数据集的名称。
  15065. * @param {string} options.durationDatasetGridName - 指定地区太阳辐射太阳直射持续时间数据集的名称。
  15066. * @param {string} options.directDatasetGridName - 指定地区太阳辐射直射辐射量数据集的名称。
  15067. * @param {number} options.latitude - 待计算区域的纬度值。
  15068. * @param {string} [options.timeMode = 'MULTIDAYS'] - 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  15069. * @param {number} options.dayStart - 起始日期(年内的第几天)。
  15070. * @param {number} options.dayEnd - 结束日期(年内的第几天)。
  15071. * @param {number} [options.hourStart] - 起始时间(一天中的第几个小时)。
  15072. * @param {number} [options.hourEnd] - 结束时间(一天中的第几个小时)。
  15073. * @param {number} [options.transmittance] - 太阳辐射穿过大气的透射率。
  15074. * @param {number} [options.hourInterval=0.5] - 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确,如果修改此参数,必须使用整数)。
  15075. * @param {number} [options.dayInterval=5] - 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确,必须使用整数)。
  15076. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  15077. */
  15078. var AreaSolarRadiationParameters_AreaSolarRadiationParameters = /*#__PURE__*/function () {
  15079. function AreaSolarRadiationParameters(options) {
  15080. AreaSolarRadiationParameters_classCallCheck(this, AreaSolarRadiationParameters);
  15081. /**
  15082. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.dataset
  15083. * @description 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示,例如:JingjinTerrain@Jingjin。注:地区太阳辐射数据必须为栅格数据集。
  15084. */
  15085. this.dataset = null;
  15086. /**
  15087. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.targetDatasourceName
  15088. * @description 指定的存储结果数据集的数据源名称,例如:"Jingjin"。
  15089. */
  15090. this.targetDatasourceName = null;
  15091. /**
  15092. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.totalGridName
  15093. * @description 指定地区太阳辐射总辐射量数据集的名称。
  15094. */
  15095. this.totalGridName = null;
  15096. /**
  15097. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.diffuseDatasetGridName
  15098. * @description 指定地区太阳辐射散射辐射量数据集的名称。
  15099. */
  15100. this.diffuseDatasetGridName = null;
  15101. /**
  15102. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.durationDatasetGridName
  15103. * @description 指定地区太阳辐射太阳直射持续时间数据集的名称。
  15104. */
  15105. this.durationDatasetGridName = null;
  15106. /**
  15107. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.durationDatasetGridName
  15108. * @description 指定地区太阳辐射直射辐射量数据集的名称。
  15109. */
  15110. this.directDatasetGridName = null;
  15111. /**
  15112. * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.latitude
  15113. * @description 待计算区域的纬度值。
  15114. */
  15115. this.latitude = null;
  15116. /**
  15117. * @member {string} [SuperMap.AreaSolarRadiationParameters.prototype.timeMode='MULTIDAYS']
  15118. * @description 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  15119. */
  15120. this.timeMode = "MULTIDAYS";
  15121. /**
  15122. * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.dayStart
  15123. * @description 起始日期(年内的第几天)。
  15124. */
  15125. this.dayStart = null;
  15126. /**
  15127. * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.dayEnd
  15128. * @description 结束日期(年内的第几天)。
  15129. */
  15130. this.dayEnd = null;
  15131. /**
  15132. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourStart]
  15133. * @description 起始时间(一天中的第几个小时)。
  15134. */
  15135. this.hourStart = null;
  15136. /**
  15137. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourEnd]
  15138. * @description 结束时间(一天中的第几个小时)。
  15139. */
  15140. this.hourEnd = null;
  15141. /**
  15142. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.transmittance]
  15143. * @description 太阳辐射穿过大气的透射率。
  15144. */
  15145. this.transmittance = null;
  15146. /**
  15147. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourInterval=0.5]
  15148. * @description 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确, 如果修改此参数,必须使用整数)
  15149. */
  15150. this.hourInterval = null;
  15151. /**
  15152. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.dayInterval=5]
  15153. * @description 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确, 必须使用整数)
  15154. */
  15155. this.dayInterval = null;
  15156. /**
  15157. * @member {boolean} [SuperMap.AreaSolarRadiationParameters.prototype.deleteExistResultDataset=false]
  15158. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  15159. */
  15160. this.deleteExistResultDataset = false;
  15161. Util_Util.extend(this, options);
  15162. this.CLASS_NAME = "SuperMap.AreaSolarRadiationParameters";
  15163. }
  15164. /**
  15165. * @function SuperMap.AreaSolarRadiationParameters.prototype.destroy
  15166. * @description 释放资源,将引用资源的属性置空。
  15167. */
  15168. AreaSolarRadiationParameters_createClass(AreaSolarRadiationParameters, [{
  15169. key: "destroy",
  15170. value: function destroy() {
  15171. var me = this;
  15172. me.dataset = null;
  15173. me.zFactor = 1.0;
  15174. me.averageCurvatureName = null;
  15175. me.profileCurvatureName = null;
  15176. me.planCurvatureName = null;
  15177. me.deleteExistResultDataset = true;
  15178. }
  15179. /**
  15180. * @function SuperMap.AreaSolarRadiationParameters.toObject
  15181. * @param {SuperMap.AreaSolarRadiationParameters} param - 地区太阳辐射参数类。
  15182. * @param {SuperMap.AreaSolarRadiationParameters} tempObj - 地区太阳辐射参数对象。
  15183. * @returns {Object} JSON对象。
  15184. * @description 将SuperMap.AreaSolarRadiationParameters对象转换成JSON对象。
  15185. */
  15186. }], [{
  15187. key: "toObject",
  15188. value: function toObject(param, tempObj) {
  15189. var parameter = {};
  15190. for (var name in param) {
  15191. if (name !== "dataset") {
  15192. var name1 = name === "latitude" || name === "timeMode" || name === "dayStart";
  15193. var name2 = name === "dayEnd" || name === "hourStart" || name === "hourEnd";
  15194. var name3 = name === "transmittance" || name === "hourInterval" || name === "dayInterval";
  15195. if (name1 || name2 || name3) {
  15196. parameter[name] = param[name];
  15197. } else {
  15198. tempObj[name] = param[name];
  15199. }
  15200. }
  15201. }
  15202. tempObj["parameter"] = parameter;
  15203. }
  15204. }]);
  15205. return AreaSolarRadiationParameters;
  15206. }();
  15207. SuperMap.AreaSolarRadiationParameters = AreaSolarRadiationParameters_AreaSolarRadiationParameters;
  15208. // CONCATENATED MODULE: ./src/common/iServer/SpatialAnalystBase.js
  15209. 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); }
  15210. function SpatialAnalystBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15211. 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); } }
  15212. function SpatialAnalystBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) SpatialAnalystBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) SpatialAnalystBase_defineProperties(Constructor, staticProps); return Constructor; }
  15213. 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); }
  15214. function SpatialAnalystBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SpatialAnalystBase_getPrototypeOf(object); if (object === null) break; } return object; }
  15215. 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); }
  15216. function SpatialAnalystBase_setPrototypeOf(o, p) { SpatialAnalystBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SpatialAnalystBase_setPrototypeOf(o, p); }
  15217. 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); }; }
  15218. function SpatialAnalystBase_possibleConstructorReturn(self, call) { if (call && (SpatialAnalystBase_typeof(call) === "object" || typeof call === "function")) { return call; } return SpatialAnalystBase_assertThisInitialized(self); }
  15219. function SpatialAnalystBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  15220. 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; } }
  15221. function SpatialAnalystBase_getPrototypeOf(o) { SpatialAnalystBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystBase_getPrototypeOf(o); }
  15222. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  15223. * This program are made available under the terms of the Apache License, Version 2.0
  15224. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15225. /**
  15226. * @class SuperMap.SpatialAnalystBase
  15227. * @category iServer SpatialAnalyst
  15228. * @classdesc 空间分析服务基类。
  15229. * @param {string} url - 地址。
  15230. * @param {Object} options - 参数。
  15231. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  15232. * @param {Object} [options.headers] - 请求头。
  15233. * @extends {SuperMap.CommonServiceBase}
  15234. */
  15235. var SpatialAnalystBase_SpatialAnalystBase = /*#__PURE__*/function (_CommonServiceBase) {
  15236. SpatialAnalystBase_inherits(SpatialAnalystBase, _CommonServiceBase);
  15237. var _super = SpatialAnalystBase_createSuper(SpatialAnalystBase);
  15238. function SpatialAnalystBase(url, options) {
  15239. var _this;
  15240. SpatialAnalystBase_classCallCheck(this, SpatialAnalystBase);
  15241. _this = _super.call(this, url, options);
  15242. /**
  15243. * @member {SuperMap.DataFormat} [SuperMap.SpatialAnalystBase.prototype.format=SuperMap.DataFormat.GEOJSON]
  15244. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"。
  15245. */
  15246. _this.format = DataFormat.GEOJSON;
  15247. _this.CLASS_NAME = "SuperMap.SpatialAnalystBase";
  15248. return _this;
  15249. }
  15250. /**
  15251. * @function SuperMap.SpatialAnalystBase.prototype.destroy
  15252. * @override
  15253. */
  15254. SpatialAnalystBase_createClass(SpatialAnalystBase, [{
  15255. key: "destroy",
  15256. value: function destroy() {
  15257. SpatialAnalystBase_get(SpatialAnalystBase_getPrototypeOf(SpatialAnalystBase.prototype), "destroy", this).call(this);
  15258. this.format = null;
  15259. }
  15260. /**
  15261. * @function SuperMap.SpatialAnalystBase.prototype.serviceProcessCompleted
  15262. * @description 分析完成,执行此方法。
  15263. * @param {Object} result - 服务器返回的结果对象。
  15264. */
  15265. }, {
  15266. key: "serviceProcessCompleted",
  15267. value: function serviceProcessCompleted(result) {
  15268. var me = this,
  15269. analystResult;
  15270. result = Util_Util.transformResult(result);
  15271. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  15272. //批量分析时会返回多个结果
  15273. if (Util_Util.isArray(result)) {
  15274. for (var i = 0; i < result.length; i++) {
  15275. result[i] = me.toGeoJSONResult(result[i]);
  15276. }
  15277. analystResult = result;
  15278. } else {
  15279. analystResult = me.toGeoJSONResult(result);
  15280. }
  15281. }
  15282. if (!analystResult) {
  15283. analystResult = result;
  15284. }
  15285. me.events.triggerEvent("processCompleted", {
  15286. result: analystResult
  15287. });
  15288. }
  15289. /**
  15290. * @function SuperMap.SpatialAnalystBase.prototype.toGeoJSONResult
  15291. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  15292. * @param {Object} result - 服务器返回的结果对象。
  15293. *
  15294. */
  15295. }, {
  15296. key: "toGeoJSONResult",
  15297. value: function toGeoJSONResult(result) {
  15298. if (!result) {
  15299. return null;
  15300. } //批量叠加分析时结果这样处理
  15301. if (result.result && result.result.resultGeometry) {
  15302. result = result.result;
  15303. }
  15304. var geoJSONFormat = new GeoJSON_GeoJSON();
  15305. if (result.recordsets) {
  15306. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  15307. if (recordsets[i].features) {
  15308. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  15309. }
  15310. }
  15311. } else if (result.recordset && result.recordset.features) {
  15312. result.recordset.features = geoJSONFormat.toGeoJSON(result.recordset.features);
  15313. }
  15314. if (result.resultGeometry) {
  15315. result.resultGeometry = geoJSONFormat.toGeoJSON(result.resultGeometry);
  15316. }
  15317. if (result.regions) {
  15318. result.regions = geoJSONFormat.toGeoJSON(result.regions);
  15319. }
  15320. return result;
  15321. }
  15322. }]);
  15323. return SpatialAnalystBase;
  15324. }(CommonServiceBase_CommonServiceBase);
  15325. SuperMap.SpatialAnalystBase = SpatialAnalystBase_SpatialAnalystBase;
  15326. // CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationService.js
  15327. 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); }
  15328. function AreaSolarRadiationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15329. 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); } }
  15330. function AreaSolarRadiationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationService_defineProperties(Constructor, staticProps); return Constructor; }
  15331. 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); }
  15332. function AreaSolarRadiationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AreaSolarRadiationService_getPrototypeOf(object); if (object === null) break; } return object; }
  15333. 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); }
  15334. function AreaSolarRadiationService_setPrototypeOf(o, p) { AreaSolarRadiationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AreaSolarRadiationService_setPrototypeOf(o, p); }
  15335. 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); }; }
  15336. function AreaSolarRadiationService_possibleConstructorReturn(self, call) { if (call && (AreaSolarRadiationService_typeof(call) === "object" || typeof call === "function")) { return call; } return AreaSolarRadiationService_assertThisInitialized(self); }
  15337. function AreaSolarRadiationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  15338. 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; } }
  15339. function AreaSolarRadiationService_getPrototypeOf(o) { AreaSolarRadiationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AreaSolarRadiationService_getPrototypeOf(o); }
  15340. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  15341. * This program are made available under the terms of the Apache License, Version 2.0
  15342. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15343. /**
  15344. * @class SuperMap.AreaSolarRadiationService
  15345. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  15346. * @classdesc 地区太阳辐射服务类。
  15347. * @param {string} url - 服务的访问地址。如:</br>http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst。</br>
  15348. * @param {Object} options - 参数。</br>
  15349. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  15350. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  15351. * @param {Object} [options.headers] - 请求头。
  15352. * @extends {SuperMap.SpatialAnalystBase}
  15353. * @example 例如:
  15354. * (start code)
  15355. * var myAreaSolarRadiationService = new SuperMap.AreaSolarRadiationService(url);
  15356. * myAreaSolarRadiationService.on({
  15357. * "processCompleted": processCompleted,
  15358. * "processFailed": processFailed
  15359. * }
  15360. * );
  15361. * (end)
  15362. *
  15363. */
  15364. var AreaSolarRadiationService_AreaSolarRadiationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  15365. AreaSolarRadiationService_inherits(AreaSolarRadiationService, _SpatialAnalystBase);
  15366. var _super = AreaSolarRadiationService_createSuper(AreaSolarRadiationService);
  15367. function AreaSolarRadiationService(url, options) {
  15368. var _this;
  15369. AreaSolarRadiationService_classCallCheck(this, AreaSolarRadiationService);
  15370. _this = _super.call(this, url, options);
  15371. _this.CLASS_NAME = "SuperMap.AreaSolarRadiationService";
  15372. return _this;
  15373. }
  15374. /**
  15375. * @function SuperMap.AreaSolarRadiationService.prototype.destroy
  15376. * @override
  15377. */
  15378. AreaSolarRadiationService_createClass(AreaSolarRadiationService, [{
  15379. key: "destroy",
  15380. value: function destroy() {
  15381. AreaSolarRadiationService_get(AreaSolarRadiationService_getPrototypeOf(AreaSolarRadiationService.prototype), "destroy", this).call(this);
  15382. }
  15383. /**
  15384. * @function SuperMap.AreaSolarRadiationService.prototype.processAsync
  15385. * @description 负责将客户端的查询参数传递到服务端。
  15386. * @param {SuperMap.AreaSolarRadiationParameters} parameter - 地区太阳辐射参数。
  15387. */
  15388. }, {
  15389. key: "processAsync",
  15390. value: function processAsync(parameter) {
  15391. if (!(parameter instanceof AreaSolarRadiationParameters_AreaSolarRadiationParameters)) {
  15392. return;
  15393. }
  15394. var me = this;
  15395. var parameterObject = {};
  15396. if (parameter instanceof AreaSolarRadiationParameters_AreaSolarRadiationParameters) {
  15397. me.url = Util_Util.urlPathAppend(me.url, "datasets/".concat(parameter.dataset, "/solarradiation"));
  15398. }
  15399. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  15400. AreaSolarRadiationParameters_AreaSolarRadiationParameters.toObject(parameter, parameterObject);
  15401. var jsonParameters = Util_Util.toJSON(parameterObject);
  15402. me.request({
  15403. method: 'POST',
  15404. data: jsonParameters,
  15405. scope: me,
  15406. success: me.serviceProcessCompleted,
  15407. failure: me.serviceProcessFailed
  15408. });
  15409. }
  15410. }]);
  15411. return AreaSolarRadiationService;
  15412. }(SpatialAnalystBase_SpatialAnalystBase);
  15413. SuperMap.AreaSolarRadiationService = AreaSolarRadiationService_AreaSolarRadiationService;
  15414. // CONCATENATED MODULE: ./src/common/iServer/BufferDistance.js
  15415. function BufferDistance_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15416. 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); } }
  15417. function BufferDistance_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferDistance_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferDistance_defineProperties(Constructor, staticProps); return Constructor; }
  15418. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  15419. * This program are made available under the terms of the Apache License, Version 2.0
  15420. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15421. /**
  15422. * @class SuperMap.BufferDistance
  15423. * @category iServer SpatialAnalyst BufferAnalyst
  15424. * @classdesc 缓冲区分析的缓冲距离类。通过该类可以设置缓冲区分析的缓冲距离,距离可以是数值也可以是数值型的字段表达式。
  15425. * @param {Object} options - 参数。
  15426. * @param {string} [options.exp] - 以数值型的字段表达式作为缓冲区分析的距离值。
  15427. * @param {number} [options.value=100] - 以数值作为缓冲区分析的距离值。单位:米。
  15428. */
  15429. var BufferDistance_BufferDistance = /*#__PURE__*/function () {
  15430. function BufferDistance(options) {
  15431. BufferDistance_classCallCheck(this, BufferDistance);
  15432. /**
  15433. * @member {string} [SuperMap.BufferDistance.prototype.exp]
  15434. * @description 以数值型的字段表达式作为缓冲区分析的距离值。
  15435. */
  15436. this.exp = null;
  15437. /**
  15438. * @member {number} [SuperMap.BufferDistance.prototype.value=100]
  15439. * @description 以数值作为缓冲区分析的距离值。单位:米。
  15440. */
  15441. this.value = 100;
  15442. Util_Util.extend(this, options);
  15443. this.CLASS_NAME = "SuperMap.BufferDistance";
  15444. }
  15445. /**
  15446. * @function SuperMap.BufferDistance.prototype.destroy
  15447. * @description 释放资源,将引用资源的属性置空。
  15448. */
  15449. BufferDistance_createClass(BufferDistance, [{
  15450. key: "destroy",
  15451. value: function destroy() {
  15452. this.exp = null;
  15453. this.value = null;
  15454. }
  15455. }]);
  15456. return BufferDistance;
  15457. }();
  15458. SuperMap.BufferDistance = BufferDistance_BufferDistance;
  15459. // CONCATENATED MODULE: ./src/common/iServer/BufferSetting.js
  15460. function BufferSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15461. 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); } }
  15462. function BufferSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferSetting_defineProperties(Constructor, staticProps); return Constructor; }
  15463. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  15464. * This program are made available under the terms of the Apache License, Version 2.0
  15465. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15466. /**
  15467. * @class SuperMap.BufferSetting
  15468. * @category iServer SpatialAnalyst BufferAnalyst
  15469. * @classdesc 缓冲区分析通用设置类。
  15470. * @param {Object} options - 参数。
  15471. * @param {SuperMap.BufferEndType} [options.endType=SuperMap.BufferEndType.FLAT] - 缓冲区端点枚举值。
  15472. * @param {SuperMap.BufferDistance} [options.leftDistance=100] - 左侧缓冲距离。
  15473. * @param {SuperMap.BufferDistance} [options.rightDistance=100] - 右侧缓冲距离。
  15474. * @param {number} [options.semicircleLineSegment=4] - 圆头缓冲圆弧处线段的个数。
  15475. * @param {SuperMap.BufferRadiusUnit} [options.radiusUnit=SuperMap.BufferRadiusUnit.METER] - 缓冲半径单位。
  15476. */
  15477. var BufferSetting_BufferSetting = /*#__PURE__*/function () {
  15478. function BufferSetting(options) {
  15479. BufferSetting_classCallCheck(this, BufferSetting);
  15480. /**
  15481. * @member {SuperMap.BufferEndType} [SuperMap.BufferSetting.prototype.endType = SuperMap.BufferEndType.FLAT]
  15482. * @description 缓冲区端点枚举值。分为平头和圆头两种。
  15483. */
  15484. this.endType = BufferEndType.FLAT;
  15485. /**
  15486. * @member {SuperMap.BufferDistance} [SuperMap.BufferSetting.prototype.leftDistance=100]
  15487. * @description 左侧缓冲距离。
  15488. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  15489. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting.radiusUnit}设置(默认全部为米)。
  15490. */
  15491. this.leftDistance = new BufferDistance_BufferDistance();
  15492. /**
  15493. * @member {SuperMap.BufferDistance} [SuperMap.BufferSetting.prototype.rightDistance=100]
  15494. * @description 右侧缓冲距离。
  15495. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  15496. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting.radiusUnit}设置(默认全部为米)。
  15497. */
  15498. this.rightDistance = new BufferDistance_BufferDistance();
  15499. /**
  15500. * @member {number} [SuperMap.BufferSetting.prototype.semicircleLineSegment=4]
  15501. * @description 圆头缓冲圆弧处线段的个数。即用多少个线段来模拟一个半圆。
  15502. */
  15503. this.semicircleLineSegment = 4;
  15504. /**
  15505. * @member {SuperMap.BufferRadiusUnit} [SuperMap.BufferSetting.prototype.radiusUnit = SuperMap.BufferRadiusUnit.METER]
  15506. * @description 缓冲半径单位,可以是{@link SuperMap.BufferRadiusUnit.METER}、{@link SuperMap.BufferRadiusUnit.MILIMETER}、
  15507. * {@link SuperMap.BufferRadiusUnit.CENTIMETER}、{@link SuperMap.BufferRadiusUnit.DECIMETER}、{@link SuperMap.BufferRadiusUnit.KILOMETER}、
  15508. * {@link SuperMap.BufferRadiusUnit.FOOT}、{@link SuperMap.BufferRadiusUnit.INCH}、{@link SuperMap.BufferRadiusUnit.MILE}、{@link SuperMap.BufferRadiusUnit.YARD}。
  15509. * 仅对BufferAnalyst有效。
  15510. */
  15511. this.radiusUnit = BufferRadiusUnit.METER;
  15512. if (options) {
  15513. Util_Util.extend(this, options);
  15514. }
  15515. this.CLASS_NAME = "SuperMap.BufferSetting";
  15516. }
  15517. /**
  15518. * @function SuperMap.BufferSetting.prototype.destroy
  15519. * @description 释放资源,将引用资源的属性置空。
  15520. */
  15521. BufferSetting_createClass(BufferSetting, [{
  15522. key: "destroy",
  15523. value: function destroy() {
  15524. var me = this;
  15525. me.endType = null;
  15526. if (me.leftDistance) {
  15527. me.leftDistance.destroy();
  15528. me.leftDistance = null;
  15529. }
  15530. if (me.rightDistance) {
  15531. me.rightDistance.destroy();
  15532. me.rightDistance = null;
  15533. }
  15534. me.semicircleLineSegment = null;
  15535. me.radiusUnit = null;
  15536. }
  15537. }]);
  15538. return BufferSetting;
  15539. }();
  15540. SuperMap.BufferSetting = BufferSetting_BufferSetting;
  15541. // CONCATENATED MODULE: ./src/common/iServer/BufferAnalystParameters.js
  15542. function BufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15543. 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); } }
  15544. function BufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  15545. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  15546. * This program are made available under the terms of the Apache License, Version 2.0
  15547. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15548. /**
  15549. * @class SuperMap.BufferAnalystParameters
  15550. * @category iServer SpatialAnalyst BufferAnalyst
  15551. * @classdesc 缓冲区分析参数基类。
  15552. * @param {Object} options - 参数。
  15553. * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  15554. */
  15555. var BufferAnalystParameters_BufferAnalystParameters = /*#__PURE__*/function () {
  15556. function BufferAnalystParameters(options) {
  15557. BufferAnalystParameters_classCallCheck(this, BufferAnalystParameters);
  15558. var me = this;
  15559. /**
  15560. * @member {SuperMap.BufferSetting} [SuperMap.BufferAnalystParameters.prototype.bufferSetting]
  15561. * @description 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  15562. */
  15563. me.bufferSetting = new BufferSetting_BufferSetting();
  15564. Util_Util.extend(this, options);
  15565. this.CLASS_NAME = "SuperMap.BufferAnalystParameters";
  15566. }
  15567. /**
  15568. * @function SuperMap.BufferAnalystParameters.prototype.destroy
  15569. * @description 释放资源,将引用资源的属性置空。
  15570. */
  15571. BufferAnalystParameters_createClass(BufferAnalystParameters, [{
  15572. key: "destroy",
  15573. value: function destroy() {
  15574. var me = this;
  15575. if (me.bufferSetting) {
  15576. me.bufferSetting.destroy();
  15577. me.bufferSetting = null;
  15578. }
  15579. }
  15580. }]);
  15581. return BufferAnalystParameters;
  15582. }();
  15583. SuperMap.BufferAnalystParameters = BufferAnalystParameters_BufferAnalystParameters;
  15584. // CONCATENATED MODULE: ./src/common/iServer/DataReturnOption.js
  15585. function DataReturnOption_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15586. 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); } }
  15587. function DataReturnOption_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataReturnOption_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataReturnOption_defineProperties(Constructor, staticProps); return Constructor; }
  15588. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  15589. * This program are made available under the terms of the Apache License, Version 2.0
  15590. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15591. /**
  15592. * @class SuperMap.DataReturnOption
  15593. * @category iServer SpatialAnalyst
  15594. * @classdesc 数据返回设置类。
  15595. * @param {Object} options - 参数。
  15596. * @param {number} [options.expectCount=1000] - 设置返回的最大记录数,小于或者等于 0 时表示返回所有记录数。
  15597. * @param {string} [options.dataset] - 设置结果数据集标识,当 dataReturnMode 为 {@link SuperMap.DataReturnMode.DATASET_ONLY}或{@link SuperMap.DataReturnMode.DATASET_AND_RECORDSET}时有效,
  15598. * 作为返回数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  15599. * @param {SuperMap.DataReturnMode} [options.dataReturnMode=SuperMap.DataReturnMode.RECORDSET_ONLY] - 数据返回模式。
  15600. * @param {boolean} [options.deleteExistResultDataset=true] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  15601. */
  15602. var DataReturnOption_DataReturnOption = /*#__PURE__*/function () {
  15603. function DataReturnOption(options) {
  15604. DataReturnOption_classCallCheck(this, DataReturnOption);
  15605. /**
  15606. * @member {number} [SuperMap.DataReturnOption.prototype.expectCount=1000]
  15607. * @description 设置返回的最大记录数,小于或者等于0时表示返回所有记录数。
  15608. */
  15609. this.expectCount = 1000;
  15610. /**
  15611. * @member {string} [SuperMap.DataReturnOption.prototype.dataset]
  15612. * @description 设置结果数据集标识,当dataReturnMode为 {@link SuperMap.DataReturnMode.DATASET_ONLY}
  15613. * 或{@link SuperMap.DataReturnMode.DATASET_AND_RECORDSET}时有效,
  15614. * 作为返回数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  15615. */
  15616. this.dataset = null;
  15617. /**
  15618. * @member {SuperMap.DataReturnMode} [SuperMap.DataReturnOption.prototype.dataReturnMode=SuperMap.DataReturnMode.RECORDSET_ONLY]
  15619. * @description 数据返回模式。
  15620. */
  15621. this.dataReturnMode = DataReturnMode.RECORDSET_ONLY;
  15622. /**
  15623. * @member {boolean} [SuperMap.DataReturnOption.prototype.deleteExistResultDataset=true]
  15624. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  15625. */
  15626. this.deleteExistResultDataset = true;
  15627. Util_Util.extend(this, options);
  15628. this.CLASS_NAME = "SuperMap.DataReturnOption";
  15629. }
  15630. /**
  15631. * @function SuperMap.DataReturnOption.prototype.destroy
  15632. * @description 释放资源,将引用资源的属性置空。
  15633. */
  15634. DataReturnOption_createClass(DataReturnOption, [{
  15635. key: "destroy",
  15636. value: function destroy() {
  15637. var me = this;
  15638. me.expectCount = null;
  15639. me.dataset = null;
  15640. me.dataReturnMode = null;
  15641. me.deleteExistResultDataset = null;
  15642. }
  15643. }]);
  15644. return DataReturnOption;
  15645. }();
  15646. SuperMap.DataReturnOption = DataReturnOption_DataReturnOption;
  15647. // CONCATENATED MODULE: ./src/common/iServer/JoinItem.js
  15648. function JoinItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15649. 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); } }
  15650. function JoinItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) JoinItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) JoinItem_defineProperties(Constructor, staticProps); return Constructor; }
  15651. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  15652. * This program are made available under the terms of the Apache License, Version 2.0
  15653. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15654. /**
  15655. * @class SuperMap.JoinItem
  15656. * @category iServer
  15657. * @classdesc 连接信息类。
  15658. * 该类用于矢量数据集与外部表的连接。外部表可以为另一个矢量数据集(其中纯属性数据集中没有空间几何信息)所对应的 DBMS 表,也可以是用户自建的业务表。
  15659. * 需要注意的是,矢量数据集与外部表必须属于同一数据源。表之间的联系的建立有两种方式,一种是连接(join),一种是关联(link)。
  15660. * 连接,实际上是依据相同的字段将一个外部表追加到指定的表;而关联是基于一个相同的字段定义了两个表格之间的联系,但不是实际的追加。
  15661. * 用于连接两个表的字段的名称不一定相同,但类型必须一致。当两个表格之间建立了连接,通过对主表进行操作,可以对外部表进行查询,制作专题图以及分析等。
  15662. * 当两个表格之间是一对一或多对一的关系时,可以使用 join 连接。当为多对一的关系时,允许指定多个字段之间的关联。
  15663. *(注意:SuperMap.JoinItem 目前支持左连接和内连接,不支持全连接和右连接,UDB 引擎不支持内连接。并且用于建立连接的两个表必须在同一个数据源下。)
  15664. * @param {Object} options - 参数。
  15665. * @param {string} options.foreignTableName - 外部表的名称。
  15666. * @param {string} options.joinFilter - 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  15667. * @param {SuperMap.JoinType} options.joinType - 两个表之间连接类型。
  15668. * @example 下面以 SQL 查询说明 joinItem 的使用方法:
  15669. *(start code)
  15670. * function queryBySQL() {
  15671. * // 设置与外部表的连接信息
  15672. * var joinItem = new SuperMap.JoinItem({
  15673. * foreignTableName: "foreignTable",
  15674. * joinFilter: "foreignTable.CONTINENT = Countries.CONTINENT",
  15675. * joinType: "LEFTJOIN"
  15676. * })
  15677. * var queryParam, queryBySQLParams, queryBySQLService;
  15678. * // 设置查询参数,在查询参数中添加joinItem关联条件信息
  15679. * queryParam = new SuperMap.FilterParameter({
  15680. * name: "Countries@World",
  15681. * joinItems: [joinItem]
  15682. * }),
  15683. * queryBySQLParams = new SuperMap.QueryBySQLParameters({
  15684. * queryParams: [queryParam]
  15685. * }),
  15686. * queryBySQLService = new SuperMap.QueryBySQLService(url, {
  15687. * eventListeners: { "processCompleted": processCompleted, "processFailed": processFailed}
  15688. * });
  15689. * queryBySQLService.processAsync(queryBySQLParams);
  15690. * }
  15691. * function processCompleted(queryEventArgs) {//todo}
  15692. * function processFailed(e) {//todo}
  15693. * (end)
  15694. */
  15695. var JoinItem_JoinItem = /*#__PURE__*/function () {
  15696. function JoinItem(options) {
  15697. JoinItem_classCallCheck(this, JoinItem);
  15698. /**
  15699. * @member {string} SuperMap.JoinItem.prototype.foreignTableName
  15700. * @description 外部表的名称。
  15701. * 如果外部表的名称是以 “表名@数据源名” 命名方式,则该属性只需赋值表名。
  15702. * 例如:外部表 Name@changchun,Name 为表名,changchun 为数据源名称,则该属性的赋值应为:Name。
  15703. */
  15704. this.foreignTableName = null;
  15705. /**
  15706. * @member {string} SuperMap.JoinItem.prototype.joinFilter
  15707. * @description 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  15708. * 例如,将房屋面数据集(Building)的 district 字段与房屋拥有者的纯属性数据集(Owner)的 region 字段相连接,
  15709. * 两个数据集对应的表名称分别为 Table_Building 和 Table_Owner,
  15710. * 则连接表达式为 Table_Building.district = Table_Owner.region。
  15711. * 当有多个字段相连接时,用 AND 将多个表达式相连。
  15712. */
  15713. this.joinFilter = null;
  15714. /**
  15715. * @member {SuperMap.JoinType} SuperMap.JoinItem.prototype.joinType
  15716. * @description 两个表之间连接类型。
  15717. * 连接类型决定了对两个表进行连接查询后返回的记录的情况。
  15718. */
  15719. this.joinType = null;
  15720. if (options) {
  15721. Util_Util.extend(this, options);
  15722. }
  15723. this.CLASS_NAME = "SuperMap.JoinItem";
  15724. }
  15725. /**
  15726. * @function SuperMap.JoinItem.prototype.destroy
  15727. * @description 释放资源,将引用资源的属性置空。
  15728. */
  15729. JoinItem_createClass(JoinItem, [{
  15730. key: "destroy",
  15731. value: function destroy() {
  15732. var me = this;
  15733. me.foreignTableName = null;
  15734. me.joinFilter = null;
  15735. me.joinType = null;
  15736. }
  15737. /**
  15738. * @function SuperMap.JoinItem.prototype.toServerJSONObject
  15739. * @description 转换成对应的 JSON 格式对象。
  15740. */
  15741. }, {
  15742. key: "toServerJSONObject",
  15743. value: function toServerJSONObject() {
  15744. var dataObj = {};
  15745. dataObj = Util_Util.copyAttributes(dataObj, this); //joinFilter基本是个纯属性对象,这里不再做转换
  15746. return dataObj;
  15747. }
  15748. }]);
  15749. return JoinItem;
  15750. }();
  15751. SuperMap.JoinItem = JoinItem_JoinItem;
  15752. // CONCATENATED MODULE: ./src/common/iServer/DatasourceConnectionInfo.js
  15753. function DatasourceConnectionInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15754. 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); } }
  15755. function DatasourceConnectionInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasourceConnectionInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasourceConnectionInfo_defineProperties(Constructor, staticProps); return Constructor; }
  15756. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  15757. * This program are made available under the terms of the Apache License, Version 2.0
  15758. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15759. // eslint-disable-line no-unused-vars
  15760. /**
  15761. * @class SuperMap.DatasourceConnectionInfo
  15762. * @category iServer Data
  15763. * @classdesc 数据源连接信息类。该类包括了进行数据源连接的所有信息,如所要连接的服务器名称、数据库名称、用户名以及密码等。
  15764. * 当保存为工作空间时, 工作空间中的数据源的连接信息都将存储到工作空间文件中。对于不同类型的数据源,其连接信息有所区别。
  15765. * 所以在使 用该类所包含的成员时,请注意该成员所适用的数据源类型。对于从数据源对象中返回的数据连接信息对象,只有 connect 方法可以被修改,
  15766. * 其他内容是不可以被修改的。对于用户创建的数据源连接信息对象,其内容都可以修改。
  15767. * @category iServer Data
  15768. * @param {Object} options - 参数。
  15769. * @param {string} options.alias - 数据源别名。
  15770. * @param {string} options.dataBase - 数据源连接的数据库名。
  15771. * @param {boolean} [options.connect] - 数据源是否自动连接数据。
  15772. * @param {string} [options.driver] - 使用 ODBC(Open Database Connectivity,开放数据库互连)的数据库的驱动程序名。
  15773. * @param {SuperMap.EngineType} [options.engineType] - 数据源连接的引擎类型。
  15774. * @param {boolean} [options.exclusive] - 是否以独占方式打开数据源。
  15775. * @param {boolean} [options.OpenLinkTable] - 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  15776. * @param {string} [options.password] - 登录数据源连接的数据库或文件的密码。
  15777. * @param {boolean} [options.readOnly] - 是否以只读方式打开数据源。
  15778. * @param {string} [options.server] - 数据库服务器名或 SDB 文件名。
  15779. * @param {string} [options.user] - 登录数据库的用户名。
  15780. */
  15781. var DatasourceConnectionInfo_DatasourceConnectionInfo = /*#__PURE__*/function () {
  15782. function DatasourceConnectionInfo(options) {
  15783. DatasourceConnectionInfo_classCallCheck(this, DatasourceConnectionInfo);
  15784. /**
  15785. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.alias
  15786. * @description 数据源别名。
  15787. */
  15788. this.alias = null;
  15789. /**
  15790. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.connect]
  15791. * @description 数据源是否自动连接数据。
  15792. */
  15793. this.connect = null;
  15794. /**
  15795. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.dataBase
  15796. * @description 数据源连接的数据库名。
  15797. */
  15798. this.dataBase = null;
  15799. /**
  15800. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.driver]
  15801. * @description 使用 ODBC(Open Database Connectivity,开放数据库互连) 的数据库的驱动程序名。
  15802. * 其中,对于 SQL Server 数据库与 iServer 发布的 WMTS 服务,此为必设参数。
  15803. * 对于 SQL Server 数据库,它使用 ODBC 连接,所设置的驱动程序名为 "SQL Server" 或 "SQL Native Client";
  15804. * 对于 iServer 发布的 WMTS 服务,设置的驱动名称为 "WMTS"。
  15805. */
  15806. this.driver = null;
  15807. /**
  15808. * @member {SuperMap.EngineType} [SuperMap.DatasourceConnectionInfo.prototype.engineType]
  15809. * @description 数据源连接的引擎类型。
  15810. */
  15811. this.engineType = null;
  15812. /**
  15813. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.exclusive]
  15814. * @description 是否以独占方式打开数据源。
  15815. */
  15816. this.exclusive = null;
  15817. /**
  15818. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.OpenLinkTable]
  15819. * @description 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  15820. */
  15821. this.OpenLinkTable = null;
  15822. /**
  15823. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.password]
  15824. * @description 登录数据源连接的数据库或文件的密码。
  15825. */
  15826. this.password = null;
  15827. /**
  15828. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.readOnly]
  15829. * @description 是否以只读方式打开数据源。
  15830. */
  15831. this.readOnly = null;
  15832. /**
  15833. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.server]
  15834. * @description 数据库服务器名、文件名或服务地址。
  15835. * 1.对于 SDB 和 UDB 文件,为其文件的绝对路径。注意:当绝对路径的长度超过 UTF-8 编码格式的 260 字节长度,该数据源无法打开。
  15836. * 2.对于 Oracle 数据库,其服务器名为其 TNS 服务名称。
  15837. * 3.对于 SQL Server 数据库,其服务器名为其系统的 DSN(Database Source Name) 名称。
  15838. * 4.对于 PostgreSQL 数据库,其服务器名为 “IP:端口号”,默认的端口号是 5432。
  15839. * 5.对于 DB2 数据库,已经进行了编目,所以不需要进行服务器的设置。
  15840. * 6.对于 Kingbase 数据库,其服务器名为其 IP 地址。
  15841. * 7.对于 GoogleMaps 数据源,其服务器地址,默认设置为 “{@link http://maps.google.com}”,且不可更改。
  15842. * 8.对于 SuperMapCould 数据源,为其服务地址。
  15843. * 9.对于 MAPWORLD 数据源,为其服务地址,默认设置为 “{@link http://www.tianditu.cn}”,且不可更改。
  15844. * 10.对于 OGC 和 REST 数据源,为其服务地址。
  15845. */
  15846. this.server = null;
  15847. /**
  15848. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.user
  15849. * @description 登录数据库的用户名。
  15850. */
  15851. this.user = null;
  15852. if (options) {
  15853. Util_Util.extend(this, options);
  15854. }
  15855. this.CLASS_NAME = "SuperMap.DatasourceConnectionInfo";
  15856. }
  15857. /**
  15858. * @function SuperMap.DatasourceConnectionInfo.prototype.destroy
  15859. * @description 释放资源,将引用资源的属性置空。
  15860. */
  15861. DatasourceConnectionInfo_createClass(DatasourceConnectionInfo, [{
  15862. key: "destroy",
  15863. value: function destroy() {
  15864. var me = this;
  15865. me.alias = null;
  15866. me.connect = null;
  15867. me.dataBase = null;
  15868. me.driver = null;
  15869. me.engineType = null;
  15870. me.exclusive = null;
  15871. me.OpenLinkTable = null;
  15872. me.password = null;
  15873. me.readOnly = null;
  15874. me.server = null;
  15875. me.user = null;
  15876. }
  15877. }]);
  15878. return DatasourceConnectionInfo;
  15879. }();
  15880. SuperMap.DatasourceConnectionInfo = DatasourceConnectionInfo_DatasourceConnectionInfo;
  15881. // CONCATENATED MODULE: ./src/common/iServer/LinkItem.js
  15882. function LinkItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15883. 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); } }
  15884. function LinkItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinkItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinkItem_defineProperties(Constructor, staticProps); return Constructor; }
  15885. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  15886. * This program are made available under the terms of the Apache License, Version 2.0
  15887. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15888. /**
  15889. * @class SuperMap.LinkItem
  15890. * @constructs SuperMap.LinkItem
  15891. * @category iServer
  15892. * @classdesc 关联信息类。
  15893. * @description 该类用于矢量数据集与外部表的关联。 外部表是另一个数据集(其中纯属性数据集中没有空间几何信息)中的 DBMS 表,
  15894. * 矢量数据集与外部表可以属于不同的数据源,但数据源类型目前只支持 SQL Server 和 Oracle 类型。使用 LinkItem 时,
  15895. * 空间数据和属性数据必须满足关联条件,即主空间数据集与外部属性表之间存在关联字段。{@link SuperMap.LinkItem}
  15896. * 只支持左连接,UDB、PostgreSQL 和 DB2 数据源不支持 {@link SuperMap.LinkItem};另外,用于建立关联关系的两个表可以不在同一个数据源下。注意:<br>
  15897. * 1. 使用 {@link SuperMap.LinkItem} 的约束条件为:空间数据和属性数据必须有关联条件,即主空间数据集与外部属性表之间存在关联字段;<br>
  15898. * 2. 使用外关联表制作专题图时,所关联的字段必须设置表名,例如,如果所关联的字段为 BaseMap_R 数据集的 SmID,就要写成 BaseMap_R.SMID。
  15899. * @param {Object} options - 参数。
  15900. * @param {SuperMap.DatasourceConnectionInfo} options.datasourceConnectionInfo - 关联的外部数据源信息。
  15901. * @param {Array.<string>} options.foreignKeys - 主空间数据集的外键。
  15902. * @param {string} options.foreignTable - 关联的外部属性表的名称。
  15903. * @param {Array.<string>} options.linkFields - 欲保留的外部属性表的字段。
  15904. * @param {string} options.linkFilter - 与外部属性表的连接条件。
  15905. * @param {string} options.name - 此关联信息对象的名称。
  15906. * @param {Array.<string>} options.primaryKeys - 需要关联的外部属性表的主键。
  15907. * @example 下面以 SQL 查询说明 linkitem 的使用方法:
  15908. * function queryBySQL() {
  15909. * // 设置关联的外部数据库信息,alias表示数据库别名
  15910. * var dc = new SuperMap.DatasourceConnectionInfo({
  15911. * dataBase: "RelQuery",
  15912. * server: "{ip}:{port}",
  15913. * user: "sa",
  15914. * password: "map",
  15915. * driver: "SQL Server",
  15916. * connect: true,
  15917. * OpenLinkTable: false,
  15918. * alias: "RelQuery",
  15919. * engineType: EngineType.SQLPLUS,
  15920. * readOnly: false,
  15921. * exclusive: false
  15922. * });
  15923. * // 设置关联信息
  15924. * var linkItem = new SuperMap.LinkItem({
  15925. * datasourceConnectionInfo: dc,
  15926. * foreignKeys: ["name"],
  15927. * foreignTable: "Pop_2011",
  15928. * linkFields: ["SmID as Pid","pop"],
  15929. * name: "link",
  15930. * primatryKeys: ["name"],
  15931. * });
  15932. * // 设置查询参数,在查询参数中添加linkItem关联条件信息
  15933. * var queryParam, queryBySQLParams, queryBySQLService;
  15934. * queryParam = new SuperMap.FilterParameter({
  15935. * name: "Province@RelQuery",
  15936. * fields: ["SmID","name"],
  15937. * attributeFilter: "SmID<7",
  15938. * linkItems: [linkItem]
  15939. * }),
  15940. * queryBySQLParams = new SuperMap.QueryBySQLParameters({
  15941. * queryParams: [queryParam]
  15942. * }),
  15943. * queryBySQLService = new SuperMap.QueryBySQLService(url, {
  15944. * eventListeners: {
  15945. * "processCompleted": processCompleted,
  15946. * "processFailed": processFailed
  15947. * }
  15948. * });
  15949. * queryBySQLService.processAsync(queryBySQLParams);
  15950. * }
  15951. * function processCompleted(queryEventArgs) {//todo}
  15952. * function processFailed(e) {//todo}
  15953. *
  15954. */
  15955. var LinkItem_LinkItem = /*#__PURE__*/function () {
  15956. function LinkItem(options) {
  15957. LinkItem_classCallCheck(this, LinkItem);
  15958. /**
  15959. * @member {SuperMap.DatasourceConnectionInfo} SuperMap.LinkItem.prototype.datasourceConnectionInfo
  15960. * @description 关联的外部数据源信息。
  15961. */
  15962. this.datasourceConnectionInfo = null;
  15963. /**
  15964. * @member {Array.<string>} SuperMap.LinkItem.prototype.foreignKeys
  15965. * @description 主空间数据集的外键。
  15966. */
  15967. this.foreignKeys = null;
  15968. /**
  15969. * @member {string} SuperMap.LinkItem.prototype.foreignTable
  15970. * @description 关联的外部属性表的名称,目前仅支持 Supermap 管理的表,即另一个矢量数据集所对应的 DBMS 表。
  15971. */
  15972. this.foreignTable = null;
  15973. /**
  15974. * @member {Array.<string>} SuperMap.LinkItem.prototype.linkFields
  15975. * @description 欲保留的外部属性表的字段。如果不设置字段或者设置的字段在外部属性表中不存在的话则不返
  15976. * 回任何外部属性表的属性信息。如果欲保留的外部表字段与主表字段存在同名,则还需要指定一个不存在字段名作为外部表的字段别名。
  15977. */
  15978. this.linkFields = null;
  15979. /**
  15980. * @member {string} SuperMap.LinkItem.prototype.linkFilter
  15981. * @description 与外部属性表的连接条件。
  15982. */
  15983. this.linkFilter = null;
  15984. /**
  15985. * @member {string} SuperMap.LinkItem.prototype.name
  15986. * @description 此关联信息对象的名称。
  15987. */
  15988. this.name = null;
  15989. /**
  15990. * @member {Array.<string>} SuperMap.LinkItem.prototype.primaryKeys
  15991. * @description 需要关联的外部属性表的主键。
  15992. */
  15993. this.primaryKeys = null;
  15994. if (options) {
  15995. Util_Util.extend(this, options);
  15996. }
  15997. this.CLASS_NAME = "SuperMap.LinkItem";
  15998. }
  15999. /**
  16000. * @function SuperMap.LinkItem.prototype.destroy
  16001. * @description 释放资源,将引用资源的属性置空。
  16002. */
  16003. LinkItem_createClass(LinkItem, [{
  16004. key: "destroy",
  16005. value: function destroy() {
  16006. var me = this;
  16007. if (me.datasourceConnectionInfo instanceof DatasourceConnectionInfo_DatasourceConnectionInfo) {
  16008. me.datasourceConnectionInfo.destroy();
  16009. me.datasourceConnectionInfo = null;
  16010. }
  16011. me.foreignKeys = null;
  16012. me.foreignTable = null;
  16013. me.linkFields = null;
  16014. me.linkFilter = null;
  16015. me.name = null;
  16016. me.primaryKeys = null;
  16017. }
  16018. }]);
  16019. return LinkItem;
  16020. }();
  16021. SuperMap.LinkItem = LinkItem_LinkItem;
  16022. // CONCATENATED MODULE: ./src/common/iServer/FilterParameter.js
  16023. function FilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16024. 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); } }
  16025. function FilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FilterParameter_defineProperties(Constructor, staticProps); return Constructor; }
  16026. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  16027. * This program are made available under the terms of the Apache License, Version 2.0
  16028. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16029. /**
  16030. * @class SuperMap.FilterParameter
  16031. * @category iServer
  16032. * @classdesc 查询过滤条件参数类。该类用于设置查询数据集的查询过滤参数。
  16033. * @param {Object} options - 参数。
  16034. * @param {string} options.attributeFilter - 属性过滤条件。
  16035. * @param {string} options.name - 查询数据集名称或者图层名称。
  16036. * @param {Array.<SuperMap.JoinItem>} [options.joinItems] - 与外部表的连接信息 SuperMap.JoinItem 数组。
  16037. * @param {Array.<SuperMap.LinkItem>} [options.linkItems] - 与外部表的关联信息 SuperMap.LinkItem 数组。
  16038. * @param {Array.<string>} [options.ids] - 查询 id 数组,即属性表中的 SmID 值。
  16039. * @param {string} [options.orderBy] - 查询排序的字段,orderBy 的字段须为数值型的。
  16040. * @param {string} [options.groupBy] - 查询分组条件的字段。
  16041. * @param {Array.<string>} [options.fields] - 查询字段数组。
  16042. */
  16043. var FilterParameter_FilterParameter = /*#__PURE__*/function () {
  16044. function FilterParameter(options) {
  16045. FilterParameter_classCallCheck(this, FilterParameter);
  16046. /**
  16047. * @member {string} SuperMap.FilterParameter.prototype.attributeFilter
  16048. * @description 属性过滤条件。
  16049. * 相当于 SQL 语句中的 WHERE 子句,其格式为:WHERE <条件表达式>,
  16050. * attributeFilter 就是其中的“条件表达式”。
  16051. * 该字段的用法为 attributeFilter = "过滤条件"。
  16052. * 例如,要查询字段 fieldValue 小于100的记录,设置 attributeFilter = "fieldValue < 100";
  16053. * 要查询字段 name 的值为“酒店”的记录,设置 attributeFilter = "name like '%酒店%'",等等。
  16054. */
  16055. this.attributeFilter = null;
  16056. /**
  16057. * @member {string} SuperMap.FilterParameter.prototype.name
  16058. * @description 查询数据集名称或者图层名称,根据实际的查询对象而定。
  16059. * 一般情况下该字段为数据集名称,但在进行与地图相关功能的操作时,
  16060. * 需要设置为图层名称(图层名称格式:数据集名称@数据源别名)。
  16061. * 因为一个地图的图层可能是来自于不同数据源的数据集,
  16062. * 而不同的数据源中可能存在同名的数据集,
  16063. * 使用数据集名称不能唯一的确定数据集,
  16064. * 所以在进行与地图相关功能的操作时,该值需要设置为图层名称。
  16065. */
  16066. this.name = null;
  16067. /**
  16068. * @member {Array.<SuperMap.JoinItem>} [SuperMap.FilterParameter.prototype.joinItems]
  16069. * @description 与外部表的连接信息 SuperMap.JoinItem 数组。
  16070. */
  16071. this.joinItems = null;
  16072. /**
  16073. * @member {Array.<SuperMap.LinkItem>} [SuperMap.FilterParameter.prototype.linkItems]
  16074. * @description 与外部表的关联信息 LinkItem 数组。
  16075. */
  16076. this.linkItems = null;
  16077. /**
  16078. * @member {Array.<string>} [SuperMap.FilterParameter.prototype.ids]
  16079. * @description 查询 id 数组,即属性表中的 SmID 值。
  16080. */
  16081. this.ids = null;
  16082. /**
  16083. * @member {string} [SuperMap.FilterParameter.prototype.orderBy]
  16084. * @description 查询排序的字段,orderBy的字段须为数值型的。
  16085. * 相当于 SQL 语句中的 ORDER BY 子句,其格式为:ORDER BY <列名>,
  16086. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  16087. * 对单个字段排序时,该字段的用法为 orderBy = "字段名";
  16088. * 对多个字段排序时,字段之间以英文逗号进行分割,用法为 orderBy = "字段名1, 字段名2"。
  16089. * 例如,现有一个国家数据集,它有两个字段分别为“SmArea”和“pop_1994”,
  16090. * 分别表示国家的面积和1994年的各国人口数量。
  16091. * 如果要按照各国人口数量对记录进行排序,则 orderBy = "pop_1994";
  16092. * 如果要以面积和人口进行排序,则 orderBy = "SmArea, pop_1994"。
  16093. */
  16094. this.orderBy = null;
  16095. /**
  16096. * @member {string} [SuperMap.FilterParameter.prototype.groupBy]
  16097. * @description 查询分组条件的字段。
  16098. * 相当于 SQL 语句中的 GROUP BY 子句,其格式为:GROUP BY <列名>,
  16099. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  16100. * 对单个字段分组时,该字段的用法为 groupBy = "字段名";
  16101. * 对多个字段分组时,字段之间以英文逗号进行分割,用法为 groupBy = "字段名1, 字段名2"。
  16102. * 例如,现有一个全球城市数据集,该数据集有两个字段分别为“Continent”和“Country”,
  16103. * 分别表示某个城市所属的洲和国家。
  16104. * 如果要按照国家对全球的城市进行分组, 可以设置 groupBy = "Country";
  16105. * 如果以洲和国家对城市进行分组,设置 groupBy = "Continent, Country"。
  16106. */
  16107. this.groupBy = null;
  16108. /**
  16109. * @member {Array.<string>} [SuperMap.FilterParameter.prototype.fields]
  16110. * @description 查询字段数组,如果不设置则使用系统返回的所有字段。
  16111. */
  16112. this.fields = null;
  16113. if (options) {
  16114. Util_Util.extend(this, options);
  16115. }
  16116. this.CLASS_NAME = "SuperMap.FilterParameter";
  16117. }
  16118. /**
  16119. * @function SuperMap.FilterParameter.prototype.destroy
  16120. * @description 释放资源,将引用资源的属性置空。
  16121. */
  16122. FilterParameter_createClass(FilterParameter, [{
  16123. key: "destroy",
  16124. value: function destroy() {
  16125. var me = this;
  16126. me.attributeFilter = null;
  16127. me.name = null;
  16128. if (me.joinItems) {
  16129. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  16130. joinItems[i].destroy();
  16131. }
  16132. me.joinItems = null;
  16133. }
  16134. if (me.linkItems) {
  16135. for (var _i = 0, linkItems = me.linkItems, _len = linkItems.length; _i < _len; _i++) {
  16136. linkItems[_i].destroy();
  16137. }
  16138. me.linkItems = null;
  16139. }
  16140. me.ids = null;
  16141. me.orderBy = null;
  16142. me.groupBy = null;
  16143. me.fields = null;
  16144. }
  16145. }]);
  16146. return FilterParameter;
  16147. }();
  16148. SuperMap.FilterParameter = FilterParameter_FilterParameter;
  16149. // CONCATENATED MODULE: ./src/common/iServer/DatasetBufferAnalystParameters.js
  16150. 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); }
  16151. function DatasetBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16152. 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); } }
  16153. function DatasetBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetBufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  16154. 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); }
  16155. function DatasetBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  16156. 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); }
  16157. function DatasetBufferAnalystParameters_setPrototypeOf(o, p) { DatasetBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetBufferAnalystParameters_setPrototypeOf(o, p); }
  16158. 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); }; }
  16159. function DatasetBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetBufferAnalystParameters_assertThisInitialized(self); }
  16160. function DatasetBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16161. 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; } }
  16162. function DatasetBufferAnalystParameters_getPrototypeOf(o) { DatasetBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetBufferAnalystParameters_getPrototypeOf(o); }
  16163. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  16164. * This program are made available under the terms of the Apache License, Version 2.0
  16165. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16166. /**
  16167. * @class SuperMap.DatasetBufferAnalystParameters
  16168. * @category iServer SpatialAnalyst BufferAnalyst
  16169. * @classdesc 数据集缓冲区分析参数类。
  16170. * @param {Object} options - 参数。
  16171. * @param {string} options.dataset - 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  16172. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  16173. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  16174. * @param {boolean} [options.isAttributeRetained=true] - 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  16175. * @param {boolean} [options.isUnion=false] - 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  16176. * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  16177. *
  16178. * @extends {SuperMap.BufferAnalystParameters}
  16179. */
  16180. var DatasetBufferAnalystParameters_DatasetBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  16181. DatasetBufferAnalystParameters_inherits(DatasetBufferAnalystParameters, _BufferAnalystParamet);
  16182. var _super = DatasetBufferAnalystParameters_createSuper(DatasetBufferAnalystParameters);
  16183. function DatasetBufferAnalystParameters(options) {
  16184. var _this;
  16185. DatasetBufferAnalystParameters_classCallCheck(this, DatasetBufferAnalystParameters);
  16186. _this = _super.call(this, options);
  16187. /**
  16188. * @member {string} SuperMap.DatasetBufferAnalystParameters.prototype.dataset
  16189. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  16190. */
  16191. _this.dataset = null;
  16192. /**
  16193. * @member {SuperMap.FilterParameter} [SuperMap.DatasetBufferAnalystParameters.prototype.filterQueryParameter]
  16194. * @description 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  16195. */
  16196. _this.filterQueryParameter = new FilterParameter_FilterParameter();
  16197. /**
  16198. * @member {SuperMap.DataReturnOption} [SuperMap.DatasetBufferAnalystParameters.prototype.resultSetting]
  16199. * @description 结果返回设置类。
  16200. */
  16201. _this.resultSetting = new DataReturnOption_DataReturnOption();
  16202. /**
  16203. * @member {boolean} [SuperMap.DatasetBufferAnalystParameters.prototype.isAttributeRetained=true]
  16204. * @description 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  16205. */
  16206. _this.isAttributeRetained = true;
  16207. /**
  16208. * @member {boolean} [SuperMap.DatasetBufferAnalystParameters.prototype.isUnion=false]
  16209. * @description 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  16210. */
  16211. _this.isUnion = false;
  16212. Util_Util.extend(DatasetBufferAnalystParameters_assertThisInitialized(_this), options);
  16213. _this.CLASS_NAME = "SuperMap.DatasetBufferAnalystParameters";
  16214. return _this;
  16215. }
  16216. /**
  16217. * @function SuperMap.DatasetBufferAnalystParameters.prototype.destroy
  16218. * @override
  16219. */
  16220. DatasetBufferAnalystParameters_createClass(DatasetBufferAnalystParameters, [{
  16221. key: "destroy",
  16222. value: function destroy() {
  16223. DatasetBufferAnalystParameters_get(DatasetBufferAnalystParameters_getPrototypeOf(DatasetBufferAnalystParameters.prototype), "destroy", this).call(this);
  16224. var me = this;
  16225. me.dataset = null;
  16226. if (me.filterQueryParameter) {
  16227. me.filterQueryParameter.destroy();
  16228. me.filterQueryParameter = null;
  16229. }
  16230. if (me.resultSetting) {
  16231. me.resultSetting.destroy();
  16232. me.resultSetting = null;
  16233. }
  16234. me.isAttributeRetained = null;
  16235. me.isUnion = null;
  16236. }
  16237. /**
  16238. * @function SuperMap.DatasetBufferAnalystParameters.toObject
  16239. * @param {SuperMap.DatasetBufferAnalystParameters} datasetBufferAnalystParameters - 数据集缓冲区分析参数类。
  16240. * @param {SuperMap.DatasetBufferAnalystParameters} tempObj - 数据集缓冲区分析参数对象。
  16241. * @description 将数据集缓冲区分析参数对象转换为 JSON 对象。
  16242. * @returns {Object} JSON 对象。
  16243. */
  16244. }], [{
  16245. key: "toObject",
  16246. value: function toObject(datasetBufferAnalystParameters, tempObj) {
  16247. for (var name in datasetBufferAnalystParameters) {
  16248. if (name === "bufferSetting") {
  16249. datasetBufferAnalystParameters.bufferSetting.radiusUnit = datasetBufferAnalystParameters.bufferSetting.radiusUnit.toUpperCase();
  16250. tempObj.bufferAnalystParameter = datasetBufferAnalystParameters.bufferSetting;
  16251. } else if (name === "resultSetting") {
  16252. tempObj.dataReturnOption = datasetBufferAnalystParameters.resultSetting;
  16253. } else if (name === "dataset") {
  16254. continue;
  16255. } else {
  16256. tempObj[name] = datasetBufferAnalystParameters[name];
  16257. }
  16258. }
  16259. }
  16260. }]);
  16261. return DatasetBufferAnalystParameters;
  16262. }(BufferAnalystParameters_BufferAnalystParameters);
  16263. SuperMap.DatasetBufferAnalystParameters = DatasetBufferAnalystParameters_DatasetBufferAnalystParameters;
  16264. // CONCATENATED MODULE: ./src/common/iServer/GeometryBufferAnalystParameters.js
  16265. 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); }
  16266. function GeometryBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16267. 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); } }
  16268. function GeometryBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  16269. 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); }
  16270. function GeometryBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  16271. 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); }
  16272. function GeometryBufferAnalystParameters_setPrototypeOf(o, p) { GeometryBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBufferAnalystParameters_setPrototypeOf(o, p); }
  16273. 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); }; }
  16274. function GeometryBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryBufferAnalystParameters_assertThisInitialized(self); }
  16275. function GeometryBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16276. 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; } }
  16277. function GeometryBufferAnalystParameters_getPrototypeOf(o) { GeometryBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBufferAnalystParameters_getPrototypeOf(o); }
  16278. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  16279. * This program are made available under the terms of the Apache License, Version 2.0
  16280. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16281. /**
  16282. * @class SuperMap.GeometryBufferAnalystParameters
  16283. * @category iServer SpatialAnalyst BufferAnalyst
  16284. * @classdesc 几何对象缓冲区分析参数类
  16285. * 对指定的某个几何对象做缓冲区分析。通过该类可以指定要做缓冲区分析的几何对象、缓冲区参数等。
  16286. * @param {Object} options - 参数。
  16287. * @param {Object} options.sourceGeometry - 要做缓冲区分析的几何对象。
  16288. * @param {number} options.sourceGeometrySRID - 缓冲区几何对象投影坐标参数, 如 4326,3857。
  16289. * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  16290. * @extends {SuperMap.BufferAnalystParameters}
  16291. */
  16292. var GeometryBufferAnalystParameters_GeometryBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  16293. GeometryBufferAnalystParameters_inherits(GeometryBufferAnalystParameters, _BufferAnalystParamet);
  16294. var _super = GeometryBufferAnalystParameters_createSuper(GeometryBufferAnalystParameters);
  16295. function GeometryBufferAnalystParameters(options) {
  16296. var _this;
  16297. GeometryBufferAnalystParameters_classCallCheck(this, GeometryBufferAnalystParameters);
  16298. _this = _super.call(this, options);
  16299. /**
  16300. * @member {Object} SuperMap.GeometryBufferAnalystParameters.prototype.sourceGeometry
  16301. * @description 要做缓冲区分析的几何对象。<br>
  16302. * 点类型可以是:{@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>
  16303. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  16304. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  16305. */
  16306. _this.sourceGeometry = null;
  16307. /**
  16308. * @member {number} SuperMap.GeometryBufferAnalystParameters.prototype.sourceGeometrySRID
  16309. * @description 缓冲区几何对象投影坐标参数, 如 4326,3857。
  16310. */
  16311. _this.sourceGeometrySRID = null;
  16312. if (options) {
  16313. Util_Util.extend(GeometryBufferAnalystParameters_assertThisInitialized(_this), options);
  16314. }
  16315. _this.CLASS_NAME = " SuperMap.GeometryBufferAnalystParameters";
  16316. return _this;
  16317. }
  16318. /**
  16319. * @function SuperMap.GeometryBufferAnalystParameters.prototype.destroy
  16320. * @override
  16321. */
  16322. GeometryBufferAnalystParameters_createClass(GeometryBufferAnalystParameters, [{
  16323. key: "destroy",
  16324. value: function destroy() {
  16325. GeometryBufferAnalystParameters_get(GeometryBufferAnalystParameters_getPrototypeOf(GeometryBufferAnalystParameters.prototype), "destroy", this).call(this);
  16326. var me = this;
  16327. if (me.sourceGeometry) {
  16328. me.sourceGeometry.destroy();
  16329. me.sourceGeometry = null;
  16330. }
  16331. }
  16332. /**
  16333. * @function SuperMap.GeometryBufferAnalystParameters.toObject
  16334. * @param {SuperMap.GeometryBufferAnalystParameters} geometryBufferAnalystParameters - 几何对象缓冲区分析参数类。
  16335. * @param {SuperMap.GeometryBufferAnalystParameters} tempObj - 几何对象缓冲区分析参数对象。
  16336. * @description 将几何对象缓冲区分析参数对象转换为 JSON 对象。
  16337. * @returns {Object} JSON 对象。
  16338. */
  16339. }], [{
  16340. key: "toObject",
  16341. value: function toObject(geometryBufferAnalystParameters, tempObj) {
  16342. for (var name in geometryBufferAnalystParameters) {
  16343. if (name === "bufferSetting") {
  16344. var tempBufferSetting = {};
  16345. for (var key in geometryBufferAnalystParameters.bufferSetting) {
  16346. tempBufferSetting[key] = geometryBufferAnalystParameters.bufferSetting[key];
  16347. }
  16348. tempObj.analystParameter = tempBufferSetting;
  16349. } else if (name === "sourceGeometry") {
  16350. tempObj.sourceGeometry = ServerGeometry_ServerGeometry.fromGeometry(geometryBufferAnalystParameters.sourceGeometry);
  16351. } else {
  16352. tempObj[name] = geometryBufferAnalystParameters[name];
  16353. }
  16354. }
  16355. }
  16356. }]);
  16357. return GeometryBufferAnalystParameters;
  16358. }(BufferAnalystParameters_BufferAnalystParameters);
  16359. SuperMap.GeometryBufferAnalystParameters = GeometryBufferAnalystParameters_GeometryBufferAnalystParameters;
  16360. // CONCATENATED MODULE: ./src/common/iServer/BufferAnalystService.js
  16361. 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); }
  16362. function BufferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16363. 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); } }
  16364. function BufferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  16365. 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); }
  16366. function BufferAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BufferAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  16367. 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); }
  16368. function BufferAnalystService_setPrototypeOf(o, p) { BufferAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BufferAnalystService_setPrototypeOf(o, p); }
  16369. 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); }; }
  16370. function BufferAnalystService_possibleConstructorReturn(self, call) { if (call && (BufferAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return BufferAnalystService_assertThisInitialized(self); }
  16371. function BufferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16372. 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; } }
  16373. function BufferAnalystService_getPrototypeOf(o) { BufferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BufferAnalystService_getPrototypeOf(o); }
  16374. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  16375. * This program are made available under the terms of the Apache License, Version 2.0
  16376. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16377. /**
  16378. * @class SuperMap.BufferAnalystService
  16379. * @category iServer SpatialAnalyst BufferAnalyst
  16380. * @classdesc 缓冲区分析服务类。
  16381. * 该类负责将客户设置的缓冲区分析参数传递给服务端,并接收服务端返回的缓冲区分析结果数据。
  16382. * 缓冲区分析结果通过该类支持的事件的监听函数参数获取。
  16383. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  16384. * @param {Object} options - 参数。</br>
  16385. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  16386. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  16387. * @param {Object} [options.headers] - 请求头。
  16388. * @extends {SuperMap.SpatialAnalystBase}
  16389. * @example 例如:
  16390. * (start code)
  16391. * var myBufferAnalystService = new SuperMap.BufferAnalystService(url, {
  16392. * eventListeners: {
  16393. * "processCompleted": bufferCompleted,
  16394. * "processFailed": bufferFailed
  16395. * }
  16396. * });
  16397. * (end)
  16398. *
  16399. *
  16400. */
  16401. var BufferAnalystService_BufferAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  16402. BufferAnalystService_inherits(BufferAnalystService, _SpatialAnalystBase);
  16403. var _super = BufferAnalystService_createSuper(BufferAnalystService);
  16404. function BufferAnalystService(url, options) {
  16405. var _this;
  16406. BufferAnalystService_classCallCheck(this, BufferAnalystService);
  16407. _this = _super.call(this, url, options);
  16408. /**
  16409. * @member {string} SuperMap.BufferAnalystService.prototype.mode
  16410. * @description 缓冲区分析类型
  16411. */
  16412. _this.mode = null;
  16413. if (options) {
  16414. Util_Util.extend(BufferAnalystService_assertThisInitialized(_this), options);
  16415. }
  16416. _this.CLASS_NAME = "SuperMap.BufferAnalystService";
  16417. return _this;
  16418. }
  16419. /**
  16420. * @function SuperMap.BufferAnalystService.prototype.destroy
  16421. * @override
  16422. */
  16423. BufferAnalystService_createClass(BufferAnalystService, [{
  16424. key: "destroy",
  16425. value: function destroy() {
  16426. BufferAnalystService_get(BufferAnalystService_getPrototypeOf(BufferAnalystService.prototype), "destroy", this).call(this);
  16427. this.mode = null;
  16428. }
  16429. /**
  16430. * @method SuperMap.BufferAnalystService.prototype.processAsync
  16431. * @description 负责将客户端的查询参数传递到服务端。
  16432. * @param {SuperMap.BufferAnalystParameters} parameter - 缓冲区分析参数
  16433. */
  16434. }, {
  16435. key: "processAsync",
  16436. value: function processAsync(parameter) {
  16437. var parameterObject = {};
  16438. var me = this;
  16439. if (parameter instanceof DatasetBufferAnalystParameters_DatasetBufferAnalystParameters) {
  16440. me.mode = 'datasets';
  16441. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/buffer');
  16442. DatasetBufferAnalystParameters_DatasetBufferAnalystParameters.toObject(parameter, parameterObject);
  16443. } else if (parameter instanceof GeometryBufferAnalystParameters_GeometryBufferAnalystParameters) {
  16444. me.mode = 'geometry';
  16445. me.url = Util_Util.urlPathAppend(me.url, 'geometry/buffer');
  16446. GeometryBufferAnalystParameters_GeometryBufferAnalystParameters.toObject(parameter, parameterObject);
  16447. }
  16448. var jsonParameters = Util_Util.toJSON(parameterObject);
  16449. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  16450. me.request({
  16451. method: "POST",
  16452. data: jsonParameters,
  16453. scope: me,
  16454. success: me.serviceProcessCompleted,
  16455. failure: me.serviceProcessFailed
  16456. });
  16457. }
  16458. }]);
  16459. return BufferAnalystService;
  16460. }(SpatialAnalystBase_SpatialAnalystBase);
  16461. SuperMap.BufferAnalystService = BufferAnalystService_BufferAnalystService;
  16462. // CONCATENATED MODULE: ./src/common/iServer/OutputSetting.js
  16463. function OutputSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16464. 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); } }
  16465. function OutputSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) OutputSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) OutputSetting_defineProperties(Constructor, staticProps); return Constructor; }
  16466. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  16467. * This program are made available under the terms of the Apache License, Version 2.0
  16468. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16469. /**
  16470. * @class SuperMap.OutputSetting
  16471. * @category iServer ProcessingService
  16472. * @classdesc 分布式分析输出类型设置类。
  16473. * @param {Object} options - 参数。
  16474. * @param {SuperMap.DatasourceConnectionInfo} options.datasourceInfo - 数据源连接信息。
  16475. * @param {string} [options.datasetName='analystResult'] - 结果数据集名称。
  16476. * @param {SuperMap.OutputType} [options.type=SuperMap.OutputType.UDB] - 输出类型。
  16477. * @param {string} [options.outputPath] - 分析结果输出路径。
  16478. */
  16479. var OutputSetting_OutputSetting = /*#__PURE__*/function () {
  16480. function OutputSetting(options) {
  16481. OutputSetting_classCallCheck(this, OutputSetting);
  16482. /**
  16483. * @member {SuperMap.OutputType} SuperMap.OutputSetting.prototype.type
  16484. * @description 分布式分析的输出类型。
  16485. */
  16486. this.type = OutputType.UDB;
  16487. /**
  16488. * @member {string} [SuperMap.OutputSetting.prototype.datasetName='analystResult']
  16489. * @description 分布式分析的输出结果数据集名称。
  16490. */
  16491. this.datasetName = "analystResult";
  16492. /**
  16493. * @member {SuperMap.DatasourceConnectionInfo} SuperMap.OutputSetting.prototype.datasourceInfo
  16494. * @description 分布式分析的输出结果数据源连接信息。
  16495. */
  16496. this.datasourceInfo = null;
  16497. /**
  16498. * @member {string} [SuperMap.OutputSetting.prototype.outputPath]
  16499. * @description 分布式分析的分析结果输出路径。
  16500. */
  16501. this.outputPath = "";
  16502. Util_Util.extend(this, options);
  16503. this.CLASS_NAME = "SuperMap.OutputSetting";
  16504. }
  16505. /**
  16506. * @function SuperMap.OutputSetting.prototype.destroy
  16507. * @description 释放资源,将引用资源的属性置空。
  16508. */
  16509. OutputSetting_createClass(OutputSetting, [{
  16510. key: "destroy",
  16511. value: function destroy() {
  16512. var me = this;
  16513. me.type = null;
  16514. me.datasetName = null;
  16515. me.outputPath = null;
  16516. if (me.datasourceInfo instanceof DatasourceConnectionInfo_DatasourceConnectionInfo) {
  16517. me.datasourceInfo.destroy();
  16518. me.datasourceInfo = null;
  16519. }
  16520. }
  16521. }]);
  16522. return OutputSetting;
  16523. }();
  16524. SuperMap.OutputSetting = OutputSetting_OutputSetting;
  16525. // CONCATENATED MODULE: ./src/common/iServer/MappingParameters.js
  16526. function MappingParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16527. 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); } }
  16528. function MappingParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MappingParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MappingParameters_defineProperties(Constructor, staticProps); return Constructor; }
  16529. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  16530. * This program are made available under the terms of the Apache License, Version 2.0
  16531. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16532. /**
  16533. * @class SuperMap.MappingParameters
  16534. * @category iServer ProcessingService
  16535. * @classdesc 分析后结果可视化的参数类。
  16536. * @param {Object} options - 参数。
  16537. * @param {Array.<SuperMap.ThemeGridRangeItem>} [options.items] - 栅格分段专题图子项数组。
  16538. * @param {number} [options.numericPrecision=1] - 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  16539. * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 专题图分段模式。
  16540. * @param {number} [options.rangeCount] - 专题图分段个数。
  16541. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 专题图颜色渐变模式。
  16542. */
  16543. var MappingParameters_MappingParameters = /*#__PURE__*/function () {
  16544. function MappingParameters(options) {
  16545. MappingParameters_classCallCheck(this, MappingParameters);
  16546. /**
  16547. * @member {Array.<SuperMap.ThemeGridRangeItem>} [SuperMap.MappingParameters.prototype.items]
  16548. * @description 栅格分段专题图子项数组。
  16549. */
  16550. this.items = null;
  16551. /**
  16552. * @member {number} [SuperMap.MappingParameters.prototype.numericPrecision=1]
  16553. * @description 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  16554. */
  16555. this.numericPrecision = 1;
  16556. /**
  16557. * @member {SuperMap.RangeMode} [SuperMap.MappingParameters.prototype.RangeMode=SuperMap.RangeMode.EQUALINTERVAL]
  16558. * @description 专题图分段模式。
  16559. */
  16560. this.rangeMode = RangeMode.EQUALINTERVAL;
  16561. /**
  16562. * @member {number} [SuperMap.MappingParameters.prototype.rangeCount]
  16563. * @description 专题图分段个数。
  16564. */
  16565. this.rangeCount = "";
  16566. /**
  16567. * @member {SuperMap.ColorGradientType} [SuperMap.MappingParameters.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  16568. * @description 专题图颜色渐变模式。
  16569. */
  16570. this.colorGradientType = ColorGradientType.YELLOW_RED;
  16571. Util_Util.extend(this, options);
  16572. this.CLASS_NAME = "SuperMap.MappingParameters";
  16573. }
  16574. /**
  16575. * @function SuperMap.MappingParameters.prototype.destroy
  16576. * @description 释放资源,将引用资源的属性置空。
  16577. */
  16578. MappingParameters_createClass(MappingParameters, [{
  16579. key: "destroy",
  16580. value: function destroy() {
  16581. var me = this;
  16582. if (me.items) {
  16583. if (me.items.length > 0) {
  16584. for (var item in me.items) {
  16585. me.items[item].destroy();
  16586. me.items[item] = null;
  16587. }
  16588. }
  16589. me.items = null;
  16590. }
  16591. me.numericPrecision = null;
  16592. me.rangeMode = null;
  16593. me.rangeCount = null;
  16594. me.colorGradientType = null;
  16595. }
  16596. }]);
  16597. return MappingParameters;
  16598. }();
  16599. SuperMap.MappingParameters = MappingParameters_MappingParameters;
  16600. // CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsParameter.js
  16601. function BuffersAnalystJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16602. 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); } }
  16603. function BuffersAnalystJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  16604. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  16605. * This program are made available under the terms of the Apache License, Version 2.0
  16606. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16607. /**
  16608. * @class SuperMap.BuffersAnalystJobsParameter
  16609. * @category iServer ProcessingService BufferAnalyst
  16610. * @classdesc 缓冲区分析任务参数类。
  16611. * @param {Object} options - 参数。
  16612. * @param {string} options.datasetName - 数据集名。
  16613. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 分析范围(默认为全图范围)。
  16614. * @param {string} [options.distance='15'] - 缓冲距离,或缓冲区半径。
  16615. * @param {string} [options.distanceField='pickup_latitude'] - 缓冲区分析距离字段。
  16616. * @param {SuperMap.AnalystSizeUnit} [options.distanceUnit=SuperMap.AnalystSizeUnit.METER] - 缓冲距离单位单位。
  16617. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  16618. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  16619. */
  16620. var BuffersAnalystJobsParameter_BuffersAnalystJobsParameter = /*#__PURE__*/function () {
  16621. function BuffersAnalystJobsParameter(options) {
  16622. BuffersAnalystJobsParameter_classCallCheck(this, BuffersAnalystJobsParameter);
  16623. /**
  16624. * @member {string} SuperMap.BuffersAnalystJobsParameter.prototype.datasetName
  16625. * @description 数据集名。
  16626. */
  16627. this.datasetName = '';
  16628. /**
  16629. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.BuffersAnalystJobsParameter.prototype.bounds
  16630. * @description 分析范围。
  16631. */
  16632. this.bounds = '';
  16633. /**
  16634. * @member {string} [SuperMap.BuffersAnalystJobsParameter.prototype.distance='15']
  16635. * @description 缓冲距离,或称为缓冲区半径。当缓冲距离字段位空时,此参数有效。
  16636. */
  16637. this.distance = '';
  16638. /**
  16639. * @member {string} [SuperMap.BuffersAnalystJobsParameter.prototype.distanceField='pickup_latitude']
  16640. * @description 缓冲距离字段。
  16641. */
  16642. this.distanceField = '';
  16643. /**
  16644. * @member {SuperMap.AnalystSizeUnit} [SuperMap.BuffersAnalystJobsParameter.prototype.distanceUnit=SuperMap.AnalystSizeUnit.METER]
  16645. * @description 缓冲距离单位。
  16646. */
  16647. this.distanceUnit = AnalystSizeUnit.METER;
  16648. /**
  16649. * @member {string} SuperMap.BuffersAnalystJobsParameter.prototype.dissolveField
  16650. * @description 融合字段,根据字段值对缓冲区结果面对象进行融合。
  16651. */
  16652. this.dissolveField = '';
  16653. /**
  16654. * @member {SuperMap.OutputSetting} [SuperMap.BuffersAnalystJobsParameter.prototype.output]
  16655. * @description 输出参数设置类。
  16656. */
  16657. this.output = null;
  16658. /**
  16659. * @member {SuperMap.MappingParameters} [SuperMap.BuffersAnalystJobsParameter.prototype.mappingParameters]
  16660. * @description 分析后结果可视化的参数类。
  16661. */
  16662. this.mappingParameters = null;
  16663. if (!options) {
  16664. return this;
  16665. }
  16666. Util_Util.extend(this, options);
  16667. this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsParameter';
  16668. }
  16669. /**
  16670. * @function SuperMap.BuffersAnalystJobsParameter.prototype.destroy
  16671. * @description 释放资源,将引用资源的属性置空。
  16672. */
  16673. BuffersAnalystJobsParameter_createClass(BuffersAnalystJobsParameter, [{
  16674. key: "destroy",
  16675. value: function destroy() {
  16676. this.datasetName = null;
  16677. this.bounds = null;
  16678. this.distance = null;
  16679. this.distanceField = null;
  16680. this.distanceUnit = null;
  16681. this.dissolveField = null;
  16682. if (this.output instanceof OutputSetting_OutputSetting) {
  16683. this.output.destroy();
  16684. this.output = null;
  16685. }
  16686. if (this.mappingParameters instanceof MappingParameters_MappingParameters) {
  16687. this.mappingParameters.destroy();
  16688. this.mappingParameters = null;
  16689. }
  16690. }
  16691. /**
  16692. * @function SuperMap.BuffersAnalystJobsParameter.toObject
  16693. * @param {SuperMap.BuffersAnalystJobsParameter} BuffersAnalystJobsParameter - 缓冲区分析任务参数。
  16694. * @param {Object} tempObj - 目标对象。
  16695. * @description 生成缓冲区分析任务对象。
  16696. */
  16697. }], [{
  16698. key: "toObject",
  16699. value: function toObject(BuffersAnalystJobsParameter, tempObj) {
  16700. for (var name in BuffersAnalystJobsParameter) {
  16701. if (name === 'datasetName') {
  16702. tempObj['input'] = tempObj['input'] || {};
  16703. tempObj['input'][name] = BuffersAnalystJobsParameter[name];
  16704. continue;
  16705. }
  16706. if (name === 'output') {
  16707. tempObj['output'] = tempObj['output'] || {};
  16708. tempObj['output'] = BuffersAnalystJobsParameter[name];
  16709. continue;
  16710. }
  16711. tempObj['analyst'] = tempObj['analyst'] || {};
  16712. if (name === 'bounds' && BuffersAnalystJobsParameter[name]) {
  16713. tempObj['analyst'][name] = BuffersAnalystJobsParameter[name].toBBOX();
  16714. } else {
  16715. tempObj['analyst'][name] = BuffersAnalystJobsParameter[name];
  16716. }
  16717. if (name === 'mappingParameters') {
  16718. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  16719. tempObj['analyst']['mappingParameters'] = BuffersAnalystJobsParameter[name];
  16720. }
  16721. }
  16722. }
  16723. }]);
  16724. return BuffersAnalystJobsParameter;
  16725. }();
  16726. SuperMap.BuffersAnalystJobsParameter = BuffersAnalystJobsParameter_BuffersAnalystJobsParameter;
  16727. // CONCATENATED MODULE: ./src/common/iServer/ProcessingServiceBase.js
  16728. 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); }
  16729. function ProcessingServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16730. 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); } }
  16731. function ProcessingServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  16732. 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); }
  16733. function ProcessingServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ProcessingServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  16734. 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); }
  16735. function ProcessingServiceBase_setPrototypeOf(o, p) { ProcessingServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingServiceBase_setPrototypeOf(o, p); }
  16736. 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); }; }
  16737. function ProcessingServiceBase_possibleConstructorReturn(self, call) { if (call && (ProcessingServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return ProcessingServiceBase_assertThisInitialized(self); }
  16738. function ProcessingServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16739. 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; } }
  16740. function ProcessingServiceBase_getPrototypeOf(o) { ProcessingServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingServiceBase_getPrototypeOf(o); }
  16741. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  16742. * This program are made available under the terms of the Apache License, Version 2.0
  16743. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16744. /**
  16745. * @class SuperMap.ProcessingServiceBase
  16746. * @category iServer ProcessingService
  16747. * @classdesc 分布式分析服务基类
  16748. * @extends {SuperMap.CommonServiceBase}
  16749. * @param {string} url - 分布式分析服务地址。
  16750. * @param {Object} options - 参数。
  16751. * @param {SuperMap.Events} options.events - 处理所有事件的对象。
  16752. * @param {number} options.index - 服务访问地址在数组中的位置。
  16753. * @param {number} options.length - 服务访问地址数组长度。
  16754. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  16755. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  16756. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  16757. * @param {Object} [options.headers] - 请求头。
  16758. */
  16759. var ProcessingServiceBase_ProcessingServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  16760. ProcessingServiceBase_inherits(ProcessingServiceBase, _CommonServiceBase);
  16761. var _super = ProcessingServiceBase_createSuper(ProcessingServiceBase);
  16762. function ProcessingServiceBase(url, options) {
  16763. var _this;
  16764. ProcessingServiceBase_classCallCheck(this, ProcessingServiceBase);
  16765. options = options || {};
  16766. /*
  16767. * Constant: EVENT_TYPES
  16768. * {Array.<string>}
  16769. * 此类支持的事件类型
  16770. * - *processCompleted* 创建成功后触发的事件。
  16771. * - *processFailed* 创建失败后触发的事件 。
  16772. * - *processRunning* 创建过程的整个阶段都会触发的事件,用于获取创建过程的状态 。
  16773. */
  16774. options.EVENT_TYPES = ["processCompleted", "processFailed", "processRunning"];
  16775. _this = _super.call(this, url, options);
  16776. _this.CLASS_NAME = "SuperMap.ProcessingServiceBase";
  16777. return _this;
  16778. }
  16779. /**
  16780. * @function SuperMap.ProcessingServiceBase.prototype.destroy
  16781. * @override
  16782. */
  16783. ProcessingServiceBase_createClass(ProcessingServiceBase, [{
  16784. key: "destroy",
  16785. value: function destroy() {
  16786. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "destroy", this).call(this);
  16787. }
  16788. /**
  16789. * @function SuperMap.ProcessingServiceBase.prototype.getJobs
  16790. * @description 获取分布式分析任务。
  16791. * @param {string} url - 资源地址。
  16792. */
  16793. }, {
  16794. key: "getJobs",
  16795. value: function getJobs(url) {
  16796. var me = this;
  16797. FetchRequest.get(me._processUrl(url), null, {
  16798. proxy: me.proxy
  16799. }).then(function (response) {
  16800. return response.json();
  16801. }).then(function (result) {
  16802. me.events.triggerEvent("processCompleted", {
  16803. result: result
  16804. });
  16805. })["catch"](function (e) {
  16806. me.eventListeners.processFailed({
  16807. error: e
  16808. });
  16809. });
  16810. }
  16811. /**
  16812. * @function SuperMap.ProcessingServiceBase.prototype.addJob
  16813. * @description 添加分布式分析任务。
  16814. * @param {string} url - 资源根地址。
  16815. * @param {Object} params - 创建一个空间分析的请求参数。
  16816. * @param {string} paramType - 请求参数类型。
  16817. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  16818. */
  16819. }, {
  16820. key: "addJob",
  16821. value: function addJob(url, params, paramType, seconds) {
  16822. var me = this,
  16823. parameterObject = null;
  16824. if (params && params instanceof paramType) {
  16825. parameterObject = new Object();
  16826. paramType.toObject(params, parameterObject);
  16827. }
  16828. var headers = Object.assign({
  16829. 'Content-Type': 'application/x-www-form-urlencoded'
  16830. }, me.headers || {});
  16831. var options = {
  16832. proxy: me.proxy,
  16833. headers: headers,
  16834. withCredentials: me.withCredentials,
  16835. crossOrigin: me.crossOrigin,
  16836. isInTheSameDomain: me.isInTheSameDomain
  16837. };
  16838. FetchRequest.post(me._processUrl(url), JSON.stringify(parameterObject), options).then(function (response) {
  16839. return response.json();
  16840. }).then(function (result) {
  16841. if (result.succeed) {
  16842. me.serviceProcessCompleted(result, seconds);
  16843. } else {
  16844. me.serviceProcessFailed(result);
  16845. }
  16846. })["catch"](function (e) {
  16847. me.serviceProcessFailed({
  16848. error: e
  16849. });
  16850. });
  16851. }
  16852. }, {
  16853. key: "serviceProcessCompleted",
  16854. value: function serviceProcessCompleted(result, seconds) {
  16855. result = Util_Util.transformResult(result);
  16856. seconds = seconds || 1000;
  16857. var me = this;
  16858. if (result) {
  16859. var id = setInterval(function () {
  16860. FetchRequest.get(me._processUrl(result.newResourceLocation), {
  16861. _t: new Date().getTime()
  16862. }).then(function (response) {
  16863. return response.json();
  16864. }).then(function (job) {
  16865. me.events.triggerEvent("processRunning", {
  16866. id: job.id,
  16867. state: job.state
  16868. });
  16869. if (job.state.runState === 'LOST' || job.state.runState === 'KILLED' || job.state.runState === 'FAILED') {
  16870. clearInterval(id);
  16871. me.events.triggerEvent("processFailed", {
  16872. error: job.state.errorMsg,
  16873. state: job.state.runState
  16874. });
  16875. }
  16876. if (job.state.runState === 'FINISHED' && job.setting.serviceInfo) {
  16877. clearInterval(id);
  16878. me.events.triggerEvent("processCompleted", {
  16879. result: job
  16880. });
  16881. }
  16882. })["catch"](function (e) {
  16883. clearInterval(id);
  16884. me.events.triggerEvent("processFailed", {
  16885. error: e
  16886. });
  16887. });
  16888. }, seconds);
  16889. }
  16890. }
  16891. }, {
  16892. key: "serviceProcessFailed",
  16893. value: function serviceProcessFailed(result) {
  16894. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "serviceProcessFailed", this).call(this, result);
  16895. }
  16896. }, {
  16897. key: "_processUrl",
  16898. value: function _processUrl(url) {
  16899. if (SecurityManager_SecurityManager.getToken(url)) {
  16900. url = Util_Util.urlAppend(url, 'token=' + SecurityManager_SecurityManager.getToken(url));
  16901. }
  16902. return url;
  16903. }
  16904. }]);
  16905. return ProcessingServiceBase;
  16906. }(CommonServiceBase_CommonServiceBase);
  16907. SuperMap.ProcessingServiceBase = ProcessingServiceBase_ProcessingServiceBase;
  16908. // CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsService.js
  16909. 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); }
  16910. function BuffersAnalystJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16911. 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); } }
  16912. function BuffersAnalystJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  16913. 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); }
  16914. function BuffersAnalystJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BuffersAnalystJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  16915. 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); }
  16916. function BuffersAnalystJobsService_setPrototypeOf(o, p) { BuffersAnalystJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BuffersAnalystJobsService_setPrototypeOf(o, p); }
  16917. 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); }; }
  16918. function BuffersAnalystJobsService_possibleConstructorReturn(self, call) { if (call && (BuffersAnalystJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return BuffersAnalystJobsService_assertThisInitialized(self); }
  16919. function BuffersAnalystJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16920. 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; } }
  16921. function BuffersAnalystJobsService_getPrototypeOf(o) { BuffersAnalystJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BuffersAnalystJobsService_getPrototypeOf(o); }
  16922. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  16923. * This program are made available under the terms of the Apache License, Version 2.0
  16924. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16925. /**
  16926. * @class SuperMap.BuffersAnalystJobsService
  16927. * @category iServer ProcessingService BufferAnalyst
  16928. * @classdesc 缓冲区分析服务类
  16929. * @extends {SuperMap.ProcessingServiceBase}
  16930. * @param {string} url - 服务地址。
  16931. * @param {Object} options - 参数。
  16932. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  16933. * @param {Object} [options.headers] - 请求头。
  16934. */
  16935. var BuffersAnalystJobsService_BuffersAnalystJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  16936. BuffersAnalystJobsService_inherits(BuffersAnalystJobsService, _ProcessingServiceBas);
  16937. var _super = BuffersAnalystJobsService_createSuper(BuffersAnalystJobsService);
  16938. function BuffersAnalystJobsService(url, options) {
  16939. var _this;
  16940. BuffersAnalystJobsService_classCallCheck(this, BuffersAnalystJobsService);
  16941. _this = _super.call(this, url, options);
  16942. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/buffers');
  16943. _this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsService';
  16944. return _this;
  16945. }
  16946. /**
  16947. *@override
  16948. */
  16949. BuffersAnalystJobsService_createClass(BuffersAnalystJobsService, [{
  16950. key: "destroy",
  16951. value: function destroy() {
  16952. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "destroy", this).call(this);
  16953. }
  16954. /**
  16955. * @function SuperMap.BuffersAnalystJobsService.prototype.getBufferJobs
  16956. * @description 获取缓冲区分析所有任务
  16957. */
  16958. }, {
  16959. key: "getBuffersJobs",
  16960. value: function getBuffersJobs() {
  16961. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, this.url);
  16962. }
  16963. /**
  16964. * @function SuperMap.BuffersAnalystJobsService.prototype.getBufferJob
  16965. * @description 获取指定id的缓冲区分析服务
  16966. * @param {string} id - 指定要获取数据的id。
  16967. */
  16968. }, {
  16969. key: "getBuffersJob",
  16970. value: function getBuffersJob(id) {
  16971. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  16972. }
  16973. /**
  16974. * @function SuperMap.BuffersAnalystJobsService.prototype.addBufferJob
  16975. * @description 新建缓冲区分析服务
  16976. * @param {SuperMap.BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  16977. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  16978. */
  16979. }, {
  16980. key: "addBuffersJob",
  16981. value: function addBuffersJob(params, seconds) {
  16982. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "addJob", this).call(this, this.url, params, BuffersAnalystJobsParameter_BuffersAnalystJobsParameter, seconds);
  16983. }
  16984. }]);
  16985. return BuffersAnalystJobsService;
  16986. }(ProcessingServiceBase_ProcessingServiceBase);
  16987. SuperMap.BuffersAnalystJobsService = BuffersAnalystJobsService_BuffersAnalystJobsService;
  16988. // CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystParameters.js
  16989. function BurstPipelineAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16990. 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); } }
  16991. function BurstPipelineAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  16992. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  16993. * This program are made available under the terms of the Apache License, Version 2.0
  16994. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16995. /**
  16996. * @class SuperMap.BurstPipelineAnalystParameters
  16997. * @category iServer NetworkAnalyst BurstAnalyse
  16998. * @classdesc 爆管分析参数类。
  16999. * @param {Object} options - 参数。
  17000. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  17001. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  17002. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  17003. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  17004. */
  17005. var BurstPipelineAnalystParameters_BurstPipelineAnalystParameters = /*#__PURE__*/function () {
  17006. function BurstPipelineAnalystParameters(options) {
  17007. BurstPipelineAnalystParameters_classCallCheck(this, BurstPipelineAnalystParameters);
  17008. var me = this;
  17009. /**
  17010. * @member {Array.<number>} SuperMap.BurstPipelineAnalystParameters.prototype.sourceNodeIDs
  17011. * @description 指定的设施点 ID 数组。
  17012. */
  17013. this.sourceNodeIDs = null;
  17014. /**
  17015. * @member {number} [SuperMap.BurstPipelineAnalystParameters.prototype.edgeID]
  17016. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  17017. */
  17018. this.edgeID = null;
  17019. /**
  17020. * @member {number} [SuperMap.BurstPipelineAnalystParameters.prototype.nodeID]
  17021. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  17022. */
  17023. this.nodeID = null;
  17024. /**
  17025. * @member {boolean} [SuperMap.BurstPipelineAnalystParameters.prototype.isUncertainDirectionValid=false]
  17026. * @description 指定不确定流向是否有效。
  17027. * 指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行。
  17028. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  17029. */
  17030. this.isUncertainDirectionValid = false;
  17031. Util_Util.extend(me, options);
  17032. this.CLASS_NAME = "SuperMap.BurstPipelineAnalystParameters";
  17033. }
  17034. /**
  17035. * @function SuperMap.BurstPipelineAnalystParameters.prototype.destroy
  17036. * @description 释放资源,将引用资源的属性置空。
  17037. */
  17038. BurstPipelineAnalystParameters_createClass(BurstPipelineAnalystParameters, [{
  17039. key: "destroy",
  17040. value: function destroy() {
  17041. var me = this;
  17042. me.sourceNodeIDs = null;
  17043. me.edgeID = null;
  17044. me.nodeID = null;
  17045. me.isUncertainDirectionValid = null;
  17046. }
  17047. }]);
  17048. return BurstPipelineAnalystParameters;
  17049. }();
  17050. SuperMap.BurstPipelineAnalystParameters = BurstPipelineAnalystParameters_BurstPipelineAnalystParameters;
  17051. // CONCATENATED MODULE: ./src/common/iServer/NetworkAnalystServiceBase.js
  17052. 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); }
  17053. function NetworkAnalystServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17054. 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); } }
  17055. function NetworkAnalystServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalystServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalystServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  17056. 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); }
  17057. function NetworkAnalystServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NetworkAnalystServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  17058. 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); }
  17059. function NetworkAnalystServiceBase_setPrototypeOf(o, p) { NetworkAnalystServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalystServiceBase_setPrototypeOf(o, p); }
  17060. 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); }; }
  17061. function NetworkAnalystServiceBase_possibleConstructorReturn(self, call) { if (call && (NetworkAnalystServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return NetworkAnalystServiceBase_assertThisInitialized(self); }
  17062. function NetworkAnalystServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  17063. 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; } }
  17064. function NetworkAnalystServiceBase_getPrototypeOf(o) { NetworkAnalystServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystServiceBase_getPrototypeOf(o); }
  17065. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  17066. * This program are made available under the terms of the Apache License, Version 2.0
  17067. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17068. /**
  17069. * @class SuperMap.NetworkAnalystServiceBase
  17070. * @category iServer NetworkAnalyst
  17071. * @classdesc 网络分析服务基类。
  17072. * @description 网络分析服务基类。
  17073. * @extends {SuperMap.CommonServiceBase}
  17074. * @param {string} url - 网络分析服务地址。
  17075. * @param {Object} options - 参数。
  17076. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  17077. * @param {Object} [options.headers] - 请求头。
  17078. */
  17079. var NetworkAnalystServiceBase_NetworkAnalystServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  17080. NetworkAnalystServiceBase_inherits(NetworkAnalystServiceBase, _CommonServiceBase);
  17081. var _super = NetworkAnalystServiceBase_createSuper(NetworkAnalystServiceBase);
  17082. function NetworkAnalystServiceBase(url, options) {
  17083. var _this;
  17084. NetworkAnalystServiceBase_classCallCheck(this, NetworkAnalystServiceBase);
  17085. _this = _super.call(this, url, options);
  17086. /**
  17087. * @member {SuperMap.DataFormat} [SuperMap.NetworkAnalystServiceBase.prototype.format=SuperMap.DataFormat.GEOJSON]
  17088. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"
  17089. */
  17090. _this.format = DataFormat.GEOJSON;
  17091. _this.CLASS_NAME = "SuperMap.NetworkAnalystServiceBase";
  17092. return _this;
  17093. }
  17094. /**
  17095. * @function SuperMap.NetworkAnalystServiceBase.prototype.destroy
  17096. * @description 释放资源,将引用的资源属性置空。
  17097. */
  17098. NetworkAnalystServiceBase_createClass(NetworkAnalystServiceBase, [{
  17099. key: "destroy",
  17100. value: function destroy() {
  17101. NetworkAnalystServiceBase_get(NetworkAnalystServiceBase_getPrototypeOf(NetworkAnalystServiceBase.prototype), "destroy", this).call(this);
  17102. this.format = null;
  17103. }
  17104. /**
  17105. * @function SuperMap.NetworkAnalystServiceBase.prototype.serviceProcessCompleted
  17106. * @description 分析完成,执行此方法。
  17107. * @param {Object} result - 服务器返回的结果对象。
  17108. */
  17109. }, {
  17110. key: "serviceProcessCompleted",
  17111. value: function serviceProcessCompleted(result) {
  17112. var me = this,
  17113. analystResult;
  17114. result = Util_Util.transformResult(result);
  17115. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  17116. analystResult = me.toGeoJSONResult(result);
  17117. }
  17118. if (!analystResult) {
  17119. analystResult = result;
  17120. }
  17121. me.events.triggerEvent("processCompleted", {
  17122. result: analystResult
  17123. });
  17124. }
  17125. /**
  17126. * @function SuperMap.NetworkAnalystServiceBase.prototype.toGeoJSONResult
  17127. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。只处理结果中的路由,由子类实现。
  17128. * @param {Object} result - 服务器返回的结果对象。
  17129. * @returns {GeoJSONObject} GeoJSON 对象。
  17130. */
  17131. }, {
  17132. key: "toGeoJSONResult",
  17133. value: function toGeoJSONResult(result) {
  17134. // eslint-disable-line no-unused-vars
  17135. return null;
  17136. }
  17137. }]);
  17138. return NetworkAnalystServiceBase;
  17139. }(CommonServiceBase_CommonServiceBase);
  17140. SuperMap.NetworkAnalystServiceBase = NetworkAnalystServiceBase_NetworkAnalystServiceBase;
  17141. // CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystService.js
  17142. 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); }
  17143. function BurstPipelineAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17144. 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); } }
  17145. function BurstPipelineAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  17146. 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); }
  17147. function BurstPipelineAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BurstPipelineAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  17148. 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); }
  17149. function BurstPipelineAnalystService_setPrototypeOf(o, p) { BurstPipelineAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BurstPipelineAnalystService_setPrototypeOf(o, p); }
  17150. 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); }; }
  17151. function BurstPipelineAnalystService_possibleConstructorReturn(self, call) { if (call && (BurstPipelineAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return BurstPipelineAnalystService_assertThisInitialized(self); }
  17152. function BurstPipelineAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  17153. 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; } }
  17154. function BurstPipelineAnalystService_getPrototypeOf(o) { BurstPipelineAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BurstPipelineAnalystService_getPrototypeOf(o); }
  17155. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  17156. * This program are made available under the terms of the Apache License, Version 2.0
  17157. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17158. /**
  17159. * @class SuperMap.BurstPipelineAnalystService
  17160. * @category iServer NetworkAnalyst BurstAnalyse
  17161. * @classdesc 爆管分析服务类,即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组、普通结点 ID 数组及其上下游弧段 ID 数组。
  17162. * @extends {SuperMap.NetworkAnalystServiceBase}
  17163. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  17164. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源},
  17165. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  17166. * @param {Object} options - 参数。
  17167. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  17168. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  17169. * @param {Object} [options.headers] - 请求头。
  17170. */
  17171. var BurstPipelineAnalystService_BurstPipelineAnalystService = /*#__PURE__*/function (_NetworkAnalystServic) {
  17172. BurstPipelineAnalystService_inherits(BurstPipelineAnalystService, _NetworkAnalystServic);
  17173. var _super = BurstPipelineAnalystService_createSuper(BurstPipelineAnalystService);
  17174. function BurstPipelineAnalystService(url, options) {
  17175. var _this;
  17176. BurstPipelineAnalystService_classCallCheck(this, BurstPipelineAnalystService);
  17177. _this = _super.call(this, url, options);
  17178. _this.CLASS_NAME = "SuperMap.BurstPipelineAnalystService";
  17179. return _this;
  17180. }
  17181. /**
  17182. * @function SuperMap.BurstPipelineAnalystService.prototype.destroy
  17183. * @override
  17184. */
  17185. BurstPipelineAnalystService_createClass(BurstPipelineAnalystService, [{
  17186. key: "destroy",
  17187. value: function destroy() {
  17188. BurstPipelineAnalystService_get(BurstPipelineAnalystService_getPrototypeOf(BurstPipelineAnalystService.prototype), "destroy", this).call(this);
  17189. }
  17190. /**
  17191. * @function SuperMap.BurstPipelineAnalystService.prototype.processAsync
  17192. * @description 负责将客户端的查询参数传递到服务端。
  17193. * @params {SuperMap.BurstPipelineAnalystParameters} params - 爆管分析参数类
  17194. */
  17195. }, {
  17196. key: "processAsync",
  17197. value: function processAsync(params) {
  17198. if (!(params instanceof BurstPipelineAnalystParameters_BurstPipelineAnalystParameters)) {
  17199. return null;
  17200. }
  17201. var me = this,
  17202. jsonObject;
  17203. me.url = Util_Util.urlPathAppend(me.url, 'burstAnalyse');
  17204. jsonObject = {
  17205. sourceNodeIDs: params.sourceNodeIDs,
  17206. isUncertainDirectionValid: params.isUncertainDirectionValid
  17207. }; //必传参数不正确,就终止
  17208. if (params.edgeID !== null && params.nodeID !== null) {
  17209. throw new Error('edgeID and nodeID cannot be null at the same time.');
  17210. }
  17211. if (params.edgeID === null && params.nodeID === null) {
  17212. throw new Error('edgeID and nodeID cannot be null at the same time.');
  17213. }
  17214. if (params.edgeID !== null) {
  17215. jsonObject.edgeID = params.edgeID;
  17216. } else {
  17217. jsonObject.nodeID = params.nodeID;
  17218. }
  17219. me.request({
  17220. method: "GET",
  17221. params: jsonObject,
  17222. scope: me,
  17223. success: me.serviceProcessCompleted,
  17224. failure: me.serviceProcessFailed
  17225. });
  17226. }
  17227. }]);
  17228. return BurstPipelineAnalystService;
  17229. }(NetworkAnalystServiceBase_NetworkAnalystServiceBase);
  17230. SuperMap.BurstPipelineAnalystService = BurstPipelineAnalystService_BurstPipelineAnalystService;
  17231. // CONCATENATED MODULE: ./src/common/iServer/ChartFeatureInfoSpecsService.js
  17232. 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); }
  17233. function ChartFeatureInfoSpecsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17234. 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); } }
  17235. function ChartFeatureInfoSpecsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartFeatureInfoSpecsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartFeatureInfoSpecsService_defineProperties(Constructor, staticProps); return Constructor; }
  17236. 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); }
  17237. function ChartFeatureInfoSpecsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ChartFeatureInfoSpecsService_getPrototypeOf(object); if (object === null) break; } return object; }
  17238. 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); }
  17239. function ChartFeatureInfoSpecsService_setPrototypeOf(o, p) { ChartFeatureInfoSpecsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartFeatureInfoSpecsService_setPrototypeOf(o, p); }
  17240. 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); }; }
  17241. function ChartFeatureInfoSpecsService_possibleConstructorReturn(self, call) { if (call && (ChartFeatureInfoSpecsService_typeof(call) === "object" || typeof call === "function")) { return call; } return ChartFeatureInfoSpecsService_assertThisInitialized(self); }
  17242. function ChartFeatureInfoSpecsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  17243. 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; } }
  17244. function ChartFeatureInfoSpecsService_getPrototypeOf(o) { ChartFeatureInfoSpecsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartFeatureInfoSpecsService_getPrototypeOf(o); }
  17245. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  17246. * This program are made available under the terms of the Apache License, Version 2.0
  17247. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17248. /**
  17249. * @class SuperMap.ChartFeatureInfoSpecsService
  17250. * @category iServer Map Chart
  17251. * @classdesc 海图物标信息服务类,通过该服务类可以查询到服务端支持的所有海图物标信息。
  17252. * 用户可以通过两种方式获取查询结果:
  17253. * 一种是通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件;
  17254. * 另一种是使用 AsyncResponder 类实现异步处理。
  17255. * @extends {SuperMap.CommonServiceBase}
  17256. * @param {string} url - 地图(特指海图)服务地址。
  17257. * 如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  17258. * 发送请求格式类似于:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图/chartFeatureInfoSpecs.json"。
  17259. * @param {Object} options - 参数。
  17260. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  17261. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  17262. * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为"ISERVER","GEOJSON"。
  17263. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  17264. * @param {Object} [options.headers] - 请求头。
  17265. */
  17266. var ChartFeatureInfoSpecsService_ChartFeatureInfoSpecsService = /*#__PURE__*/function (_CommonServiceBase) {
  17267. ChartFeatureInfoSpecsService_inherits(ChartFeatureInfoSpecsService, _CommonServiceBase);
  17268. var _super = ChartFeatureInfoSpecsService_createSuper(ChartFeatureInfoSpecsService);
  17269. function ChartFeatureInfoSpecsService(url, options) {
  17270. var _this;
  17271. ChartFeatureInfoSpecsService_classCallCheck(this, ChartFeatureInfoSpecsService);
  17272. _this = _super.call(this, url, options);
  17273. _this.CLASS_NAME = "SuperMap.ChartFeatureInfoSpecsService";
  17274. return _this;
  17275. }
  17276. /**
  17277. * @function SuperMap.ChartFeatureInfoSpecsService.prototype.destroy
  17278. * @override
  17279. */
  17280. ChartFeatureInfoSpecsService_createClass(ChartFeatureInfoSpecsService, [{
  17281. key: "destroy",
  17282. value: function destroy() {
  17283. ChartFeatureInfoSpecsService_get(ChartFeatureInfoSpecsService_getPrototypeOf(ChartFeatureInfoSpecsService.prototype), "destroy", this).call(this);
  17284. Util_Util.reset(this);
  17285. }
  17286. /**
  17287. * @function SuperMap.ChartFeatureInfoSpecsService.prototype.processAsync
  17288. * @description 根据地图(特指海图)服务地址与服务端完成异步通讯,获取物标信息。
  17289. * 当查询物标信息成功时,将触发 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE
  17290. * 事件。用可以通过户两种方式获取图层信息:
  17291. * 1. 通过 AsyncResponder 类获取(推荐使用);
  17292. * 2. 通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件获取。
  17293. */
  17294. }, {
  17295. key: "processAsync",
  17296. value: function processAsync() {
  17297. var me = this,
  17298. method = "GET";
  17299. if (!me.isTempLayers) {
  17300. Util_Util.urlPathAppend(me.url, 'chartFeatureInfoSpecs');
  17301. }
  17302. me.request({
  17303. method: method,
  17304. params: null,
  17305. scope: me,
  17306. success: me.serviceProcessCompleted,
  17307. failure: me.serviceProcessFailed
  17308. });
  17309. }
  17310. }]);
  17311. return ChartFeatureInfoSpecsService;
  17312. }(CommonServiceBase_CommonServiceBase);
  17313. SuperMap.ChartFeatureInfoSpecsService = ChartFeatureInfoSpecsService_ChartFeatureInfoSpecsService;
  17314. // CONCATENATED MODULE: ./src/common/iServer/ChartQueryFilterParameter.js
  17315. function ChartQueryFilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17316. 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); } }
  17317. function ChartQueryFilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryFilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryFilterParameter_defineProperties(Constructor, staticProps); return Constructor; }
  17318. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  17319. * This program are made available under the terms of the Apache License, Version 2.0
  17320. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17321. /**
  17322. * @class SuperMap.ChartQueryFilterParameter
  17323. * @category iServer Map Chart
  17324. * @classdesc 海图查询过滤参数类,用于设置海图查询的过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  17325. * @param {Object} options - 参数。
  17326. * @param {string} options.attributeFilter - 属性字段过滤条件。
  17327. * @param {number} options.chartFeatureInfoSpecCode - 查询的物标代号。
  17328. * @param {boolean} [options.isQueryPoint] - 是否查询点。
  17329. * @param {boolean} [options.isQueryLine] - 是否查询线。
  17330. * @param {boolean} [options.isQueryRegion] - 是否查询面。
  17331. */
  17332. var ChartQueryFilterParameter_ChartQueryFilterParameter = /*#__PURE__*/function () {
  17333. function ChartQueryFilterParameter(options) {
  17334. ChartQueryFilterParameter_classCallCheck(this, ChartQueryFilterParameter);
  17335. /**
  17336. * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryPoint]
  17337. * @description 是否查询点。
  17338. */
  17339. this.isQueryPoint = null;
  17340. /**
  17341. * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryLine]
  17342. * @description 是否查询线。
  17343. */
  17344. this.isQueryLine = null;
  17345. /**
  17346. * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryRegion]
  17347. * @description 是否查询面。
  17348. */
  17349. this.isQueryRegion = null;
  17350. /**
  17351. * @member {string} SuperMap.ChartQueryFilterParameter.prototype.attributeFilter
  17352. * @description 属性字段过滤条件。
  17353. */
  17354. this.attributeFilter = null;
  17355. /**
  17356. * @member {number} SuperMap.ChartQueryFilterParameter.prototype.chartFeatureInfoSpecCode
  17357. * @description 查询的物标代号。
  17358. */
  17359. this.chartFeatureInfoSpecCode = null;
  17360. Util_Util.extend(this, options);
  17361. this.CLASS_NAME = "SuperMap.ChartQueryFilterParameter";
  17362. }
  17363. /**
  17364. * @function SuperMap.ChartQueryFilterParameter.prototype.destroy
  17365. * @description 释放资源,将引用资源的属性置空。
  17366. */
  17367. ChartQueryFilterParameter_createClass(ChartQueryFilterParameter, [{
  17368. key: "destroy",
  17369. value: function destroy() {
  17370. var me = this;
  17371. me.isQueryPoint = null;
  17372. me.isQueryLine = null;
  17373. me.isQueryRegion = null;
  17374. me.attributeFilter = null;
  17375. me.chartFeatureInfoSpecCode = null;
  17376. }
  17377. /**
  17378. * @function SuperMap.ChartQueryFilterParameter.prototype.toJson
  17379. * @description 将属性信息转化成 JSON 格式字符串。
  17380. */
  17381. }, {
  17382. key: "toJson",
  17383. value: function toJson() {
  17384. var json = "";
  17385. json += "\"isQueryPoint\":" + this.isQueryPoint + ",";
  17386. json += "\"isQueryLine\":" + this.isQueryLine + ",";
  17387. json += "\"isQueryRegion\":" + this.isQueryRegion + ",";
  17388. if (this.attributeFilter) {
  17389. json += "\"attributeFilter\": \"" + this.attributeFilter + "\",";
  17390. }
  17391. json += "\"chartFeatureInfoSpecCode\":" + this.chartFeatureInfoSpecCode;
  17392. json = "{" + json + "}";
  17393. return json;
  17394. }
  17395. }]);
  17396. return ChartQueryFilterParameter;
  17397. }();
  17398. SuperMap.ChartQueryFilterParameter = ChartQueryFilterParameter_ChartQueryFilterParameter;
  17399. // CONCATENATED MODULE: ./src/common/iServer/ChartQueryParameters.js
  17400. function ChartQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17401. 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); } }
  17402. function ChartQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  17403. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  17404. * This program are made available under the terms of the Apache License, Version 2.0
  17405. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17406. /**
  17407. * @class SuperMap.ChartQueryParameters
  17408. * @category iServer Map Chart
  17409. * @classdesc 海图查询参数类,该类用于设置海图查询时的相关参数,海图查询分为海图属性查询和海图范围查询两类,通过属性 queryMode 指定查询模式。
  17410. * 必设属性有:queryMode、chartLayerNames、chartQueryFilterParameters。当进行海图范围查询时,必设属性还包括 bounds。
  17411. * @param {Object} options - 参数。
  17412. * @param {string} options.queryMode - 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery")。
  17413. * @param {Array.<string>} options.chartLayerNames - 查询的海图图层的名称。
  17414. * @param {Array.<{SuperMap.ChartQueryFilterParameter}>} options.chartQueryFilterParameters - 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  17415. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 海图查询范围。当进行海图范围查询时,此参数为必选。
  17416. * @param {boolean} [options.returnContent=true] - 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  17417. * @param {number} [options.startRecord=0] - 查询起始记录位置。
  17418. * @param {number} [options.expectCount] - 期望查询结果返回的记录数,该值大于0。
  17419. */
  17420. var ChartQueryParameters_ChartQueryParameters = /*#__PURE__*/function () {
  17421. function ChartQueryParameters(options) {
  17422. ChartQueryParameters_classCallCheck(this, ChartQueryParameters);
  17423. /**
  17424. * @member {string} SuperMap.ChartQueryParameters.prototype.queryMode
  17425. * @description 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery") 。
  17426. */
  17427. this.queryMode = null;
  17428. /**
  17429. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.ChartQueryParameters.prototype.bounds
  17430. * @description 海图查询范围。
  17431. */
  17432. this.bounds = null;
  17433. /**
  17434. * @member {Array.<string>} SuperMap.ChartQueryParameters.prototype.chartLayerNames
  17435. * @description 查询的海图图层的名称。
  17436. */
  17437. this.chartLayerNames = null;
  17438. /**
  17439. * @member {Array.<SuperMap.ChartQueryFilterParameter>} SuperMap.ChartQueryParameters.prototype.chartQueryFilterParameters
  17440. * @description 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  17441. */
  17442. this.chartQueryFilterParameters = null;
  17443. /**
  17444. * @member {boolean} [SuperMap.ChartQueryParameters.prototype.returnContent=true]
  17445. * @description 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  17446. */
  17447. this.returnContent = true;
  17448. /**
  17449. * @member {number} [SuperMap.ChartQueryParameters.prototype.startRecord=0]
  17450. * @description 查询起始记录位置。
  17451. */
  17452. this.startRecord = 0;
  17453. /**
  17454. * @member {number} [SuperMap.ChartQueryParameters.prototype.expectCount]
  17455. * @description 期望查询结果返回的记录数,该值大于0。
  17456. */
  17457. this.expectCount = null;
  17458. Util_Util.extend(this, options);
  17459. this.CLASS_NAME = "SuperMap.ChartQueryParameters";
  17460. }
  17461. /**
  17462. * @function SuperMap.ChartQueryParameters.prototype.destroy
  17463. * @description 释放资源,将引用资源的属性置空。
  17464. */
  17465. ChartQueryParameters_createClass(ChartQueryParameters, [{
  17466. key: "destroy",
  17467. value: function destroy() {
  17468. var me = this;
  17469. me.queryMode = null;
  17470. me.bounds = null;
  17471. me.chartLayerNames = null;
  17472. me.chartQueryFilterParameters = null;
  17473. me.returnContent = true;
  17474. me.startRecord = 0;
  17475. me.expectCount = null;
  17476. }
  17477. /**
  17478. * @function SuperMap.ChartQueryParameters.prototype.getVariablesJson
  17479. * @description 将属性信息转换成能够被服务识别的 JSON 格式字符串。
  17480. * @returns {string} JSON 字符串。
  17481. */
  17482. }, {
  17483. key: "getVariablesJson",
  17484. value: function getVariablesJson() {
  17485. var json = "";
  17486. json += "\"queryMode\":\"" + this.queryMode + "\",";
  17487. if (this.chartLayerNames && this.chartLayerNames.length) {
  17488. var chartLayersArray = [];
  17489. var layerLength = this.chartLayerNames.length;
  17490. for (var i = 0; i < layerLength; i++) {
  17491. chartLayersArray.push("\"" + this.chartLayerNames[i] + "\"");
  17492. }
  17493. var layerNames = "[" + chartLayersArray.join(",") + "]";
  17494. json += "\"chartLayerNames\":" + layerNames + ",";
  17495. }
  17496. if (this.queryMode === "ChartBoundsQuery" && this.bounds) {
  17497. json += "\"bounds\":" + "{" + "\"leftBottom\":" + "{" + "\"x\":" + this.bounds.left + "," + "\"y\":" + this.bounds.bottom + "}" + "," + "\"rightTop\":" + "{" + "\"x\":" + this.bounds.right + "," + "\"y\":" + this.bounds.top + "}" + "},";
  17498. }
  17499. if (this.chartQueryFilterParameters && this.chartQueryFilterParameters.length) {
  17500. var chartParamArray = [];
  17501. var chartLength = this.chartQueryFilterParameters.length;
  17502. for (var j = 0; j < chartLength; j++) {
  17503. var chartQueryFilterParameter = this.chartQueryFilterParameters[j];
  17504. if (!(chartQueryFilterParameter instanceof ChartQueryFilterParameter_ChartQueryFilterParameter)) {
  17505. continue;
  17506. }
  17507. chartParamArray.push(chartQueryFilterParameter.toJson());
  17508. }
  17509. var chartParamsJson = "[" + chartParamArray.join(",") + "]";
  17510. chartParamsJson = "\"chartQueryParams\":" + chartParamsJson + ",";
  17511. chartParamsJson += "\"startRecord\":" + this.startRecord + ",";
  17512. chartParamsJson += "\"expectCount\":" + this.expectCount;
  17513. chartParamsJson = "{" + chartParamsJson + "}";
  17514. json += "\"chartQueryParameters\":" + chartParamsJson;
  17515. }
  17516. json = "{" + json + "}";
  17517. return json;
  17518. }
  17519. }]);
  17520. return ChartQueryParameters;
  17521. }();
  17522. SuperMap.ChartQueryParameters = ChartQueryParameters_ChartQueryParameters;
  17523. // CONCATENATED MODULE: ./src/common/iServer/QueryParameters.js
  17524. function QueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17525. 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); } }
  17526. function QueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  17527. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  17528. * This program are made available under the terms of the Apache License, Version 2.0
  17529. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17530. /**
  17531. * @class SuperMap.QueryParameters
  17532. * @category iServer Map QueryResults
  17533. * @classdesc 查询参数基类。距离查询、SQL 查询、几何地物查询等各自的参数均继承此类。
  17534. * @param {Object} options - 参数。
  17535. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  17536. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  17537. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  17538. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  17539. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  17540. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  17541. * @param {number} [options.startRecord=0] - 查询起始记录号。
  17542. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  17543. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  17544. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  17545. */
  17546. var QueryParameters_QueryParameters = /*#__PURE__*/function () {
  17547. function QueryParameters(options) {
  17548. QueryParameters_classCallCheck(this, QueryParameters);
  17549. if (!options) {
  17550. return;
  17551. }
  17552. /**
  17553. * @member {string} [SuperMap.QueryParameters.prototype.customParams]
  17554. * @description 自定义参数,供扩展使用。
  17555. */
  17556. this.customParams = null;
  17557. /**
  17558. * @member {Object} [SuperMap.QueryParameters.prototype.prjCoordSys]
  17559. * @description 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}
  17560. */
  17561. this.prjCoordSys = null;
  17562. /**
  17563. * @member {number} [SuperMap.QueryParameters.prototype.expectCount=100000]
  17564. * @description 期望返回结果记录个数,默认返回100000条查询记录,
  17565. * 如果实际不足100000条则返回实际记录条数。
  17566. */
  17567. this.expectCount = 100000;
  17568. /**
  17569. * @member {SuperMap.GeometryType} [SuperMap.QueryParameters.prototype.networkType=SuperMap.GeometryType.LINE]
  17570. * @description 网络数据集对应的查询类型,分为点和线两种类型。
  17571. */
  17572. this.networkType = GeometryType.LINE;
  17573. /**
  17574. * @member {SuperMap.QueryOption} [SuperMap.QueryParameters.prototype.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY]
  17575. * @description 查询结果类型枚举类。
  17576. * 该类描述查询结果返回类型,包括只返回属性、
  17577. * 只返回几何实体以及返回属性和几何实体。
  17578. */
  17579. this.queryOption = QueryOption.ATTRIBUTEANDGEOMETRY;
  17580. /**
  17581. * @member {Array.<SuperMap.FilterParameter>} SuperMap.QueryParameters.prototype.queryParams
  17582. * @description 查询过滤条件参数数组。
  17583. * 该类用于设置查询数据集的查询过滤参数。
  17584. */
  17585. this.queryParams = null;
  17586. /**
  17587. * @member {number} [SuperMap.QueryParameters.prototype.startRecord=0]
  17588. * @description 查询起始记录号。
  17589. */
  17590. this.startRecord = 0;
  17591. /**
  17592. * @member {number} [SuperMap.QueryParameters.prototype.holdTime=10]
  17593. * @description 资源在服务端保存的时间,单位为分钟。
  17594. */
  17595. this.holdTime = 10;
  17596. /**
  17597. * @member {boolean} [SuperMap.QueryParameters.prototype.returnCustomResult=false]
  17598. * @description 仅供三维使用。
  17599. */
  17600. this.returnCustomResult = false;
  17601. /**
  17602. * @member {boolean} [SuperMap.QueryParameters.prototype.returnFeatureWithFieldCaption=false]
  17603. * @description 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  17604. */
  17605. this.returnFeatureWithFieldCaption = false;
  17606. Util_Util.extend(this, options);
  17607. this.CLASS_NAME = "SuperMap.QueryParameters";
  17608. }
  17609. /**
  17610. * @function SuperMap.QueryParameters.prototype.destroy
  17611. * @description 释放资源,将引用资源的属性置空。
  17612. */
  17613. QueryParameters_createClass(QueryParameters, [{
  17614. key: "destroy",
  17615. value: function destroy() {
  17616. var me = this;
  17617. me.customParams = null;
  17618. me.expectCount = null;
  17619. me.networkType = null;
  17620. me.queryOption = null;
  17621. if (me.queryParams) {
  17622. for (var i = 0, qps = me.queryParams, len = qps.length; i < len; i++) {
  17623. qps[i].destroy();
  17624. }
  17625. me.queryParams = null;
  17626. }
  17627. me.startRecord = null;
  17628. me.holdTime = null;
  17629. me.returnCustomResult = null;
  17630. me.prjCoordSys = null;
  17631. }
  17632. }]);
  17633. return QueryParameters;
  17634. }();
  17635. SuperMap.QueryParameters = QueryParameters_QueryParameters;
  17636. // CONCATENATED MODULE: ./src/common/iServer/ChartQueryService.js
  17637. 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); }
  17638. function ChartQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17639. 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); } }
  17640. function ChartQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryService_defineProperties(Constructor, staticProps); return Constructor; }
  17641. 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); }
  17642. function ChartQueryService_setPrototypeOf(o, p) { ChartQueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartQueryService_setPrototypeOf(o, p); }
  17643. 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); }; }
  17644. function ChartQueryService_possibleConstructorReturn(self, call) { if (call && (ChartQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return ChartQueryService_assertThisInitialized(self); }
  17645. function ChartQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  17646. 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; } }
  17647. function ChartQueryService_getPrototypeOf(o) { ChartQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartQueryService_getPrototypeOf(o); }
  17648. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  17649. * This program are made available under the terms of the Apache License, Version 2.0
  17650. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17651. /**
  17652. * @class SuperMap.ChartQueryService
  17653. * @category iServer Map Chart
  17654. * @classdesc 海图查询服务类。该类负责将海图查询所需参数(ChartQueryParameters)传递至服务端,并获取服务端的返回结果。
  17655. * 用户可以通过两种方式获取查询结果:
  17656. * 1.通过 AsyncResponder 类获取(推荐使用);
  17657. * 2.通过监听 QueryEvent.PROCESS_COMPLETE 事件获取。
  17658. * @extends {SuperMap.CommonServiceBase}
  17659. * @param {string} url - 地图查询服务访问地址。如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  17660. * @param {Object} options - 参数。
  17661. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  17662. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  17663. * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为"ISERVER","GEOJSON"。
  17664. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  17665. * @param {Object} [options.headers] - 请求头。
  17666. * @example
  17667. * 下面示例显示了如何进行海图属性查询:
  17668. * var nameArray = ["GB4X0000_52000"];
  17669. * var chartQueryFilterParameter = new ChartQueryFilterParameter({
  17670. * isQueryPoint:true,
  17671. * isQueryLine:true,
  17672. * isQueryRegion:true,
  17673. * attributeFilter:"SmID<10",
  17674. * chartFeatureInfoSpecCode:1
  17675. * });
  17676. *
  17677. * var chartQueryParameters = new SuperMap.ChartQueryParameters({
  17678. * queryMode:"ChartAttributeQuery",
  17679. * chartLayerNames:nameArray,
  17680. * returnContent:true,
  17681. * chartQueryFilterParameters:[chartQueryFilterParameter]
  17682. * });
  17683. *
  17684. * var chartQueryService = new SuperMap.ChartQueryService(url);
  17685. *
  17686. * chartQueryService.events.on({
  17687. * "processCompleted":processCompleted,
  17688. * "processFailed":processFailed
  17689. * });
  17690. * chartQueryService.processAsync(chartQueryParameters);
  17691. */
  17692. var ChartQueryService_ChartQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  17693. ChartQueryService_inherits(ChartQueryService, _CommonServiceBase);
  17694. var _super = ChartQueryService_createSuper(ChartQueryService);
  17695. function ChartQueryService(url, options) {
  17696. var _this;
  17697. ChartQueryService_classCallCheck(this, ChartQueryService);
  17698. _this = _super.call(this, url, options);
  17699. options = options || {};
  17700. /**
  17701. * @member {boolean} SuperMap.ChartQueryService.prototype.returnContent
  17702. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  17703. */
  17704. _this.returnContent = null;
  17705. /**
  17706. * @member {SuperMap.DataFormat} SuperMap.ChartQueryService.prototype.format
  17707. * @description 查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式
  17708. * 参数格式为"ISERVER","GEOJSON",GEOJSON
  17709. */
  17710. _this.format = DataFormat.GEOJSON;
  17711. Util_Util.extend(ChartQueryService_assertThisInitialized(_this), options);
  17712. var me = ChartQueryService_assertThisInitialized(_this);
  17713. if (options.format) {
  17714. me.format = options.format.toUpperCase();
  17715. }
  17716. if (!me.url) {
  17717. return ChartQueryService_possibleConstructorReturn(_this);
  17718. }
  17719. me.url = Util_Util.urlPathAppend(me.url, 'queryResults');
  17720. _this.CLASS_NAME = "SuperMap.ChartQueryService";
  17721. return _this;
  17722. }
  17723. /**
  17724. * @function SuperMap.ChartQueryService.prototype.destroy
  17725. * @override
  17726. */
  17727. ChartQueryService_createClass(ChartQueryService, [{
  17728. key: "destroy",
  17729. value: function destroy() {
  17730. var me = this;
  17731. CommonServiceBase_CommonServiceBase.prototype.destroy.apply(this, arguments);
  17732. me.returnContent = null;
  17733. me.format = null;
  17734. }
  17735. /**
  17736. * @function SuperMap.ChartQueryService.prototype.processAsync
  17737. * @description 使用服务地址 URL 实例化 ChartQueryService 对象。
  17738. * @param {SuperMap.ChartQueryParameters} params - 查询参数。
  17739. */
  17740. }, {
  17741. key: "processAsync",
  17742. value: function processAsync(params) {
  17743. //todo重点需要添加代码的地方
  17744. if (!(params instanceof ChartQueryParameters_ChartQueryParameters)) {
  17745. return;
  17746. }
  17747. var me = this,
  17748. jsonParameters;
  17749. me.returnContent = params.returnContent;
  17750. jsonParameters = params.getVariablesJson();
  17751. if (me.returnContent) {
  17752. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  17753. }
  17754. me.request({
  17755. method: "POST",
  17756. data: jsonParameters,
  17757. scope: me,
  17758. success: me.serviceProcessCompleted,
  17759. failure: me.serviceProcessFailed
  17760. });
  17761. }
  17762. /**
  17763. * @function SuperMap.ChartQueryService.prototype.serviceProcessCompleted
  17764. * @description 查询完成,执行此方法。
  17765. * @param {Object} result - 服务器返回的结果对象。
  17766. */
  17767. }, {
  17768. key: "serviceProcessCompleted",
  17769. value: function serviceProcessCompleted(result) {
  17770. var me = this;
  17771. result = Util_Util.transformResult(result);
  17772. if (result && result.recordsets && me.format === DataFormat.GEOJSON) {
  17773. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  17774. if (recordsets[i].features) {
  17775. var geoJSONFormat = new GeoJSON_GeoJSON();
  17776. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  17777. }
  17778. }
  17779. }
  17780. me.events.triggerEvent("processCompleted", {
  17781. result: result
  17782. });
  17783. }
  17784. /**
  17785. * @function SuperMap.ChartQueryService.prototype.getQueryParameters
  17786. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  17787. * @param {Object} params - JSON 字符串表示的查询参数。
  17788. * @returns {SuperMap.QueryParameters} 返回查询结果
  17789. */
  17790. }, {
  17791. key: "getQueryParameters",
  17792. value: function getQueryParameters(params) {
  17793. return new QueryParameters_QueryParameters({
  17794. queryMode: params.queryMode,
  17795. bounds: params.bounds,
  17796. chartLayerNames: params.chartLayerNames,
  17797. chartQueryFilterParameters: params.chartQueryFilterParameters,
  17798. returnContent: params.returnContent
  17799. });
  17800. }
  17801. }]);
  17802. return ChartQueryService;
  17803. }(CommonServiceBase_CommonServiceBase);
  17804. SuperMap.ChartQueryService = ChartQueryService_ChartQueryService;
  17805. // CONCATENATED MODULE: ./src/common/iServer/ClipParameter.js
  17806. function ClipParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17807. 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); } }
  17808. function ClipParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ClipParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ClipParameter_defineProperties(Constructor, staticProps); return Constructor; }
  17809. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  17810. * This program are made available under the terms of the Apache License, Version 2.0
  17811. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17812. /**
  17813. * @class SuperMap.ClipParameter
  17814. * @category iServer SpatialAnalyst InterpolationAnalyst
  17815. * @classdesc 用于裁剪的参数。
  17816. * @description 优先使用用户指定的裁剪区域多边形进行裁剪,也可以通过指定数据源和数据集名,从而使用指定数据集的边界多边形进行裁剪。
  17817. * @param {Object} options - 参数。
  17818. * @param {string} [options.clipDatasetName] - 裁剪的数据集名。
  17819. * @param {string} [options.clipDatasourceName] - 裁剪的数据集所在数据源的名字。
  17820. * @param {(SuperMap.Geometry.Polygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON)} [options.clipRegion] - 用户指定的裁剪区域。
  17821. * @param {boolean} [options.isClipInRegion=true] - 是否对裁剪区内的数据集进行裁剪。
  17822. * @param {boolean} [options.isExactClip=true] - 是否使用精确裁剪。
  17823. */
  17824. var ClipParameter_ClipParameter = /*#__PURE__*/function () {
  17825. function ClipParameter(options) {
  17826. ClipParameter_classCallCheck(this, ClipParameter);
  17827. /**
  17828. * @member {string} SuperMap.ClipParameter.prototype.clipDatasetName
  17829. * @description 用于裁剪的数据集名,clipDatasetName 与 clipRegion 必须设置一个。
  17830. */
  17831. this.clipDatasetName = null;
  17832. /**
  17833. * @member {string} SuperMap.ClipParameter.prototype.clipDatasourceName
  17834. * @description 用于裁剪的数据集所在数据源的名字。当 clipRegion 不设置时起作用。
  17835. */
  17836. this.clipDatasourceName = null;
  17837. /**
  17838. * @member {(SuperMap.Geometry.Polygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON)} SuperMap.ClipParameter.prototype.clipRegion
  17839. * @description 用户指定的裁剪区域,优先使用,clipDatasetName 与 clipRegion 必须设置一个。
  17840. */
  17841. this.clipRegion = null;
  17842. /**
  17843. * @member {boolean} [SuperMap.ClipParameter.prototype.isClipInRegion=true]
  17844. * @description 是否对裁剪区内的数据集进行裁剪。若为 true,则对裁剪区域内的结果进行裁剪,若为 false,则对裁剪区域外的结果进行裁剪。
  17845. */
  17846. this.isClipInRegion = true;
  17847. /**
  17848. * @member {boolean} [SuperMap.ClipParameter.prototype.isExactClip=true]
  17849. * @description 是否使用精确裁剪。
  17850. */
  17851. this.isExactClip = null;
  17852. if (options) {
  17853. Util_Util.extend(this, options);
  17854. }
  17855. this.CLASS_NAME = "SuperMap.ClipParameter";
  17856. }
  17857. /**
  17858. * @function SuperMap.ClipParameter.prototype.destroy
  17859. * @description 释放资源,将引用资源的属性置空。
  17860. */
  17861. ClipParameter_createClass(ClipParameter, [{
  17862. key: "destroy",
  17863. value: function destroy() {
  17864. var me = this;
  17865. me.clipDatasetName = null;
  17866. me.clipDatasourceName = null;
  17867. me.clipRegion = null;
  17868. me.isClipInRegion = null;
  17869. me.isExactClip = null;
  17870. }
  17871. /**
  17872. * @function SuperMap.ClipParameter.prototype.toJSON
  17873. * @description 将 ClipParameter 对象转化为 JSON 字符串。
  17874. * @returns {string} 返回转换后的 JSON 字符串。
  17875. */
  17876. }, {
  17877. key: "toJSON",
  17878. value: function toJSON() {
  17879. return Util_Util.toJSON({
  17880. isClipInRegion: this.isClipInRegion,
  17881. clipDatasetName: this.clipDatasetName,
  17882. clipDatasourceName: this.clipDatasourceName,
  17883. isExactClip: this.isExactClip,
  17884. clipRegion: ServerGeometry_ServerGeometry.fromGeometry(this.clipRegion)
  17885. });
  17886. }
  17887. }]);
  17888. return ClipParameter;
  17889. }();
  17890. SuperMap.ClipParameter = ClipParameter_ClipParameter;
  17891. // CONCATENATED MODULE: ./src/common/iServer/ColorDictionary.js
  17892. function ColorDictionary_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17893. 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); } }
  17894. function ColorDictionary_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorDictionary_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorDictionary_defineProperties(Constructor, staticProps); return Constructor; }
  17895. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  17896. * This program are made available under the terms of the Apache License, Version 2.0
  17897. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17898. /**
  17899. * @class SuperMap.ColorDictionary
  17900. * @category iServer Map Theme
  17901. * @classdesc 颜色对照表类。
  17902. * @description 颜色对照表中的键名为具体的高程值,键值表示该高程值要显示的颜色。对于栅格图层中高程值小于颜色对照表中高程最小值的点使用颜色对照表中高程最小值对应的颜色,对于栅格图层中高程值大于颜色对照表中高程最大值的点使用颜色对照表中高程最大值对应的颜色,对于栅格图层中高程值在颜色对照表中没有对应颜色的点,则查找颜色对照表中与当前高程值相邻的两个高程对应的颜色,然后通过渐变运算要显示的颜色。如果设置了颜色对照表的话,则颜色表设置无效。
  17903. * @param {Object} options - 参数。
  17904. * @param {number} options.elevation - 高程值。
  17905. * @param {SuperMap.ServerColor} options.color - 服务端颜色类。
  17906. */
  17907. var ColorDictionary_ColorDictionary = /*#__PURE__*/function () {
  17908. function ColorDictionary(options) {
  17909. ColorDictionary_classCallCheck(this, ColorDictionary);
  17910. options = options || {};
  17911. /**
  17912. * @member {number} SuperMap.ColorDictionary.prototype.elevation
  17913. * @description 高程值。
  17914. */
  17915. this.elevation = null;
  17916. /**
  17917. * @member {SuperMap.ServerColor} SuperMap.ColorDictionary.prototype.color
  17918. * @description 服务端颜色类。
  17919. */
  17920. this.color = null;
  17921. Util_Util.extend(this, options);
  17922. var me = this,
  17923. c = me.color;
  17924. if (c) {
  17925. me.color = new ServerColor(c.red, c.green, c.blue);
  17926. }
  17927. this.CLASS_NAME = "SuperMap.ColorDictionary";
  17928. }
  17929. /**
  17930. * @function SuperMap.ColorDictionary.prototype.destroy
  17931. * @description 释放资源,将引用资源的属性置空。
  17932. */
  17933. ColorDictionary_createClass(ColorDictionary, [{
  17934. key: "destroy",
  17935. value: function destroy() {
  17936. Util_Util.reset(this);
  17937. }
  17938. /**
  17939. * @function SuperMap.ColorDictionary.prototype.toServerJSONObject
  17940. * @description 转换成对应的 JSON 格式对象。
  17941. * @returns {Object} JSON 对象。
  17942. */
  17943. }, {
  17944. key: "toServerJSONObject",
  17945. value: function toServerJSONObject() {
  17946. var dataObj = {};
  17947. dataObj = Util_Util.copyAttributes(dataObj, this);
  17948. return dataObj;
  17949. }
  17950. }]);
  17951. return ColorDictionary;
  17952. }();
  17953. SuperMap.ColorDictionary = ColorDictionary_ColorDictionary;
  17954. // CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystResultSetting.js
  17955. function TransportationAnalystResultSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17956. 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); } }
  17957. function TransportationAnalystResultSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystResultSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystResultSetting_defineProperties(Constructor, staticProps); return Constructor; }
  17958. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  17959. * This program are made available under the terms of the Apache License, Version 2.0
  17960. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17961. /**
  17962. * @class SuperMap.TransportationAnalystResultSetting
  17963. * @category iServer NetworkAnalyst
  17964. * @classdesc 交通网络分析结果参数类。
  17965. * @description 通过该类设置交通网络分析返回的结果,包括是否返回图片、是否返回弧段空间信息、是否返回结点空间信息等。
  17966. * @param {Object} options - 参数。
  17967. * @param {boolean} [options.returnEdgeFeatures=false] - 是否在分析结果中包含弧段要素集合。
  17968. * @param {boolean} [options.returnEdgeGeometry=false] - 返回的弧段要素集合中是否包含几何对象信息。
  17969. * @param {boolean} [options.returnEdgeIDs=false] - 返回结果中是否包含经过弧段 ID 集合。
  17970. * @param {boolean} [options.returnNodeFeatures=false] - 是否在分析结果中包含结点要素集合。
  17971. * @param {boolean} [options.returnNodeGeometry=false] - 返回的结点要素集合中是否包含几何对象信息。
  17972. * @param {boolean} [options.returnNodeIDs=false] - 返回结果中是否包含经过结点 ID 集合。
  17973. * @param {boolean} [options.returnPathGuides=false] - 返回分析结果中是否包含行驶导引集合。
  17974. * @param {boolean} [options.returnRoutes=false] - 返回分析结果中是否包含路由对象的集合。
  17975. */
  17976. var TransportationAnalystResultSetting_TransportationAnalystResultSetting = /*#__PURE__*/function () {
  17977. function TransportationAnalystResultSetting(options) {
  17978. TransportationAnalystResultSetting_classCallCheck(this, TransportationAnalystResultSetting);
  17979. if (!options) {
  17980. return;
  17981. }
  17982. /**
  17983. * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeFeatures
  17984. * @description 是否在分析结果中包含弧段要素集合。弧段要素包括弧段的空间信息和属性信息。
  17985. */
  17986. this.returnEdgeFeatures = false;
  17987. /**
  17988. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeGeometry=false]
  17989. * @description 返回的弧段要素集合中是否包含几何对象信息。
  17990. */
  17991. this.returnEdgeGeometry = false;
  17992. /**
  17993. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeIDs=false]
  17994. * @description 返回结果中是否包含经过弧段 ID 集合。
  17995. */
  17996. this.returnEdgeIDs = false;
  17997. /**
  17998. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeFeatures=false]
  17999. * @description 是否在分析结果中包含结点要素集合。
  18000. * 结点要素包括结点的空间信息和属性信息。其中返回的结点要素是否包含空间信息可通过 returnNodeGeometry 字段设置。
  18001. */
  18002. this.returnNodeFeatures = false;
  18003. /**
  18004. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeGeometry=false]
  18005. * @description 返回的结点要素集合中是否包含几何对象信息。
  18006. */
  18007. this.returnNodeGeometry = false;
  18008. /**
  18009. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeIDs=false]
  18010. * @description 返回结果中是否包含经过结点 ID 集合。
  18011. */
  18012. this.returnNodeIDs = false;
  18013. /**
  18014. * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnPathGuides
  18015. * @description 返回分析结果中是否包含行驶导引集合。
  18016. */
  18017. this.returnPathGuides = false;
  18018. /**
  18019. * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnRoutes
  18020. * @description 返回分析结果中是否包含路由对象的集合。
  18021. */
  18022. this.returnRoutes = false;
  18023. Util_Util.extend(this, options);
  18024. this.CLASS_NAME = "SuperMap.TransportationAnalystResultSetting";
  18025. }
  18026. /**
  18027. * @function SuperMap.TransportationAnalystResultSetting.prototype.destroy
  18028. * @description 释放资源,将引用资源的属性置空。
  18029. */
  18030. TransportationAnalystResultSetting_createClass(TransportationAnalystResultSetting, [{
  18031. key: "destroy",
  18032. value: function destroy() {
  18033. var me = this;
  18034. me.returnEdgeFeatures = null;
  18035. me.returnEdgeGeometry = null;
  18036. me.returnEdgeIDs = null;
  18037. me.returnNodeFeatures = null;
  18038. me.returnNodeGeometry = null;
  18039. me.returnNodeIDs = null;
  18040. me.returnPathGuides = null;
  18041. me.returnRoutes = null;
  18042. }
  18043. }]);
  18044. return TransportationAnalystResultSetting;
  18045. }();
  18046. SuperMap.TransportationAnalystResultSetting = TransportationAnalystResultSetting_TransportationAnalystResultSetting;
  18047. // CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystParameter.js
  18048. function TransportationAnalystParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18049. 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); } }
  18050. function TransportationAnalystParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystParameter_defineProperties(Constructor, staticProps); return Constructor; }
  18051. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  18052. * This program are made available under the terms of the Apache License, Version 2.0
  18053. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18054. /**
  18055. * @class SuperMap.TransportationAnalystParameter
  18056. * @category iServer NetworkAnalyst
  18057. * @classdesc 交通网络分析通用参数类。
  18058. * @description 该类主要用来提供交通网络分析所需的通用参数。
  18059. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息,还可以对分析结果包含的内容进行一些设置。
  18060. * @param {Object} options - 参数。
  18061. * @param {Array.<number>} options.barrierEdgeIDs - 网络分析中障碍弧段的 ID 数组。
  18062. * @param {Array.<number>} options.barrierNodeIDs - 网络分析中障碍点的 ID 数组。
  18063. * @param {string} options.turnWeightField - 转向权重字段的名称。
  18064. * @param {SuperMap.TransportationAnalystResultSetting} options.resultSetting - 分析结果返回内容。
  18065. * @param {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} [options.barrierPoints] - 网络分析中 Point2D 类型的障碍点数组。
  18066. * @param {string} [options.weightFieldName] - 阻力字段的名称。
  18067. */
  18068. var TransportationAnalystParameter_TransportationAnalystParameter = /*#__PURE__*/function () {
  18069. function TransportationAnalystParameter(options) {
  18070. TransportationAnalystParameter_classCallCheck(this, TransportationAnalystParameter);
  18071. if (!options) {
  18072. return;
  18073. }
  18074. /**
  18075. * @member {Array.<number>} SuperMap.TransportationAnalystParameter.prototype.barrierEdgeIDs
  18076. * @description 网络分析中障碍弧段的 ID 数组。弧段设置为障碍边之后,表示双向都不通。
  18077. */
  18078. this.barrierEdgeIDs = null;
  18079. /**
  18080. * @member {Array.<number>} SuperMap.TransportationAnalystParameter.prototype.barrierNodeIDs
  18081. * @description 网络分析中障碍点的 ID 数组。结点设置为障碍点之后,表示任何方向都不能通过此结点。
  18082. */
  18083. this.barrierNodeIDs = null;
  18084. /**
  18085. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.TransportationAnalystParameter.prototype.barrierPoints
  18086. * @description 网络分析中 Point2D 类型的障碍点数组。障碍点表示任何方向都不能通过此点。</br>
  18087. * 当各网络分析参数类中的 isAnalyzeById 属性设置为 false 时,该属性才生效。
  18088. */
  18089. this.barrierPoints = null;
  18090. /**
  18091. * @member {string} [SuperMap.TransportationAnalystParameter.prototype.weightFieldName]
  18092. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段,例如表示时间、长度等的字段都可以用作阻力字段。
  18093. * 该字段默值为服务器发布的所有耗费字段的第一个字段。
  18094. */
  18095. this.weightFieldName = null;
  18096. /**
  18097. * @member {string} SuperMap.TransportationAnalystParameter.prototype.turnWeightField
  18098. * @description 转向权重字段的名称。
  18099. */
  18100. this.turnWeightField = null;
  18101. /**
  18102. * @member {SuperMap.TransportationAnalystResultSetting} SuperMap.TransportationAnalystParameter.prototype.resultSetting
  18103. * @description 分析结果返回内容。
  18104. */
  18105. this.resultSetting = new TransportationAnalystResultSetting_TransportationAnalystResultSetting();
  18106. Util_Util.extend(this, options);
  18107. this.CLASS_NAME = "SuperMap.TransportationAnalystParameter";
  18108. }
  18109. /**
  18110. * @function SuperMap.TransportationAnalystParameter.prototype.destroy
  18111. * @description 释放资源,将引用资源的属性置空。
  18112. */
  18113. TransportationAnalystParameter_createClass(TransportationAnalystParameter, [{
  18114. key: "destroy",
  18115. value: function destroy() {
  18116. var me = this;
  18117. me.barrierEdgeIDs = null;
  18118. me.barrierNodeIDs = null;
  18119. me.weightFieldName = null;
  18120. me.turnWeightField = null;
  18121. if (me.resultSetting) {
  18122. me.resultSetting.destroy();
  18123. me.resultSetting = null;
  18124. }
  18125. if (me.barrierPoints && me.barrierPoints.length) {
  18126. for (var i in me.barrierPoints) {
  18127. me.barrierPoints[i].destroy();
  18128. }
  18129. }
  18130. me.barrierPoints = null;
  18131. }
  18132. }]);
  18133. return TransportationAnalystParameter;
  18134. }();
  18135. SuperMap.TransportationAnalystParameter = TransportationAnalystParameter_TransportationAnalystParameter;
  18136. // CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixParameters.js
  18137. function ComputeWeightMatrixParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18138. 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); } }
  18139. function ComputeWeightMatrixParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18140. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  18141. * This program are made available under the terms of the Apache License, Version 2.0
  18142. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18143. /**
  18144. * @class SuperMap.ComputeWeightMatrixParameters
  18145. * @category iServer NetworkAnalyst WeightMatrix
  18146. * @classdesc 耗费矩阵分析参数类。根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  18147. * @param {Object} options - 参数。
  18148. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  18149. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 要计算耗费矩阵的点数组。
  18150. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  18151. */
  18152. var ComputeWeightMatrixParameters_ComputeWeightMatrixParameters = /*#__PURE__*/function () {
  18153. function ComputeWeightMatrixParameters(options) {
  18154. ComputeWeightMatrixParameters_classCallCheck(this, ComputeWeightMatrixParameters);
  18155. /**
  18156. * @member {boolean} [SuperMap.ComputeWeightMatrixParameters.prototype.isAnalyzeById=false]
  18157. * @description 是否通过节点 ID 指定路径分析的结点,即通过坐标点指定。
  18158. */
  18159. this.isAnalyzeById = false;
  18160. /**
  18161. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.ComputeWeightMatrixParameters.prototype.nodes
  18162. * @description 要计算耗费矩阵的点数组。
  18163. * 当 {@link SuperMap.ComputeWeightMatrixParameters.isAnalyzeById} = false 时,nodes 应为点的坐标数组;
  18164. * 当 {@link SuperMap.ComputeWeightMatrixParameters.isAnalyzeById} = true 时,nodes 应为点的 ID 数组。
  18165. */
  18166. this.nodes = null;
  18167. /**
  18168. * @member {SuperMap.TransportationAnalystParameter} SuperMap.ComputeWeightMatrixParameters.prototype.parameter
  18169. * @description 交通网络分析通用参数。
  18170. */
  18171. this.parameter = new TransportationAnalystParameter_TransportationAnalystParameter();
  18172. Util_Util.extend(this, options);
  18173. this.CLASS_NAME = "SuperMap.ComputeWeightMatrixParameters";
  18174. }
  18175. /**
  18176. * @function SuperMap.ComputeWeightMatrixParameters.prototype.destroy
  18177. * @description 释放资源,将引用资源的属性置空。
  18178. */
  18179. ComputeWeightMatrixParameters_createClass(ComputeWeightMatrixParameters, [{
  18180. key: "destroy",
  18181. value: function destroy() {
  18182. var me = this;
  18183. me.isAnalyzeById = null;
  18184. me.nodes = null;
  18185. if (me.parameter) {
  18186. me.parameter.destroy();
  18187. me.parameter = null;
  18188. }
  18189. }
  18190. }]);
  18191. return ComputeWeightMatrixParameters;
  18192. }();
  18193. SuperMap.ComputeWeightMatrixParameters = ComputeWeightMatrixParameters_ComputeWeightMatrixParameters;
  18194. // CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixService.js
  18195. 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); }
  18196. function ComputeWeightMatrixService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18197. 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); } }
  18198. function ComputeWeightMatrixService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixService_defineProperties(Constructor, staticProps); return Constructor; }
  18199. 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); }
  18200. function ComputeWeightMatrixService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ComputeWeightMatrixService_getPrototypeOf(object); if (object === null) break; } return object; }
  18201. 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); }
  18202. function ComputeWeightMatrixService_setPrototypeOf(o, p) { ComputeWeightMatrixService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ComputeWeightMatrixService_setPrototypeOf(o, p); }
  18203. 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); }; }
  18204. function ComputeWeightMatrixService_possibleConstructorReturn(self, call) { if (call && (ComputeWeightMatrixService_typeof(call) === "object" || typeof call === "function")) { return call; } return ComputeWeightMatrixService_assertThisInitialized(self); }
  18205. function ComputeWeightMatrixService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18206. 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; } }
  18207. function ComputeWeightMatrixService_getPrototypeOf(o) { ComputeWeightMatrixService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ComputeWeightMatrixService_getPrototypeOf(o); }
  18208. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  18209. * This program are made available under the terms of the Apache License, Version 2.0
  18210. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18211. /**
  18212. * @class SuperMap.ComputeWeightMatrixService
  18213. * @category iServer NetworkAnalyst WeightMatrix
  18214. * @classdesc 耗费矩阵分析服务类。
  18215. * 耗费矩阵是根据交通网络分析参数中的耗费字段来计算一个二维数组,
  18216. * 用来存储指定的任意两点间的资源消耗。
  18217. * 耗费矩阵分析结果通过该类支持的事件的监听函数参数获取
  18218. * @extends {SuperMap.NetworkAnalystServiceBase}
  18219. * @example
  18220. * var mycomputeWeightMatrixService = new SuperMap.ComputeWeightMatrixService(url,{
  18221. * eventListeners: {
  18222. * "processCompleted": computeWeightMatrixCompleted,
  18223. * "processFailed": computeWeightMatrixnError
  18224. * }
  18225. * });
  18226. * @param {string} url - 耗费矩阵分析服务地址。请求服务的URL应为:
  18227. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  18228. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  18229. * @param {Object} options - 参数。
  18230. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  18231. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  18232. * @param {Object} [options.headers] - 请求头。
  18233. */
  18234. var ComputeWeightMatrixService_ComputeWeightMatrixService = /*#__PURE__*/function (_NetworkAnalystServic) {
  18235. ComputeWeightMatrixService_inherits(ComputeWeightMatrixService, _NetworkAnalystServic);
  18236. var _super = ComputeWeightMatrixService_createSuper(ComputeWeightMatrixService);
  18237. function ComputeWeightMatrixService(url, options) {
  18238. var _this;
  18239. ComputeWeightMatrixService_classCallCheck(this, ComputeWeightMatrixService);
  18240. _this = _super.call(this, url, options);
  18241. _this.CLASS_NAME = "SuperMap.ComputeWeightMatrixService";
  18242. return _this;
  18243. }
  18244. /**
  18245. * @function SuperMap.ComputeWeightMatrixService.prototype.destroy
  18246. * @override
  18247. */
  18248. ComputeWeightMatrixService_createClass(ComputeWeightMatrixService, [{
  18249. key: "destroy",
  18250. value: function destroy() {
  18251. ComputeWeightMatrixService_get(ComputeWeightMatrixService_getPrototypeOf(ComputeWeightMatrixService.prototype), "destroy", this).call(this);
  18252. }
  18253. /**
  18254. * @function SuperMap.ComputeWeightMatrixService.prototype.processAsync
  18255. * @description 负责将客户端的查询参数传递到服务端。
  18256. * @param {SuperMap.ComputeWeightMatrixParameters} params - 耗费矩阵分析参数类
  18257. */
  18258. }, {
  18259. key: "processAsync",
  18260. value: function processAsync(params) {
  18261. if (!(params instanceof ComputeWeightMatrixParameters_ComputeWeightMatrixParameters)) {
  18262. return;
  18263. }
  18264. var me = this,
  18265. jsonObject;
  18266. me.url = Util_Util.urlPathAppend(me.url, 'weightmatrix');
  18267. jsonObject = {
  18268. parameter: Util_Util.toJSON(params.parameter),
  18269. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  18270. };
  18271. me.request({
  18272. method: "GET",
  18273. params: jsonObject,
  18274. scope: me,
  18275. success: me.serviceProcessCompleted,
  18276. failure: me.serviceProcessFailed
  18277. });
  18278. }
  18279. /**
  18280. * @function SuperMap.ComputeWeightMatrixService.prototype.getJson
  18281. * @description 将对象转化为JSON字符串。
  18282. * @param {boolean} isAnalyzeById - 是否通过id分析
  18283. * @param {Array.<SuperMap.ComputeWeightMatrixParameters>} params - 分析参数数组
  18284. * @returns {string} 转化后的JSON字符串。
  18285. */
  18286. }, {
  18287. key: "getJson",
  18288. value: function getJson(isAnalyzeById, params) {
  18289. var jsonString = "[",
  18290. len = params ? params.length : 0;
  18291. if (isAnalyzeById === false) {
  18292. for (var i = 0; i < len; i++) {
  18293. if (i > 0) {
  18294. jsonString += ",";
  18295. }
  18296. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  18297. }
  18298. } else if (isAnalyzeById === true) {
  18299. for (var _i = 0; _i < len; _i++) {
  18300. if (_i > 0) {
  18301. jsonString += ",";
  18302. }
  18303. jsonString += params[_i];
  18304. }
  18305. }
  18306. jsonString += ']';
  18307. return jsonString;
  18308. }
  18309. }]);
  18310. return ComputeWeightMatrixService;
  18311. }(NetworkAnalystServiceBase_NetworkAnalystServiceBase);
  18312. SuperMap.ComputeWeightMatrixService = ComputeWeightMatrixService_ComputeWeightMatrixService;
  18313. // CONCATENATED MODULE: ./src/common/iServer/DataFlowService.js
  18314. 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); }
  18315. function DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18316. 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); } }
  18317. function DataFlowService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataFlowService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataFlowService_defineProperties(Constructor, staticProps); return Constructor; }
  18318. 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); }
  18319. function DataFlowService_setPrototypeOf(o, p) { DataFlowService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DataFlowService_setPrototypeOf(o, p); }
  18320. 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); }; }
  18321. function DataFlowService_possibleConstructorReturn(self, call) { if (call && (DataFlowService_typeof(call) === "object" || typeof call === "function")) { return call; } return DataFlowService_assertThisInitialized(self); }
  18322. function DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18323. 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; } }
  18324. function DataFlowService_getPrototypeOf(o) { DataFlowService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DataFlowService_getPrototypeOf(o); }
  18325. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  18326. * This program are made available under the terms of the Apache License, Version 2.0
  18327. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18328. /**
  18329. * @class SuperMap.DataFlowService
  18330. * @category iServer DataFlow
  18331. * @classdesc 数据流服务类
  18332. * @extends {SuperMap.CommonServiceBase}
  18333. * @param {string} url - 数据流服务地址
  18334. * @param {Object} options - 参数。
  18335. * @param {function} options.style - 设置数据加载样式。
  18336. * @param {function} [options.onEachFeature] - 设置每个数据加载popup等。
  18337. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  18338. * @param {Object} [options.excludeField] - -排除字段。
  18339. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  18340. * @param {Object} [options.headers] - 请求头。
  18341. */
  18342. var DataFlowService_DataFlowService = /*#__PURE__*/function (_CommonServiceBase) {
  18343. DataFlowService_inherits(DataFlowService, _CommonServiceBase);
  18344. var _super = DataFlowService_createSuper(DataFlowService);
  18345. function DataFlowService(url, options) {
  18346. var _this;
  18347. DataFlowService_classCallCheck(this, DataFlowService);
  18348. options = options || {};
  18349. /*
  18350. * @constant EVENT_TYPES
  18351. * {Array.<string>}
  18352. * 此类支持的事件类型
  18353. */
  18354. options.EVENT_TYPES = ["broadcastSocketConnected", "broadcastSocketError", "broadcastFailed", "broadcastSucceeded", "subscribeSocketConnected", "subscribeSocketError", "messageSucceeded", "setFilterParamSucceeded"];
  18355. _this = _super.call(this, url, options);
  18356. /**
  18357. * @member {GeoJSONObject} SuperMap.DataFlowService.prototype.geometry
  18358. * @description 指定几何范围,该范围内的要素才能被订阅。
  18359. */
  18360. _this.geometry = null;
  18361. /**
  18362. * @member {Object} SuperMap.DataFlowService.prototype.prjCoordSys
  18363. * @description 动态投影参数
  18364. */
  18365. _this.prjCoordSys = null;
  18366. /**
  18367. * @member {Object} SuperMap.DataFlowService.prototype.excludeField
  18368. * @description 排除字段
  18369. */
  18370. _this.excludeField = null;
  18371. Util_Util.extend(DataFlowService_assertThisInitialized(_this), options);
  18372. _this.CLASS_NAME = "SuperMap.DataFlowService";
  18373. return _this;
  18374. }
  18375. /**
  18376. * @function SuperMap.DataFlowService.prototype.initBroadcast
  18377. * @description 初始化广播
  18378. * @returns {SuperMap.DataFlowService}
  18379. */
  18380. DataFlowService_createClass(DataFlowService, [{
  18381. key: "initBroadcast",
  18382. value: function initBroadcast() {
  18383. var me = this;
  18384. this.broadcastWebSocket = this._connect(Util_Util.urlPathAppend(me.url, 'broadcast'));
  18385. this.broadcastWebSocket.onopen = function (e) {
  18386. me.broadcastWebSocket.isOpen = true;
  18387. e.eventType = 'broadcastSocketConnected';
  18388. me.events.triggerEvent('broadcastSocketConnected', e);
  18389. };
  18390. this.broadcastWebSocket.onclose = function (e) {
  18391. me.broadcastWebSocket.isOpen = false;
  18392. e.eventType = 'broadcastSocketConnected';
  18393. me.events.triggerEvent('broadcastSocketConnected', e);
  18394. };
  18395. this.broadcastWebSocket.onerror = function (e) {
  18396. e.eventType = 'broadcastSocketError';
  18397. me.events.triggerEvent('broadcastSocketError', e);
  18398. };
  18399. return this;
  18400. }
  18401. /**
  18402. * @function SuperMap.DataFlowService.prototype.broadcast
  18403. * @description 加载广播数据。
  18404. * @param {GeoJSONObject} geoJSONFeature - JSON 格式的要素数据。
  18405. */
  18406. }, {
  18407. key: "broadcast",
  18408. value: function broadcast(geoJSONFeature) {
  18409. if (!this.broadcastWebSocket || !this.broadcastWebSocket.isOpen) {
  18410. this.events.triggerEvent('broadcastFailed');
  18411. return;
  18412. }
  18413. this.broadcastWebSocket.send(JSON.stringify(geoJSONFeature));
  18414. this.events.triggerEvent('broadcastSucceeded');
  18415. }
  18416. /**
  18417. * @function SuperMap.DataFlowService.prototype.initSubscribe
  18418. * @description 初始化订阅数据
  18419. * @returns {this} this
  18420. */
  18421. }, {
  18422. key: "initSubscribe",
  18423. value: function initSubscribe() {
  18424. var me = this;
  18425. this.subscribeWebSocket = this._connect(Util_Util.urlPathAppend(me.url, 'subscribe'));
  18426. this.subscribeWebSocket.onopen = function (e) {
  18427. me.subscribeWebSocket.send(me._getFilterParams());
  18428. e.eventType = 'subscribeSocketConnected';
  18429. me.events.triggerEvent('subscribeSocketConnected', e);
  18430. };
  18431. this.subscribeWebSocket.onerror = function (e) {
  18432. e.eventType = 'subscribeSocketError';
  18433. me.events.triggerEvent('subscribeSocketError', e);
  18434. };
  18435. this.subscribeWebSocket.onmessage = function (e) {
  18436. me._onMessage(e);
  18437. };
  18438. return this;
  18439. }
  18440. /**
  18441. * @function SuperMap.DataFlowService.prototype.setExcludeField
  18442. * @description 设置排除字段
  18443. * @param {Object} excludeField - 排除字段
  18444. * @returns {this} this
  18445. */
  18446. }, {
  18447. key: "setExcludeField",
  18448. value: function setExcludeField(excludeField) {
  18449. this.excludeField = excludeField;
  18450. this.subscribeWebSocket.send(this._getFilterParams());
  18451. return this;
  18452. }
  18453. /**
  18454. * @function SuperMap.DataFlowService.prototype.setGeometry
  18455. * @description 设置添加的几何要素数据
  18456. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  18457. * @returns {this} this
  18458. */
  18459. }, {
  18460. key: "setGeometry",
  18461. value: function setGeometry(geometry) {
  18462. this.geometry = geometry;
  18463. this.subscribeWebSocket.send(this._getFilterParams());
  18464. return this;
  18465. }
  18466. /**
  18467. * @function SuperMap.DataFlowService.prototype.unSubscribe
  18468. * @description 结束订阅数据
  18469. */
  18470. }, {
  18471. key: "unSubscribe",
  18472. value: function unSubscribe() {
  18473. if (!this.subscribeWebSocket) {
  18474. return;
  18475. }
  18476. this.subscribeWebSocket.close();
  18477. this.subscribeWebSocket = null;
  18478. }
  18479. /**
  18480. * @function SuperMap.DataFlowService.prototype.unBroadcast
  18481. * @description 结束加载广播
  18482. */
  18483. }, {
  18484. key: "unBroadcast",
  18485. value: function unBroadcast() {
  18486. if (!this.broadcastWebSocket) {
  18487. return;
  18488. }
  18489. this.broadcastWebSocket.close();
  18490. this.broadcastWebSocket = null;
  18491. }
  18492. /**
  18493. * @function SuperMap.DataFlowService.prototype.destroy
  18494. * @override
  18495. */
  18496. }, {
  18497. key: "destroy",
  18498. value: function destroy() {
  18499. CommonServiceBase_CommonServiceBase.prototype.destroy.apply(this, arguments);
  18500. var me = this;
  18501. me.geometry = null;
  18502. me.prjCoordSys = null;
  18503. me.excludeField = null;
  18504. this.unBroadcast();
  18505. this.unSubscribe();
  18506. }
  18507. }, {
  18508. key: "_getFilterParams",
  18509. value: function _getFilterParams() {
  18510. var filter = {
  18511. filterParam: {
  18512. prjCoordSys: this.prjCoordSys,
  18513. excludeField: this.excludeField,
  18514. geometry: this.geometry
  18515. }
  18516. };
  18517. return Util_Util.toJSON(filter);
  18518. }
  18519. }, {
  18520. key: "_onMessage",
  18521. value: function _onMessage(e) {
  18522. if (e.data && e.data.indexOf("filterParam") >= 0) {
  18523. var filterParam = JSON.parse(e.data);
  18524. e.filterParam = filterParam;
  18525. e.eventType = 'setFilterParamSucceeded';
  18526. this.events.triggerEvent('setFilterParamSucceeded', e);
  18527. return;
  18528. }
  18529. var feature = JSON.parse(e.data);
  18530. e.featureResult = feature;
  18531. e.eventType = 'messageSucceeded';
  18532. this.events.triggerEvent('messageSucceeded', e);
  18533. }
  18534. }, {
  18535. key: "_connect",
  18536. value: function _connect(url) {
  18537. url = this._appendCredentials(url);
  18538. if ("WebSocket" in window) {
  18539. return new WebSocket(url);
  18540. } else if ("MozWebSocket" in window) {
  18541. var mozWebSocket = window.MozWebSocket;
  18542. return new mozWebSocket(url);
  18543. } else {
  18544. console.log("no WebSocket");
  18545. return null;
  18546. }
  18547. }
  18548. }, {
  18549. key: "_appendCredentials",
  18550. value: function _appendCredentials(url) {
  18551. var token = SecurityManager_SecurityManager.getToken(url);
  18552. if (token) {
  18553. url = Util_Util.urlAppend(url, "token=" + token);
  18554. }
  18555. return url;
  18556. }
  18557. }]);
  18558. return DataFlowService;
  18559. }(CommonServiceBase_CommonServiceBase);
  18560. SuperMap.DataFlowService = DataFlowService_DataFlowService;
  18561. // CONCATENATED MODULE: ./src/common/iServer/DatasetInfo.js
  18562. function DatasetInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18563. 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); } }
  18564. function DatasetInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetInfo_defineProperties(Constructor, staticProps); return Constructor; }
  18565. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  18566. * This program are made available under the terms of the Apache License, Version 2.0
  18567. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18568. /**
  18569. * @class SuperMap.DatasetInfo
  18570. * @category iServer Data
  18571. * @classdesc 数据集信息类。
  18572. * @description 数据集一般为存储在一起的相关数据的集合;根据数据类型的不同,分为矢量数据集、栅格数据集(griddataset)和
  18573. * 影像数据集(image dataset),以及为了处理特定问题而设计的数据集,如拓扑数据集,网络数据集等。
  18574. * 数据集是 GIS 数据组织的最小单位。其中矢量数据集是由同种类型空间要素组成的集合,
  18575. * 所以也可以称为要素集。根据要素的空间特征的不同,矢量数据集又分为点数据集,
  18576. * 线数据集,面数据集等,各矢量数据集是空间特征和性质相同的数据组织起来的集合。
  18577. * 目前版本支持的数据集主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、
  18578. * 网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  18579. * @param {Object} options - 参数。
  18580. * @param {SuperMap.Bounds} [options.bounds] - 数据集范围,该字段只读。
  18581. * @param {string} [options.dataSourceName] - 数据源名称,该字段只读。
  18582. * @param {string} [options.description] - 数据集的描述信息。
  18583. * @param {string} [options.encodeType] - 数据集存储时的压缩编码方式,该字段只读。
  18584. * @param {boolean} [options.isReadOnly] - 数据集是否为只读。
  18585. * @param {string} options.name - 数据集名称,该字段必须且只读。
  18586. * @param {SuperMap.Projection} [options.prjCoordSys] - 数据集的投影信息。
  18587. * @param {string} [options.tableName] - 表名,该字段只读。
  18588. * @param {string} options.type - 数据集类型。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  18589. */
  18590. var DatasetInfo_DatasetInfo = /*#__PURE__*/function () {
  18591. function DatasetInfo(options) {
  18592. DatasetInfo_classCallCheck(this, DatasetInfo);
  18593. options = options || {};
  18594. /**
  18595. * @member {SuperMap.Bounds} [SuperMap.DatasetInfo.prototype.bounds]
  18596. * @description 数据集范围,该字段只读。
  18597. */
  18598. this.bounds = null;
  18599. /**
  18600. * @member {string} [SuperMap.DatasetInfo.prototype.dataSourceName]
  18601. * @description 数据源名称,该字段只读。
  18602. */
  18603. this.dataSourceName = null;
  18604. /**
  18605. * @member {string} [SuperMap.DatasetInfo.prototype.description]
  18606. * @description 数据集的描述信息。
  18607. */
  18608. this.description = null;
  18609. /**
  18610. * @member {string} [SuperMap.DatasetInfo.prototype.encodeType]
  18611. * @description 数据集存储时的压缩编码方式,该字段只读。
  18612. */
  18613. this.encodeType = null;
  18614. /**
  18615. * @member {boolean} [SuperMap.DatasetInfo.prototype.isReadOnly]
  18616. * @description 数据集是否为只读。
  18617. */
  18618. this.isReadOnly = null;
  18619. /**
  18620. * @member {string} SuperMap.DatasetInfo.prototype.name
  18621. * @description 数据集名称,该字段必须且只读。
  18622. */
  18623. this.name = null;
  18624. /**
  18625. * @member {SuperMap.Projection} [SuperMap.DatasetInfo.prototype.prjCoordSys]
  18626. * @description 数据集的投影信息。
  18627. */
  18628. this.prjCoordSys = null;
  18629. /**
  18630. * @member {string} [SuperMap.DatasetInfo.prototype.tableName]
  18631. * @description 表名,该字段只读。
  18632. */
  18633. this.tableName = null;
  18634. /**
  18635. * @member {string} SuperMap.DatasetInfo.prototype.type
  18636. * @description 数据集类型,该字段必设。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  18637. */
  18638. this.type = null;
  18639. Util_Util.extend(this, options);
  18640. var b = this.bounds;
  18641. if (b) {
  18642. this.bounds = new Bounds_Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  18643. }
  18644. this.CLASS_NAME = "SuperMap.DatasetInfo";
  18645. }
  18646. /**
  18647. * @function SuperMap.DatasetInfo.prototype.destroy
  18648. * @description 释放资源,将引用资源的属性置空。
  18649. */
  18650. DatasetInfo_createClass(DatasetInfo, [{
  18651. key: "destroy",
  18652. value: function destroy() {
  18653. Util_Util.reset(this);
  18654. }
  18655. /**
  18656. * @function SuperMap.DatasetInfo.prototype.toServerJSONObject
  18657. * @description 转换成对应的 JSON 格式对象。
  18658. * @returns {Object} JSON 对象。
  18659. */
  18660. }, {
  18661. key: "toServerJSONObject",
  18662. value: function toServerJSONObject() {
  18663. var dataObj = {};
  18664. dataObj = Util_Util.copyAttributes(dataObj, this);
  18665. if (dataObj.bounds) {
  18666. if (dataObj.bounds.toServerJSONObject) {
  18667. dataObj.bounds = dataObj.bounds.toServerJSONObject();
  18668. }
  18669. }
  18670. return dataObj;
  18671. }
  18672. }]);
  18673. return DatasetInfo;
  18674. }();
  18675. SuperMap.DatasetInfo = DatasetInfo_DatasetInfo;
  18676. // CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystParameters.js
  18677. function OverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18678. 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); } }
  18679. function OverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18680. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  18681. * This program are made available under the terms of the Apache License, Version 2.0
  18682. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18683. /**
  18684. * @class SuperMap.OverlayAnalystParameters
  18685. * @category iServer SpatialAnalyst OverlayAnalyst
  18686. * @classdesc 叠加分析参数基类。数据集叠加分析参数和几何对象叠加分析参数均继承此基类。
  18687. * @param {Object} options - 参数。
  18688. */
  18689. var OverlayAnalystParameters_OverlayAnalystParameters = /*#__PURE__*/function () {
  18690. function OverlayAnalystParameters(options) {
  18691. OverlayAnalystParameters_classCallCheck(this, OverlayAnalystParameters);
  18692. /**
  18693. * @member {SuperMap.OverlayOperationType} [SuperMap.OverlayAnalystParameters.prototype.operation=SuperMap.OverlayOperationType.UNION]
  18694. * @description 指定叠加分析操作类型。
  18695. */
  18696. this.operation = OverlayOperationType.UNION;
  18697. if (options) {
  18698. Util_Util.extend(this, options);
  18699. }
  18700. this.CLASS_NAME = "SuperMap.OverlayAnalystParameters";
  18701. }
  18702. /**
  18703. * @function SuperMap.OverlayAnalystParameters.prototype.destroy
  18704. * @description 释放资源,将引用资源的属性置空。
  18705. */
  18706. OverlayAnalystParameters_createClass(OverlayAnalystParameters, [{
  18707. key: "destroy",
  18708. value: function destroy() {
  18709. var me = this;
  18710. me.operation = null;
  18711. }
  18712. }]);
  18713. return OverlayAnalystParameters;
  18714. }();
  18715. SuperMap.OverlayAnalystParameters = OverlayAnalystParameters_OverlayAnalystParameters;
  18716. // CONCATENATED MODULE: ./src/common/iServer/DatasetOverlayAnalystParameters.js
  18717. 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); }
  18718. function DatasetOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18719. 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); } }
  18720. function DatasetOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetOverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18721. 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); }
  18722. function DatasetOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  18723. 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); }
  18724. function DatasetOverlayAnalystParameters_setPrototypeOf(o, p) { DatasetOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetOverlayAnalystParameters_setPrototypeOf(o, p); }
  18725. 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); }; }
  18726. function DatasetOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetOverlayAnalystParameters_assertThisInitialized(self); }
  18727. function DatasetOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18728. 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; } }
  18729. function DatasetOverlayAnalystParameters_getPrototypeOf(o) { DatasetOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetOverlayAnalystParameters_getPrototypeOf(o); }
  18730. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  18731. * This program are made available under the terms of the Apache License, Version 2.0
  18732. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18733. /**
  18734. * @class SuperMap.DatasetOverlayAnalystParameters
  18735. * @category iServer SpatialAnalyst OverlayAnalyst
  18736. * @classdesc 数据集叠加分析参数类。
  18737. * @param {Object} options - 参数。
  18738. * @param {string} options.operateDataset - 叠加分析中操作数据集的名称。
  18739. * @param {string} options.sourceDataset - 叠加分析中源数据集的名称。
  18740. * @param {Array.<string>} [options.operateDatasetFields] - 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  18741. * @param {SuperMap.FilterParameter} [options.operateDatasetFilter] - 设置操作数据集中空间对象过滤条件。
  18742. * @param {Array.<SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon>} [options.operateRegions] - 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  18743. * @param {Array.<string>} [options.sourceDatasetFields] - 叠加分析中源数据集保留在结果数据集中的字段名列表。
  18744. * @param {SuperMap.FilterParameter} [options.sourceDatasetFilter] - 设置源数据集中空间对象过滤条件。
  18745. * @param {number} [options.tolerance=0] - 容限。
  18746. * @param {SuperMap.OverlayOperationType} options.operation - 叠加操作枚举值。
  18747. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  18748. * @extends {SuperMap.GetFeaturesParametersBase}
  18749. */
  18750. var DatasetOverlayAnalystParameters_DatasetOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  18751. DatasetOverlayAnalystParameters_inherits(DatasetOverlayAnalystParameters, _OverlayAnalystParame);
  18752. var _super = DatasetOverlayAnalystParameters_createSuper(DatasetOverlayAnalystParameters);
  18753. function DatasetOverlayAnalystParameters(options) {
  18754. var _this;
  18755. DatasetOverlayAnalystParameters_classCallCheck(this, DatasetOverlayAnalystParameters);
  18756. _this = _super.call(this, options);
  18757. /**
  18758. * @member {string} SuperMap.DatasetOverlayAnalystParameters.prototype.operateDataset
  18759. * @description 叠加分析中操作数据集的名称。
  18760. */
  18761. _this.operateDataset = null;
  18762. /**
  18763. * @member {Array.<string>} [SuperMap.DatasetOverlayAnalystParameters.prototype.operateDatasetFields]
  18764. * @description 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  18765. */
  18766. _this.operateDatasetFields = [];
  18767. /**
  18768. * @member {SuperMap.FilterParameter} SuperMap.DatasetOverlayAnalystParameters.prototype.operateDatasetFilter
  18769. * @description 设置操作数据集中空间对象过滤条件。
  18770. */
  18771. _this.operateDatasetFilter = new FilterParameter_FilterParameter();
  18772. /**
  18773. * @member {Array.<SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon>} [SuperMap.DatasetOverlayAnalystParameters.prototype.operateRegions]
  18774. * @description 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  18775. */
  18776. _this.operateRegions = [];
  18777. /**
  18778. * @member {string} SuperMap.DatasetOverlayAnalystParameters.prototype.sourceDataset
  18779. * @description 叠加分析中源数据集的名称。
  18780. */
  18781. _this.sourceDataset = null;
  18782. /**
  18783. * @member {Array.<string>} [SuperMap.DatasetOverlayAnalystParameters.prototype.sourceDatasetFields]
  18784. * @description 叠加分析中源数据集保留在结果数据集中的字段名列表。
  18785. */
  18786. _this.sourceDatasetFields = [];
  18787. /**
  18788. * @member {SuperMap.FilterParameter} [SuperMap.DatasetOverlayAnalystParameters.prototype.filterQueryParameter]
  18789. * @description 设置源数据集中空间对象过滤条件。
  18790. */
  18791. _this.sourceDatasetFilter = new FilterParameter_FilterParameter();
  18792. /**
  18793. * @member {number} [SuperMap.DatasetOverlayAnalystParameters.prototype.tolerance=0]
  18794. * @description 容限。
  18795. */
  18796. _this.tolerance = 0;
  18797. /**
  18798. * @member {SuperMap.DataReturnOption} [SuperMap.DatasetOverlayAnalystParameters.prototype.resultSetting]
  18799. * @description 结果返回设置类。
  18800. */
  18801. _this.resultSetting = new DataReturnOption_DataReturnOption();
  18802. Util_Util.extend(DatasetOverlayAnalystParameters_assertThisInitialized(_this), options);
  18803. _this.CLASS_NAME = "SuperMap.DatasetOverlayAnalystParameters";
  18804. return _this;
  18805. }
  18806. /**
  18807. * @function SuperMap.DatasetOverlayAnalystParameters.prototype.destroy
  18808. * @override
  18809. */
  18810. DatasetOverlayAnalystParameters_createClass(DatasetOverlayAnalystParameters, [{
  18811. key: "destroy",
  18812. value: function destroy() {
  18813. DatasetOverlayAnalystParameters_get(DatasetOverlayAnalystParameters_getPrototypeOf(DatasetOverlayAnalystParameters.prototype), "destroy", this).call(this);
  18814. var me = this;
  18815. me.operateDataset = null;
  18816. me.operateDatasetFields = null;
  18817. if (me.operateDatasetFilter) {
  18818. me.operateDatasetFilter.destroy();
  18819. me.operateDatasetFilter = null;
  18820. }
  18821. if (me.operateRegions) {
  18822. for (var i = 0, opRegions = me.operateRegions, len = opRegions.length; i < len; i++) {
  18823. opRegions[i].destroy();
  18824. }
  18825. me.operateRegions = null;
  18826. }
  18827. me.sourceDataset = null;
  18828. me.sourceDatasetFields = null;
  18829. if (me.sourceDatasetFilter) {
  18830. me.sourceDatasetFilter.destroy();
  18831. me.sourceDatasetFilter = null;
  18832. }
  18833. me.tolerance = null;
  18834. if (me.resultSetting) {
  18835. me.resultSetting.destroy();
  18836. me.resultSetting = null;
  18837. }
  18838. }
  18839. /**
  18840. * @function SuperMap.DatasetOverlayAnalystParameters.toObject
  18841. * @param {SuperMap.DatasetOverlayAnalystParameters} datasetOverlayAnalystParameters - 数据集叠加分析参数类。
  18842. * @param {SuperMap.DatasetOverlayAnalystParameters} tempObj - 数据集叠加分析参数对象。
  18843. * @description 将数据集叠加分析参数类转换为 JSON 对象。
  18844. * @returns {Object} JSON 对象。
  18845. */
  18846. }], [{
  18847. key: "toObject",
  18848. value: function toObject(datasetOverlayAnalystParameters, tempObj) {
  18849. for (var name in datasetOverlayAnalystParameters) {
  18850. if (name === "sourceDataset") {
  18851. continue;
  18852. } else if (name === "operateRegions") {
  18853. tempObj.operateRegions = [];
  18854. var ors = datasetOverlayAnalystParameters.operateRegions;
  18855. for (var index in ors) {
  18856. if (ors.hasOwnProperty(index)) {
  18857. //icl542
  18858. tempObj.operateRegions[index] = ServerGeometry_ServerGeometry.fromGeometry(ors[index]);
  18859. }
  18860. }
  18861. } else if (name === "resultSetting") {
  18862. tempObj.dataReturnOption = datasetOverlayAnalystParameters.resultSetting;
  18863. } else {
  18864. tempObj[name] = datasetOverlayAnalystParameters[name];
  18865. }
  18866. }
  18867. }
  18868. }]);
  18869. return DatasetOverlayAnalystParameters;
  18870. }(OverlayAnalystParameters_OverlayAnalystParameters);
  18871. SuperMap.DatasetOverlayAnalystParameters = DatasetOverlayAnalystParameters_DatasetOverlayAnalystParameters;
  18872. // CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParametersSetting.js
  18873. function SurfaceAnalystParametersSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18874. 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); } }
  18875. function SurfaceAnalystParametersSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParametersSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParametersSetting_defineProperties(Constructor, staticProps); return Constructor; }
  18876. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  18877. * This program are made available under the terms of the Apache License, Version 2.0
  18878. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18879. /**
  18880. * @class SuperMap.SurfaceAnalystParametersSetting
  18881. * @category iServer SpatialAnalyst SurfaceAnalyst
  18882. * @classdesc 表面分析参数设置类。
  18883. * 通过该类可以设置表面分析提取等值线、提取等值面的一些参数,包括基准值、等值距、光滑度、光滑方法等。
  18884. * @param {Object} options - 参数。
  18885. * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.clipRegion] - 获取或设置裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  18886. * @param {number} [options.datumValue=0] - 获取或设置表面分析中提取等值线、提取等值面的基准值。
  18887. * @param {Array.<number>} options.expectedZValues - 获取或设置期望分析结果的 Z 值集合。
  18888. * @param {number} [options.interval=0] - 获取或设置等值距。等值距是两条等值线之间的间隔值。
  18889. * @param {number} [options.resampleTolerance=0] - 获取或设置重采样容限。
  18890. * @param {SuperMap.SmoothMethod} [options.smoothMethod=SuperMap.SmoothMethod.BSPLINE] - 获取或设置光滑处理所使用的方法。
  18891. * @param {number} [options.smoothness=0] - 获取或设置表面分析中等值线或等值面的边界线的光滑度。
  18892. */
  18893. var SurfaceAnalystParametersSetting_SurfaceAnalystParametersSetting = /*#__PURE__*/function () {
  18894. function SurfaceAnalystParametersSetting(options) {
  18895. SurfaceAnalystParametersSetting_classCallCheck(this, SurfaceAnalystParametersSetting);
  18896. /**
  18897. * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.SurfaceAnalystParametersSetting.prototype.clipRegion]
  18898. * @description 获取或设置裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  18899. */
  18900. this.clipRegion = null;
  18901. /**
  18902. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.datumValue=0]
  18903. * @description 获取或设置表面分析中提取等值线、提取等值面的基准值。
  18904. * 基准值是作为一个生成等值线的初始起算值,并不一定是最小等值线的值。 例如,高程范围为 220 -1550 的 DEM 栅格数据,
  18905. * 如果设基准值为 0, 等值距为 50,则提取等值线时,以基准值 0 为起点,等值距 50 为间隔提取等值线,
  18906. * 因为给定高程的最小值是 220,所以,在给定范围内提取等值线的最小高程是 250。
  18907. * 提取等值线的结果是:最小等值线值为 250,最大等值线值为 1550。
  18908. */
  18909. this.datumValue = 0;
  18910. /**
  18911. * @member {Array.<number>} SuperMap.SurfaceAnalystParametersSetting.prototype.expectedZValues
  18912. * @description 获取或设置期望分析结果的 Z 值集合。
  18913. * Z 值集合存储一系列数值,该数值为待提取等值线的值。即仅高程值在 Z 值集合中的等值线会被提取。
  18914. */
  18915. this.expectedZValues = null;
  18916. /**
  18917. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.interval=0]
  18918. * @description 获取或设置等值距。等值距是两条等值线之间的间隔值。
  18919. */
  18920. this.interval = 0;
  18921. /**
  18922. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.resampleTolerance=0]
  18923. * @description 获取或设置重采样容限。
  18924. * 容限值越大,采样结果数据越简化。当分析结果出现交叉时,可通过调整重采样容限为较小的值来处理。
  18925. */
  18926. this.resampleTolerance = 0;
  18927. /**
  18928. * @member {SuperMap.SmoothMethod} [SuperMap.SurfaceAnalystParametersSetting.prototype.smoothMethod=SuperMap.SmoothMethod.BSPLINE]
  18929. * @description 获取或设置光滑处理所使用的方法。
  18930. */
  18931. this.smoothMethod = SmoothMethod.BSPLINE;
  18932. /**
  18933. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.smoothness=0]
  18934. * @description 获取或设置表面分析中等值线或等值面的边界线的光滑度。
  18935. * 以为 0-5 为例,光滑度为 0 表示不进行光滑操作,值越大表示光滑度越高。
  18936. * 随着光滑度的增加,提取的等值线越光滑.当然光滑度越大,
  18937. * 计算所需的时间和占用的内存也就越大。而且,当等值距较小时,
  18938. * 光滑度太高会出现等值线相交的问题。
  18939. */
  18940. this.smoothness = 0;
  18941. if (options) {
  18942. Util_Util.extend(this, options);
  18943. }
  18944. this.CLASS_NAME = "SuperMap.SurfaceAnalystParametersSetting";
  18945. }
  18946. /**
  18947. * @function SuperMap.SurfaceAnalystParametersSetting.prototype.destroy
  18948. * @description 释放资源,将引用资源的属性置空。
  18949. */
  18950. SurfaceAnalystParametersSetting_createClass(SurfaceAnalystParametersSetting, [{
  18951. key: "destroy",
  18952. value: function destroy() {
  18953. var me = this;
  18954. if (me.clipRegion) {
  18955. me.clipRegion.destroy();
  18956. me.clipRegion = null;
  18957. }
  18958. me.datumValue = null;
  18959. me.expectedZValues = null;
  18960. me.interval = null;
  18961. me.resampleTolerance = null;
  18962. me.smoothMethod = null;
  18963. me.smoothness = null;
  18964. }
  18965. /**
  18966. * @function SuperMap.SurfaceAnalystParametersSetting.prototype.toJSON
  18967. * @description 将对象转化为 JSON 字符串。
  18968. * @returns {string} 对象 JSON 字符串。
  18969. */
  18970. }, {
  18971. key: "toJSON",
  18972. value: function toJSON() {
  18973. var json = "'datumValue':" + Util_Util.toJSON(this.datumValue);
  18974. json += ",'interval':" + Util_Util.toJSON(this.interval);
  18975. json += ",'resampleTolerance':" + Util_Util.toJSON(this.resampleTolerance);
  18976. json += ",'smoothMethod':" + Util_Util.toJSON(this.smoothMethod);
  18977. json += ",'smoothness':" + Util_Util.toJSON(this.smoothness);
  18978. if (this.expectedZValues != null) {
  18979. json += "," + "'expectedZValues':" + Util_Util.toJSON(this.expectedZValues);
  18980. }
  18981. if (this.clipRegion != null) {
  18982. var serverGeometry = this.clipRegion;
  18983. if (this.clipRegion instanceof Geometry_Geometry && this.clipRegion.components) {
  18984. serverGeometry = ServerGeometry_ServerGeometry.fromGeometry(this.clipRegion);
  18985. }
  18986. json += ",'clipRegion':" + Util_Util.toJSON(serverGeometry);
  18987. }
  18988. return "{" + json + "}";
  18989. }
  18990. }]);
  18991. return SurfaceAnalystParametersSetting;
  18992. }();
  18993. SuperMap.SurfaceAnalystParametersSetting = SurfaceAnalystParametersSetting_SurfaceAnalystParametersSetting;
  18994. // CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParameters.js
  18995. function SurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18996. 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); } }
  18997. function SurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18998. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  18999. * This program are made available under the terms of the Apache License, Version 2.0
  19000. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19001. /**
  19002. * @class SuperMap.SurfaceAnalystParameters
  19003. * @category iServer SpatialAnalyst SurfaceAnalyst
  19004. * @classdesc 表面分析提取操作参数类。
  19005. * @description 通过该类可以为进行表面分析提供参数信息,包括表面分析的方法提取等值线、提取等值面和中间结果的分辨率,
  19006. * {@link SuperMap.DatasetSurfaceAnalystParameters} 和 {@link SuperMap.GeometrySurfaceAnalystParameters} 继承自该类。
  19007. * @param {Object} options - 参数。
  19008. * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 获取或设置表面分析参数。
  19009. * @param {number} options.resolution - 指定中间结果(栅格数据集)的分辨率。
  19010. * @param {SuperMap.DataReturnOption} options.resultSetting - 结果返回设置类。
  19011. * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  19012. */
  19013. var SurfaceAnalystParameters_SurfaceAnalystParameters = /*#__PURE__*/function () {
  19014. function SurfaceAnalystParameters(options) {
  19015. SurfaceAnalystParameters_classCallCheck(this, SurfaceAnalystParameters);
  19016. /**
  19017. * @member {number} SuperMap.SurfaceAnalystParameters.prototype.resolution
  19018. * @description 获取或设置指定中间结果(栅格数据集)的分辨率。
  19019. */
  19020. this.resolution = 0;
  19021. /**
  19022. * @member {SuperMap.SurfaceAnalystParametersSetting} SuperMap.SurfaceAnalystParameters.prototype.extractParameter
  19023. * @description 获取或设置表面分析参数。
  19024. * 在进行点数据集进行提取等值面分析时,暂时不支持 SurfaceAnalystParametersSetting 类中的 expectedZValues 字段。
  19025. */
  19026. this.extractParameter = new SurfaceAnalystParametersSetting_SurfaceAnalystParametersSetting();
  19027. /**
  19028. * @member {SuperMap.DataReturnOption} SuperMap.SurfaceAnalystParameters.prototype.resultSetting
  19029. * @description 结果返回设置类。
  19030. */
  19031. this.resultSetting = new DataReturnOption_DataReturnOption();
  19032. /**
  19033. * @member {SuperMap.SurfaceAnalystMethod} [SuperMap.SurfaceAnalystParameters.prototype.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE]
  19034. * @description 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  19035. */
  19036. this.surfaceAnalystMethod = SurfaceAnalystMethod.ISOLINE;
  19037. if (options) {
  19038. Util_Util.extend(this, options);
  19039. }
  19040. this.CLASS_NAME = "SuperMap.SurfaceAnalystParameters";
  19041. }
  19042. /**
  19043. * @function SuperMap.SurfaceAnalystParameters.prototype.destroy
  19044. * @description 释放资源,将引用资源的属性置空。
  19045. */
  19046. SurfaceAnalystParameters_createClass(SurfaceAnalystParameters, [{
  19047. key: "destroy",
  19048. value: function destroy() {
  19049. var me = this;
  19050. me.resolution = null;
  19051. if (me.extractParameter) {
  19052. me.extractParameter.destroy();
  19053. me.extractParameter = null;
  19054. }
  19055. if (me.resultSetting) {
  19056. me.resultSetting.destroy();
  19057. me.resultSetting = null;
  19058. }
  19059. me.surfaceAnalystMethod = null;
  19060. }
  19061. }]);
  19062. return SurfaceAnalystParameters;
  19063. }();
  19064. SuperMap.SurfaceAnalystParameters = SurfaceAnalystParameters_SurfaceAnalystParameters;
  19065. // CONCATENATED MODULE: ./src/common/iServer/DatasetSurfaceAnalystParameters.js
  19066. 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); }
  19067. function DatasetSurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19068. 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); } }
  19069. function DatasetSurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19070. 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); }
  19071. function DatasetSurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetSurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  19072. 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); }
  19073. function DatasetSurfaceAnalystParameters_setPrototypeOf(o, p) { DatasetSurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetSurfaceAnalystParameters_setPrototypeOf(o, p); }
  19074. 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); }; }
  19075. function DatasetSurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetSurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetSurfaceAnalystParameters_assertThisInitialized(self); }
  19076. function DatasetSurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19077. 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; } }
  19078. function DatasetSurfaceAnalystParameters_getPrototypeOf(o) { DatasetSurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetSurfaceAnalystParameters_getPrototypeOf(o); }
  19079. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  19080. * This program are made available under the terms of the Apache License, Version 2.0
  19081. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19082. /**
  19083. * @class SuperMap.DatasetSurfaceAnalystParameters
  19084. * @category iServer SpatialAnalyst SurfaceAnalyst
  19085. * @classdesc 数据集表面分析参数类。该类对数据集表面分析所用到的参数进行设置。
  19086. * @param {Object} options - 参数。
  19087. * @param {string} options.dataset - 要用来做数据集表面分析的数据源中数据集的名称。
  19088. * @param {string} options.zValueFieldName - 获取或设置用于提取操作的字段名称。
  19089. * @param {integer} options.resolution - 获取或设置指定中间结果(栅格数据集)的分辨率。
  19090. * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 表面分析参数设置类。获取或设置表面分析参数。
  19091. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 获取或设置查询过滤条件参数。
  19092. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  19093. * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  19094. * @extends {SuperMap.SurfaceAnalystParameters}
  19095. */
  19096. var DatasetSurfaceAnalystParameters_DatasetSurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  19097. DatasetSurfaceAnalystParameters_inherits(DatasetSurfaceAnalystParameters, _SurfaceAnalystParame);
  19098. var _super = DatasetSurfaceAnalystParameters_createSuper(DatasetSurfaceAnalystParameters);
  19099. function DatasetSurfaceAnalystParameters(options) {
  19100. var _this;
  19101. DatasetSurfaceAnalystParameters_classCallCheck(this, DatasetSurfaceAnalystParameters);
  19102. _this = _super.call(this, options);
  19103. /**
  19104. * @member {string} SuperMap.DatasetSurfaceAnalystParameters.prototype.dataset
  19105. * @description 要用来做数据集表面分析的数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Country@World。
  19106. */
  19107. _this.dataset = null;
  19108. /**
  19109. * @member {SuperMap.FilterParameter} SuperMap.DatasetSurfaceAnalystParameters.prototype.filterQueryParameter
  19110. * @description 获取或设置查询过滤条件参数。
  19111. */
  19112. _this.filterQueryParameter = new FilterParameter_FilterParameter();
  19113. /**
  19114. * @member {string} SuperMap.DatasetSurfaceAnalystParameters.prototype.zValueFieldName
  19115. * @description 获取或设置用于提取操作的字段名称。提取等值线时,将使用该字段中的值,对点记录集中的点数据进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  19116. */
  19117. _this.zValueFieldName = null;
  19118. if (options) {
  19119. Util_Util.extend(DatasetSurfaceAnalystParameters_assertThisInitialized(_this), options);
  19120. }
  19121. _this.CLASS_NAME = "SuperMap.DatasetSurfaceAnalystParameters";
  19122. return _this;
  19123. }
  19124. /**
  19125. * @function SuperMap.DatasetSurfaceAnalystParameters.prototype.destroy
  19126. * @override
  19127. */
  19128. DatasetSurfaceAnalystParameters_createClass(DatasetSurfaceAnalystParameters, [{
  19129. key: "destroy",
  19130. value: function destroy() {
  19131. DatasetSurfaceAnalystParameters_get(DatasetSurfaceAnalystParameters_getPrototypeOf(DatasetSurfaceAnalystParameters.prototype), "destroy", this).call(this);
  19132. var me = this;
  19133. me.dataset = null;
  19134. if (me.filterQueryParameter) {
  19135. me.filterQueryParameter.destroy();
  19136. me.filterQueryParameter = null;
  19137. }
  19138. me.zValueFieldName = null;
  19139. }
  19140. /**
  19141. * @function SuperMap.DatasetSurfaceAnalystParameters.toObject
  19142. * @param {SuperMap.DatasetSurfaceAnalystParameters} datasetSurfaceAnalystParameters - 数据集表面分析参数类。
  19143. * @param {SuperMap.DatasetSurfaceAnalystParameters} tempObj - 数据集表面分析参数对象。
  19144. * @description 将数据集表面分析参数对象转换为 JSON 对象。
  19145. * @returns JSON 对象。
  19146. */
  19147. }], [{
  19148. key: "toObject",
  19149. value: function toObject(datasetSurfaceAnalystParameters, tempObj) {
  19150. for (var name in datasetSurfaceAnalystParameters) {
  19151. if (name === "filterQueryParameter") {
  19152. tempObj.filterQueryParameter = datasetSurfaceAnalystParameters.filterQueryParameter;
  19153. }
  19154. if (name === "extractParameter") {
  19155. if (datasetSurfaceAnalystParameters.extractParameter.clipRegion instanceof Geometry_Geometry && datasetSurfaceAnalystParameters.extractParameter.clipRegion.components) {
  19156. datasetSurfaceAnalystParameters.extractParameter.clipRegion = ServerGeometry_ServerGeometry.fromGeometry(datasetSurfaceAnalystParameters.extractParameter.clipRegion);
  19157. }
  19158. tempObj.extractParameter = datasetSurfaceAnalystParameters.extractParameter;
  19159. } else if (name === "dataset") {
  19160. continue;
  19161. } else if (name === "surfaceAnalystMethod") {
  19162. continue;
  19163. } else {
  19164. tempObj[name] = datasetSurfaceAnalystParameters[name];
  19165. }
  19166. }
  19167. }
  19168. }]);
  19169. return DatasetSurfaceAnalystParameters;
  19170. }(SurfaceAnalystParameters_SurfaceAnalystParameters);
  19171. SuperMap.DatasetSurfaceAnalystParameters = DatasetSurfaceAnalystParameters_DatasetSurfaceAnalystParameters;
  19172. // CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystParameters.js
  19173. function ThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19174. 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); } }
  19175. function ThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19176. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  19177. * This program are made available under the terms of the Apache License, Version 2.0
  19178. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19179. /**
  19180. * @class SuperMap.ThiessenAnalystParameters
  19181. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  19182. * @classdesc 泰森多边形分析参数基类。
  19183. * @param {Object} options - 参数。
  19184. * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.clipRegion] - 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  19185. * @param {boolean} [options.createResultDataset=false] - 是否返回结果数据集。
  19186. * @param {string} [options.resultDatasetName] - 指定结果数据集名称。
  19187. * @param {string} [options.resultDatasourceName] - 指定结果数据集所在数据源,默认为当前数据源。
  19188. * @param {boolean} [options.returnResultRegion=true] - 是否返回分析得到的多边形面数组。
  19189. */
  19190. var ThiessenAnalystParameters_ThiessenAnalystParameters = /*#__PURE__*/function () {
  19191. function ThiessenAnalystParameters(options) {
  19192. ThiessenAnalystParameters_classCallCheck(this, ThiessenAnalystParameters);
  19193. if (!options) {
  19194. return;
  19195. }
  19196. /**
  19197. * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.ThiessenAnalystParameters.prototype.clipRegion]
  19198. * @description 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  19199. */
  19200. this.clipRegion = null;
  19201. /**
  19202. * @member {boolean} [SuperMap.ThiessenAnalystParameters.prototype.createResultDataset=false]
  19203. * @description 是否返回结果数据集。如果为 true,则必须设置属性 resultDatasetName 和 resultDatasourceName。
  19204. */
  19205. this.createResultDataset = false;
  19206. /**
  19207. * @member {string} SuperMap.ThiessenAnalystParameters.prototype.resultDatasetName
  19208. * @description 指定结果数据集名称。
  19209. */
  19210. this.resultDatasetName = null;
  19211. /**
  19212. * @member {string} SuperMap.ThiessenAnalystParameters.prototype.resultDatasourceName
  19213. * @description 指定结果数据集所在数据源。
  19214. */
  19215. this.resultDatasourceName = null;
  19216. /**
  19217. * @member {boolean} SuperMap.ThiessenAnalystParameters.prototype.returnResultRegion
  19218. * @description 是否返回分析得到的多边形面数组。
  19219. */
  19220. this.returnResultRegion = true;
  19221. Util_Util.extend(this, options);
  19222. this.CLASS_NAME = "SuperMap.ThiessenAnalystParameters";
  19223. }
  19224. /**
  19225. * @function SuperMap.ThiessenAnalystParameters.prototype.destroy
  19226. * @description 释放资源,将引用资源的属性置空。
  19227. */
  19228. ThiessenAnalystParameters_createClass(ThiessenAnalystParameters, [{
  19229. key: "destroy",
  19230. value: function destroy() {
  19231. var me = this;
  19232. if (me.clipRegion) {
  19233. me.clipRegion.destroy();
  19234. me.clipRegion = null;
  19235. }
  19236. me.createResultDataset = null;
  19237. me.resultDatasetName = null;
  19238. me.resultDatasourceName = null;
  19239. me.returnResultRegion = null;
  19240. }
  19241. }]);
  19242. return ThiessenAnalystParameters;
  19243. }();
  19244. SuperMap.ThiessenAnalystParameters = ThiessenAnalystParameters_ThiessenAnalystParameters;
  19245. // CONCATENATED MODULE: ./src/common/iServer/DatasetThiessenAnalystParameters.js
  19246. 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); }
  19247. function DatasetThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19248. 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); } }
  19249. function DatasetThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19250. 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); }
  19251. function DatasetThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  19252. 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); }
  19253. function DatasetThiessenAnalystParameters_setPrototypeOf(o, p) { DatasetThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetThiessenAnalystParameters_setPrototypeOf(o, p); }
  19254. 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); }; }
  19255. function DatasetThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetThiessenAnalystParameters_assertThisInitialized(self); }
  19256. function DatasetThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19257. 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; } }
  19258. function DatasetThiessenAnalystParameters_getPrototypeOf(o) { DatasetThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetThiessenAnalystParameters_getPrototypeOf(o); }
  19259. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  19260. * This program are made available under the terms of the Apache License, Version 2.0
  19261. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19262. /**
  19263. * @class SuperMap.DatasetThiessenAnalystParameters
  19264. * @category iServer SpatialAnalyst ThiessenAnalyst
  19265. * @classdesc 数据集泰森多边形分析参数类。
  19266. * @param {Object} options - 参数。
  19267. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 对待分析数据集中的点进行过滤,即对数据集中的所有点进行分析。
  19268. * @extends {SuperMap.ThiessenAnalystParameters}
  19269. */
  19270. var DatasetThiessenAnalystParameters_DatasetThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  19271. DatasetThiessenAnalystParameters_inherits(DatasetThiessenAnalystParameters, _ThiessenAnalystParam);
  19272. var _super = DatasetThiessenAnalystParameters_createSuper(DatasetThiessenAnalystParameters);
  19273. function DatasetThiessenAnalystParameters(options) {
  19274. var _this;
  19275. DatasetThiessenAnalystParameters_classCallCheck(this, DatasetThiessenAnalystParameters);
  19276. _this = _super.call(this, options);
  19277. /**
  19278. * @member {SuperMap.FilterParameter} [SuperMap.DatasetThiessenAnalystParameters.prototype.filterQueryParameter]
  19279. * @description 过滤条件,对待分析数据集中的点进行过滤,即对数据集中的所有点进行分析。
  19280. * @example
  19281. * var filterQueryParameter = new SuperMap.FilterParameter({
  19282. * name: "Countries@World",
  19283. * attributeFilter: "SmID>100"
  19284. * });
  19285. */
  19286. _this.filterQueryParameter = null;
  19287. /**
  19288. * @member {string} SuperMap.DatasetThiessenAnalystParameters.prototype.dataset
  19289. * @description 数据集名称待分析的数据集名称,请使用 "datasetName@datasourceName" 格式来表示。
  19290. */
  19291. _this.dataset = null;
  19292. if (options) {
  19293. Util_Util.extend(DatasetThiessenAnalystParameters_assertThisInitialized(_this), options);
  19294. }
  19295. _this.CLASS_NAME = "SuperMap.DatasetThiessenAnalystParameters";
  19296. return _this;
  19297. }
  19298. /**
  19299. * @function SuperMap.DatasetThiessenAnalystParameters.prototype.destroy
  19300. * @override
  19301. */
  19302. DatasetThiessenAnalystParameters_createClass(DatasetThiessenAnalystParameters, [{
  19303. key: "destroy",
  19304. value: function destroy() {
  19305. DatasetThiessenAnalystParameters_get(DatasetThiessenAnalystParameters_getPrototypeOf(DatasetThiessenAnalystParameters.prototype), "destroy", this).call(this);
  19306. var me = this;
  19307. if (me.filterQueryParameter) {
  19308. me.filterQueryParameter.destroy();
  19309. me.filterQueryParameter = null;
  19310. }
  19311. }
  19312. /**
  19313. * @function SuperMap.DatasetThiessenAnalystParameters.toObject
  19314. * @param {SuperMap.DatasetThiessenAnalystParameters} datasetThiessenAnalystParameters - 泰森多边形分析服务参数类。
  19315. * @param {SuperMap.DatasetThiessenAnalystParameters} tempObj - 泰森多边形分析服务参数对象。
  19316. * @description 将泰森多边形分析服务参数对象转换为 JSON 对象。
  19317. * @returns JSON 对象。
  19318. */
  19319. }], [{
  19320. key: "toObject",
  19321. value: function toObject(datasetThiessenAnalystParameters, tempObj) {
  19322. for (var name in datasetThiessenAnalystParameters) {
  19323. if (name === "clipRegion") {
  19324. tempObj.clipRegion = ServerGeometry_ServerGeometry.fromGeometry(datasetThiessenAnalystParameters.clipRegion);
  19325. } else {
  19326. tempObj[name] = datasetThiessenAnalystParameters[name];
  19327. }
  19328. }
  19329. }
  19330. }]);
  19331. return DatasetThiessenAnalystParameters;
  19332. }(ThiessenAnalystParameters_ThiessenAnalystParameters);
  19333. SuperMap.DatasetThiessenAnalystParameters = DatasetThiessenAnalystParameters_DatasetThiessenAnalystParameters;
  19334. // CONCATENATED MODULE: ./src/common/iServer/DensityKernelAnalystParameters.js
  19335. function DensityKernelAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19336. 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); } }
  19337. function DensityKernelAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityKernelAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityKernelAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19338. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  19339. * This program are made available under the terms of the Apache License, Version 2.0
  19340. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19341. /**
  19342. * @class SuperMap.DensityKernelAnalystParameters
  19343. * @category iServer SpatialAnalyst DensityAnalyst
  19344. * @classdesc 核密度分析参数类。
  19345. * @param {Object} options - 参数。
  19346. * @param {string} options.dataset - 要用来做核密度分析数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:BaseMap_P@Jingjin。
  19347. * @param {string} options.fieldName - 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  19348. * @param {string} options.resultGridName - 指定结果数据集名称。
  19349. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 核密度分析的范围,用于确定结果栅格数据集的范围。如果缺省,则默认为原数据集的范围。
  19350. * @param {number} [options.searchRadius] - 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  19351. * @param {number} [options.resultGridDatasetResolution] - 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  19352. * @param {string} [options.targetDatasource] - 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  19353. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  19354. */
  19355. var DensityKernelAnalystParameters_DensityKernelAnalystParameters = /*#__PURE__*/function () {
  19356. function DensityKernelAnalystParameters(options) {
  19357. DensityKernelAnalystParameters_classCallCheck(this, DensityKernelAnalystParameters);
  19358. /**
  19359. * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.dataset
  19360. * @description 要用来做核密度分析数据源中数据集的名称。
  19361. * 该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Railway@Changchun。
  19362. * 注:核密度分析支持点数据集和线数据集。
  19363. */
  19364. this.dataset = null;
  19365. /**
  19366. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} [SuperMap.DensityKernelAnalystParameters.prototype.bounds]
  19367. * @description 核密度分析的范围,用于确定结果栅格数据集的范围。
  19368. * 如果缺省,则默认为原数据集的范围。
  19369. */
  19370. this.bounds = null;
  19371. /**
  19372. * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.fieldName
  19373. * @description 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  19374. */
  19375. this.fieldName = null;
  19376. /**
  19377. * @member {number} [SuperMap.DensityKernelAnalystParameters.prototype.resultGridDatasetResolution]
  19378. * @description 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  19379. */
  19380. this.resultGridDatasetResolution = null;
  19381. /**
  19382. * @member {number} [SuperMap.DensityKernelAnalystParameters.prototype.searchRadius]
  19383. * @description 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  19384. */
  19385. this.searchRadius = null;
  19386. /**
  19387. * @member {string} [SuperMap.DensityKernelAnalystParameters.prototype.targetDatasource]
  19388. * @description 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  19389. */
  19390. this.targetDatasource = null;
  19391. /**
  19392. * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.resultGridName
  19393. * @description 指定结果数据集名称。
  19394. */
  19395. this.resultGridName = null;
  19396. /**
  19397. * @member {boolean} [SuperMap.DensityKernelAnalystParameters.prototype.deleteExistResultDataset=false]
  19398. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  19399. */
  19400. this.deleteExistResultDataset = false;
  19401. Util_Util.extend(this, options);
  19402. this.CLASS_NAME = "SuperMap.DensityKernelAnalystParameters";
  19403. }
  19404. /**
  19405. * @function SuperMap.DensityKernelAnalystParameters.prototype.destroy
  19406. * @description 释放资源,将引用资源的属性置空。
  19407. */
  19408. DensityKernelAnalystParameters_createClass(DensityKernelAnalystParameters, [{
  19409. key: "destroy",
  19410. value: function destroy() {
  19411. var me = this;
  19412. me.dataset = null;
  19413. me.bounds = null;
  19414. me.fieldName = null;
  19415. me.resultGridDatasetResolution = null;
  19416. me.searchRadius = null;
  19417. me.targetDatasource = null;
  19418. me.resultGridName = null;
  19419. me.deleteExistResultDataset = null;
  19420. }
  19421. /**
  19422. * @function SuperMap.DensityKernelAnalystParameters.toObject
  19423. * @param {SuperMap.DensityKernelAnalystParameters} densityKernelAnalystParameters -核密度分析参数类。
  19424. * @param {SuperMap.DensityKernelAnalystParameters} tempObj - 核密度分析参数对象。
  19425. * @description 将核密度分析参数对象转换成 JSON 对象。
  19426. * @returns JSON 对象。
  19427. */
  19428. }], [{
  19429. key: "toObject",
  19430. value: function toObject(densityKernelAnalystParameters, tempObj) {
  19431. for (var name in densityKernelAnalystParameters) {
  19432. if (name !== "dataset") {
  19433. tempObj[name] = densityKernelAnalystParameters[name];
  19434. }
  19435. }
  19436. }
  19437. }]);
  19438. return DensityKernelAnalystParameters;
  19439. }();
  19440. SuperMap.DensityKernelAnalystParameters = DensityKernelAnalystParameters_DensityKernelAnalystParameters;
  19441. // CONCATENATED MODULE: ./src/common/iServer/DensityAnalystService.js
  19442. 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); }
  19443. function DensityAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19444. 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); } }
  19445. function DensityAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  19446. 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); }
  19447. function DensityAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DensityAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  19448. 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); }
  19449. function DensityAnalystService_setPrototypeOf(o, p) { DensityAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DensityAnalystService_setPrototypeOf(o, p); }
  19450. 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); }; }
  19451. function DensityAnalystService_possibleConstructorReturn(self, call) { if (call && (DensityAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return DensityAnalystService_assertThisInitialized(self); }
  19452. function DensityAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19453. 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; } }
  19454. function DensityAnalystService_getPrototypeOf(o) { DensityAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DensityAnalystService_getPrototypeOf(o); }
  19455. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  19456. * This program are made available under the terms of the Apache License, Version 2.0
  19457. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19458. /**
  19459. * @class SuperMap.DensityAnalystService
  19460. * @category iServer SpatialAnalyst DensityAnalyst
  19461. * @classdesc
  19462. * 密度分析服务类,密度分析可计算每个输出栅格像元周围圆形邻域内输入的点或线对象的密度。
  19463. * 密度分析,在某种意义上来说,相当于在表面上将输入的点线对象的测量值散开来,将每个点或线对象的测量量分布在整个研究区域,并计算输出栅格中每个像元的密度值。目前提供1种密度分析:核密度分析(Kernel)。
  19464. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  19465. * @param {Object} options - 参数。</br>
  19466. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  19467. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19468. * @param {Object} [options.headers] - 请求头。
  19469. * @extends {SuperMap.SpatialAnalystBase}
  19470. * @example 例如:
  19471. * var myDensityAnalystService = new SuperMap.DensityAnalystService(url);
  19472. * myDensityAnalystService.on({
  19473. * "processCompleted": processCompleted,
  19474. * "processFailed": processFailed
  19475. * }
  19476. * );
  19477. */
  19478. var DensityAnalystService_DensityAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  19479. DensityAnalystService_inherits(DensityAnalystService, _SpatialAnalystBase);
  19480. var _super = DensityAnalystService_createSuper(DensityAnalystService);
  19481. function DensityAnalystService(url, options) {
  19482. var _this;
  19483. DensityAnalystService_classCallCheck(this, DensityAnalystService);
  19484. _this = _super.call(this, url, options);
  19485. /**
  19486. * @member {string} SuperMap.DensityAnalystService.prototype.mode
  19487. * @description 密度分析类型。
  19488. */
  19489. _this.mode = null;
  19490. if (options) {
  19491. Util_Util.extend(DensityAnalystService_assertThisInitialized(_this), options);
  19492. }
  19493. _this.CLASS_NAME = "SuperMap.DensityAnalystService";
  19494. return _this;
  19495. }
  19496. /**
  19497. * @function SuperMap.DensityAnalystService.prototype.destroy
  19498. * @description 释放资源,将引用资源的属性置空。
  19499. */
  19500. DensityAnalystService_createClass(DensityAnalystService, [{
  19501. key: "destroy",
  19502. value: function destroy() {
  19503. DensityAnalystService_get(DensityAnalystService_getPrototypeOf(DensityAnalystService.prototype), "destroy", this).call(this);
  19504. this.mode = null;
  19505. }
  19506. /**
  19507. * @function SuperMap.DensityAnalystService.prototype.processAsync
  19508. * @description 负责将客户端的查询参数传递到服务端。
  19509. * @param {SuperMap.DensityKernelAnalystParameters} parameter - 核密度分析参数。
  19510. */
  19511. }, {
  19512. key: "processAsync",
  19513. value: function processAsync(parameter) {
  19514. var me = this;
  19515. var parameterObject = new Object();
  19516. if (parameter instanceof DensityKernelAnalystParameters_DensityKernelAnalystParameters) {
  19517. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/densityanalyst/kernel');
  19518. me.mode = "kernel";
  19519. }
  19520. DensityKernelAnalystParameters_DensityKernelAnalystParameters.toObject(parameter, parameterObject);
  19521. var jsonParameters = Util_Util.toJSON(parameterObject);
  19522. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  19523. me.request({
  19524. method: "POST",
  19525. data: jsonParameters,
  19526. scope: me,
  19527. success: me.serviceProcessCompleted,
  19528. failure: me.serviceProcessFailed
  19529. });
  19530. }
  19531. }]);
  19532. return DensityAnalystService;
  19533. }(SpatialAnalystBase_SpatialAnalystBase);
  19534. SuperMap.DensityAnalystService = DensityAnalystService_DensityAnalystService;
  19535. // CONCATENATED MODULE: ./src/common/iServer/EditFeaturesParameters.js
  19536. function EditFeaturesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19537. 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); } }
  19538. function EditFeaturesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19539. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  19540. * This program are made available under the terms of the Apache License, Version 2.0
  19541. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19542. /**
  19543. * @class SuperMap.EditFeaturesParameters
  19544. * @category iServer Data Feature
  19545. * @classdesc 数据服务中数据集添加、修改、删除参数类。
  19546. * @category iServer Data
  19547. * @param {Object} options - 参数。
  19548. * @param {Array.<SuperMap.Feature.Vector|GeoJSONObject|ol.feature>} options.features - 当前需要创建或者是修改的要素集。
  19549. * @param {boolean} [options.returnContent=false] - 是返回创建要素的 ID 数组还是返回 featureResult 资源的 URI。
  19550. * @param {SuperMap.EditType} [options.editType=SuperMap.EditType.ADD] - POST 动作类型 (ADD、UPDATE、DELETE)。
  19551. * @param {Array.<string|integer>} [options.IDs] - 删除要素时的要素的 ID 数组。
  19552. */
  19553. var EditFeaturesParameters_EditFeaturesParameters = /*#__PURE__*/function () {
  19554. function EditFeaturesParameters(options) {
  19555. EditFeaturesParameters_classCallCheck(this, EditFeaturesParameters);
  19556. /**
  19557. * @member {string} SuperMap.EditFeaturesParameters.prototype.dataSourceName
  19558. * @description 当前需要创建或者是修改的要素的数据源。
  19559. */
  19560. this.dataSourceName = null;
  19561. /**
  19562. * @member {string} SuperMap.EditFeaturesParameters.prototype.dataSetName
  19563. * @description 当前需要创建或者是修改的要素的数据集。
  19564. */
  19565. this.dataSetName = null;
  19566. /**
  19567. * @member {Array.<SuperMap.Feature.Vector|GeoJSONObject|ol.feature>} SuperMap.EditFeaturesParameters.prototype.features
  19568. * @description 当前需要创建或者是修改的要素集。
  19569. */
  19570. this.features = null;
  19571. /**
  19572. * @member {SuperMap.EditType} [SuperMap.EditFeaturesParameters.prototype.editType=SuperMap.EditType.ADD]
  19573. * @description 要素集更新类型 (add、update、delete)。
  19574. */
  19575. this.editType = EditType.ADD;
  19576. /**
  19577. * @member {Array.<string|number>} [SuperMap.EditFeaturesParameters.prototype.IDs]
  19578. * @description 执行删除时要素集 ID 集合。
  19579. */
  19580. this.IDs = null;
  19581. /**
  19582. * @member {boolean} [SuperMap.EditFeaturesParameters.prototype.returnContent=false]
  19583. * @description 要素添加时,isUseBatch 不传或传为 false 的情况下有效。
  19584. * true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  19585. */
  19586. this.returnContent = false;
  19587. /**
  19588. * @member {boolean} [SuperMap.EditFeaturesParameters.prototype.isUseBatch=false]
  19589. * @description 是否使用批量添加要素功能,要素添加时有效。批量添加能够提高要素编辑效率。true 表示批量添加;false 表示不使用批量添加。
  19590. */
  19591. this.isUseBatch = false;
  19592. Util_Util.extend(this, options);
  19593. this.CLASS_NAME = "SuperMap.EditFeaturesParameters";
  19594. }
  19595. /**
  19596. * @function SuperMap.EditFeaturesParameters.prototype.destroy
  19597. * @description 释放资源,将引用资源的属性置空。
  19598. */
  19599. EditFeaturesParameters_createClass(EditFeaturesParameters, [{
  19600. key: "destroy",
  19601. value: function destroy() {
  19602. var me = this;
  19603. me.dataSourceName = null;
  19604. me.dataSetName = null;
  19605. me.features = null;
  19606. me.editType = null;
  19607. me.IDs = null;
  19608. me.returnContent = null;
  19609. }
  19610. /**
  19611. * @function SuperMap.EditFeaturesParameters.prototype.toJsonParameters
  19612. * @description 将 EditFeaturesParameters 对象参数转换为 JSON 字符串。
  19613. * @param {SuperMap.EditFeaturesParameters} params - 地物编辑参数。
  19614. * @returns {string} JSON 字符串。
  19615. */
  19616. }], [{
  19617. key: "toJsonParameters",
  19618. value: function toJsonParameters(params) {
  19619. var feature,
  19620. len,
  19621. features,
  19622. editType = params.editType;
  19623. if (editType === EditType.DELETE) {
  19624. if (params.IDs === null) {
  19625. return;
  19626. }
  19627. features = {
  19628. ids: params.IDs
  19629. };
  19630. } else {
  19631. features = [];
  19632. if (params.features) {
  19633. len = params.features.length;
  19634. for (var i = 0; i < len; i++) {
  19635. feature = params.features[i];
  19636. feature.geometry = ServerGeometry_ServerGeometry.fromGeometry(feature.geometry);
  19637. features.push(feature);
  19638. }
  19639. }
  19640. }
  19641. return Util_Util.toJSON(features);
  19642. }
  19643. }]);
  19644. return EditFeaturesParameters;
  19645. }();
  19646. SuperMap.EditFeaturesParameters = EditFeaturesParameters_EditFeaturesParameters;
  19647. // CONCATENATED MODULE: ./src/common/iServer/EditFeaturesService.js
  19648. 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); }
  19649. function EditFeaturesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19650. 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); } }
  19651. function EditFeaturesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesService_defineProperties(Constructor, staticProps); return Constructor; }
  19652. 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); }
  19653. function EditFeaturesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = EditFeaturesService_getPrototypeOf(object); if (object === null) break; } return object; }
  19654. 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); }
  19655. function EditFeaturesService_setPrototypeOf(o, p) { EditFeaturesService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return EditFeaturesService_setPrototypeOf(o, p); }
  19656. 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); }; }
  19657. function EditFeaturesService_possibleConstructorReturn(self, call) { if (call && (EditFeaturesService_typeof(call) === "object" || typeof call === "function")) { return call; } return EditFeaturesService_assertThisInitialized(self); }
  19658. function EditFeaturesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19659. 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; } }
  19660. function EditFeaturesService_getPrototypeOf(o) { EditFeaturesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return EditFeaturesService_getPrototypeOf(o); }
  19661. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  19662. * This program are made available under the terms of the Apache License, Version 2.0
  19663. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19664. /**
  19665. * @class SuperMap.EditFeaturesService
  19666. * @category iServer Data Feature
  19667. * @classdesc 数据服务中数据集添加、更新、删除服务类。
  19668. * @extends {SuperMap.CommonServiceBase}
  19669. * @param {string} url - 服务端的数据服务资源地址。请求数据服务中数据集编辑服务,URL 应为:</br>
  19670. * http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/datasources/name/{数据源名}/datasets/name/{数据集名} 。</br>
  19671. * 例如:http://localhost:8090/iserver/services/data-jingjin/rest/data/datasources/name/Jingjin/datasets/name/Landuse_R
  19672. * @param {Object} options - 参数。</br>
  19673. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  19674. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  19675. * @param {SuperMap.DataFormat} [format] -查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"。
  19676. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19677. * @param {Object} [options.headers] - 请求头。
  19678. * @example
  19679. * var myService = new SuperMap.EditFeaturesService(url, {eventListeners: {
  19680. * "processCompleted": editFeatureCompleted,
  19681. * "processFailed": editFeatureError
  19682. * }
  19683. * };
  19684. *
  19685. */
  19686. var EditFeaturesService_EditFeaturesService = /*#__PURE__*/function (_CommonServiceBase) {
  19687. EditFeaturesService_inherits(EditFeaturesService, _CommonServiceBase);
  19688. var _super = EditFeaturesService_createSuper(EditFeaturesService);
  19689. function EditFeaturesService(url, options) {
  19690. var _this;
  19691. EditFeaturesService_classCallCheck(this, EditFeaturesService);
  19692. _this = _super.call(this, url, options);
  19693. /**
  19694. * @member {boolean} [SuperMap.EditFeaturesService.prototype.returnContent=false]
  19695. * @description要素添加时,isUseBatch 不传或传为 false 的情况下有效。true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  19696. */
  19697. _this.returnContent = false;
  19698. /**
  19699. * @member {boolean} [SuperMap.EditFeaturesService.prototype.isUseBatch=false]
  19700. * @description 是否使用批量添加要素功能,要素添加时有效。
  19701. * 批量添加能够提高要素编辑效率。
  19702. * true 表示批量添加;false 表示不使用批量添加。
  19703. */
  19704. _this.isUseBatch = false;
  19705. if (options) {
  19706. Util_Util.extend(EditFeaturesService_assertThisInitialized(_this), options);
  19707. }
  19708. _this.url = Util_Util.urlPathAppend(_this.url, 'features');
  19709. _this.CLASS_NAME = "SuperMap.EditFeaturesService";
  19710. return _this;
  19711. }
  19712. /**
  19713. * @function SuperMap.EditFeaturesService.prototype.destroy
  19714. * @override
  19715. */
  19716. EditFeaturesService_createClass(EditFeaturesService, [{
  19717. key: "destroy",
  19718. value: function destroy() {
  19719. EditFeaturesService_get(EditFeaturesService_getPrototypeOf(EditFeaturesService.prototype), "destroy", this).call(this);
  19720. var me = this;
  19721. me.returnContent = null;
  19722. me.isUseBatch = null;
  19723. me.fromIndex = null;
  19724. me.toIndex = null;
  19725. }
  19726. /**
  19727. * @function SuperMap.EditFeaturesService.prototype.processAsync
  19728. * @description 负责将客户端的更新参数传递到服务端。
  19729. * @param {SuperMap.EditFeaturesParameters} params - 编辑要素参数。
  19730. */
  19731. }, {
  19732. key: "processAsync",
  19733. value: function processAsync(params) {
  19734. if (!(params instanceof EditFeaturesParameters_EditFeaturesParameters)) {
  19735. return;
  19736. }
  19737. var me = this,
  19738. method = "POST",
  19739. ids = "",
  19740. editType = params.editType,
  19741. jsonParameters = null;
  19742. me.returnContent = params.returnContent;
  19743. me.isUseBatch = params.isUseBatch;
  19744. jsonParameters = EditFeaturesParameters_EditFeaturesParameters.toJsonParameters(params);
  19745. if (editType === EditType.DELETE) {
  19746. ids = Util_Util.toJSON(params.IDs);
  19747. me.url = Util_Util.urlAppend(me.url, "ids=" + ids);
  19748. method = "DELETE";
  19749. jsonParameters = ids;
  19750. } else if (editType === EditType.UPDATE) {
  19751. method = "PUT";
  19752. } else {
  19753. if (me.isUseBatch) {
  19754. me.url = Util_Util.urlAppend(me.url, "isUseBatch=".concat(me.isUseBatch));
  19755. me.returnContent = false;
  19756. }
  19757. if (me.returnContent) {
  19758. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  19759. method = "POST";
  19760. }
  19761. }
  19762. me.request({
  19763. method: method,
  19764. data: jsonParameters,
  19765. scope: me,
  19766. success: me.serviceProcessCompleted,
  19767. failure: me.serviceProcessFailed
  19768. });
  19769. }
  19770. }]);
  19771. return EditFeaturesService;
  19772. }(CommonServiceBase_CommonServiceBase);
  19773. SuperMap.EditFeaturesService = EditFeaturesService_EditFeaturesService;
  19774. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalyst3DParameters.js
  19775. function FacilityAnalyst3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19776. 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); } }
  19777. function FacilityAnalyst3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalyst3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalyst3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19778. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  19779. * This program are made available under the terms of the Apache License, Version 2.0
  19780. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19781. /**
  19782. * @class SuperMap.FacilityAnalyst3DParameters
  19783. * @category iServer FacilityAnalyst3D
  19784. * @classdesc 最近设施分析参数基类。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  19785. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,
  19786. * 超过 10 分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起
  19787. * 作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  19788. * @param {Object} options - 参数。
  19789. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  19790. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  19791. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  19792. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  19793. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  19794. */
  19795. var FacilityAnalyst3DParameters_FacilityAnalyst3DParameters = /*#__PURE__*/function () {
  19796. function FacilityAnalyst3DParameters(options) {
  19797. FacilityAnalyst3DParameters_classCallCheck(this, FacilityAnalyst3DParameters);
  19798. /**
  19799. * @member {number} [SuperMap.FacilityAnalyst3DParameters.prototype.edgeID]
  19800. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  19801. */
  19802. this.edgeID = null;
  19803. /**
  19804. * @member {number} [SuperMap.FacilityAnalyst3DParameters.prototype.nodeID]
  19805. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  19806. */
  19807. this.nodeID = null;
  19808. /**
  19809. * @member {string} SuperMap.FacilityAnalyst3DParameters.prototype.weightName
  19810. * @description 指定的权值字段信息对象的名称。
  19811. */
  19812. this.weightName = null;
  19813. /**
  19814. * @member {boolean} [SuperMap.FacilityAnalyst3DParameters.prototype.isUncertainDirectionValid=false]
  19815. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  19816. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找
  19817. */
  19818. this.isUncertainDirectionValid = false;
  19819. Util_Util.extend(this, options);
  19820. this.CLASS_NAME = "SuperMap.FacilityAnalyst3DParameters";
  19821. }
  19822. /**
  19823. * @function SuperMap.FacilityAnalyst3DParameters.prototype.destroy
  19824. * @override
  19825. */
  19826. FacilityAnalyst3DParameters_createClass(FacilityAnalyst3DParameters, [{
  19827. key: "destroy",
  19828. value: function destroy() {
  19829. var me = this;
  19830. me.edgeID = null;
  19831. me.nodeID = null;
  19832. me.weightName = null;
  19833. me.isUncertainDirectionValid = null;
  19834. }
  19835. }]);
  19836. return FacilityAnalyst3DParameters;
  19837. }();
  19838. SuperMap.FacilityAnalyst3DParameters = FacilityAnalyst3DParameters_FacilityAnalyst3DParameters;
  19839. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DParameters.js
  19840. 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); }
  19841. function FacilityAnalystSinks3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19842. 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); } }
  19843. function FacilityAnalystSinks3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19844. 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); }
  19845. function FacilityAnalystSinks3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSinks3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  19846. 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); }
  19847. function FacilityAnalystSinks3DParameters_setPrototypeOf(o, p) { FacilityAnalystSinks3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DParameters_setPrototypeOf(o, p); }
  19848. 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); }; }
  19849. function FacilityAnalystSinks3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSinks3DParameters_assertThisInitialized(self); }
  19850. function FacilityAnalystSinks3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19851. 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; } }
  19852. function FacilityAnalystSinks3DParameters_getPrototypeOf(o) { FacilityAnalystSinks3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DParameters_getPrototypeOf(o); }
  19853. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  19854. * This program are made available under the terms of the Apache License, Version 2.0
  19855. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19856. /**
  19857. * @class SuperMap.FacilityAnalystSinks3DParameters
  19858. * @category iServer FacilityAnalyst3D Sinks
  19859. * @classdesc 最近设施分析参数类(汇查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  19860. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分钟
  19861. * 能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、
  19862. * 转向表、耗费等属性在最近设施分析时同样可设置。
  19863. * @extends {SuperMap.FacilityAnalyst3DParameters}
  19864. * @param {Object} options - 参数。
  19865. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  19866. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  19867. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  19868. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  19869. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  19870. */
  19871. var FacilityAnalystSinks3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  19872. FacilityAnalystSinks3DParameters_inherits(FacilityAnalystSinks3DParameters, _FacilityAnalyst3DPar);
  19873. var _super = FacilityAnalystSinks3DParameters_createSuper(FacilityAnalystSinks3DParameters);
  19874. function FacilityAnalystSinks3DParameters(options) {
  19875. var _this;
  19876. FacilityAnalystSinks3DParameters_classCallCheck(this, FacilityAnalystSinks3DParameters);
  19877. _this = _super.call(this, options);
  19878. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DParameters";
  19879. return _this;
  19880. }
  19881. /**
  19882. * @function SuperMap.FacilityAnalystSinks3DParameters.prototype.destroy
  19883. * @override
  19884. */
  19885. FacilityAnalystSinks3DParameters_createClass(FacilityAnalystSinks3DParameters, [{
  19886. key: "destroy",
  19887. value: function destroy() {
  19888. FacilityAnalystSinks3DParameters_get(FacilityAnalystSinks3DParameters_getPrototypeOf(FacilityAnalystSinks3DParameters.prototype), "destroy", this).call(this);
  19889. }
  19890. }]);
  19891. return FacilityAnalystSinks3DParameters;
  19892. }(FacilityAnalyst3DParameters_FacilityAnalyst3DParameters);
  19893. SuperMap.FacilityAnalystSinks3DParameters = FacilityAnalystSinks3DParameters;
  19894. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DService.js
  19895. 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); }
  19896. function FacilityAnalystSinks3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19897. 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); } }
  19898. function FacilityAnalystSinks3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DService_defineProperties(Constructor, staticProps); return Constructor; }
  19899. 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); }
  19900. function FacilityAnalystSinks3DService_setPrototypeOf(o, p) { FacilityAnalystSinks3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DService_setPrototypeOf(o, p); }
  19901. 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); }; }
  19902. function FacilityAnalystSinks3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSinks3DService_assertThisInitialized(self); }
  19903. function FacilityAnalystSinks3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19904. 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; } }
  19905. function FacilityAnalystSinks3DService_getPrototypeOf(o) { FacilityAnalystSinks3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DService_getPrototypeOf(o); }
  19906. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  19907. * This program are made available under the terms of the Apache License, Version 2.0
  19908. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19909. /**
  19910. * @class SuperMap.FacilityAnalystSinks3DService
  19911. * @category iServer FacilityAnalyst3D Sinks
  19912. * @classdesc 最近设施分析服务类(汇查找资源)<br>
  19913. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  19914. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  19915. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  19916. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  19917. * @extends {SuperMap.CommonServiceBase}
  19918. * @example
  19919. * var myFacilityAnalystSinks3DService = new SuperMap.FacilityAnalystSinks3DService(url, {
  19920. * eventListeners: {
  19921. * "processCompleted": facilityAnalystSinks3DCompleted,
  19922. * "processFailed": facilityAnalystSinks3DError
  19923. * }
  19924. * });
  19925. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:<br>
  19926. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};<br>
  19927. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。<br>
  19928. * @param {Object} options - 参数。<br>
  19929. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  19930. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19931. * @param {Object} [options.headers] - 请求头。
  19932. */
  19933. var FacilityAnalystSinks3DService_FacilityAnalystSinks3DService = /*#__PURE__*/function (_CommonServiceBase) {
  19934. FacilityAnalystSinks3DService_inherits(FacilityAnalystSinks3DService, _CommonServiceBase);
  19935. var _super = FacilityAnalystSinks3DService_createSuper(FacilityAnalystSinks3DService);
  19936. function FacilityAnalystSinks3DService(url, options) {
  19937. var _this;
  19938. FacilityAnalystSinks3DService_classCallCheck(this, FacilityAnalystSinks3DService);
  19939. _this = _super.call(this, url, options);
  19940. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DService";
  19941. return _this;
  19942. }
  19943. /**
  19944. * @function SuperMap.FacilityAnalystSinks3DService.prototype.destroy
  19945. * @override
  19946. */
  19947. FacilityAnalystSinks3DService_createClass(FacilityAnalystSinks3DService, [{
  19948. key: "destroy",
  19949. value: function destroy() {
  19950. CommonServiceBase_CommonServiceBase.prototype.destroy.apply(this, arguments);
  19951. }
  19952. /**
  19953. * @function SuperMap.FacilityAnalystSinks3DService.prototype.processAsync
  19954. * @description 负责将客户端的查询参数传递到服务端。
  19955. * @param {SuperMap.FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)
  19956. */
  19957. }, {
  19958. key: "processAsync",
  19959. value: function processAsync(params) {
  19960. if (!(params instanceof FacilityAnalystSinks3DParameters)) {
  19961. return;
  19962. }
  19963. var me = this,
  19964. jsonObject;
  19965. me.url = Util_Util.urlPathAppend(me.url, 'sinks');
  19966. jsonObject = {
  19967. edgeID: params.edgeID,
  19968. nodeID: params.nodeID,
  19969. weightName: params.weightName,
  19970. isUncertainDirectionValid: params.isUncertainDirectionValid
  19971. };
  19972. me.request({
  19973. method: "GET",
  19974. params: jsonObject,
  19975. scope: me,
  19976. success: me.serviceProcessCompleted,
  19977. failure: me.serviceProcessFailed
  19978. });
  19979. }
  19980. }]);
  19981. return FacilityAnalystSinks3DService;
  19982. }(CommonServiceBase_CommonServiceBase);
  19983. SuperMap.FacilityAnalystSinks3DService = FacilityAnalystSinks3DService_FacilityAnalystSinks3DService;
  19984. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DParameters.js
  19985. 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); }
  19986. function FacilityAnalystSources3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19987. 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); } }
  19988. function FacilityAnalystSources3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19989. 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); }
  19990. function FacilityAnalystSources3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  19991. 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); }
  19992. function FacilityAnalystSources3DParameters_setPrototypeOf(o, p) { FacilityAnalystSources3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DParameters_setPrototypeOf(o, p); }
  19993. 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); }; }
  19994. function FacilityAnalystSources3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSources3DParameters_assertThisInitialized(self); }
  19995. function FacilityAnalystSources3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19996. 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; } }
  19997. function FacilityAnalystSources3DParameters_getPrototypeOf(o) { FacilityAnalystSources3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DParameters_getPrototypeOf(o); }
  19998. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  19999. * This program are made available under the terms of the Apache License, Version 2.0
  20000. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20001. /**
  20002. * @class SuperMap.FacilityAnalystSources3DParameters
  20003. * @category iServer FacilityAnalyst3D Sources
  20004. * @classdesc 最近设施分析参数类(源查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  20005. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分
  20006. * 钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍
  20007. * 点、转向表、耗费等属性在最近设施分析时同样可设置。
  20008. * @extends {SuperMap.FacilityAnalyst3DParameters}
  20009. * @param {Object} options - 参数。
  20010. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  20011. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  20012. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  20013. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  20014. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  20015. */
  20016. var FacilityAnalystSources3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  20017. FacilityAnalystSources3DParameters_inherits(FacilityAnalystSources3DParameters, _FacilityAnalyst3DPar);
  20018. var _super = FacilityAnalystSources3DParameters_createSuper(FacilityAnalystSources3DParameters);
  20019. function FacilityAnalystSources3DParameters(options) {
  20020. var _this;
  20021. FacilityAnalystSources3DParameters_classCallCheck(this, FacilityAnalystSources3DParameters);
  20022. _this = _super.call(this, options);
  20023. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DParameters";
  20024. return _this;
  20025. }
  20026. /**
  20027. * @function SuperMap.FacilityAnalystSources3DParameters.prototype.destroy
  20028. * @override
  20029. */
  20030. FacilityAnalystSources3DParameters_createClass(FacilityAnalystSources3DParameters, [{
  20031. key: "destroy",
  20032. value: function destroy() {
  20033. FacilityAnalystSources3DParameters_get(FacilityAnalystSources3DParameters_getPrototypeOf(FacilityAnalystSources3DParameters.prototype), "destroy", this).call(this);
  20034. }
  20035. }]);
  20036. return FacilityAnalystSources3DParameters;
  20037. }(FacilityAnalyst3DParameters_FacilityAnalyst3DParameters);
  20038. SuperMap.FacilityAnalystSources3DParameters = FacilityAnalystSources3DParameters;
  20039. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DService.js
  20040. 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); }
  20041. function FacilityAnalystSources3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20042. 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); } }
  20043. function FacilityAnalystSources3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DService_defineProperties(Constructor, staticProps); return Constructor; }
  20044. 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); }
  20045. function FacilityAnalystSources3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  20046. 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); }
  20047. function FacilityAnalystSources3DService_setPrototypeOf(o, p) { FacilityAnalystSources3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DService_setPrototypeOf(o, p); }
  20048. 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); }; }
  20049. function FacilityAnalystSources3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSources3DService_assertThisInitialized(self); }
  20050. function FacilityAnalystSources3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20051. 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; } }
  20052. function FacilityAnalystSources3DService_getPrototypeOf(o) { FacilityAnalystSources3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DService_getPrototypeOf(o); }
  20053. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20054. * This program are made available under the terms of the Apache License, Version 2.0
  20055. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20056. /**
  20057. * @class SuperMap.FacilityAnalystSources3DService
  20058. * @category iServer FacilityAnalyst3D Sources
  20059. * @classdesc 最近设施分析服务类(源查找资源)
  20060. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  20061. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  20062. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  20063. * 最近设施分析结果通过该类支持的事件的监听函数参数获取。
  20064. * @extends {SuperMap.CommonServiceBase}
  20065. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  20066. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  20067. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  20068. * @param {Object} options - 参数。
  20069. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  20070. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20071. * @param {Object} [options.headers] - 请求头。
  20072. */
  20073. var FacilityAnalystSources3DService_FacilityAnalystSources3DService = /*#__PURE__*/function (_CommonServiceBase) {
  20074. FacilityAnalystSources3DService_inherits(FacilityAnalystSources3DService, _CommonServiceBase);
  20075. var _super = FacilityAnalystSources3DService_createSuper(FacilityAnalystSources3DService);
  20076. function FacilityAnalystSources3DService(url, options) {
  20077. var _this;
  20078. FacilityAnalystSources3DService_classCallCheck(this, FacilityAnalystSources3DService);
  20079. _this = _super.call(this, url, options);
  20080. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DService";
  20081. return _this;
  20082. }
  20083. /**
  20084. * @function SuperMap.FacilityAnalystSources3DService.prototype.destroy
  20085. * @override
  20086. */
  20087. FacilityAnalystSources3DService_createClass(FacilityAnalystSources3DService, [{
  20088. key: "destroy",
  20089. value: function destroy() {
  20090. FacilityAnalystSources3DService_get(FacilityAnalystSources3DService_getPrototypeOf(FacilityAnalystSources3DService.prototype), "destroy", this).call(this);
  20091. }
  20092. /**
  20093. * @function SuperMap.FacilityAnalystSources3DService.prototype.processAsync
  20094. * @description 负责将客户端的查询参数传递到服务端。
  20095. * @param {SuperMap.FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找资源)
  20096. */
  20097. }, {
  20098. key: "processAsync",
  20099. value: function processAsync(params) {
  20100. if (!(params instanceof FacilityAnalystSources3DParameters)) {
  20101. return;
  20102. }
  20103. var me = this,
  20104. jsonObject;
  20105. me.url = Util_Util.urlPathAppend(me.url, 'sources');
  20106. jsonObject = {
  20107. edgeID: params.edgeID,
  20108. nodeID: params.nodeID,
  20109. weightName: params.weightName,
  20110. isUncertainDirectionValid: params.isUncertainDirectionValid
  20111. };
  20112. me.request({
  20113. method: "GET",
  20114. params: jsonObject,
  20115. scope: me,
  20116. success: me.serviceProcessCompleted,
  20117. failure: me.serviceProcessFailed
  20118. });
  20119. }
  20120. }]);
  20121. return FacilityAnalystSources3DService;
  20122. }(CommonServiceBase_CommonServiceBase);
  20123. SuperMap.FacilityAnalystSources3DService = FacilityAnalystSources3DService_FacilityAnalystSources3DService;
  20124. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamParameters.js
  20125. function FacilityAnalystStreamParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20126. 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); } }
  20127. function FacilityAnalystStreamParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20128. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20129. * This program are made available under the terms of the Apache License, Version 2.0
  20130. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20131. /**
  20132. * @class SuperMap.FacilityAnalystStreamParameters
  20133. * @category iServer NetworkAnalyst UpstreamCriticalFacilities
  20134. * @classdesc 上游/下游关键设施查找资源参数类。
  20135. * @param {Object} options - 参数。
  20136. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  20137. * @param {number} options.queryType - 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  20138. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  20139. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  20140. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  20141. */
  20142. var FacilityAnalystStreamParameters_FacilityAnalystStreamParameters = /*#__PURE__*/function () {
  20143. function FacilityAnalystStreamParameters(options) {
  20144. FacilityAnalystStreamParameters_classCallCheck(this, FacilityAnalystStreamParameters);
  20145. /**
  20146. * @member {Array.<number>} [SuperMap.FacilityAnalystStreamParameters.prototype.sourceNodeIDs]
  20147. * @description 指定的设施点 ID 数组。
  20148. */
  20149. this.sourceNodeIDs = null;
  20150. /**
  20151. * @member {number} [SuperMap.FacilityAnalystStreamParameters.prototype.edgeID]
  20152. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  20153. */
  20154. this.edgeID = null;
  20155. /**
  20156. * @member {number} [SuperMap.FacilityAnalystStreamParameters.prototype.nodeID]
  20157. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  20158. */
  20159. this.nodeID = null;
  20160. /**
  20161. * @member {boolean} [SuperMap.FacilityAnalystStreamParameters.prototype.isUncertainDirectionValid=false]
  20162. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  20163. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  20164. */
  20165. this.isUncertainDirectionValid = false;
  20166. /**
  20167. * @member {number} SuperMap.FacilityAnalystStreamParameters.prototype.queryType
  20168. * @description 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  20169. */
  20170. this.queryType = null;
  20171. Util_Util.extend(this, options);
  20172. this.CLASS_NAME = "SuperMap.FacilityAnalystStreamParameters";
  20173. }
  20174. /**
  20175. * @function SuperMap.FacilityAnalystStreamParameters.prototype.destroy
  20176. * @description 释放资源,将引用资源的属性置空。
  20177. */
  20178. FacilityAnalystStreamParameters_createClass(FacilityAnalystStreamParameters, [{
  20179. key: "destroy",
  20180. value: function destroy() {
  20181. var me = this;
  20182. me.edgeID = null;
  20183. me.nodeID = null;
  20184. me.weightName = null;
  20185. me.isUncertainDirectionValid = null;
  20186. me.type = null;
  20187. }
  20188. }]);
  20189. return FacilityAnalystStreamParameters;
  20190. }();
  20191. SuperMap.FacilityAnalystStreamParameters = FacilityAnalystStreamParameters_FacilityAnalystStreamParameters;
  20192. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamService.js
  20193. 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); }
  20194. function FacilityAnalystStreamService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20195. 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); } }
  20196. function FacilityAnalystStreamService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamService_defineProperties(Constructor, staticProps); return Constructor; }
  20197. 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); }
  20198. function FacilityAnalystStreamService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystStreamService_getPrototypeOf(object); if (object === null) break; } return object; }
  20199. 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); }
  20200. function FacilityAnalystStreamService_setPrototypeOf(o, p) { FacilityAnalystStreamService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystStreamService_setPrototypeOf(o, p); }
  20201. 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); }; }
  20202. function FacilityAnalystStreamService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystStreamService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystStreamService_assertThisInitialized(self); }
  20203. function FacilityAnalystStreamService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20204. 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; } }
  20205. function FacilityAnalystStreamService_getPrototypeOf(o) { FacilityAnalystStreamService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystStreamService_getPrototypeOf(o); }
  20206. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20207. * This program are made available under the terms of the Apache License, Version 2.0
  20208. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20209. /**
  20210. * @class SuperMap.FacilityAnalystStreamService
  20211. * @category iServer NetworkAnalyst UpstreamCriticalFacilities
  20212. * @classdesc 上游/下游 关键设施查找资源服务类;即查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  20213. * @extends SuperMap.NetworkAnalystServiceBase
  20214. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  20215. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  20216. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet";
  20217. * @param {Object} options - 参数。
  20218. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  20219. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20220. * @param {Object} [options.headers] - 请求头。
  20221. */
  20222. var FacilityAnalystStreamService_FacilityAnalystStreamService = /*#__PURE__*/function (_NetworkAnalystServic) {
  20223. FacilityAnalystStreamService_inherits(FacilityAnalystStreamService, _NetworkAnalystServic);
  20224. var _super = FacilityAnalystStreamService_createSuper(FacilityAnalystStreamService);
  20225. function FacilityAnalystStreamService(url, options) {
  20226. var _this;
  20227. FacilityAnalystStreamService_classCallCheck(this, FacilityAnalystStreamService);
  20228. _this = _super.call(this, url, options);
  20229. _this.CLASS_NAME = "SuperMap.FacilityAnalystStreamService";
  20230. return _this;
  20231. }
  20232. /**
  20233. * @function SuperMap.FacilityAnalystStreamService.prototype.destroy
  20234. * @override
  20235. */
  20236. FacilityAnalystStreamService_createClass(FacilityAnalystStreamService, [{
  20237. key: "destroy",
  20238. value: function destroy() {
  20239. FacilityAnalystStreamService_get(FacilityAnalystStreamService_getPrototypeOf(FacilityAnalystStreamService.prototype), "destroy", this).call(this);
  20240. }
  20241. /**
  20242. * @function SuperMap.FacilityAnalystStreamService.prototype.processAsync
  20243. * @description 负责将客户端的查询参数传递到服务端。
  20244. * @param {SuperMap.FacilityAnalystStreamParameters} params - 上游/下游关键设施查找资源参数类。
  20245. */
  20246. }, {
  20247. key: "processAsync",
  20248. value: function processAsync(params) {
  20249. if (!(params instanceof FacilityAnalystStreamParameters_FacilityAnalystStreamParameters)) {
  20250. return;
  20251. }
  20252. var me = this,
  20253. jsonObject; //URL 通过参数类型来判断是 上游 还是下游 查询
  20254. if (params.queryType === 0) {
  20255. me.url = Util_Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  20256. } else if (params.queryType === 1) {
  20257. me.url = Util_Util.urlPathAppend(me.url, 'downstreamcirticalfaclilities');
  20258. } else {
  20259. return;
  20260. }
  20261. jsonObject = {
  20262. sourceNodeIDs: params.sourceNodeIDs,
  20263. isUncertainDirectionValid: params.isUncertainDirectionValid
  20264. };
  20265. if (params.edgeID !== null && params.nodeID !== null) {
  20266. return;
  20267. }
  20268. if (params.edgeID === null && params.nodeID === null) {
  20269. return;
  20270. }
  20271. if (params.edgeID !== null) {
  20272. jsonObject.edgeID = params.edgeID;
  20273. } else {
  20274. jsonObject.nodeID = params.nodeID;
  20275. }
  20276. me.request({
  20277. method: "GET",
  20278. params: jsonObject,
  20279. scope: me,
  20280. success: me.serviceProcessCompleted,
  20281. failure: me.serviceProcessFailed
  20282. });
  20283. }
  20284. }]);
  20285. return FacilityAnalystStreamService;
  20286. }(NetworkAnalystServiceBase_NetworkAnalystServiceBase);
  20287. SuperMap.FacilityAnalystStreamService = FacilityAnalystStreamService_FacilityAnalystStreamService;
  20288. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DParameters.js
  20289. 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); }
  20290. function FacilityAnalystTracedown3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20291. 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); } }
  20292. function FacilityAnalystTracedown3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20293. 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); }
  20294. function FacilityAnalystTracedown3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  20295. 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); }
  20296. function FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p) { FacilityAnalystTracedown3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p); }
  20297. 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); }; }
  20298. function FacilityAnalystTracedown3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTracedown3DParameters_assertThisInitialized(self); }
  20299. function FacilityAnalystTracedown3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20300. 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; } }
  20301. function FacilityAnalystTracedown3DParameters_getPrototypeOf(o) { FacilityAnalystTracedown3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DParameters_getPrototypeOf(o); }
  20302. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20303. * This program are made available under the terms of the Apache License, Version 2.0
  20304. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20305. /**
  20306. * @class SuperMap.FacilityAnalystTracedown3DParameters
  20307. * @category iServer FacilityAnalyst3D TraceDownResult
  20308. * @classdesc 下游追踪资源参数类。
  20309. * @extends {SuperMap.FacilityAnalyst3DParameters}
  20310. * @param {Object} options - 参数。
  20311. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  20312. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  20313. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  20314. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  20315. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  20316. */
  20317. var FacilityAnalystTracedown3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  20318. FacilityAnalystTracedown3DParameters_inherits(FacilityAnalystTracedown3DParameters, _FacilityAnalyst3DPar);
  20319. var _super = FacilityAnalystTracedown3DParameters_createSuper(FacilityAnalystTracedown3DParameters);
  20320. function FacilityAnalystTracedown3DParameters(options) {
  20321. var _this;
  20322. FacilityAnalystTracedown3DParameters_classCallCheck(this, FacilityAnalystTracedown3DParameters);
  20323. _this = _super.call(this, options);
  20324. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DParameters";
  20325. return _this;
  20326. }
  20327. /**
  20328. * @function SuperMap.FacilityAnalystTracedown3DParameters.prototype.destroy
  20329. * @override
  20330. */
  20331. FacilityAnalystTracedown3DParameters_createClass(FacilityAnalystTracedown3DParameters, [{
  20332. key: "destroy",
  20333. value: function destroy() {
  20334. FacilityAnalystTracedown3DParameters_get(FacilityAnalystTracedown3DParameters_getPrototypeOf(FacilityAnalystTracedown3DParameters.prototype), "destroy", this).call(this);
  20335. }
  20336. }]);
  20337. return FacilityAnalystTracedown3DParameters;
  20338. }(FacilityAnalyst3DParameters_FacilityAnalyst3DParameters);
  20339. SuperMap.FacilityAnalystTracedown3DParameters = FacilityAnalystTracedown3DParameters;
  20340. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DService.js
  20341. 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); }
  20342. function FacilityAnalystTracedown3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20343. 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); } }
  20344. function FacilityAnalystTracedown3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DService_defineProperties(Constructor, staticProps); return Constructor; }
  20345. 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); }
  20346. function FacilityAnalystTracedown3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  20347. 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); }
  20348. function FacilityAnalystTracedown3DService_setPrototypeOf(o, p) { FacilityAnalystTracedown3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DService_setPrototypeOf(o, p); }
  20349. 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); }; }
  20350. function FacilityAnalystTracedown3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTracedown3DService_assertThisInitialized(self); }
  20351. function FacilityAnalystTracedown3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20352. 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; } }
  20353. function FacilityAnalystTracedown3DService_getPrototypeOf(o) { FacilityAnalystTracedown3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DService_getPrototypeOf(o); }
  20354. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20355. * This program are made available under the terms of the Apache License, Version 2.0
  20356. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20357. /**
  20358. * @class SuperMap.FacilityAnalystTracedown3DService
  20359. * @category iServer FacilityAnalyst3D TraceDownResult
  20360. * @classdesc 下游追踪资源服务类
  20361. * @extends {SuperMap.CommonServiceBase}
  20362. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  20363. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  20364. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  20365. * @param {Object} options - 参数。
  20366. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  20367. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20368. * @param {Object} [options.headers] - 请求头。
  20369. */
  20370. var FacilityAnalystTracedown3DService_FacilityAnalystTracedown3DService = /*#__PURE__*/function (_CommonServiceBase) {
  20371. FacilityAnalystTracedown3DService_inherits(FacilityAnalystTracedown3DService, _CommonServiceBase);
  20372. var _super = FacilityAnalystTracedown3DService_createSuper(FacilityAnalystTracedown3DService);
  20373. function FacilityAnalystTracedown3DService(url, options) {
  20374. var _this;
  20375. FacilityAnalystTracedown3DService_classCallCheck(this, FacilityAnalystTracedown3DService);
  20376. _this = _super.call(this, url, options);
  20377. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DService";
  20378. return _this;
  20379. }
  20380. /**
  20381. * @function SuperMap.FacilityAnalystTracedown3DService.prototype.destroy
  20382. * @override
  20383. */
  20384. FacilityAnalystTracedown3DService_createClass(FacilityAnalystTracedown3DService, [{
  20385. key: "destroy",
  20386. value: function destroy() {
  20387. FacilityAnalystTracedown3DService_get(FacilityAnalystTracedown3DService_getPrototypeOf(FacilityAnalystTracedown3DService.prototype), "destroy", this).call(this);
  20388. }
  20389. /**
  20390. * @function SuperMap.FacilityAnalystTracedown3DService.prototype.processAsync
  20391. * @description 负责将客户端的查询参数传递到服务端。
  20392. * @param {SuperMap.FacilityAnalystTracedown3DParameters} params - 下游追踪资源参数类。
  20393. */
  20394. }, {
  20395. key: "processAsync",
  20396. value: function processAsync(params) {
  20397. if (!(params instanceof FacilityAnalystTracedown3DParameters)) {
  20398. return;
  20399. }
  20400. var me = this,
  20401. jsonObject;
  20402. me.url = Util_Util.urlPathAppend(me.url, 'tracedownresult');
  20403. jsonObject = {
  20404. edgeID: params.edgeID,
  20405. nodeID: params.nodeID,
  20406. weightName: params.weightName,
  20407. isUncertainDirectionValid: params.isUncertainDirectionValid
  20408. };
  20409. me.request({
  20410. method: "GET",
  20411. params: jsonObject,
  20412. scope: me,
  20413. success: me.serviceProcessCompleted,
  20414. failure: me.serviceProcessFailed
  20415. });
  20416. }
  20417. }]);
  20418. return FacilityAnalystTracedown3DService;
  20419. }(CommonServiceBase_CommonServiceBase);
  20420. SuperMap.FacilityAnalystTracedown3DService = FacilityAnalystTracedown3DService_FacilityAnalystTracedown3DService;
  20421. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DParameters.js
  20422. 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); }
  20423. function FacilityAnalystTraceup3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20424. 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); } }
  20425. function FacilityAnalystTraceup3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20426. 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); }
  20427. function FacilityAnalystTraceup3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  20428. 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); }
  20429. function FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p) { FacilityAnalystTraceup3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p); }
  20430. 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); }; }
  20431. function FacilityAnalystTraceup3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTraceup3DParameters_assertThisInitialized(self); }
  20432. function FacilityAnalystTraceup3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20433. 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; } }
  20434. function FacilityAnalystTraceup3DParameters_getPrototypeOf(o) { FacilityAnalystTraceup3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DParameters_getPrototypeOf(o); }
  20435. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20436. * This program are made available under the terms of the Apache License, Version 2.0
  20437. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20438. /**
  20439. * @class SuperMap.FacilityAnalystTraceup3DParameters
  20440. * @category iServer FacilityAnalyst3D TraceUpResult
  20441. * @classdesc 上游追踪资源参数类。
  20442. * @extends {SuperMap.FacilityAnalyst3DParameters}
  20443. * @param {Object} options - 参数。
  20444. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  20445. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  20446. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  20447. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  20448. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  20449. */
  20450. var FacilityAnalystTraceup3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  20451. FacilityAnalystTraceup3DParameters_inherits(FacilityAnalystTraceup3DParameters, _FacilityAnalyst3DPar);
  20452. var _super = FacilityAnalystTraceup3DParameters_createSuper(FacilityAnalystTraceup3DParameters);
  20453. function FacilityAnalystTraceup3DParameters(options) {
  20454. var _this;
  20455. FacilityAnalystTraceup3DParameters_classCallCheck(this, FacilityAnalystTraceup3DParameters);
  20456. _this = _super.call(this, options);
  20457. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DParameters";
  20458. return _this;
  20459. }
  20460. /**
  20461. * @function SuperMap.FacilityAnalystTraceup3DParameters.prototype.destroy
  20462. * @override
  20463. */
  20464. FacilityAnalystTraceup3DParameters_createClass(FacilityAnalystTraceup3DParameters, [{
  20465. key: "destroy",
  20466. value: function destroy() {
  20467. FacilityAnalystTraceup3DParameters_get(FacilityAnalystTraceup3DParameters_getPrototypeOf(FacilityAnalystTraceup3DParameters.prototype), "destroy", this).call(this);
  20468. }
  20469. }]);
  20470. return FacilityAnalystTraceup3DParameters;
  20471. }(FacilityAnalyst3DParameters_FacilityAnalyst3DParameters);
  20472. SuperMap.FacilityAnalystTraceup3DParameters = FacilityAnalystTraceup3DParameters;
  20473. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DService.js
  20474. 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); }
  20475. function FacilityAnalystTraceup3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20476. 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); } }
  20477. function FacilityAnalystTraceup3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DService_defineProperties(Constructor, staticProps); return Constructor; }
  20478. 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); }
  20479. function FacilityAnalystTraceup3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  20480. 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); }
  20481. function FacilityAnalystTraceup3DService_setPrototypeOf(o, p) { FacilityAnalystTraceup3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DService_setPrototypeOf(o, p); }
  20482. 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); }; }
  20483. function FacilityAnalystTraceup3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTraceup3DService_assertThisInitialized(self); }
  20484. function FacilityAnalystTraceup3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20485. 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; } }
  20486. function FacilityAnalystTraceup3DService_getPrototypeOf(o) { FacilityAnalystTraceup3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DService_getPrototypeOf(o); }
  20487. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20488. * This program are made available under the terms of the Apache License, Version 2.0
  20489. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20490. /**
  20491. * @class SuperMap.FacilityAnalystTraceup3DService
  20492. * @category iServer FacilityAnalyst3D TraceUpResult
  20493. * @classdesc 上游追踪资源服务类
  20494. * @extends {SuperMap.CommonServiceBase}
  20495. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  20496. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  20497. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  20498. * @param {Object} options - 参数。
  20499. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  20500. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20501. * @param {Object} [options.headers] - 请求头。
  20502. */
  20503. var FacilityAnalystTraceup3DService_FacilityAnalystTraceup3DService = /*#__PURE__*/function (_CommonServiceBase) {
  20504. FacilityAnalystTraceup3DService_inherits(FacilityAnalystTraceup3DService, _CommonServiceBase);
  20505. var _super = FacilityAnalystTraceup3DService_createSuper(FacilityAnalystTraceup3DService);
  20506. /**
  20507. * @function SuperMap.FacilityAnalystTraceup3DService.constructor
  20508. * @description 上游追踪资源服务类构造函数。
  20509. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  20510. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  20511. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  20512. * @param {Object} options - 参数。
  20513. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  20514. */
  20515. function FacilityAnalystTraceup3DService(url, options) {
  20516. var _this;
  20517. FacilityAnalystTraceup3DService_classCallCheck(this, FacilityAnalystTraceup3DService);
  20518. _this = _super.call(this, url, options);
  20519. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DService";
  20520. return _this;
  20521. }
  20522. /**
  20523. * @function SuperMap.FacilityAnalystTraceup3DService.prototype.destroy
  20524. * @override
  20525. */
  20526. FacilityAnalystTraceup3DService_createClass(FacilityAnalystTraceup3DService, [{
  20527. key: "destroy",
  20528. value: function destroy() {
  20529. FacilityAnalystTraceup3DService_get(FacilityAnalystTraceup3DService_getPrototypeOf(FacilityAnalystTraceup3DService.prototype), "destroy", this).call(this);
  20530. }
  20531. /**
  20532. * @function SuperMap.FacilityAnalystTraceup3DService.prototype.processAsync
  20533. * @description 负责将客户端的查询参数传递到服务端。
  20534. * @param {SuperMap.FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类
  20535. */
  20536. }, {
  20537. key: "processAsync",
  20538. value: function processAsync(params) {
  20539. if (!(params instanceof FacilityAnalystTraceup3DParameters)) {
  20540. return;
  20541. }
  20542. var me = this,
  20543. jsonObject;
  20544. me.url = Util_Util.urlPathAppend(me.url, 'traceupresult');
  20545. jsonObject = {
  20546. edgeID: params.edgeID,
  20547. nodeID: params.nodeID,
  20548. weightName: params.weightName,
  20549. isUncertainDirectionValid: params.isUncertainDirectionValid
  20550. };
  20551. me.request({
  20552. method: "GET",
  20553. params: jsonObject,
  20554. scope: me,
  20555. success: me.serviceProcessCompleted,
  20556. failure: me.serviceProcessFailed
  20557. });
  20558. }
  20559. }]);
  20560. return FacilityAnalystTraceup3DService;
  20561. }(CommonServiceBase_CommonServiceBase);
  20562. SuperMap.FacilityAnalystTraceup3DService = FacilityAnalystTraceup3DService_FacilityAnalystTraceup3DService;
  20563. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DParameters.js
  20564. 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); }
  20565. function FacilityAnalystUpstream3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20566. 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); } }
  20567. function FacilityAnalystUpstream3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20568. 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); }
  20569. function FacilityAnalystUpstream3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  20570. 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); }
  20571. function FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p) { FacilityAnalystUpstream3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p); }
  20572. 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); }; }
  20573. function FacilityAnalystUpstream3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystUpstream3DParameters_assertThisInitialized(self); }
  20574. function FacilityAnalystUpstream3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20575. 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; } }
  20576. function FacilityAnalystUpstream3DParameters_getPrototypeOf(o) { FacilityAnalystUpstream3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DParameters_getPrototypeOf(o); }
  20577. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20578. * This program are made available under the terms of the Apache License, Version 2.0
  20579. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20580. /**
  20581. * @class SuperMap.FacilityAnalystUpstream3DParameters
  20582. * @category iServer FacilityAnalyst3D UpstreamCriticalFacilities
  20583. * @classdesc 上游关键设施查找资源参数类。
  20584. * @extends {SuperMap.FacilityAnalyst3DParameters}
  20585. * @param {Object} options - 参数。
  20586. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  20587. * @param {number} [options.edgeID] - 指定的弧段ID。edgeID 与 nodeID 必须指定一个。
  20588. * @param {number} [options.nodeID] - 指定的结点ID。edgeID 与 edgeID 必须指定一个。
  20589. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  20590. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  20591. */
  20592. var FacilityAnalystUpstream3DParameters_FacilityAnalystUpstream3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  20593. FacilityAnalystUpstream3DParameters_inherits(FacilityAnalystUpstream3DParameters, _FacilityAnalyst3DPar);
  20594. var _super = FacilityAnalystUpstream3DParameters_createSuper(FacilityAnalystUpstream3DParameters);
  20595. function FacilityAnalystUpstream3DParameters(options) {
  20596. var _this;
  20597. FacilityAnalystUpstream3DParameters_classCallCheck(this, FacilityAnalystUpstream3DParameters);
  20598. _this = _super.call(this, options);
  20599. options = options || {};
  20600. _this.sourceNodeIDs = null;
  20601. Util_Util.extend(FacilityAnalystUpstream3DParameters_assertThisInitialized(_this), options);
  20602. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DParameters";
  20603. return _this;
  20604. }
  20605. /**
  20606. * @function SuperMap.FacilityAnalystUpstream3DParameters.prototype.destroy
  20607. * @override
  20608. */
  20609. FacilityAnalystUpstream3DParameters_createClass(FacilityAnalystUpstream3DParameters, [{
  20610. key: "destroy",
  20611. value: function destroy() {
  20612. FacilityAnalystUpstream3DParameters_get(FacilityAnalystUpstream3DParameters_getPrototypeOf(FacilityAnalystUpstream3DParameters.prototype), "destroy", this).call(this);
  20613. this.sourceNodeIDs = null;
  20614. }
  20615. }]);
  20616. return FacilityAnalystUpstream3DParameters;
  20617. }(FacilityAnalyst3DParameters_FacilityAnalyst3DParameters);
  20618. SuperMap.FacilityAnalystUpstream3DParameters = FacilityAnalystUpstream3DParameters_FacilityAnalystUpstream3DParameters;
  20619. // CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DService.js
  20620. 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); }
  20621. function FacilityAnalystUpstream3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20622. 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); } }
  20623. function FacilityAnalystUpstream3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DService_defineProperties(Constructor, staticProps); return Constructor; }
  20624. 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); }
  20625. function FacilityAnalystUpstream3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  20626. 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); }
  20627. function FacilityAnalystUpstream3DService_setPrototypeOf(o, p) { FacilityAnalystUpstream3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DService_setPrototypeOf(o, p); }
  20628. 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); }; }
  20629. function FacilityAnalystUpstream3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystUpstream3DService_assertThisInitialized(self); }
  20630. function FacilityAnalystUpstream3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20631. 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; } }
  20632. function FacilityAnalystUpstream3DService_getPrototypeOf(o) { FacilityAnalystUpstream3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DService_getPrototypeOf(o); }
  20633. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20634. * This program are made available under the terms of the Apache License, Version 2.0
  20635. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20636. /**
  20637. * @class SuperMap.FacilityAnalystUpstream3DService
  20638. * @category iServer FacilityAnalyst3D UpstreamCriticalFacilities
  20639. * @classdesc 上游关键设施查找资源服务类
  20640. * @extends {SuperMap.CommonServiceBase}
  20641. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  20642. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  20643. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  20644. * @param {Object} options - 参数。
  20645. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  20646. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20647. * @param {Object} [options.headers] - 请求头。
  20648. */
  20649. var FacilityAnalystUpstream3DService_FacilityAnalystUpstream3DService = /*#__PURE__*/function (_CommonServiceBase) {
  20650. FacilityAnalystUpstream3DService_inherits(FacilityAnalystUpstream3DService, _CommonServiceBase);
  20651. var _super = FacilityAnalystUpstream3DService_createSuper(FacilityAnalystUpstream3DService);
  20652. function FacilityAnalystUpstream3DService(url, options) {
  20653. var _this;
  20654. FacilityAnalystUpstream3DService_classCallCheck(this, FacilityAnalystUpstream3DService);
  20655. _this = _super.call(this, url, options);
  20656. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DService";
  20657. return _this;
  20658. }
  20659. /**
  20660. * @function SuperMap.FacilityAnalystUpstream3DService.prototype.destroy
  20661. * @override
  20662. */
  20663. FacilityAnalystUpstream3DService_createClass(FacilityAnalystUpstream3DService, [{
  20664. key: "destroy",
  20665. value: function destroy() {
  20666. FacilityAnalystUpstream3DService_get(FacilityAnalystUpstream3DService_getPrototypeOf(FacilityAnalystUpstream3DService.prototype), "destroy", this).call(this);
  20667. }
  20668. /**
  20669. * @function SuperMap.FacilityAnalystUpstream3DService.prototype.processAsync
  20670. * @description 负责将客户端的查询参数传递到服务端。
  20671. * @param {SuperMap.FacilityAnalystUpstream3DParameters} params - 上游关键设施查找资源参数类
  20672. */
  20673. }, {
  20674. key: "processAsync",
  20675. value: function processAsync(params) {
  20676. if (!(params instanceof FacilityAnalystUpstream3DParameters_FacilityAnalystUpstream3DParameters)) {
  20677. return;
  20678. }
  20679. var me = this,
  20680. jsonObject;
  20681. me.url = Util_Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  20682. jsonObject = {
  20683. sourceNodeIDs: params.sourceNodeIDs,
  20684. edgeID: params.edgeID,
  20685. nodeID: params.nodeID,
  20686. isUncertainDirectionValid: params.isUncertainDirectionValid
  20687. };
  20688. me.request({
  20689. method: "GET",
  20690. params: jsonObject,
  20691. scope: me,
  20692. success: me.serviceProcessCompleted,
  20693. failure: me.serviceProcessFailed
  20694. });
  20695. }
  20696. }]);
  20697. return FacilityAnalystUpstream3DService;
  20698. }(CommonServiceBase_CommonServiceBase);
  20699. SuperMap.FacilityAnalystUpstream3DService = FacilityAnalystUpstream3DService_FacilityAnalystUpstream3DService;
  20700. // CONCATENATED MODULE: ./src/common/iServer/FilterAggParameter.js
  20701. 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); }
  20702. function FilterAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20703. 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); } }
  20704. function FilterAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FilterAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FilterAggParameter_defineProperties(Constructor, staticProps); return Constructor; }
  20705. 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); }
  20706. function FilterAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FilterAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  20707. 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); }
  20708. function FilterAggParameter_setPrototypeOf(o, p) { FilterAggParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FilterAggParameter_setPrototypeOf(o, p); }
  20709. 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); }; }
  20710. function FilterAggParameter_possibleConstructorReturn(self, call) { if (call && (FilterAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return FilterAggParameter_assertThisInitialized(self); }
  20711. function FilterAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20712. 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; } }
  20713. function FilterAggParameter_getPrototypeOf(o) { FilterAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FilterAggParameter_getPrototypeOf(o); }
  20714. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20715. * This program are made available under the terms of the Apache License, Version 2.0
  20716. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20717. /**
  20718. * @class SuperMap.FilterAggParameter
  20719. * @classdesc 过滤条件参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  20720. * @category iServer Data FeatureResults
  20721. * @param {Object} options - 初始化参数。
  20722. * @param {SuperMap.AggQueryBuilderParameter} options.filterParam - 过滤条件参数设置类。
  20723. * @param {SuperMap.AggregationType} [options.aggType=AggregationType.FILTER] - 聚合类型。
  20724. */
  20725. var FilterAggParameter_FilterAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  20726. FilterAggParameter_inherits(FilterAggParameter, _AggregationParameter);
  20727. var _super = FilterAggParameter_createSuper(FilterAggParameter);
  20728. function FilterAggParameter(options) {
  20729. var _this;
  20730. FilterAggParameter_classCallCheck(this, FilterAggParameter);
  20731. _this = _super.call(this, options);
  20732. /**
  20733. * @member {SuperMap.AggQueryBuilderParameter} SuperMap.FilterAggParameter.prototype.filterParam
  20734. * @description 过滤条件参数设置类。
  20735. */
  20736. _this.filterParam = null;
  20737. /**
  20738. * @member {SuperMap.AggregationType} [SuperMap.FilterAggParameter.prototype.aggType=AggregationType.FILTER]
  20739. * @description 聚合类型。
  20740. */
  20741. _this.aggType = AggregationType.FILTER;
  20742. _this.CLASS_NAME = "SuperMap.FilterAggParameter";
  20743. Util_Util.extend(FilterAggParameter_assertThisInitialized(_this), options);
  20744. return _this;
  20745. }
  20746. FilterAggParameter_createClass(FilterAggParameter, [{
  20747. key: "destroy",
  20748. value: function destroy() {
  20749. FilterAggParameter_get(FilterAggParameter_getPrototypeOf(FilterAggParameter.prototype), "destroy", this).call(this);
  20750. var me = this;
  20751. if (me.filterParam) {
  20752. me.filterParam = null;
  20753. }
  20754. }
  20755. }]);
  20756. return FilterAggParameter;
  20757. }(AggregationParameter_AggregationParameter);
  20758. SuperMap.FilterAggParameter = FilterAggParameter_FilterAggParameter;
  20759. // CONCATENATED MODULE: ./src/common/iServer/FieldParameters.js
  20760. function FieldParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20761. 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); } }
  20762. function FieldParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20763. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20764. * This program are made available under the terms of the Apache License, Version 2.0
  20765. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20766. /**
  20767. * @class SuperMap.FieldParameters
  20768. * @category iServer Data Field
  20769. * @classdesc 字段信息查询参数类。
  20770. * @param {Object} options - 参数。
  20771. * @param {string} options.datasource - 数据源名称。
  20772. * @param {string} options.dataset - 数据集名称。
  20773. */
  20774. var FieldParameters_FieldParameters = /*#__PURE__*/function () {
  20775. function FieldParameters(options) {
  20776. FieldParameters_classCallCheck(this, FieldParameters);
  20777. /**
  20778. * @member {string} SuperMap.FieldParameters.prototype.datasource
  20779. * @description 要查询的数据集所在的数据源名称。
  20780. */
  20781. this.datasource = null;
  20782. /**
  20783. * @member {string} SuperMap.FieldParameters.prototype.dataset
  20784. * @description 要查询的数据集名称。
  20785. */
  20786. this.dataset = null;
  20787. if (options) {
  20788. Util_Util.extend(this, options);
  20789. }
  20790. this.CLASS_NAME = "SuperMap.FieldParameters";
  20791. }
  20792. /**
  20793. * @function SuperMap.FieldParameters.prototype.destroy
  20794. * @description 释放资源,将引用资源的属性置空。
  20795. */
  20796. FieldParameters_createClass(FieldParameters, [{
  20797. key: "destroy",
  20798. value: function destroy() {
  20799. var me = this;
  20800. me.datasource = null;
  20801. me.dataset = null;
  20802. }
  20803. }]);
  20804. return FieldParameters;
  20805. }();
  20806. SuperMap.FieldParameters = FieldParameters_FieldParameters;
  20807. // CONCATENATED MODULE: ./src/common/iServer/FieldStatisticsParameters.js
  20808. 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); }
  20809. function FieldStatisticsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20810. 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); } }
  20811. function FieldStatisticsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20812. 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); }
  20813. function FieldStatisticsParameters_setPrototypeOf(o, p) { FieldStatisticsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticsParameters_setPrototypeOf(o, p); }
  20814. 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); }; }
  20815. function FieldStatisticsParameters_possibleConstructorReturn(self, call) { if (call && (FieldStatisticsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FieldStatisticsParameters_assertThisInitialized(self); }
  20816. function FieldStatisticsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20817. 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; } }
  20818. function FieldStatisticsParameters_getPrototypeOf(o) { FieldStatisticsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticsParameters_getPrototypeOf(o); }
  20819. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20820. * This program are made available under the terms of the Apache License, Version 2.0
  20821. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20822. /**
  20823. * @class SuperMap.FieldStatisticsParameters
  20824. * @category iServer Data Field
  20825. * @classdesc 字段统计信息查询参数类。
  20826. * @param {Object} options - 参数。
  20827. * @param {string} options.datasource - 数据源名称。
  20828. * @param {string} options.dataset - 数据集名称。
  20829. * @param {string} options.fieldName - 字段名。
  20830. * @param {(string.<SuperMap.StatisticMode>|Array.<string.<SuperMap.StatisticMode>>)} statisticMode - 字段统计方法类型。
  20831. * @extends {SuperMap.FieldParameters}
  20832. */
  20833. var FieldStatisticsParameters_FieldStatisticsParameters = /*#__PURE__*/function (_FieldParameters) {
  20834. FieldStatisticsParameters_inherits(FieldStatisticsParameters, _FieldParameters);
  20835. var _super = FieldStatisticsParameters_createSuper(FieldStatisticsParameters);
  20836. function FieldStatisticsParameters(options) {
  20837. var _this;
  20838. FieldStatisticsParameters_classCallCheck(this, FieldStatisticsParameters);
  20839. _this = _super.call(this, options);
  20840. /**
  20841. * @member {string} SuperMap.FieldStatisticsParameters.prototype.fieldName
  20842. * @description 字段名
  20843. */
  20844. _this.fieldName = null;
  20845. /**
  20846. * @member {(string.<SuperMap.StatisticMode>|Array.<string.<SuperMap.StatisticMode>>)} SuperMap.FieldStatisticsParameters.prototype.statisticMode
  20847. * @description 字段统计方法类型
  20848. */
  20849. _this.statisticMode = null;
  20850. if (options) {
  20851. Util_Util.extend(FieldStatisticsParameters_assertThisInitialized(_this), options);
  20852. }
  20853. _this.CLASS_NAME = "SuperMap.FieldStatisticsParameters";
  20854. return _this;
  20855. }
  20856. /**
  20857. * @function SuperMap.FieldStatisticsParameters.prototype.destroy
  20858. * @description 释放资源,将引用资源的属性置空。
  20859. */
  20860. FieldStatisticsParameters_createClass(FieldStatisticsParameters, [{
  20861. key: "destroy",
  20862. value: function destroy() {
  20863. var me = this;
  20864. me.fieldName = null;
  20865. me.statisticMode = null;
  20866. }
  20867. }]);
  20868. return FieldStatisticsParameters;
  20869. }(FieldParameters_FieldParameters);
  20870. SuperMap.FieldStatisticsParameters = FieldStatisticsParameters_FieldStatisticsParameters;
  20871. // CONCATENATED MODULE: ./src/common/iServer/FieldStatisticService.js
  20872. 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); }
  20873. function FieldStatisticService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20874. 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); } }
  20875. function FieldStatisticService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticService_defineProperties(Constructor, staticProps); return Constructor; }
  20876. 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); }
  20877. function FieldStatisticService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FieldStatisticService_getPrototypeOf(object); if (object === null) break; } return object; }
  20878. 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); }
  20879. function FieldStatisticService_setPrototypeOf(o, p) { FieldStatisticService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticService_setPrototypeOf(o, p); }
  20880. 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); }; }
  20881. function FieldStatisticService_possibleConstructorReturn(self, call) { if (call && (FieldStatisticService_typeof(call) === "object" || typeof call === "function")) { return call; } return FieldStatisticService_assertThisInitialized(self); }
  20882. function FieldStatisticService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20883. 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; } }
  20884. function FieldStatisticService_getPrototypeOf(o) { FieldStatisticService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticService_getPrototypeOf(o); }
  20885. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20886. * This program are made available under the terms of the Apache License, Version 2.0
  20887. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20888. /**
  20889. * @class SuperMap.FieldStatisticService
  20890. * @category iServer Data Field
  20891. * @classdesc 字段查询统计服务类。用来完成对指定数据集指定字段的查询统计分析,即求平均值,最大值等。
  20892. * @extends {SuperMap.CommonServiceBase}
  20893. * @param {string} url - 服务的访问地址。如访问 World Map 服务,只需将 url 设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  20894. * @param {Object} options - 参数。
  20895. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  20896. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  20897. * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  20898. * @param {string} options.datasource - 数据集所在的数据源名称。
  20899. * @param {string} options.dataset - 数据集名称。
  20900. * @param {string} options.field - 查询统计的目标字段名称。
  20901. * @param {SuperMap.StatisticMode} options.statisticMode - 字段查询统计的方法类型。
  20902. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20903. * @param {Object} [options.headers] - 请求头。
  20904. * @example
  20905. * var myService = new SuperMap.FieldStatisticService(url, {eventListeners: {
  20906. * "processCompleted": fieldStatisticCompleted,
  20907. * "processFailed": fieldStatisticError
  20908. * },
  20909. * datasource: "World",
  20910. * dataset: "Countries",
  20911. * field: "SmID",
  20912. * statisticMode: StatisticMode.AVERAGE
  20913. * };
  20914. */
  20915. var FieldStatisticService_FieldStatisticService = /*#__PURE__*/function (_CommonServiceBase) {
  20916. FieldStatisticService_inherits(FieldStatisticService, _CommonServiceBase);
  20917. var _super = FieldStatisticService_createSuper(FieldStatisticService);
  20918. function FieldStatisticService(url, options) {
  20919. var _this;
  20920. FieldStatisticService_classCallCheck(this, FieldStatisticService);
  20921. _this = _super.call(this, url, options);
  20922. /**
  20923. * @member {string} SuperMap.FieldStatisticService.prototype.datasource
  20924. * @description 数据集所在的数据源名称。
  20925. */
  20926. _this.datasource = null;
  20927. /**
  20928. * @member {string} SuperMap.FieldStatisticService.prototype.dataset
  20929. * @description 数据集名称。
  20930. */
  20931. _this.dataset = null;
  20932. /**
  20933. * @member {string} SuperMap.FieldStatisticService.prototype.field
  20934. * @description 查询统计的目标字段名称。
  20935. */
  20936. _this.field = null;
  20937. /**
  20938. * @member {SuperMap.StatisticMode} SuperMap.FieldStatisticService.prototype.statisticMode
  20939. * @description 字段查询统计的方法类型。
  20940. */
  20941. _this.statisticMode = null;
  20942. if (options) {
  20943. Util_Util.extend(FieldStatisticService_assertThisInitialized(_this), options);
  20944. }
  20945. _this.CLASS_NAME = "SuperMap.FieldStatisticService";
  20946. return _this;
  20947. }
  20948. /**
  20949. * @function SuperMap.FieldStatisticService.prototype.destroy
  20950. * @override
  20951. */
  20952. FieldStatisticService_createClass(FieldStatisticService, [{
  20953. key: "destroy",
  20954. value: function destroy() {
  20955. FieldStatisticService_get(FieldStatisticService_getPrototypeOf(FieldStatisticService.prototype), "destroy", this).call(this);
  20956. var me = this;
  20957. me.datasource = null;
  20958. me.dataset = null;
  20959. me.field = null;
  20960. me.statisticMode = null;
  20961. }
  20962. /**
  20963. * @function SuperMap.FieldStatisticService.prototype.processAsync
  20964. * @description 执行服务,进行指定字段的查询统计。
  20965. */
  20966. }, {
  20967. key: "processAsync",
  20968. value: function processAsync() {
  20969. var me = this,
  20970. fieldStatisticURL = "datasources/" + me.datasource + "/datasets/" + me.dataset + "/fields/" + me.field + "/" + me.statisticMode;
  20971. me.url = Util_Util.urlPathAppend(me.url, fieldStatisticURL);
  20972. me.request({
  20973. method: "GET",
  20974. data: null,
  20975. scope: me,
  20976. success: me.serviceProcessCompleted,
  20977. failure: me.serviceProcessFailed
  20978. });
  20979. }
  20980. }]);
  20981. return FieldStatisticService;
  20982. }(CommonServiceBase_CommonServiceBase);
  20983. SuperMap.FieldStatisticService = FieldStatisticService_FieldStatisticService;
  20984. // CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesParameters.js
  20985. function FindClosestFacilitiesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20986. 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); } }
  20987. function FindClosestFacilitiesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20988. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  20989. * This program are made available under the terms of the Apache License, Version 2.0
  20990. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20991. /**
  20992. * @class SuperMap.FindClosestFacilitiesParameters
  20993. * @category iServer NetworkAnalyst ClosestFacility
  20994. * @classdesc 最近设施分析参数类。
  20995. * @param {Object} options - 参数。
  20996. * @param {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)} options.event - 事件点,一般为需要获得服务设施服务的事件位置。
  20997. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.facilities - 设施点集合,一般为提供服务的服务设施位置。
  20998. * @param {number} [options.expectFacilityCount=1] - 要查找的设施点数量。
  20999. * @param {boolean} [options.fromEvent=false] - 是否从事件点到设施点进行查找。
  21000. * @param {boolean} [options.isAnalyzeById=false] - 事件点和设施点是否通过节点 ID 号来指定。
  21001. * @param {number} [options.maxWeight=0] - 查找半径。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  21002. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  21003. */
  21004. var FindClosestFacilitiesParameters_FindClosestFacilitiesParameters = /*#__PURE__*/function () {
  21005. function FindClosestFacilitiesParameters(options) {
  21006. FindClosestFacilitiesParameters_classCallCheck(this, FindClosestFacilitiesParameters);
  21007. /**
  21008. * @member {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)} SuperMap.FindClosestFacilitiesParameters.prototype.event
  21009. * @description 事件点,一般为需要获得服务设施服务的事件位置。
  21010. * 可以通过两种方式赋予事件点:当该类中字段 isAnalyzeById = true 时,应输入事件点 ID 号;当 isAnalyzeById = false 时,应输入事件点坐标。
  21011. */
  21012. this.event = null;
  21013. /**
  21014. * @member {number} [SuperMap.FindClosestFacilitiesParameters.prototype.expectFacilityCount=1]
  21015. * @description 要查找的设施点数量。
  21016. */
  21017. this.expectFacilityCount = 1;
  21018. /**
  21019. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} [SuperMap.FindClosestFacilitiesParameters.prototype.facilities=false]
  21020. * @description 设施点集合,一般为提供服务的服务设施位置。
  21021. * 可以通过两种方式赋予设施点:当该类中字段 isAnalyzeById = true 时,应输入设施点 ID 号;当 isAnalyzeById = false 时,应输入设施点坐标。
  21022. */
  21023. this.facilities = null;
  21024. /**
  21025. * @member {boolean} [SuperMap.FindClosestFacilitiesParameters.prototype.fromEvent=false]
  21026. * @description 是否从事件点到设施点进行查找。最近设施分析主要是通过设施点和事件点之间最优的路线来分析在一定范围内哪个或哪些设施与事件点有最优路线的关系。
  21027. * 这个行走线路是通过网络图层进行网络分析算法计算出来的两点间的最优路线。由于存在从 A 点到 B 点与从 B 点到 A 点的耗费不一样的情况,因此起止点
  21028. * 不同可能会得到不同的最优路线。因此在进行最近设施分析之前,需要设置获取的最优路线的方向,即是以事件点作为起点到最近设施点的方向分析,还是以最
  21029. * 近设施点为起点到事件点的方向分析。如果需要以事件点作为起点到设施点方向进行查找,设置该字段值为 true;设置为 false,表示从设施点到事件点进行查找。
  21030. */
  21031. this.fromEvent = false;
  21032. /**
  21033. * @member {boolean} [SuperMap.FindClosestFacilitiesParameters.prototype.isAnalyzeById=false]
  21034. * @description 事件点和设施点是否通过节点 ID 号来指定,设置为 false,表示通过坐标点指定事件点和设施点。
  21035. */
  21036. this.isAnalyzeById = false;
  21037. /**
  21038. * @member {number} [SuperMap.FindClosestFacilitiesParameters.prototype.maxWeight=0]
  21039. * @description 查找半径。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  21040. * 例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,超过 10 分钟能到达的都不予考虑。
  21041. * 那么需要将网络分析参数中 parameter.weightFieldName 设置为表示时间的字段,然后设置查找范围的半径值为10。
  21042. */
  21043. this.maxWeight = 0;
  21044. /**
  21045. * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindClosestFacilitiesParameters.prototype.parameter]
  21046. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  21047. * 它为 SuperMap.TransportationAnalystParameter 类型,虽然为可选参数,但是如果不设置其中的 resultSetting 字段,
  21048. * 则返回结果空间信息等都为空。
  21049. */
  21050. this.parameter = new TransportationAnalystParameter_TransportationAnalystParameter();
  21051. Util_Util.extend(this, options);
  21052. this.CLASS_NAME = "SuperMap.FindClosestFacilitiesParameters";
  21053. }
  21054. /**
  21055. * @function SuperMap.FindClosestFacilitiesParameters.prototype.destroy
  21056. * @description 释放资源,将引用资源的属性置空。
  21057. */
  21058. FindClosestFacilitiesParameters_createClass(FindClosestFacilitiesParameters, [{
  21059. key: "destroy",
  21060. value: function destroy() {
  21061. var me = this;
  21062. me.event = null;
  21063. me.expectFacilityCount = null;
  21064. me.facilities = null;
  21065. me.fromEvent = null;
  21066. me.isAnalyzeById = null;
  21067. me.maxWeight = null;
  21068. if (me.parameter) {
  21069. me.parameter.destroy();
  21070. me.parameter = null;
  21071. }
  21072. }
  21073. }]);
  21074. return FindClosestFacilitiesParameters;
  21075. }();
  21076. SuperMap.FindClosestFacilitiesParameters = FindClosestFacilitiesParameters_FindClosestFacilitiesParameters;
  21077. // CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesService.js
  21078. 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); }
  21079. function FindClosestFacilitiesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21080. 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); } }
  21081. function FindClosestFacilitiesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesService_defineProperties(Constructor, staticProps); return Constructor; }
  21082. 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); }
  21083. function FindClosestFacilitiesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindClosestFacilitiesService_getPrototypeOf(object); if (object === null) break; } return object; }
  21084. 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); }
  21085. function FindClosestFacilitiesService_setPrototypeOf(o, p) { FindClosestFacilitiesService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindClosestFacilitiesService_setPrototypeOf(o, p); }
  21086. 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); }; }
  21087. function FindClosestFacilitiesService_possibleConstructorReturn(self, call) { if (call && (FindClosestFacilitiesService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindClosestFacilitiesService_assertThisInitialized(self); }
  21088. function FindClosestFacilitiesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21089. 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; } }
  21090. function FindClosestFacilitiesService_getPrototypeOf(o) { FindClosestFacilitiesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindClosestFacilitiesService_getPrototypeOf(o); }
  21091. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  21092. * This program are made available under the terms of the Apache License, Version 2.0
  21093. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21094. /**
  21095. * @class SuperMap.FindClosestFacilitiesService
  21096. * @category iServer NetworkAnalyst ClosestFacility
  21097. * @classdesc 最近设施分析服务类。
  21098. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  21099. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  21100. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  21101. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  21102. * @extends {SuperMap.NetworkAnalystServiceBase}
  21103. * @example
  21104. * var myfindClosestFacilitiesService = new SuperMap.FindClosestFacilitiesService(url, {
  21105. * eventListeners: {
  21106. * "processCompleted": findClosestFacilitiesCompleted,
  21107. * "processFailed": findClosestFacilitiesError
  21108. * }
  21109. * });
  21110. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  21111. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  21112. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  21113. * @param {Object} options - 参数。
  21114. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  21115. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21116. * @param {Object} [options.headers] - 请求头。
  21117. */
  21118. var FindClosestFacilitiesService_FindClosestFacilitiesService = /*#__PURE__*/function (_NetworkAnalystServic) {
  21119. FindClosestFacilitiesService_inherits(FindClosestFacilitiesService, _NetworkAnalystServic);
  21120. var _super = FindClosestFacilitiesService_createSuper(FindClosestFacilitiesService);
  21121. /*
  21122. * @function SuperMap.FindClosestFacilitiesService.prototype.constructor
  21123. * @description 最近设施分析服务类构造函数。
  21124. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  21125. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  21126. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  21127. * @param {Object} options - 选参数。<br>
  21128. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  21129. */
  21130. function FindClosestFacilitiesService(url, options) {
  21131. var _this;
  21132. FindClosestFacilitiesService_classCallCheck(this, FindClosestFacilitiesService);
  21133. _this = _super.call(this, url, options);
  21134. _this.CLASS_NAME = "SuperMap.FindClosestFacilitiesService";
  21135. return _this;
  21136. }
  21137. /**
  21138. * @function SuperMap.FindClosestFacilitiesService.prototype.destroy
  21139. * @override
  21140. */
  21141. FindClosestFacilitiesService_createClass(FindClosestFacilitiesService, [{
  21142. key: "destroy",
  21143. value: function destroy() {
  21144. FindClosestFacilitiesService_get(FindClosestFacilitiesService_getPrototypeOf(FindClosestFacilitiesService.prototype), "destroy", this).call(this);
  21145. }
  21146. /**
  21147. * @function SuperMap.FindClosestFacilitiesService.prototype.processAsync
  21148. * @description 负责将客户端的查询参数传递到服务端。
  21149. * @param {SuperMap.FindClosestFacilitiesParameters} params - 最近设施分析服务参数类
  21150. */
  21151. }, {
  21152. key: "processAsync",
  21153. value: function processAsync(params) {
  21154. if (!(params instanceof FindClosestFacilitiesParameters_FindClosestFacilitiesParameters)) {
  21155. return;
  21156. }
  21157. var me = this,
  21158. jsonObject;
  21159. me.url = Util_Util.urlPathAppend(me.url, 'closestfacility');
  21160. jsonObject = {
  21161. expectFacilityCount: params.expectFacilityCount,
  21162. fromEvent: params.fromEvent,
  21163. maxWeight: params.maxWeight,
  21164. parameter: Util_Util.toJSON(params.parameter),
  21165. event: Util_Util.toJSON(params.event),
  21166. facilities: me.getJson(params.isAnalyzeById, params.facilities)
  21167. };
  21168. me.request({
  21169. method: "GET",
  21170. params: jsonObject,
  21171. scope: me,
  21172. success: me.serviceProcessCompleted,
  21173. failure: me.serviceProcessFailed
  21174. });
  21175. }
  21176. /**
  21177. * @function SuperMap.FindClosestFacilitiesService.prototype.getJson
  21178. * @description 将对象转化为JSON字符串。
  21179. * @param {boolean} isAnalyzeById - 是否通过ID来分析
  21180. * @param {Array} params - 分析参数数组
  21181. * @returns {Object} 转化后的JSON字符串。
  21182. */
  21183. }, {
  21184. key: "getJson",
  21185. value: function getJson(isAnalyzeById, params) {
  21186. var jsonString = "[",
  21187. len = params ? params.length : 0;
  21188. if (isAnalyzeById === false) {
  21189. for (var i = 0; i < len; i++) {
  21190. if (i > 0) {
  21191. jsonString += ",";
  21192. }
  21193. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  21194. }
  21195. } else if (isAnalyzeById === true) {
  21196. for (var _i = 0; _i < len; _i++) {
  21197. if (_i > 0) {
  21198. jsonString += ",";
  21199. }
  21200. jsonString += params[_i];
  21201. }
  21202. }
  21203. jsonString += ']';
  21204. return jsonString;
  21205. }
  21206. /**
  21207. * @function SuperMap.FindClosestFacilitiesService.prototype.toGeoJSONResult
  21208. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  21209. * @param {Object} result - 服务器返回的结果对象。
  21210. */
  21211. }, {
  21212. key: "toGeoJSONResult",
  21213. value: function toGeoJSONResult(result) {
  21214. if (!result || !result.facilityPathList) {
  21215. return result;
  21216. }
  21217. var geoJSONFormat = new GeoJSON_GeoJSON();
  21218. result.facilityPathList.map(function (path) {
  21219. if (path.route) {
  21220. path.route = geoJSONFormat.toGeoJSON(path.route);
  21221. }
  21222. if (path.pathGuideItems) {
  21223. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  21224. }
  21225. if (path.edgeFeatures) {
  21226. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  21227. }
  21228. if (path.nodeFeatures) {
  21229. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  21230. }
  21231. return path;
  21232. });
  21233. return result;
  21234. }
  21235. }]);
  21236. return FindClosestFacilitiesService;
  21237. }(NetworkAnalystServiceBase_NetworkAnalystServiceBase);
  21238. SuperMap.FindClosestFacilitiesService = FindClosestFacilitiesService_FindClosestFacilitiesService;
  21239. // CONCATENATED MODULE: ./src/common/iServer/FindLocationParameters.js
  21240. function FindLocationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21241. 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); } }
  21242. function FindLocationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21243. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  21244. * This program are made available under the terms of the Apache License, Version 2.0
  21245. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21246. /**
  21247. * @class SuperMap.FindLocationParameters
  21248. * @category iServer NetworkAnalyst Location
  21249. * @classdesc 选址分区分析参数类。
  21250. * @param {Object} options - 参数。
  21251. * @param {string} options.turnWeightField - 转向权值字段的名称。
  21252. * @param {string} options.weightName - 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  21253. * @param {Array.<SuperMap.SupplyCenter>} options.supplyCenters - 资源供给中心集合。
  21254. * @param {number} [options.expectedSupplyCenterCount=1] - 期望用于最终设施选址的资源供给中心数量。
  21255. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分配资源。
  21256. */
  21257. var FindLocationParameters_FindLocationParameters = /*#__PURE__*/function () {
  21258. function FindLocationParameters(options) {
  21259. FindLocationParameters_classCallCheck(this, FindLocationParameters);
  21260. /**
  21261. * @member {number} [SuperMap.FindLocationParameters.prototype.expectedSupplyCenterCount=1]
  21262. * @description 期望用于最终设施选址的资源供给中心数量。
  21263. * 当输入值为 0 时,最终设施选址的资源供给中心数量默认为覆盖分析区域内的所需最少的供给中心数。
  21264. */
  21265. this.expectedSupplyCenterCount = null;
  21266. /**
  21267. * @member {boolean} [SuperMap.FindLocationParameters.prototype.isFromCenter=false]
  21268. * @description 是否从中心点开始分配资源。
  21269. * 由于网路数据中的弧段具有正反阻力,即弧段的正向阻力值与其反向阻力值可能不同,
  21270. * 因此,在进行分析时,从资源供给中心开始分配资源到需求点与从需求点向资源供给中心分配这两种分配形式下,所得的分析结果会不同。
  21271. */
  21272. this.isFromCenter = false;
  21273. /**
  21274. * @member {Array.<SuperMap.SupplyCenter>} SuperMap.FindLocationParameters.prototype.supplyCenters
  21275. * @description 资源供给中心集合。
  21276. * 资源供给中心是提供资源和服务的设施,对应于网络结点,
  21277. * 资源供给中心的相关信息包括资源量、最大阻力值、资源供给中心类型,资源供给中心在网络中所处结点的 ID 等,以便在进行选址分区分析时使用。
  21278. */
  21279. this.supplyCenters = null;
  21280. /**
  21281. * @member {string} SuperMap.FindLocationParameters.prototype.turnWeightField
  21282. * @description 转向权值字段的名称。
  21283. */
  21284. this.turnWeightField = null;
  21285. /**
  21286. * @member {string} SuperMap.FindLocationParameters.prototype.weightName
  21287. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  21288. */
  21289. this.weightName = null;
  21290. Util_Util.extend(this, options);
  21291. this.CLASS_NAME = "SuperMap.FindLocationParameters";
  21292. }
  21293. /**
  21294. * @function SuperMap.FindLocationParameters.prototype.destroy
  21295. * @description 释放资源,将引用资源的属性置空。
  21296. */
  21297. FindLocationParameters_createClass(FindLocationParameters, [{
  21298. key: "destroy",
  21299. value: function destroy() {
  21300. var me = this;
  21301. me.expectedSupplyCenterCount = null;
  21302. me.isFromCenter = null;
  21303. me.turnWeightField = null;
  21304. me.weightName = null;
  21305. if (me.supplyCenters) {
  21306. for (var i = 0, supplyCenters = me.supplyCenters, len = supplyCenters.length; i < len; i++) {
  21307. supplyCenters[i].destroy();
  21308. }
  21309. me.supplyCenters = null;
  21310. }
  21311. }
  21312. }]);
  21313. return FindLocationParameters;
  21314. }();
  21315. SuperMap.FindLocationParameters = FindLocationParameters_FindLocationParameters;
  21316. // CONCATENATED MODULE: ./src/common/iServer/FindLocationService.js
  21317. 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); }
  21318. function FindLocationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21319. 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); } }
  21320. function FindLocationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationService_defineProperties(Constructor, staticProps); return Constructor; }
  21321. 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); }
  21322. function FindLocationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindLocationService_getPrototypeOf(object); if (object === null) break; } return object; }
  21323. 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); }
  21324. function FindLocationService_setPrototypeOf(o, p) { FindLocationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindLocationService_setPrototypeOf(o, p); }
  21325. 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); }; }
  21326. function FindLocationService_possibleConstructorReturn(self, call) { if (call && (FindLocationService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindLocationService_assertThisInitialized(self); }
  21327. function FindLocationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21328. 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; } }
  21329. function FindLocationService_getPrototypeOf(o) { FindLocationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindLocationService_getPrototypeOf(o); }
  21330. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  21331. * This program are made available under the terms of the Apache License, Version 2.0
  21332. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21333. /**
  21334. * @class SuperMap.FindLocationService
  21335. * @category iServer NetworkAnalyst Location
  21336. * @classdesc 选址分区分析服务类。
  21337. * 选址分区分析是为了确定一个或多个待建设施的最佳或最优位置,使得设施可以用一种最经济有效的方式为需求方提供服务或者商品。
  21338. * 选址分区不仅仅是一个选址过程,还要将需求点的需求分配到相应的新建设施的服务区中,因此称之为选址与分区。
  21339. * 选址分区分析结果通过该类支持的事件的监听函数参数获取
  21340. * @extends {SuperMap.NetworkAnalystServiceBase}
  21341. * @example
  21342. * (start code)
  21343. * var findLocationService = new SuperMap.FindLocationService(url, {
  21344. * eventListeners: {
  21345. * "processCompleted": findLocationCompleted,
  21346. * "processFailed": findLocationError
  21347. * }
  21348. * });
  21349. * (end)
  21350. * @param {string} url - 服务的访问地址。
  21351. * 如 http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  21352. * @param {Object} options - 参数。
  21353. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  21354. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21355. * @param {Object} [options.headers] - 请求头。
  21356. */
  21357. var FindLocationService_FindLocationService = /*#__PURE__*/function (_NetworkAnalystServic) {
  21358. FindLocationService_inherits(FindLocationService, _NetworkAnalystServic);
  21359. var _super = FindLocationService_createSuper(FindLocationService);
  21360. function FindLocationService(url, options) {
  21361. var _this;
  21362. FindLocationService_classCallCheck(this, FindLocationService);
  21363. _this = _super.call(this, url, options);
  21364. _this.CLASS_NAME = "SuperMap.FindLocationService";
  21365. return _this;
  21366. }
  21367. /**
  21368. * @function SuperMap.FindLocationService.prototype.destroy
  21369. * @override
  21370. */
  21371. FindLocationService_createClass(FindLocationService, [{
  21372. key: "destroy",
  21373. value: function destroy() {
  21374. FindLocationService_get(FindLocationService_getPrototypeOf(FindLocationService.prototype), "destroy", this).call(this);
  21375. }
  21376. /**
  21377. * @function SuperMap.FindLocationService.prototype.processAsync
  21378. * @description 负责将客户端的查询参数传递到服务端。
  21379. * @param {SuperMap.FindLocationParameters} params - 选址分区分析服务参数类
  21380. */
  21381. }, {
  21382. key: "processAsync",
  21383. value: function processAsync(params) {
  21384. if (!(params instanceof FindLocationParameters_FindLocationParameters)) {
  21385. return;
  21386. }
  21387. var me = this,
  21388. jsonObject;
  21389. me.url = Util_Util.urlPathAppend(me.url, 'location');
  21390. jsonObject = {
  21391. isFromCenter: params.isFromCenter,
  21392. expectedSupplyCenterCount: params.expectedSupplyCenterCount,
  21393. weightName: params.weightName,
  21394. turnWeightField: params.turnWeightField,
  21395. returnEdgeFeature: true,
  21396. returnEdgeGeometry: true,
  21397. returnNodeFeature: true,
  21398. mapParameter: Util_Util.toJSON(params.mapParameter),
  21399. supplyCenters: me.getCentersJson(params.supplyCenters)
  21400. };
  21401. me.request({
  21402. method: "GET",
  21403. params: jsonObject,
  21404. scope: me,
  21405. success: me.serviceProcessCompleted,
  21406. failure: me.serviceProcessFailed
  21407. });
  21408. }
  21409. /**
  21410. * @function SuperMap.FindLocationService.prototype.getCentersJson
  21411. * @description 将数组对象转化为JSON字符串。
  21412. * @param {Array} params - 需要转换的参数
  21413. * @returns {string} 转化后的JSON字符串。
  21414. */
  21415. }, {
  21416. key: "getCentersJson",
  21417. value: function getCentersJson(params) {
  21418. var json = "[",
  21419. len = params ? params.length : 0;
  21420. for (var i = 0; i < len; i++) {
  21421. if (i > 0) {
  21422. json += ",";
  21423. }
  21424. json += Util_Util.toJSON(params[i]);
  21425. }
  21426. json += "]";
  21427. return json;
  21428. }
  21429. /**
  21430. * @function SuperMap.FindLocationService.prototype.toGeoJSONResult
  21431. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  21432. * @param {Object} result - 服务器返回的结果对象。
  21433. */
  21434. }, {
  21435. key: "toGeoJSONResult",
  21436. value: function toGeoJSONResult(result) {
  21437. if (!result) {
  21438. return null;
  21439. }
  21440. var geoJSONFormat = new GeoJSON_GeoJSON();
  21441. if (result.demandResults) {
  21442. result.demandResults = geoJSONFormat.toGeoJSON(result.demandResults);
  21443. }
  21444. if (result.supplyResults) {
  21445. result.supplyResults = geoJSONFormat.toGeoJSON(result.supplyResults);
  21446. }
  21447. return result;
  21448. }
  21449. }]);
  21450. return FindLocationService;
  21451. }(NetworkAnalystServiceBase_NetworkAnalystServiceBase);
  21452. SuperMap.FindLocationService = FindLocationService_FindLocationService;
  21453. // CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsParameters.js
  21454. function FindMTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21455. 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); } }
  21456. function FindMTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21457. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  21458. * This program are made available under the terms of the Apache License, Version 2.0
  21459. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21460. /**
  21461. * @class SuperMap.FindMTSPPathsParameters
  21462. * @category iServer NetworkAnalyst MTSPPath
  21463. * @classdesc 多旅行商分析参数类
  21464. * @param {Object} options - 参数。
  21465. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.centers - 配送中心集合。
  21466. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 配送目标集合。
  21467. * @param {boolean} [options.hasLeastTotalCost=false] - 配送模式是否为总花费最小方案。
  21468. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  21469. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  21470. */
  21471. var FindMTSPPathsParameters_FindMTSPPathsParameters = /*#__PURE__*/function () {
  21472. function FindMTSPPathsParameters(options) {
  21473. FindMTSPPathsParameters_classCallCheck(this, FindMTSPPathsParameters);
  21474. /**
  21475. * @member SuperMap.FindMTSPPathsParameters.prototype.centers - {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>}
  21476. * @description 配送中心集合。
  21477. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = false 时,centers 应为点的坐标数组;
  21478. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = true 时,centers 应为点的 ID 数组。
  21479. */
  21480. this.centers = null;
  21481. /**
  21482. * @member {boolean} [SuperMap.FindMTSPPathsParameters.prototype.hasLeastTotalCost=false]
  21483. * @description 配送模式是否为总花费最小方案。
  21484. * 若为 true,则按照总花费最小的模式进行配送,此时可能会出现某几个配送中心点配送的花费较多而其他配送中心点的花费很少的情况。
  21485. * 若为 false,则为局部最优,此方案会控制每个配送中心点的花费,使各个中心点花费相对平均,此时总花费不一定最小。
  21486. */
  21487. this.hasLeastTotalCost = false;
  21488. /**
  21489. * @member {boolean} [SuperMap.FindMTSPPathsParameters.prototype.isAnalyzeById=false]
  21490. * @description 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  21491. */
  21492. this.isAnalyzeById = false;
  21493. /**
  21494. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindMTSPPathsParameters.prototype.nodes
  21495. * @description 配送目标集合。
  21496. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  21497. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  21498. */
  21499. this.nodes = null;
  21500. /**
  21501. * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindMTSPPathsParameters.prototype.parameter]
  21502. * @description 交通网络分析通用参数。
  21503. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  21504. * SuperMap.TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting 字段,则返回结果空间信息等都为空。
  21505. */
  21506. this.parameter = new TransportationAnalystParameter_TransportationAnalystParameter();
  21507. Util_Util.extend(this, options);
  21508. this.CLASS_NAME = "SuperMap.FindMTSPPathsParameters";
  21509. }
  21510. /**
  21511. * @function SuperMap.FindMTSPPathsParameters.prototype.destroy
  21512. * @description 释放资源,将引用资源的属性置空。
  21513. */
  21514. FindMTSPPathsParameters_createClass(FindMTSPPathsParameters, [{
  21515. key: "destroy",
  21516. value: function destroy() {
  21517. var me = this;
  21518. me.centers = null;
  21519. me.hasLeastTotalCost = null;
  21520. me.isAnalyzeById = null;
  21521. me.nodes = null;
  21522. me.maxWeight = null;
  21523. if (me.parameter) {
  21524. me.parameter.destroy();
  21525. me.parameter = null;
  21526. }
  21527. }
  21528. }]);
  21529. return FindMTSPPathsParameters;
  21530. }();
  21531. SuperMap.FindMTSPPathsParameters = FindMTSPPathsParameters_FindMTSPPathsParameters;
  21532. // CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsService.js
  21533. 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); }
  21534. function FindMTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21535. 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); } }
  21536. function FindMTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsService_defineProperties(Constructor, staticProps); return Constructor; }
  21537. 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); }
  21538. function FindMTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindMTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  21539. 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); }
  21540. function FindMTSPPathsService_setPrototypeOf(o, p) { FindMTSPPathsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindMTSPPathsService_setPrototypeOf(o, p); }
  21541. 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); }; }
  21542. function FindMTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindMTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindMTSPPathsService_assertThisInitialized(self); }
  21543. function FindMTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21544. 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; } }
  21545. function FindMTSPPathsService_getPrototypeOf(o) { FindMTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindMTSPPathsService_getPrototypeOf(o); }
  21546. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  21547. * This program are made available under the terms of the Apache License, Version 2.0
  21548. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21549. /**
  21550. * @class SuperMap.FindMTSPPathsService
  21551. * @category iServer NetworkAnalyst MTSPPath
  21552. * @classdesc 多旅行商分析服务类
  21553. * 多旅行商分析也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。
  21554. * 查找经济有效的配送路径,并给出相应的行走路线。
  21555. * 物流配送功能就是解决如何合理分配配送次序和送货路线,使配送总花费达到最小或每个配送中心的花费达到最小。
  21556. * 该类负责将客户端指定的多旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  21557. * 多旅行商分析结果通过该类支持的事件的监听函数参数获取
  21558. * @extends {SuperMap.NetworkAnalystServiceBase}
  21559. * @example
  21560. * var myFindMTSPPathsService = new SuperMap.FindMTSPPathsService(url, {
  21561. * eventListeners: {
  21562. * "processCompleted": findMTSPPathsCompleted,
  21563. * "processFailed": findMTSPPathsError
  21564. * }
  21565. * });
  21566. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  21567. * http://{服务器地址}:{服务端口号}/iserver/services/网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  21568. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  21569. * @param {Object} options - 互服务时所需可选参数。如:
  21570. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  21571. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21572. * @param {Object} [options.headers] - 请求头。
  21573. */
  21574. var FindMTSPPathsService_FindMTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  21575. FindMTSPPathsService_inherits(FindMTSPPathsService, _NetworkAnalystServic);
  21576. var _super = FindMTSPPathsService_createSuper(FindMTSPPathsService);
  21577. function FindMTSPPathsService(url, options) {
  21578. var _this;
  21579. FindMTSPPathsService_classCallCheck(this, FindMTSPPathsService);
  21580. _this = _super.call(this, url, options);
  21581. _this.CLASS_NAME = "SuperMap.FindMTSPPathsService";
  21582. return _this;
  21583. }
  21584. /**
  21585. * @function SuperMap.FindMTSPPathsService.prototype.destroy
  21586. * @override
  21587. */
  21588. FindMTSPPathsService_createClass(FindMTSPPathsService, [{
  21589. key: "destroy",
  21590. value: function destroy() {
  21591. FindMTSPPathsService_get(FindMTSPPathsService_getPrototypeOf(FindMTSPPathsService.prototype), "destroy", this).call(this);
  21592. }
  21593. /**
  21594. * @function SuperMap.FindMTSPPathsService..prototype.processAsync
  21595. * @description 负责将客户端的查询参数传递到服务端。
  21596. * @param {SuperMap.FindMTSPPathsParameters} params - 多旅行商分析服务参数类
  21597. */
  21598. }, {
  21599. key: "processAsync",
  21600. value: function processAsync(params) {
  21601. if (!(params instanceof FindMTSPPathsParameters_FindMTSPPathsParameters)) {
  21602. return;
  21603. }
  21604. var me = this,
  21605. jsonObject,
  21606. //end = me.url.substr(me.url.length - 1, 1),
  21607. centers = me.getJson(params.isAnalyzeById, params.centers),
  21608. nodes = me.getJson(params.isAnalyzeById, params.nodes);
  21609. me.url = Util_Util.urlPathAppend(me.url, 'mtsppath');
  21610. jsonObject = {
  21611. centers: centers,
  21612. nodes: nodes,
  21613. parameter: Util_Util.toJSON(params.parameter),
  21614. hasLeastTotalCost: params.hasLeastTotalCost
  21615. };
  21616. me.request({
  21617. method: "GET",
  21618. params: jsonObject,
  21619. scope: me,
  21620. success: me.serviceProcessCompleted,
  21621. failure: me.serviceProcessFailed
  21622. });
  21623. }
  21624. /**
  21625. * @function SuperMap.FindMTSPPathsService.prototype.getJson
  21626. * @description 将对象转化为JSON字符串。
  21627. * @param {boolean} isAnalyzeById - 是否通过id分析
  21628. * @param {Array} params - 需要转换的数字
  21629. * @returns {Object} 转化后的JSON字符串。
  21630. */
  21631. }, {
  21632. key: "getJson",
  21633. value: function getJson(isAnalyzeById, params) {
  21634. var jsonString = "[",
  21635. len = params ? params.length : 0;
  21636. if (isAnalyzeById === false) {
  21637. for (var i = 0; i < len; i++) {
  21638. if (i > 0) {
  21639. jsonString += ",";
  21640. }
  21641. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  21642. }
  21643. } else if (isAnalyzeById === true) {
  21644. for (var _i = 0; _i < len; _i++) {
  21645. if (_i > 0) {
  21646. jsonString += ",";
  21647. }
  21648. jsonString += params[_i];
  21649. }
  21650. }
  21651. jsonString += ']';
  21652. return jsonString;
  21653. }
  21654. /**
  21655. * @function SuperMap.FindMTSPPathsService.prototype.toGeoJSONResult
  21656. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  21657. * @param {Object} result - 服务器返回的结果对象。
  21658. */
  21659. }, {
  21660. key: "toGeoJSONResult",
  21661. value: function toGeoJSONResult(result) {
  21662. if (!result || !result.pathList) {
  21663. return null;
  21664. }
  21665. var geoJSONFormat = new GeoJSON_GeoJSON();
  21666. result.pathList.map(function (path) {
  21667. if (path.route) {
  21668. path.route = geoJSONFormat.toGeoJSON(path.route);
  21669. }
  21670. if (path.pathGuideItems) {
  21671. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  21672. }
  21673. if (path.edgeFeatures) {
  21674. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  21675. }
  21676. if (path.nodeFeatures) {
  21677. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  21678. }
  21679. return path;
  21680. });
  21681. return result;
  21682. }
  21683. }]);
  21684. return FindMTSPPathsService;
  21685. }(NetworkAnalystServiceBase_NetworkAnalystServiceBase);
  21686. SuperMap.FindMTSPPathsService = FindMTSPPathsService_FindMTSPPathsService;
  21687. // CONCATENATED MODULE: ./src/common/iServer/FindPathParameters.js
  21688. function FindPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21689. 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); } }
  21690. function FindPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21691. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  21692. * This program are made available under the terms of the Apache License, Version 2.0
  21693. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21694. /**
  21695. * @class SuperMap.FindPathParameters
  21696. * @category iServer NetworkAnalyst Path
  21697. * @classdesc 最佳路径分析参数类。最佳路径是在网络数据集中指定一些结点,按照顺序访问结点从而求解起止点之间阻抗最小的路径。
  21698. * 例如如果要顺序访问 1、2、3、4 四个结点,则需要分别找到1、2结点间的最佳路径 R1—2,2、3 间的最佳路径 R2—3 和 3、4 结点间的最佳路径 R3—4,
  21699. * 顺序访问 1、2、3、4 四个结点的最佳路径就是 R = R1—2 + R2—3 + R3—4。
  21700. * 阻抗就是指从一点到另一点的耗费,在实际应用中我们可以将距离、时间、花费等作为阻抗条件。
  21701. * 阻抗最小也就可以理解为从一点到另一点距离最短、时间最少、花费最低等。当两点间距离最短时为最短路径,它是最佳路径问题的一个特例。
  21702. * 阻抗值通过 SuperMap.TransportationAnalystParameter.weightFieldName 设置。
  21703. * 计算最佳路径除了受阻抗影响外,还受转向字段的影响。转向值通过 {@link SuperMap.TransportationAnalystParameter.turnWeightField} 设置。
  21704. *
  21705. * @param {Object} options - 参数。
  21706. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 最佳路径分析经过的结点或设施点数组。该字段至少包含两个点。
  21707. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  21708. * @param {boolean} [options.hasLeastEdgeCount=false] - 是否按照弧段数最少的进行最佳路径分析。
  21709. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  21710. */
  21711. var FindPathParameters_FindPathParameters = /*#__PURE__*/function () {
  21712. function FindPathParameters(options) {
  21713. FindPathParameters_classCallCheck(this, FindPathParameters);
  21714. /**
  21715. * @member {boolean} [SuperMap.FindPathParameters.prototype.isAnalyzeById=false]
  21716. * @description 是否通过节点 ID 指定路径分析的结点。
  21717. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  21718. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 SuperMap.FindPathParameters.nodes = [ID1,ID2,...];
  21719. * 反之表示通过结点坐标指定途经点,即 SuperMap.FindPathParameters.nodes = [{x1,y1},{x2,y2},...] 。
  21720. */
  21721. this.isAnalyzeById = false;
  21722. /**
  21723. * @member {boolean} [SuperMap.FindPathParameters.prototype.hasLeastEdgeCount=false]
  21724. * @description 是否按照弧段数最少的进行最佳路径分析。
  21725. * true 表示按照弧段数最少进行分析,返回弧段数最少的路径中一个阻抗最小的最佳路径;
  21726. * false 表示直接返回阻抗最小的路径,而不考虑弧段的多少。
  21727. */
  21728. this.hasLeastEdgeCount = null;
  21729. /**
  21730. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindPathParameters.prototype.nodes
  21731. * @description 最佳路径分析经过的结点或设施点数组,必设字段。该字段至少包含两个点。
  21732. * 当 SuperMap.FindPathParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  21733. * 当 SuperMap.FindPathParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  21734. */
  21735. this.nodes = null;
  21736. /**
  21737. * @member {SuperMap.TransportationAnalystParameter} SuperMap.FindPathParameters.prototype.parameter
  21738. * @description 交通网络分析通用参数。
  21739. */
  21740. this.parameter = new TransportationAnalystParameter_TransportationAnalystParameter();
  21741. Util_Util.extend(this, options);
  21742. this.CLASS_NAME = "SuperMap.FindPathParameters";
  21743. }
  21744. /**
  21745. * @function SuperMap.FindPathParameters.prototype.destroy
  21746. * @description 释放资源,将引用资源的属性置空。
  21747. */
  21748. FindPathParameters_createClass(FindPathParameters, [{
  21749. key: "destroy",
  21750. value: function destroy() {
  21751. var me = this;
  21752. me.isAnalyzeById = null;
  21753. me.hasLeastEdgeCount = null;
  21754. me.nodes = null;
  21755. if (me.parameter) {
  21756. me.parameter.destroy();
  21757. me.parameter = null;
  21758. }
  21759. }
  21760. }]);
  21761. return FindPathParameters;
  21762. }();
  21763. SuperMap.FindPathParameters = FindPathParameters_FindPathParameters;
  21764. // CONCATENATED MODULE: ./src/common/iServer/FindPathService.js
  21765. 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); }
  21766. function FindPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21767. 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); } }
  21768. function FindPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathService_defineProperties(Constructor, staticProps); return Constructor; }
  21769. 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); }
  21770. function FindPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  21771. 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); }
  21772. function FindPathService_setPrototypeOf(o, p) { FindPathService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindPathService_setPrototypeOf(o, p); }
  21773. 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); }; }
  21774. function FindPathService_possibleConstructorReturn(self, call) { if (call && (FindPathService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindPathService_assertThisInitialized(self); }
  21775. function FindPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21776. 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; } }
  21777. function FindPathService_getPrototypeOf(o) { FindPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindPathService_getPrototypeOf(o); }
  21778. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  21779. * This program are made available under the terms of the Apache License, Version 2.0
  21780. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21781. /**
  21782. * @class SuperMap.FindPathService
  21783. * @category iServer NetworkAnalyst Path
  21784. * @classdesc 最佳路径分析服务类。
  21785. * 最佳路径是在网络数据集中指定一些节点,按照节点的选择顺序,
  21786. * 顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  21787. * 该类负责将客户端指定的最佳路径分析参数传递给服务端,并接收服务端返回的结果数据。
  21788. * 最佳路径分析结果通过该类支持的事件的监听函数参数获取
  21789. * @extends {SuperMap.NetworkAnalystServiceBase}
  21790. * @example
  21791. * var myFindPathService = new SuperMap.FindPathService(url, {
  21792. * eventListeners: {
  21793. * "processCompleted": findPathCompleted,
  21794. * "processFailed": findPathError
  21795. * }
  21796. * });
  21797. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  21798. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  21799. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  21800. * @param {Object} options - 参数。
  21801. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  21802. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21803. * @param {Object} [options.headers] - 请求头。
  21804. */
  21805. var FindPathService_FindPathService = /*#__PURE__*/function (_NetworkAnalystServic) {
  21806. FindPathService_inherits(FindPathService, _NetworkAnalystServic);
  21807. var _super = FindPathService_createSuper(FindPathService);
  21808. function FindPathService(url, options) {
  21809. var _this;
  21810. FindPathService_classCallCheck(this, FindPathService);
  21811. _this = _super.call(this, url, options);
  21812. _this.CLASS_NAME = "SuperMap.FindPathService";
  21813. return _this;
  21814. }
  21815. /**
  21816. * @function SuperMap.FindPathService.prototype.destroy
  21817. * @override
  21818. */
  21819. FindPathService_createClass(FindPathService, [{
  21820. key: "destroy",
  21821. value: function destroy() {
  21822. FindPathService_get(FindPathService_getPrototypeOf(FindPathService.prototype), "destroy", this).call(this);
  21823. }
  21824. /**
  21825. * @function SuperMap.FindPathService.prototype.processAsync
  21826. * @description 负责将客户端的查询参数传递到服务端。
  21827. * @param {SuperMap.FindPathParameters} params - 最佳路径分析服务参数类
  21828. */
  21829. }, {
  21830. key: "processAsync",
  21831. value: function processAsync(params) {
  21832. if (!(params instanceof FindPathParameters_FindPathParameters)) {
  21833. return;
  21834. }
  21835. var me = this,
  21836. jsonObject;
  21837. me.url = Util_Util.urlPathAppend(me.url, 'path');
  21838. jsonObject = {
  21839. hasLeastEdgeCount: params.hasLeastEdgeCount,
  21840. parameter: Util_Util.toJSON(params.parameter),
  21841. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  21842. };
  21843. me.request({
  21844. method: "GET",
  21845. params: jsonObject,
  21846. scope: me,
  21847. success: me.serviceProcessCompleted,
  21848. failure: me.serviceProcessFailed
  21849. });
  21850. }
  21851. /**
  21852. * @function SuperMap.FindPathService.prototype.getJson
  21853. * @description 将对象转化为JSON字符串。
  21854. * @param {boolean} isAnalyzeById - 是否通过id分析
  21855. * @param {Array} params - 需要转换的数字
  21856. * @returns {Object} 转化后的JSON字符串。
  21857. */
  21858. }, {
  21859. key: "getJson",
  21860. value: function getJson(isAnalyzeById, params) {
  21861. var jsonString = "[",
  21862. len = params ? params.length : 0;
  21863. if (isAnalyzeById === false) {
  21864. for (var i = 0; i < len; i++) {
  21865. if (i > 0) {
  21866. jsonString += ",";
  21867. }
  21868. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  21869. }
  21870. } else if (isAnalyzeById === true) {
  21871. for (var _i = 0; _i < len; _i++) {
  21872. if (_i > 0) {
  21873. jsonString += ",";
  21874. }
  21875. jsonString += params[_i];
  21876. }
  21877. }
  21878. jsonString += ']';
  21879. return jsonString;
  21880. }
  21881. /**
  21882. * @function SuperMap.FindMTSPPathsService.prototype.toGeoJSONResult
  21883. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  21884. * @param {Object} result - 服务器返回的结果对象。
  21885. */
  21886. }, {
  21887. key: "toGeoJSONResult",
  21888. value: function toGeoJSONResult(result) {
  21889. if (!result || !result.pathList || result.pathList.length < 1) {
  21890. return null;
  21891. }
  21892. var geoJSONFormat = new GeoJSON_GeoJSON();
  21893. result.pathList.forEach(function (path) {
  21894. if (path.route) {
  21895. path.route = geoJSONFormat.toGeoJSON(path.route);
  21896. }
  21897. if (path.pathGuideItems) {
  21898. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  21899. }
  21900. if (path.edgeFeatures) {
  21901. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  21902. }
  21903. if (path.nodeFeatures) {
  21904. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  21905. }
  21906. });
  21907. return result;
  21908. }
  21909. }]);
  21910. return FindPathService;
  21911. }(NetworkAnalystServiceBase_NetworkAnalystServiceBase);
  21912. SuperMap.FindPathService = FindPathService_FindPathService;
  21913. // CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasParameters.js
  21914. function FindServiceAreasParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21915. 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); } }
  21916. function FindServiceAreasParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21917. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  21918. * This program are made available under the terms of the Apache License, Version 2.0
  21919. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21920. /**
  21921. * @class SuperMap.FindServiceAreasParameters
  21922. * @category iServer NetworkAnalyst ServiceArea
  21923. * @classdesc 服务区分析参数类。
  21924. * 服务区分析是以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  21925. * 例如:计算某快餐店能够在30分钟内送达快餐的区域。
  21926. * @param {Object} options - 参数。
  21927. * @param {Array.<number>} options.weights - 每个服务站点提供服务的阻力半径,超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  21928. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.centers - 服务站点数组。
  21929. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  21930. * @param {boolean} [options.isCenterMutuallyExclusive=false] - 是否中心点互斥。
  21931. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分析。
  21932. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  21933. */
  21934. var FindServiceAreasParameters_FindServiceAreasParameters = /*#__PURE__*/function () {
  21935. function FindServiceAreasParameters(options) {
  21936. FindServiceAreasParameters_classCallCheck(this, FindServiceAreasParameters);
  21937. /**
  21938. * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isAnalyzeById=false]
  21939. * @description 是否通过节点 ID 指定路径分析的结点。
  21940. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  21941. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 SuperMap.FindServiceAreasParameters.centers = [ID1,ID2,...];
  21942. * 反之表示通过结点坐标指定途经点,即 SuperMap.FindServiceAreasParameters.centers = [{x1,y1},{x2,y2},...]。
  21943. */
  21944. this.isAnalyzeById = false;
  21945. /**
  21946. * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isCenterMutuallyExclusive=false]
  21947. * @description 是否中心点互斥,即按照中心点的距离进行判断是否要进行互斥处理。
  21948. * 若分析出的服务区有重叠的部分,则通过设置该参数进行互斥处理。
  21949. */
  21950. this.isCenterMutuallyExclusive = false;
  21951. /**
  21952. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindServiceAreasParameters.prototype.centers
  21953. * @description 服务站点数组。
  21954. * 当该类的 iSAnalyzeById = true 时,通过结点 ID 号指定服务站点;当 iSAnalyzeById = false 时,通过点坐标指定服务站点。
  21955. */
  21956. this.centers = null;
  21957. /**
  21958. * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isFromCenter=false]
  21959. * @description 是否从中心点开始分析。
  21960. * 从中心点开始分析和不从中心点开始分析,体现了服务中心和需要该服务的需求地的关系模式。
  21961. * 从中心点开始分析,是一个服务中心向服务需求地提供服务;
  21962. * 而不从中心点开始分析,是一个服务需求地主动到服务中心获得服务。
  21963. */
  21964. this.isFromCenter = false;
  21965. /**
  21966. * APIProperty: weights
  21967. * @member {Array.<number>} SuperMap.FindServiceAreasParameters.prototype.weights
  21968. * @description 每个服务站点提供服务的阻力半径,即超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  21969. * 该字段为一个数组,数组长度跟服务中心个数一致,按照索引顺序与站点一一对应,每个元素表示了在对每个服务中心进行服务区分析时,所用的服务半径。
  21970. */
  21971. this.weights = null;
  21972. /**
  21973. * @member {SuperMap.TransportationAnalystParameter} SuperMap.FindServiceAreasParameters.prototype.parameter
  21974. * @description 交通网络分析通用参数。
  21975. */
  21976. this.parameter = new TransportationAnalystParameter_TransportationAnalystParameter();
  21977. Util_Util.extend(this, options);
  21978. this.CLASS_NAME = "SuperMap.FindServiceAreasParameters";
  21979. }
  21980. /**
  21981. * @function SuperMap.FindServiceAreasParameters.prototype.destroy
  21982. * @description 释放资源,将引用资源的属性置空。
  21983. */
  21984. FindServiceAreasParameters_createClass(FindServiceAreasParameters, [{
  21985. key: "destroy",
  21986. value: function destroy() {
  21987. var me = this;
  21988. me.isAnalyzeById = null;
  21989. me.isCenterMutuallyExclusive = null;
  21990. me.centers = null;
  21991. me.isFromCenter = null;
  21992. me.weights = null;
  21993. if (me.parameter) {
  21994. me.parameter.destroy();
  21995. me.parameter = null;
  21996. }
  21997. }
  21998. }]);
  21999. return FindServiceAreasParameters;
  22000. }();
  22001. SuperMap.FindServiceAreasParameters = FindServiceAreasParameters_FindServiceAreasParameters;
  22002. // CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasService.js
  22003. 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); }
  22004. function FindServiceAreasService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22005. 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); } }
  22006. function FindServiceAreasService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasService_defineProperties(Constructor, staticProps); return Constructor; }
  22007. 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); }
  22008. function FindServiceAreasService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindServiceAreasService_getPrototypeOf(object); if (object === null) break; } return object; }
  22009. 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); }
  22010. function FindServiceAreasService_setPrototypeOf(o, p) { FindServiceAreasService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindServiceAreasService_setPrototypeOf(o, p); }
  22011. 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); }; }
  22012. function FindServiceAreasService_possibleConstructorReturn(self, call) { if (call && (FindServiceAreasService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindServiceAreasService_assertThisInitialized(self); }
  22013. function FindServiceAreasService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22014. 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; } }
  22015. function FindServiceAreasService_getPrototypeOf(o) { FindServiceAreasService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindServiceAreasService_getPrototypeOf(o); }
  22016. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  22017. * This program are made available under the terms of the Apache License, Version 2.0
  22018. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22019. /**
  22020. * @class SuperMap.FindServiceAreasService
  22021. * @category iServer NetworkAnalyst ServiceArea
  22022. * @classdesc 服务区分析服务类。
  22023. * 服务区分析是以指定服务站点为中心,
  22024. * 在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  22025. * 该类负责将客户端指定的服务区分析参数传递给服务端,并接收服务端返回的结果数据。
  22026. * 服务区分析结果通过该类支持的事件的监听函数参数获取
  22027. * @extends {SuperMap.NetworkAnalystServiceBase}
  22028. * @example
  22029. * var myFindServiceAreasService = new SuperMap.FindServiceAreasService(url, {
  22030. * eventListeners: {
  22031. * "processCompleted": findServiceAreasCompleted,
  22032. * "processFailed": findServiceAreasError
  22033. * }
  22034. * });
  22035. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  22036. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  22037. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  22038. * @param {Object} options - 互服务时所需可选参数。如:
  22039. * @param {Object} options.eventListeners - 需要被注册的监听器对象
  22040. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22041. * @param {Object} [options.headers] - 请求头。
  22042. */
  22043. var FindServiceAreasService_FindServiceAreasService = /*#__PURE__*/function (_NetworkAnalystServic) {
  22044. FindServiceAreasService_inherits(FindServiceAreasService, _NetworkAnalystServic);
  22045. var _super = FindServiceAreasService_createSuper(FindServiceAreasService);
  22046. function FindServiceAreasService(url, options) {
  22047. var _this;
  22048. FindServiceAreasService_classCallCheck(this, FindServiceAreasService);
  22049. _this = _super.call(this, url, options);
  22050. _this.CLASS_NAME = "SuperMap.FindServiceAreasService";
  22051. return _this;
  22052. }
  22053. /**
  22054. * @function SuperMap.FindServiceAreasService.prototype.destroy
  22055. * @override
  22056. */
  22057. FindServiceAreasService_createClass(FindServiceAreasService, [{
  22058. key: "destroy",
  22059. value: function destroy() {
  22060. FindServiceAreasService_get(FindServiceAreasService_getPrototypeOf(FindServiceAreasService.prototype), "destroy", this).call(this);
  22061. }
  22062. /**
  22063. * @function SuperMap.FindServiceAreasService.prototype.processAsync
  22064. * @description 负责将客户端的查询参数传递到服务端。
  22065. * @param {SuperMap.FindServiceAreasParameters} params - 服务区分析服务参数类
  22066. */
  22067. }, {
  22068. key: "processAsync",
  22069. value: function processAsync(params) {
  22070. if (!(params instanceof FindServiceAreasParameters_FindServiceAreasParameters)) {
  22071. return;
  22072. }
  22073. var me = this,
  22074. jsonObject;
  22075. me.url = Util_Util.urlPathAppend(me.url, 'servicearea');
  22076. jsonObject = {
  22077. isFromCenter: params.isFromCenter,
  22078. isCenterMutuallyExclusive: params.isCenterMutuallyExclusive,
  22079. parameter: Util_Util.toJSON(params.parameter),
  22080. centers: me.getJson(params.isAnalyzeById, params.centers),
  22081. weights: me.getJson(true, params.weights)
  22082. };
  22083. me.request({
  22084. method: "GET",
  22085. params: jsonObject,
  22086. scope: me,
  22087. success: me.serviceProcessCompleted,
  22088. failure: me.serviceProcessFailed
  22089. });
  22090. }
  22091. /**
  22092. * @function SuperMap.FindServiceAreasService.prototype.getJson
  22093. * @description 将对象转化为JSON字符串。
  22094. * @param {boolean} isAnalyzeById - 是否通过id分析
  22095. * @param {Array} params - 需要转换的数字
  22096. * @returns {Object} 转化后的JSON字符串。
  22097. */
  22098. }, {
  22099. key: "getJson",
  22100. value: function getJson(isAnalyzeById, params) {
  22101. var jsonString = "[",
  22102. len = params ? params.length : 0;
  22103. if (isAnalyzeById === false) {
  22104. for (var i = 0; i < len; i++) {
  22105. if (i > 0) {
  22106. jsonString += ",";
  22107. }
  22108. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  22109. }
  22110. } else if (isAnalyzeById === true) {
  22111. for (var _i = 0; _i < len; _i++) {
  22112. if (_i > 0) {
  22113. jsonString += ",";
  22114. }
  22115. jsonString += params[_i];
  22116. }
  22117. }
  22118. jsonString += ']';
  22119. return jsonString;
  22120. }
  22121. /**
  22122. * @function SuperMap.FindServiceAreasService.prototype.toGeoJSONResult
  22123. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  22124. * @param {Object} result - 服务器返回的结果对象。。
  22125. */
  22126. }, {
  22127. key: "toGeoJSONResult",
  22128. value: function toGeoJSONResult(result) {
  22129. if (!result || !result.serviceAreaList) {
  22130. return result;
  22131. }
  22132. var geoJSONFormat = new GeoJSON_GeoJSON();
  22133. result.serviceAreaList.map(function (serviceArea) {
  22134. if (serviceArea.serviceRegion) {
  22135. serviceArea.serviceRegion = geoJSONFormat.toGeoJSON(serviceArea.serviceRegion);
  22136. }
  22137. if (serviceArea.edgeFeatures) {
  22138. serviceArea.edgeFeatures = geoJSONFormat.toGeoJSON(serviceArea.edgeFeatures);
  22139. }
  22140. if (serviceArea.nodeFeatures) {
  22141. serviceArea.nodeFeatures = geoJSONFormat.toGeoJSON(serviceArea.nodeFeatures);
  22142. }
  22143. if (serviceArea.routes) {
  22144. serviceArea.routes = geoJSONFormat.toGeoJSON(serviceArea.routes);
  22145. }
  22146. return serviceArea;
  22147. });
  22148. return result;
  22149. }
  22150. }]);
  22151. return FindServiceAreasService;
  22152. }(NetworkAnalystServiceBase_NetworkAnalystServiceBase);
  22153. SuperMap.FindServiceAreasService = FindServiceAreasService_FindServiceAreasService;
  22154. // CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsParameters.js
  22155. function FindTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22156. 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); } }
  22157. function FindTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22158. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  22159. * This program are made available under the terms of the Apache License, Version 2.0
  22160. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22161. /**
  22162. * @class SuperMap.FindTSPPathsParameters
  22163. * @category iServer NetworkAnalyst TSPPath
  22164. * @classdesc 旅行商分析参数类。
  22165. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  22166. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  22167. * 旅行商分析和最佳路径分析都是在网络中寻找遍历所有站点的最经济的路径,区别是在遍历网络所有站点的过程中对结点访问顺序不同
  22168. * 最佳路径分析必须按照指定顺序对站点进行访问,而旅行商分析是无序的路径分析。
  22169. * @param {Object} options - 参数。
  22170. * @param {boolean} [options.endNodeAssigned=false] - 是否指定终止点,将指定的途经点的最后一个点作为终止点。true 表示指定终止点,则旅行商必须最后一个访问终止点。
  22171. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点。
  22172. * @param {Array.<(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)>} options.nodes - 配送目标集合。
  22173. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  22174. */
  22175. var FindTSPPathsParameters_FindTSPPathsParameters = /*#__PURE__*/function () {
  22176. function FindTSPPathsParameters(options) {
  22177. FindTSPPathsParameters_classCallCheck(this, FindTSPPathsParameters);
  22178. /**
  22179. * @member {boolean} [SuperMap.FindTSPPathsParameters.prototype.endNodeAssigned=false]
  22180. * @description 是否指定终止点,将指定的途经点的最后一个点作为终止点。
  22181. * true 表示指定终止点,则旅行商必须最后一个访问终止点。
  22182. */
  22183. this.endNodeAssigned = false;
  22184. /**
  22185. * @member {boolean} [SuperMap.FindTSPPathsParameters.prototype.isAnalyzeById=false]
  22186. * @description 是否通过节点 ID 号来指定途经点。
  22187. */
  22188. this.isAnalyzeById = false;
  22189. /**
  22190. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindTSPPathsParameters.prototype.nodes
  22191. * @description 旅行商分析途经点数组。
  22192. * 当 SuperMap.FindTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  22193. * 当 SuperMap.FindTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  22194. */
  22195. this.nodes = null;
  22196. /**
  22197. * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindTSPPathsParameters.prototype.parameter]
  22198. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  22199. * SuperMap.TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting
  22200. * 字段,则返回结果空间信息等都为空。
  22201. */
  22202. this.parameter = new TransportationAnalystParameter_TransportationAnalystParameter();
  22203. Util_Util.extend(this, options);
  22204. this.CLASS_NAME = "SuperMap.FindTSPPathsParameters";
  22205. }
  22206. /**
  22207. * @function SuperMap.FindTSPPathsParameters.prototype.destroy
  22208. * @description 释放资源,将引用资源的属性置空。
  22209. */
  22210. FindTSPPathsParameters_createClass(FindTSPPathsParameters, [{
  22211. key: "destroy",
  22212. value: function destroy() {
  22213. var me = this;
  22214. me.endNodeAssigned = null;
  22215. me.isAnalyzeById = null;
  22216. me.nodes = null;
  22217. if (me.parameter) {
  22218. me.parameter.destroy();
  22219. me.parameter = null;
  22220. }
  22221. }
  22222. }]);
  22223. return FindTSPPathsParameters;
  22224. }();
  22225. SuperMap.FindTSPPathsParameters = FindTSPPathsParameters_FindTSPPathsParameters;
  22226. // CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsService.js
  22227. 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); }
  22228. function FindTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22229. 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); } }
  22230. function FindTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsService_defineProperties(Constructor, staticProps); return Constructor; }
  22231. 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); }
  22232. function FindTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  22233. 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); }
  22234. function FindTSPPathsService_setPrototypeOf(o, p) { FindTSPPathsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindTSPPathsService_setPrototypeOf(o, p); }
  22235. 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); }; }
  22236. function FindTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindTSPPathsService_assertThisInitialized(self); }
  22237. function FindTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22238. 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; } }
  22239. function FindTSPPathsService_getPrototypeOf(o) { FindTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindTSPPathsService_getPrototypeOf(o); }
  22240. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  22241. * This program are made available under the terms of the Apache License, Version 2.0
  22242. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22243. /**
  22244. * @class SuperMap.FindTSPPathsService
  22245. * @category iServer NetworkAnalyst TSPPath
  22246. * @classdesc 旅行商分析服务类
  22247. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  22248. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  22249. * 该类负责将客户端指定的旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  22250. * 旅行商分析结果通过该类支持的事件的监听函数参数获取
  22251. * @extends {SuperMap.NetworkAnalystServiceBase}
  22252. * @example
  22253. * (start code)
  22254. * var myFindTSPPathsService = new SuperMap.FindTSPPathsService(url, {
  22255. * eventListeners: {
  22256. * "processCompleted": findTSPPathsCompleted,
  22257. * "processFailed": findTSPPathsError
  22258. * }
  22259. * });
  22260. * (end)
  22261. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  22262. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  22263. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  22264. * @param {Object} options - 参数。
  22265. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  22266. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22267. * @param {Object} [options.headers] - 请求头。
  22268. */
  22269. var FindTSPPathsService_FindTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  22270. FindTSPPathsService_inherits(FindTSPPathsService, _NetworkAnalystServic);
  22271. var _super = FindTSPPathsService_createSuper(FindTSPPathsService);
  22272. function FindTSPPathsService(url, options) {
  22273. var _this;
  22274. FindTSPPathsService_classCallCheck(this, FindTSPPathsService);
  22275. _this = _super.call(this, url, options);
  22276. _this.CLASS_NAME = "SuperMap.FindTSPPathsService";
  22277. return _this;
  22278. }
  22279. /**
  22280. * @function SuperMap.FindTSPPathsService.prototype.destroy
  22281. * @override
  22282. */
  22283. FindTSPPathsService_createClass(FindTSPPathsService, [{
  22284. key: "destroy",
  22285. value: function destroy() {
  22286. FindTSPPathsService_get(FindTSPPathsService_getPrototypeOf(FindTSPPathsService.prototype), "destroy", this).call(this);
  22287. }
  22288. /**
  22289. * @function SuperMap.FindTSPPathsService.prototype.processAsync
  22290. * @description 负责将客户端的查询参数传递到服务端。
  22291. * @param {SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
  22292. */
  22293. }, {
  22294. key: "processAsync",
  22295. value: function processAsync(params) {
  22296. if (!(params instanceof FindTSPPathsParameters_FindTSPPathsParameters)) {
  22297. return;
  22298. }
  22299. var me = this,
  22300. jsonObject;
  22301. me.url = Util_Util.urlPathAppend(me.url, 'tsppath');
  22302. jsonObject = {
  22303. parameter: SuperMap.Util.toJSON(params.parameter),
  22304. endNodeAssigned: params.endNodeAssigned,
  22305. nodes: me.getNodesJson(params)
  22306. };
  22307. me.request({
  22308. method: "GET",
  22309. params: jsonObject,
  22310. scope: me,
  22311. success: me.serviceProcessCompleted,
  22312. failure: me.serviceProcessFailed
  22313. });
  22314. }
  22315. /**
  22316. * @function SuperMap.FindTSPPathsService.prototype.getNodesJson
  22317. * @description 将节点对象转化为JSON字符串。
  22318. * @param {SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
  22319. * @returns {string} 转化后的JSON字符串。
  22320. */
  22321. }, {
  22322. key: "getNodesJson",
  22323. value: function getNodesJson(params) {
  22324. var jsonParameters = "",
  22325. nodesString,
  22326. i,
  22327. len,
  22328. nodes;
  22329. if (params.isAnalyzeById === false) {
  22330. for (nodesString = "[", i = 0, nodes = params.nodes, len = nodes.length; i < len; i++) {
  22331. if (i > 0) {
  22332. nodesString += ",";
  22333. }
  22334. nodesString += '{"x":' + nodes[i].x + ',"y":' + nodes[i].y + '}';
  22335. }
  22336. nodesString += ']';
  22337. jsonParameters += nodesString;
  22338. } else if (params.isAnalyzeById === true) {
  22339. var nodeIDsString = "[",
  22340. _nodes = params.nodes,
  22341. _len = _nodes.length;
  22342. for (var _i = 0; _i < _len; _i++) {
  22343. if (_i > 0) {
  22344. nodeIDsString += ",";
  22345. }
  22346. nodeIDsString += _nodes[_i];
  22347. }
  22348. nodeIDsString += ']';
  22349. jsonParameters += nodeIDsString;
  22350. }
  22351. return jsonParameters;
  22352. }
  22353. /**
  22354. * @function SuperMap.FindTSPPathsService.prototype.toGeoJSONResult
  22355. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  22356. * @param {Object} result - 服务器返回的结果对象。
  22357. */
  22358. }, {
  22359. key: "toGeoJSONResult",
  22360. value: function toGeoJSONResult(result) {
  22361. if (!result || !result.tspPathList) {
  22362. return null;
  22363. }
  22364. var geoJSONFormat = new GeoJSON_GeoJSON();
  22365. result.tspPathList.forEach(function (path) {
  22366. if (path.route) {
  22367. path.route = geoJSONFormat.toGeoJSON(path.route);
  22368. }
  22369. if (path.pathGuideItems) {
  22370. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  22371. }
  22372. if (path.edgeFeatures) {
  22373. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  22374. }
  22375. if (path.nodeFeatures) {
  22376. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  22377. }
  22378. });
  22379. return result;
  22380. }
  22381. }]);
  22382. return FindTSPPathsService;
  22383. }(NetworkAnalystServiceBase_NetworkAnalystServiceBase);
  22384. SuperMap.FindTSPPathsService = FindTSPPathsService_FindTSPPathsService;
  22385. // CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataParameters.js
  22386. function GenerateSpatialDataParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22387. 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); } }
  22388. function GenerateSpatialDataParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22389. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  22390. * This program are made available under the terms of the Apache License, Version 2.0
  22391. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22392. /**
  22393. * @class SuperMap.GenerateSpatialDataParameters
  22394. * @category iServer SpatialAnalyst GenerateSpatialData
  22395. * @classdesc 动态分段操作参数类。通过该类可以为动态分段提供参数信息。
  22396. * @param {Object} options - 参数。
  22397. * @param {string} options.routeTable - 路由数据集。
  22398. * @param {string} options.routeIDField - 路由数据集的标识字段。
  22399. * @param {string} options.eventTable - 用于生成空间数据的事件表名。
  22400. * @param {SuperMap.DataReturnOption} options.dataReturnOption - 设置数据返回选项。
  22401. * @param {string} [options.attributeFilter] - 属性过滤条件。
  22402. * @param {string} options.eventRouteIDField - 用于生成空间数据的事件表的路由标识字段。
  22403. * @param {string} [options.measureField] - 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义。
  22404. * @param {string} [options.measureStartField] - 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  22405. * @param {string} [options.measureEndField] - 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  22406. * @param {string} [options.measureOffsetField] - 刻度偏移量字段。
  22407. * @param {string} [options.errorInfoField] - 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  22408. * @param {Array.<string>} [options.retainedFields] - 欲保留到结果空间数据中的字段集合(系统字段除外)。
  22409. */
  22410. var GenerateSpatialDataParameters_GenerateSpatialDataParameters = /*#__PURE__*/function () {
  22411. function GenerateSpatialDataParameters(options) {
  22412. GenerateSpatialDataParameters_classCallCheck(this, GenerateSpatialDataParameters);
  22413. /**
  22414. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.routeTable
  22415. * @description 路由数据集。
  22416. */
  22417. this.routeTable = null;
  22418. /**
  22419. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.routeIDField
  22420. * @description 路由数据集的标识字段。
  22421. */
  22422. this.routeIDField = null;
  22423. /**
  22424. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.attributeFilter]
  22425. * @description 属性过滤条件。
  22426. * 当 {@link SuperMap.GenerateSpatialDataParameters.prototype.dataReturnOption.dataReturnMode} 为 {@link DataReturnMode.DATASET_AND_RECORDSET} 或 {@link DataReturnMode.RECORDSET_ONLY} 时有效。
  22427. */
  22428. this.attributeFilter = null;
  22429. /**
  22430. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.eventTable
  22431. * @description 用于生成空间数据的事件表名。
  22432. */
  22433. this.eventTable = null;
  22434. /**
  22435. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.eventRouteIDField
  22436. * @description 用于生成空间数据的事件表的路由标识字段。
  22437. */
  22438. this.eventRouteIDField = null;
  22439. /**
  22440. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureField]
  22441. * @description 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义
  22442. */
  22443. this.measureField = null;
  22444. /**
  22445. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureStartField]
  22446. * @description 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  22447. */
  22448. this.measureStartField = null;
  22449. /**
  22450. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureEndField]
  22451. * @description 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  22452. */
  22453. this.measureEndField = null;
  22454. /**
  22455. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureOffsetField]
  22456. * @description 刻度偏移量字段。
  22457. */
  22458. this.measureOffsetField = null;
  22459. /**
  22460. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.errorInfoField]
  22461. * @description 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  22462. */
  22463. this.errorInfoField = null;
  22464. /**
  22465. * @member {Array.<string>} [SuperMap.GenerateSpatialDataParameters.prototype.retainedFields]
  22466. * @description 欲保留到结果空间数据中的字段集合(系统字段除外)。
  22467. * 生成空间数据时,无论是否指定保留字段,路由 ID 字段、刻度偏移量字段、刻度值字段(点事件为刻度字段,线事件是起始和终止刻度字段)都会保留到结果空间数据中;
  22468. * 如果没有指定 retainedFields 参数或者 retainedFields 参数数组长度为 0,则返回所有用户字段。
  22469. */
  22470. this.retainedFields = null;
  22471. /**
  22472. * @member {SuperMap.DataReturnOption} SuperMap.GenerateSpatialDataParameters.prototype.dataReturnOption
  22473. * @description 设置数据返回的选项。
  22474. */
  22475. this.dataReturnOption = null;
  22476. if (options) {
  22477. Util_Util.extend(this, options);
  22478. }
  22479. this.CLASS_NAME = "SuperMap.GenerateSpatialDataParameters";
  22480. }
  22481. /**
  22482. * @function SuperMap.GenerateSpatialDataParameters.prototype.destroy
  22483. * @description 释放资源,将引用资源的属性置空。
  22484. */
  22485. GenerateSpatialDataParameters_createClass(GenerateSpatialDataParameters, [{
  22486. key: "destroy",
  22487. value: function destroy() {
  22488. var me = this;
  22489. if (me.routeTable) {
  22490. me.routeTable = null;
  22491. }
  22492. me.routeIDField = null;
  22493. me.attributeFilter = null;
  22494. me.eventTable = null;
  22495. me.eventRouteIDField = null;
  22496. me.measureField = null;
  22497. me.measureStartField = null;
  22498. me.measureEndField = null;
  22499. me.measureOffsetField = null;
  22500. me.errorInfoField = null;
  22501. if (me.dataReturnOption) {
  22502. me.dataReturnOption.destroy();
  22503. me.dataReturnOption = null;
  22504. }
  22505. }
  22506. }]);
  22507. return GenerateSpatialDataParameters;
  22508. }();
  22509. SuperMap.GenerateSpatialDataParameters = GenerateSpatialDataParameters_GenerateSpatialDataParameters;
  22510. // CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataService.js
  22511. 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); }
  22512. function GenerateSpatialDataService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22513. 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); } }
  22514. function GenerateSpatialDataService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataService_defineProperties(Constructor, staticProps); return Constructor; }
  22515. 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); }
  22516. function GenerateSpatialDataService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GenerateSpatialDataService_getPrototypeOf(object); if (object === null) break; } return object; }
  22517. 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); }
  22518. function GenerateSpatialDataService_setPrototypeOf(o, p) { GenerateSpatialDataService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GenerateSpatialDataService_setPrototypeOf(o, p); }
  22519. 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); }; }
  22520. function GenerateSpatialDataService_possibleConstructorReturn(self, call) { if (call && (GenerateSpatialDataService_typeof(call) === "object" || typeof call === "function")) { return call; } return GenerateSpatialDataService_assertThisInitialized(self); }
  22521. function GenerateSpatialDataService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22522. 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; } }
  22523. function GenerateSpatialDataService_getPrototypeOf(o) { GenerateSpatialDataService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GenerateSpatialDataService_getPrototypeOf(o); }
  22524. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  22525. * This program are made available under the terms of the Apache License, Version 2.0
  22526. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22527. /**
  22528. * @class SuperMap.GenerateSpatialDataService
  22529. * @category iServer SpatialAnalyst GenerateSpatialData
  22530. * @classdesc 动态分段分析服务类。该类负责将客户设置的动态分段分析服务参数传递给服务端,并接收服务端返回的动态分段分析结果数据。
  22531. * 获取的结果数据包括 originResult 、result 两种,其中,originResult 为服务端返回的用 JSON 对象表示的动态分段分析结果数据,result 为服务端返回的动态分段分析结果数据。
  22532. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  22533. * @param {Object} options - 参数。</br>
  22534. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  22535. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22536. * @param {Object} [options.headers] - 请求头。
  22537. * @extends {SuperMap.SpatialAnalystBase}
  22538. * @example 实例化该类如下例所示:
  22539. * (start code)
  22540. * function GenerateSpatialData(){
  22541. *
  22542. * //配置数据返回选项(option)
  22543. * var option = new SuperMap.DataReturnOption({
  22544. * expectCount: 1000,
  22545. * dataset: "generateSpatialData",
  22546. * deleteExistResultDataset: true,
  22547. * dataReturnMode: SuperMap.DataReturnMode.DATASET_ONLY
  22548. * }),
  22549. * //配置动态分段参数(Parameters)
  22550. * parameters = new SuperMap.GenerateSpatialDataParameters({
  22551. * routeTable: "RouteDT_road@Changchun",
  22552. * routeIDField: "RouteID",
  22553. * eventTable: "LinearEventTabDT@Changchun",
  22554. * eventRouteIDField: "RouteID",
  22555. * measureField: "",
  22556. * measureStartField: "LineMeasureFrom",
  22557. * measureEndField: "LineMeasureTo",
  22558. * measureOffsetField: "",
  22559. * errorInfoField: "",
  22560. * retainedFields:[],
  22561. * dataReturnOption: option
  22562. * }),
  22563. * //配置动态分段iService
  22564. * iService = new SuperMap.GenerateSpatialDataService(Changchun_spatialanalyst, {
  22565. * eventListeners: {
  22566. * processCompleted: generateCompleted,
  22567. * processFailed: generateFailded
  22568. * }
  22569. * });
  22570. * //执行
  22571. * iService.processAsync(parameters);
  22572. * function Completed(generateSpatialDataEventArgs){//todo};
  22573. * function Error(generateSpatialDataEventArgs){//todo};
  22574. * (end)
  22575. */
  22576. var GenerateSpatialDataService_GenerateSpatialDataService = /*#__PURE__*/function (_SpatialAnalystBase) {
  22577. GenerateSpatialDataService_inherits(GenerateSpatialDataService, _SpatialAnalystBase);
  22578. var _super = GenerateSpatialDataService_createSuper(GenerateSpatialDataService);
  22579. function GenerateSpatialDataService(url, options) {
  22580. var _this;
  22581. GenerateSpatialDataService_classCallCheck(this, GenerateSpatialDataService);
  22582. _this = _super.call(this, url, options);
  22583. _this.CLASS_NAME = "SuperMap.GenerateSpatialDataService";
  22584. return _this;
  22585. }
  22586. /**
  22587. * @function SuperMap.GenerateSpatialDataService.prototype.destroy
  22588. * @override
  22589. */
  22590. GenerateSpatialDataService_createClass(GenerateSpatialDataService, [{
  22591. key: "destroy",
  22592. value: function destroy() {
  22593. GenerateSpatialDataService_get(GenerateSpatialDataService_getPrototypeOf(GenerateSpatialDataService.prototype), "destroy", this).call(this);
  22594. }
  22595. /**
  22596. * @function SuperMap.GenerateSpatialDataService.prototype.processAsync
  22597. * @description 负责将客户端的动态分段服务参数传递到服务端。
  22598. * @param {SuperMap.GenerateSpatialDataParameters} params - 动态分段操作参数类。
  22599. */
  22600. }, {
  22601. key: "processAsync",
  22602. value: function processAsync(params) {
  22603. if (!(params instanceof GenerateSpatialDataParameters_GenerateSpatialDataParameters)) {
  22604. return;
  22605. }
  22606. var me = this,
  22607. jsonParameters;
  22608. jsonParameters = me.getJsonParameters(params);
  22609. me.request({
  22610. method: "POST",
  22611. data: jsonParameters,
  22612. scope: me,
  22613. success: me.serviceProcessCompleted,
  22614. failure: me.serviceProcessFailed
  22615. });
  22616. }
  22617. /**
  22618. * @function SuperMap.GenerateSpatialDataService.prototype.getJsonParameters
  22619. * @description 将参数转化为 JSON 字符串。
  22620. * @param {SuperMap.GenerateSpatialDataParameters} params - 动态分段操作参数类。
  22621. * @returns {string}转化后的JSON字符串。
  22622. */
  22623. }, {
  22624. key: "getJsonParameters",
  22625. value: function getJsonParameters(params) {
  22626. var jsonParameters = "",
  22627. jsonStr = "datasets/" + params.routeTable + "/linearreferencing/generatespatialdata",
  22628. me = this;
  22629. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  22630. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  22631. jsonParameters = Util_Util.toJSON(params);
  22632. return jsonParameters;
  22633. }
  22634. }]);
  22635. return GenerateSpatialDataService;
  22636. }(SpatialAnalystBase_SpatialAnalystBase);
  22637. SuperMap.GenerateSpatialDataService = GenerateSpatialDataService_GenerateSpatialDataService;
  22638. // CONCATENATED MODULE: ./src/common/iServer/GeoBoundingBoxQueryBuilderParameter.js
  22639. 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); }
  22640. function GeoBoundingBoxQueryBuilderParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22641. 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); } }
  22642. function GeoBoundingBoxQueryBuilderParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoBoundingBoxQueryBuilderParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoBoundingBoxQueryBuilderParameter_defineProperties(Constructor, staticProps); return Constructor; }
  22643. 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); }
  22644. function GeoBoundingBoxQueryBuilderParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  22645. 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); }
  22646. function GeoBoundingBoxQueryBuilderParameter_setPrototypeOf(o, p) { GeoBoundingBoxQueryBuilderParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoBoundingBoxQueryBuilderParameter_setPrototypeOf(o, p); }
  22647. 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); }; }
  22648. function GeoBoundingBoxQueryBuilderParameter_possibleConstructorReturn(self, call) { if (call && (GeoBoundingBoxQueryBuilderParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(self); }
  22649. function GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22650. 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; } }
  22651. function GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(o) { GeoBoundingBoxQueryBuilderParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(o); }
  22652. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  22653. * This program are made available under the terms of the Apache License, Version 2.0
  22654. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22655. /**
  22656. * @class SuperMap.GeoBoundingBoxQueryBuilderParameter
  22657. * @classdesc bounds 查询参数设置类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  22658. * @category iServer Data FeatureResults
  22659. * @param {Object} options - 参数。
  22660. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 查询范围。
  22661. * @param {SuperMap.AggregationQueryBuilderType} [options.queryType=SuperMap.AggregationQueryBuilderType.GEO_BOUNDING_BOX] - 查询类型。
  22662. */
  22663. var GeoBoundingBoxQueryBuilderParameter_GeoBoundingBoxQueryBuilderParameter = /*#__PURE__*/function (_AggQueryBuilderParam) {
  22664. GeoBoundingBoxQueryBuilderParameter_inherits(GeoBoundingBoxQueryBuilderParameter, _AggQueryBuilderParam);
  22665. var _super = GeoBoundingBoxQueryBuilderParameter_createSuper(GeoBoundingBoxQueryBuilderParameter);
  22666. function GeoBoundingBoxQueryBuilderParameter(options) {
  22667. var _this;
  22668. GeoBoundingBoxQueryBuilderParameter_classCallCheck(this, GeoBoundingBoxQueryBuilderParameter);
  22669. _this = _super.call(this, options);
  22670. /**
  22671. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.GeoBoundingBoxQueryBuilderParameter.prototype.bounds
  22672. * @description 查询范围。
  22673. */
  22674. _this.bounds = null;
  22675. /**
  22676. * @member {SuperMap.AggregationQueryBuilderType} [SuperMap.GeoBoundingBoxQueryBuilderParameter.prototype.queryType=SuperMap.AggregationQueryBuilderType.GEO_BOUNDING_BOX]
  22677. * @description 查询类型。
  22678. */
  22679. _this.queryType = AggregationQueryBuilderType.GEO_BOUNDING_BOX;
  22680. _this.CLASS_NAME = "SuperMap.GeoBoundingBoxQueryBuilderParameter";
  22681. Util_Util.extend(GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(_this), options);
  22682. return _this;
  22683. }
  22684. GeoBoundingBoxQueryBuilderParameter_createClass(GeoBoundingBoxQueryBuilderParameter, [{
  22685. key: "destroy",
  22686. value: function destroy() {
  22687. GeoBoundingBoxQueryBuilderParameter_get(GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(GeoBoundingBoxQueryBuilderParameter.prototype), "destroy", this).call(this);
  22688. this.bounds = null;
  22689. this.queryType = null;
  22690. }
  22691. }]);
  22692. return GeoBoundingBoxQueryBuilderParameter;
  22693. }(AggQueryBuilderParameter_AggQueryBuilderParameter);
  22694. SuperMap.GeoBoundingBoxQueryBuilderParameter = GeoBoundingBoxQueryBuilderParameter_GeoBoundingBoxQueryBuilderParameter;
  22695. // CONCATENATED MODULE: ./src/common/iServer/GeoHashGridAggParameter.js
  22696. 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); }
  22697. function GeoHashGridAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22698. 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); } }
  22699. function GeoHashGridAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoHashGridAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoHashGridAggParameter_defineProperties(Constructor, staticProps); return Constructor; }
  22700. 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); }
  22701. function GeoHashGridAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoHashGridAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  22702. 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); }
  22703. function GeoHashGridAggParameter_setPrototypeOf(o, p) { GeoHashGridAggParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoHashGridAggParameter_setPrototypeOf(o, p); }
  22704. 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); }; }
  22705. function GeoHashGridAggParameter_possibleConstructorReturn(self, call) { if (call && (GeoHashGridAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoHashGridAggParameter_assertThisInitialized(self); }
  22706. function GeoHashGridAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22707. 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; } }
  22708. function GeoHashGridAggParameter_getPrototypeOf(o) { GeoHashGridAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoHashGridAggParameter_getPrototypeOf(o); }
  22709. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  22710. * This program are made available under the terms of the Apache License, Version 2.0
  22711. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22712. /**
  22713. * @class SuperMap.GeoHashGridAggParameter
  22714. * @classdesc 格网聚合查询参数类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  22715. * @category iServer Data FeatureResults
  22716. * @param {Object} option - 初始化参数。
  22717. * @param {number} [option.precision=5] - 网格中数字的精度。
  22718. * @param {SuperMap.AggregationType} [option.aggType=SuperMap.AggregationType.GEOHASH_GRID] - 格网聚合类型。
  22719. */
  22720. var GeoHashGridAggParameter_GeoHashGridAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  22721. GeoHashGridAggParameter_inherits(GeoHashGridAggParameter, _AggregationParameter);
  22722. var _super = GeoHashGridAggParameter_createSuper(GeoHashGridAggParameter);
  22723. function GeoHashGridAggParameter(option) {
  22724. var _this;
  22725. GeoHashGridAggParameter_classCallCheck(this, GeoHashGridAggParameter);
  22726. _this = _super.call(this, option);
  22727. /**
  22728. * @member {number} [SuperMap.GeoHashGridAggParameter.prototype.precision=5]
  22729. * @description 网格中数字的精度。
  22730. */
  22731. _this.precision = 5;
  22732. /**
  22733. * @member {SuperMap.AggregationType} [SuperMap.GeoHashGridAggParameter.prototype.aggType=SuperMap.AggregationType.GEOHASH_GRID]
  22734. * @description 格网聚合类型。
  22735. */
  22736. _this.aggType = AggregationType.GEOHASH_GRID;
  22737. Util_Util.extend(GeoHashGridAggParameter_assertThisInitialized(_this), option);
  22738. _this.CLASS_NAME = "SuperMap.GeoHashGridAggParameter";
  22739. return _this;
  22740. }
  22741. GeoHashGridAggParameter_createClass(GeoHashGridAggParameter, [{
  22742. key: "destroy",
  22743. value: function destroy() {
  22744. GeoHashGridAggParameter_get(GeoHashGridAggParameter_getPrototypeOf(GeoHashGridAggParameter.prototype), "destroy", this).call(this);
  22745. this.aggType = null;
  22746. }
  22747. /**
  22748. * @function SuperMap.GeoHashGridAggParameter.toJsonParameters
  22749. * @description 将对象转为 JSON 格式。
  22750. * @param param 转换对象。
  22751. * @returns {string|object}
  22752. */
  22753. }], [{
  22754. key: "toJsonParameters",
  22755. value: function toJsonParameters(param) {
  22756. var parameters = {
  22757. aggName: param.aggName,
  22758. aggFieldName: param.aggFieldName,
  22759. aggType: param.aggType,
  22760. precision: param.precision
  22761. };
  22762. if (param.subAgg) {
  22763. parameters.subAgg = param.subAgg;
  22764. }
  22765. return Util_Util.toJson(parameters);
  22766. }
  22767. }]);
  22768. return GeoHashGridAggParameter;
  22769. }(AggregationParameter_AggregationParameter);
  22770. SuperMap.GeoHashGridAggParameter = GeoHashGridAggParameter_GeoHashGridAggParameter;
  22771. // CONCATENATED MODULE: ./src/common/iServer/GeometryOverlayAnalystParameters.js
  22772. 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); }
  22773. function GeometryOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22774. 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); } }
  22775. function GeometryOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryOverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22776. 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); }
  22777. function GeometryOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  22778. 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); }
  22779. function GeometryOverlayAnalystParameters_setPrototypeOf(o, p) { GeometryOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryOverlayAnalystParameters_setPrototypeOf(o, p); }
  22780. 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); }; }
  22781. function GeometryOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryOverlayAnalystParameters_assertThisInitialized(self); }
  22782. function GeometryOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22783. 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; } }
  22784. function GeometryOverlayAnalystParameters_getPrototypeOf(o) { GeometryOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryOverlayAnalystParameters_getPrototypeOf(o); }
  22785. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  22786. * This program are made available under the terms of the Apache License, Version 2.0
  22787. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22788. /**
  22789. * @class SuperMap.GeometryOverlayAnalystParameters
  22790. * @category iServer SpatialAnalyst OverlayAnalyst
  22791. * @classdesc
  22792. * 几何对象叠加分析参数类。对指定的某两个几何对象做叠加分析。通过该类可以指定要做叠加分析的几何对象、叠加操作类型。
  22793. * @param {Object} options - 参数。
  22794. * @param {Object} options.operateGeometry - 叠加分析的操作几何对象。 </br>
  22795. * 点类型可以是:{@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>
  22796. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link GeoJSONObject}。</br>
  22797. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link GeoJSONObject}。
  22798. * @param {Object} options.sourceGeometry - 叠加分析的源几何对象。
  22799. * @param {Array.<Object>} [options.operateGeometries] - 批量叠加分析的操作几何对象数组。
  22800. * @param {Array.<Object>} [options.sourceGeometries] -批量叠加分析的源几何对象数组。
  22801. * @param {SuperMap.OverlayOperationType} [options.operation] - 叠加操作枚举值。
  22802. * @extends {SuperMap.OverlayAnalystParameters}
  22803. */
  22804. var GeometryOverlayAnalystParameters_GeometryOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  22805. GeometryOverlayAnalystParameters_inherits(GeometryOverlayAnalystParameters, _OverlayAnalystParame);
  22806. var _super = GeometryOverlayAnalystParameters_createSuper(GeometryOverlayAnalystParameters);
  22807. function GeometryOverlayAnalystParameters(options) {
  22808. var _this;
  22809. GeometryOverlayAnalystParameters_classCallCheck(this, GeometryOverlayAnalystParameters);
  22810. _this = _super.call(this, options);
  22811. if (options && options.operateGeometry) {
  22812. _this.operateGeometry = options.operateGeometry;
  22813. }
  22814. if (options && options.sourceGeometry) {
  22815. _this.sourceGeometry = options.sourceGeometry;
  22816. }
  22817. if (options && options.operateGeometries) {
  22818. _this.operateGeometries = options.operateGeometries;
  22819. }
  22820. if (options && options.sourceGeometries) {
  22821. _this.sourceGeometries = options.sourceGeometries;
  22822. }
  22823. if (options) {
  22824. Util_Util.extend(GeometryOverlayAnalystParameters_assertThisInitialized(_this), options);
  22825. }
  22826. _this.CLASS_NAME = "SuperMap.GeometryOverlayAnalystParameters";
  22827. return _this;
  22828. }
  22829. /**
  22830. * @function SuperMap.GeometryOverlayAnalystParameters.prototype.destroy
  22831. * @override
  22832. */
  22833. GeometryOverlayAnalystParameters_createClass(GeometryOverlayAnalystParameters, [{
  22834. key: "destroy",
  22835. value: function destroy() {
  22836. GeometryOverlayAnalystParameters_get(GeometryOverlayAnalystParameters_getPrototypeOf(GeometryOverlayAnalystParameters.prototype), "destroy", this).call(this);
  22837. var me = this;
  22838. if (me.sourceGeometry) {
  22839. me.sourceGeometry.destroy();
  22840. me.sourceGeometry = null;
  22841. }
  22842. if (me.sourceGeometries) {
  22843. me.sourceGeometries.destroy();
  22844. me.sourceGeometries = null;
  22845. }
  22846. if (me.sourceGeometry) {
  22847. me.sourceGeometry.destroy();
  22848. me.sourceGeometry = null;
  22849. }
  22850. if (me.operateGeometries) {
  22851. me.operateGeometries.destroy();
  22852. me.operateGeometries = null;
  22853. }
  22854. }
  22855. /**
  22856. * @function SuperMap.GeometryOverlayAnalystParameters.toObject
  22857. * @param {SuperMap.GeometryOverlayAnalystParameters} geometryOverlayAnalystParameters - 几何对象叠加分析参数类。
  22858. * @param {SuperMap.GeometryOverlayAnalystParameters} tempObj - 几何对象叠加分析参数对象。
  22859. * @description 将几何对象叠加分析参数对象转换为 JSON 对象。
  22860. * @returns {Object} JSON 对象。
  22861. */
  22862. }], [{
  22863. key: "toObject",
  22864. value: function toObject(geometryOverlayAnalystParameters, tempObj) {
  22865. for (var name in geometryOverlayAnalystParameters) {
  22866. if (name === "sourceGeometry") {
  22867. tempObj.sourceGeometry = ServerGeometry_ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometry);
  22868. } else if (name === "sourceGeometries") {
  22869. var sourceGeometries = [];
  22870. for (var i = 0; i < geometryOverlayAnalystParameters.sourceGeometries.length; i++) {
  22871. sourceGeometries.push(ServerGeometry_ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometries[i]));
  22872. }
  22873. tempObj.sourceGeometries = sourceGeometries;
  22874. } else if (name === "operateGeometry") {
  22875. tempObj.operateGeometry = ServerGeometry_ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometry);
  22876. } else if (name === "operateGeometries") {
  22877. var operateGeometries = [];
  22878. for (var j = 0; j < geometryOverlayAnalystParameters.operateGeometries.length; j++) {
  22879. operateGeometries.push(ServerGeometry_ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometries[j]));
  22880. }
  22881. tempObj.operateGeometries = operateGeometries;
  22882. } else {
  22883. tempObj[name] = geometryOverlayAnalystParameters[name];
  22884. }
  22885. }
  22886. }
  22887. }]);
  22888. return GeometryOverlayAnalystParameters;
  22889. }(OverlayAnalystParameters_OverlayAnalystParameters);
  22890. SuperMap.GeometryOverlayAnalystParameters = GeometryOverlayAnalystParameters_GeometryOverlayAnalystParameters;
  22891. // CONCATENATED MODULE: ./src/common/iServer/GeometrySurfaceAnalystParameters.js
  22892. 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); }
  22893. function GeometrySurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22894. 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); } }
  22895. function GeometrySurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22896. 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); }
  22897. function GeometrySurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometrySurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  22898. 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); }
  22899. function GeometrySurfaceAnalystParameters_setPrototypeOf(o, p) { GeometrySurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometrySurfaceAnalystParameters_setPrototypeOf(o, p); }
  22900. 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); }; }
  22901. function GeometrySurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometrySurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometrySurfaceAnalystParameters_assertThisInitialized(self); }
  22902. function GeometrySurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22903. 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; } }
  22904. function GeometrySurfaceAnalystParameters_getPrototypeOf(o) { GeometrySurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometrySurfaceAnalystParameters_getPrototypeOf(o); }
  22905. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  22906. * This program are made available under the terms of the Apache License, Version 2.0
  22907. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22908. /**
  22909. * @class SuperMap.GeometrySurfaceAnalystParameters
  22910. * @category iServer SpatialAnalyst SurfaceAnalyst
  22911. * @classdesc 几何对象表面分析参数类。该类对几何对象表面分析所用到的参数进行设置。
  22912. * @param {Object} options - 参数。
  22913. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} options.points - 表面分析的坐标点数组。
  22914. * @param {Array.<number>} options.zValues - 表面分析的坐标点的 Z 值数组。
  22915. * @param {number} [options.resolution] - 获取或设置指定中间结果(栅格数据集)的分辨率。
  22916. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  22917. * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 获取或设置表面分析参数。
  22918. * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod = SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  22919. * @extends {SuperMap.SurfaceAnalystParameters}
  22920. */
  22921. var GeometrySurfaceAnalystParameters_GeometrySurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  22922. GeometrySurfaceAnalystParameters_inherits(GeometrySurfaceAnalystParameters, _SurfaceAnalystParame);
  22923. var _super = GeometrySurfaceAnalystParameters_createSuper(GeometrySurfaceAnalystParameters);
  22924. function GeometrySurfaceAnalystParameters(options) {
  22925. var _this;
  22926. GeometrySurfaceAnalystParameters_classCallCheck(this, GeometrySurfaceAnalystParameters);
  22927. _this = _super.call(this, options);
  22928. /**
  22929. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} SuperMap.GeometrySurfaceAnalystParameters.prototype.points
  22930. * @description 获取或设置用于表面分析的坐标点数组。
  22931. */
  22932. _this.points = null;
  22933. /**
  22934. * @member {Array.<number>} SuperMap.GeometrySurfaceAnalystParameters.prototype.zValues
  22935. * @description 获取或设置用于提取操作的值。提取等值线时,将使用该数组中的值,
  22936. * 对几何对象中的坐标点数组进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  22937. */
  22938. _this.zValues = null;
  22939. if (options) {
  22940. Util_Util.extend(GeometrySurfaceAnalystParameters_assertThisInitialized(_this), options);
  22941. }
  22942. _this.CLASS_NAME = "SuperMap.GeometrySurfaceAnalystParameters";
  22943. return _this;
  22944. }
  22945. /**
  22946. * @function SuperMap.GeometrySurfaceAnalystParameters.prototype.destroy
  22947. * @override
  22948. */
  22949. GeometrySurfaceAnalystParameters_createClass(GeometrySurfaceAnalystParameters, [{
  22950. key: "destroy",
  22951. value: function destroy() {
  22952. GeometrySurfaceAnalystParameters_get(GeometrySurfaceAnalystParameters_getPrototypeOf(GeometrySurfaceAnalystParameters.prototype), "destroy", this).call(this);
  22953. var me = this;
  22954. if (me.points) {
  22955. for (var i = 0, points = me.points, len = points.length; i < len; i++) {
  22956. points[i].destroy();
  22957. }
  22958. me.points = null;
  22959. }
  22960. me.zValues = null;
  22961. }
  22962. }]);
  22963. return GeometrySurfaceAnalystParameters;
  22964. }(SurfaceAnalystParameters_SurfaceAnalystParameters);
  22965. SuperMap.GeometrySurfaceAnalystParameters = GeometrySurfaceAnalystParameters_GeometrySurfaceAnalystParameters;
  22966. // CONCATENATED MODULE: ./src/common/iServer/GeometryThiessenAnalystParameters.js
  22967. 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); }
  22968. function GeometryThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22969. 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); } }
  22970. function GeometryThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22971. 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); }
  22972. function GeometryThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  22973. 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); }
  22974. function GeometryThiessenAnalystParameters_setPrototypeOf(o, p) { GeometryThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryThiessenAnalystParameters_setPrototypeOf(o, p); }
  22975. 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); }; }
  22976. function GeometryThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryThiessenAnalystParameters_assertThisInitialized(self); }
  22977. function GeometryThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22978. 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; } }
  22979. function GeometryThiessenAnalystParameters_getPrototypeOf(o) { GeometryThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryThiessenAnalystParameters_getPrototypeOf(o); }
  22980. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  22981. * This program are made available under the terms of the Apache License, Version 2.0
  22982. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22983. /**
  22984. * @class SuperMap.GeometryThiessenAnalystParameters
  22985. * @constructs SuperMap.GeometryThiessenAnalystParameters
  22986. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  22987. * @classdesc 几何对象泰森多边形分析参数类。对指定的某个几何对象做泰森多边形分析。通过该类可以指定要做泰森多边形分析的几何对象、返回数据集名称等。
  22988. * @param {Object} options - 参数。
  22989. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} options.points - 使用点数组进行分析时使用的几何对象。
  22990. * @extends {SuperMap.ThiessenAnalystParameters}
  22991. */
  22992. var GeometryThiessenAnalystParameters_GeometryThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  22993. GeometryThiessenAnalystParameters_inherits(GeometryThiessenAnalystParameters, _ThiessenAnalystParam);
  22994. var _super = GeometryThiessenAnalystParameters_createSuper(GeometryThiessenAnalystParameters);
  22995. function GeometryThiessenAnalystParameters(options) {
  22996. var _this;
  22997. GeometryThiessenAnalystParameters_classCallCheck(this, GeometryThiessenAnalystParameters);
  22998. _this = _super.call(this, options);
  22999. /**
  23000. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} SuperMap.GeometryThiessenAnalystParameters.prototype.points
  23001. * @description 使用点数组进行分析时使用的几何对象。
  23002. */
  23003. _this.points = null;
  23004. if (options) {
  23005. Util_Util.extend(GeometryThiessenAnalystParameters_assertThisInitialized(_this), options);
  23006. }
  23007. _this.CLASS_NAME = "SuperMap.GeometryThiessenAnalystParameters";
  23008. return _this;
  23009. }
  23010. /**
  23011. * @function SuperMap.GeometryThiessenAnalystParameters.prototype.destroy
  23012. * @override
  23013. */
  23014. GeometryThiessenAnalystParameters_createClass(GeometryThiessenAnalystParameters, [{
  23015. key: "destroy",
  23016. value: function destroy() {
  23017. GeometryThiessenAnalystParameters_get(GeometryThiessenAnalystParameters_getPrototypeOf(GeometryThiessenAnalystParameters.prototype), "destroy", this).call(this);
  23018. var me = this;
  23019. if (me.points) {
  23020. for (var i = me.points.length - 1; i >= 0; i--) {
  23021. me.points[i].destroy();
  23022. }
  23023. me.points = null;
  23024. }
  23025. }
  23026. /**
  23027. * @function SuperMap.GeometryThiessenAnalystParameters.toObject
  23028. * @param {SuperMap.GeometryThiessenAnalystParameters} geometryThiessenAnalystParameters - 几何对象泰森多边形分析参数类。
  23029. * @param {SuperMap.GeometryThiessenAnalystParameters} tempObj - 几何对象泰森多边形分析参数对象。
  23030. * @description 将几何对象泰森多边形分析参数对象转换为 JSON 对象。
  23031. * @returns {Object} JSON 对象。
  23032. */
  23033. }], [{
  23034. key: "toObject",
  23035. value: function toObject(geometryThiessenAnalystParameters, tempObj) {
  23036. for (var name in geometryThiessenAnalystParameters) {
  23037. if (name === "clipRegion") {
  23038. tempObj.clipRegion = ServerGeometry_ServerGeometry.fromGeometry(geometryThiessenAnalystParameters.clipRegion);
  23039. } else {
  23040. tempObj[name] = geometryThiessenAnalystParameters[name];
  23041. }
  23042. }
  23043. }
  23044. }]);
  23045. return GeometryThiessenAnalystParameters;
  23046. }(ThiessenAnalystParameters_ThiessenAnalystParameters);
  23047. SuperMap.GeometryThiessenAnalystParameters = GeometryThiessenAnalystParameters_GeometryThiessenAnalystParameters;
  23048. // CONCATENATED MODULE: ./src/common/iServer/GeoprocessingService.js
  23049. 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); }
  23050. function GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23051. 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); } }
  23052. function GeoprocessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoprocessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoprocessingService_defineProperties(Constructor, staticProps); return Constructor; }
  23053. 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); }
  23054. function GeoprocessingService_setPrototypeOf(o, p) { GeoprocessingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoprocessingService_setPrototypeOf(o, p); }
  23055. 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); }; }
  23056. function GeoprocessingService_possibleConstructorReturn(self, call) { if (call && (GeoprocessingService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoprocessingService_assertThisInitialized(self); }
  23057. function GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23058. 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; } }
  23059. function GeoprocessingService_getPrototypeOf(o) { GeoprocessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoprocessingService_getPrototypeOf(o); }
  23060. /**
  23061. * @class SuperMap.GeoprocessingService
  23062. * @category iServer GeoprocessingService
  23063. * @classdesc 地理处理服务接口的基类。
  23064. * @version 10.1.0
  23065. * @extends {SuperMap.CommonServiceBase}
  23066. * @param {string} url - 服务地址。
  23067. * @param {Object} options - 参数。
  23068. * @param {SuperMap.Events} options.events - 处理所有事件的对象。
  23069. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,iServer|iPortal|Online。
  23070. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  23071. */
  23072. var GeoprocessingService_GeoprocessingService = /*#__PURE__*/function (_CommonServiceBase) {
  23073. GeoprocessingService_inherits(GeoprocessingService, _CommonServiceBase);
  23074. var _super = GeoprocessingService_createSuper(GeoprocessingService);
  23075. function GeoprocessingService(url, options) {
  23076. var _this;
  23077. GeoprocessingService_classCallCheck(this, GeoprocessingService);
  23078. options = options || {};
  23079. options.EVENT_TYPES = ['processCompleted', 'processFailed', 'processRunning'];
  23080. _this = _super.call(this, url, options);
  23081. _this.CLASS_NAME = 'SuperMap.GeoprocessingService';
  23082. _this.headers = {};
  23083. _this.crossOrigin = true;
  23084. return _this;
  23085. }
  23086. /**
  23087. * @function SuperMap.GeoprocessingService.prototype.getTools
  23088. * @description 获取地理处理工具列表。
  23089. */
  23090. GeoprocessingService_createClass(GeoprocessingService, [{
  23091. key: "getTools",
  23092. value: function getTools() {
  23093. this._get("".concat(this.url, "/list"));
  23094. }
  23095. /**
  23096. * @function SuperMap.GeoprocessingService.prototype.getTool
  23097. * @description 获取地理处理工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  23098. * @param {string} identifier - 地理处理工具ID。
  23099. */
  23100. }, {
  23101. key: "getTool",
  23102. value: function getTool(identifier) {
  23103. this._get("".concat(this.url, "/").concat(identifier));
  23104. }
  23105. /**
  23106. * @function SuperMap.GeoprocessingService.prototype.execute
  23107. * @description 同步执行地理处理工具。
  23108. * @param {string} identifier - 地理处理工具ID。
  23109. * @param {Object} parameter - 地理处理工具的输入参数。
  23110. * @param {Object} environment - 地理处理工具的环境参数。
  23111. */
  23112. }, {
  23113. key: "execute",
  23114. value: function execute(identifier, parameter, environment) {
  23115. parameter = parameter ? parameter : null;
  23116. environment = environment ? environment : null;
  23117. var executeParamter = {
  23118. parameter: parameter,
  23119. environment: environment
  23120. };
  23121. this._get("".concat(this.url, "/").concat(identifier, "/execute"), executeParamter);
  23122. }
  23123. /**
  23124. * @function SuperMap.GeoprocessingService.prototype.submitJob
  23125. * @description 异步执行地理处理工具。
  23126. * @param {string} identifier - 地理处理工具ID。
  23127. * @param {Object} parameter - 地理处理工具的输入参数。
  23128. * @param {Object} environments - 地理处理工具的环境参数。
  23129. */
  23130. }, {
  23131. key: "submitJob",
  23132. value: function submitJob(identifier, parameter, environments) {
  23133. parameter = parameter ? parameter : null;
  23134. environments = environments ? environments : null;
  23135. var asyncParamter = {
  23136. parameter: parameter,
  23137. environments: environments
  23138. };
  23139. this.request({
  23140. url: "".concat(this.url, "/").concat(identifier, "/jobs"),
  23141. headers: {
  23142. 'Content-type': 'application/json'
  23143. },
  23144. method: 'POST',
  23145. data: JSON.stringify(asyncParamter),
  23146. scope: this,
  23147. success: this.serviceProcessCompleted,
  23148. failure: this.serviceProcessFailed
  23149. });
  23150. }
  23151. /**
  23152. * @function SuperMap.GeoprocessingService.prototype.waitForJobCompletion
  23153. * @description 获取地理处理异步执行状态信息。
  23154. * @param {string} jobId - 地理处理任务ID。
  23155. * @param {string} identifier - 地理处理工具ID。
  23156. * @param {Object} options - 状态信息参数。
  23157. * @param {number} options.interval - 定时器时间间隔。
  23158. * @param {Callback} options.statusCallback - 任务状态的回调函数。
  23159. */
  23160. }, {
  23161. key: "waitForJobCompletion",
  23162. value: function waitForJobCompletion(jobId, identifier, options) {
  23163. var me = this;
  23164. var timer = setInterval(function () {
  23165. var serviceProcessCompleted = function serviceProcessCompleted(serverResult) {
  23166. var state = serverResult.state.runState;
  23167. if (options.statusCallback) {
  23168. options.statusCallback(state);
  23169. }
  23170. switch (state) {
  23171. case 'FINISHED':
  23172. clearInterval(timer);
  23173. me.events.triggerEvent('processCompleted', {
  23174. result: serverResult
  23175. });
  23176. break;
  23177. case 'FAILED':
  23178. clearInterval(timer);
  23179. me.events.triggerEvent('processFailed', {
  23180. result: serverResult
  23181. });
  23182. break;
  23183. case 'CANCELED':
  23184. clearInterval(timer);
  23185. me.events.triggerEvent('processFailed', {
  23186. result: serverResult
  23187. });
  23188. break;
  23189. }
  23190. };
  23191. me._get("".concat(me.url, "/").concat(identifier, "/jobs/").concat(jobId), null, serviceProcessCompleted);
  23192. }, options.interval);
  23193. }
  23194. /**
  23195. * @function SuperMap.GeoprocessingService.prototype.getJobInfo
  23196. * @description 获取地理处理任务的执行信息。
  23197. * @param {string} identifier - 地理处理工具ID。
  23198. * @param {string} jobId - 地理处理任务ID。
  23199. */
  23200. }, {
  23201. key: "getJobInfo",
  23202. value: function getJobInfo(identifier, jobId) {
  23203. this._get("".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId));
  23204. }
  23205. /**
  23206. * @function SuperMap.GeoprocessingService.prototype.cancelJob
  23207. * @description 取消地理处理任务的异步执行。
  23208. * @param {string} identifier - 地理处理工具ID。
  23209. * @param {string} jobId - 地理处理任务ID。
  23210. */
  23211. }, {
  23212. key: "cancelJob",
  23213. value: function cancelJob(identifier, jobId) {
  23214. this._get("".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/cancel"));
  23215. }
  23216. /**
  23217. * @function SuperMap.GeoprocessingService.prototype.getJobs
  23218. * @description 获取地理处理服务任务列表。
  23219. * @param {string} identifier - 地理处理工具ID。(传参代表identifier算子的任务列表,不传参代表所有任务的列表)
  23220. */
  23221. }, {
  23222. key: "getJobs",
  23223. value: function getJobs(identifier) {
  23224. var url = "".concat(this.url, "/jobs");
  23225. if (identifier) {
  23226. url = "".concat(this.url, "/").concat(identifier, "/jobs");
  23227. }
  23228. this._get(url);
  23229. }
  23230. /**
  23231. * @function SuperMap.GeoprocessingService.prototype.getResults
  23232. * @description 地理处理工具执行的结果等,支持结果过滤。
  23233. * @param {string} identifier - 地理处理工具ID。
  23234. * @param {string} jobId - 地理处理任务ID。
  23235. * @param {string} filter - 输出异步结果的id。(可选,传入filter参数时对该地理处理工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  23236. */
  23237. }, {
  23238. key: "getResults",
  23239. value: function getResults(identifier, jobId, filter) {
  23240. var url = "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/results");
  23241. if (filter) {
  23242. url = "".concat(url, "/").concat(filter);
  23243. }
  23244. this._get(url);
  23245. }
  23246. }, {
  23247. key: "_get",
  23248. value: function _get(url, paramter, serviceProcessCompleted, serviceProcessFailed) {
  23249. this.request({
  23250. url: url,
  23251. method: 'GET',
  23252. params: paramter,
  23253. headers: {
  23254. 'Content-type': 'application/json'
  23255. },
  23256. scope: this,
  23257. success: serviceProcessCompleted ? serviceProcessCompleted : this.serviceProcessCompleted,
  23258. failure: serviceProcessFailed ? serviceProcessFailed : this.serviceProcessFailed
  23259. });
  23260. }
  23261. }]);
  23262. return GeoprocessingService;
  23263. }(CommonServiceBase_CommonServiceBase);
  23264. SuperMap.GeoprocessingService = GeoprocessingService_GeoprocessingService;
  23265. // CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystParameters.js
  23266. function GeoRelationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23267. 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); } }
  23268. function GeoRelationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  23269. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  23270. * This program are made available under the terms of the Apache License, Version 2.0
  23271. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23272. /**
  23273. * @class SuperMap.GeoRelationAnalystParameters
  23274. * @category iServer SpatialAnalyst GeoRelationAnalyst
  23275. * @classdesc 空间关系分析服务参数类。使用该类可以为空间关系分析服务提供所需的参数信息。
  23276. * @param {Object} options - 参数。
  23277. * @param {SuperMap.FilterParameter} options.sourceFilter - 空间关系分析中的源数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  23278. * @param {SuperMap.FilterParameter} options.referenceFilter - 空间关系分析中的参考数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  23279. * @param {SuperMap.SpatialRelationType} options.spatialRelationType - 指定的空间关系类型。
  23280. * @param {boolean} [options.isBorderInside] - 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  23281. * @param {boolean} [options.returnFeature] - 是否返回 Feature 信息。
  23282. * @param {boolean} [options.returnGeoRelatedOnly=true] - 仅返回满足指定空间关系的空间对象。
  23283. * @param {number} [options.startRecord=0] - 分析结果起始记录位置。
  23284. * @param {number} [options.expectCount=500] - 空间关系分析期望返回结果记录数,如果实际不足500条结果则返回所有分析结果。
  23285. */
  23286. var GeoRelationAnalystParameters_GeoRelationAnalystParameters = /*#__PURE__*/function () {
  23287. function GeoRelationAnalystParameters(options) {
  23288. GeoRelationAnalystParameters_classCallCheck(this, GeoRelationAnalystParameters);
  23289. /**
  23290. * @member {string} SuperMap.GeoRelationAnalystParameters.prototype.dataset
  23291. * @description 源数据集名称。
  23292. */
  23293. this.dataset = null;
  23294. /**
  23295. * @member {SuperMap.FilterParameter} SuperMap.GeoRelationAnalystParameters.prototype.sourceFilter
  23296. * @description 空间关系分析中的源数据集查询参数。仅 ids、attributeFilter 和 fields 字段有效。
  23297. */
  23298. this.sourceFilter = null;
  23299. /**
  23300. * @member {SuperMap.FilterParameter} SuperMap.GeoRelationAnalystParameters.prototype.referenceFilter
  23301. * @description 空间关系分析中的参考数据集查询参数。仅 name,ids,attributeFilter 和 fields 字段有效。
  23302. */
  23303. this.referenceFilter = null;
  23304. /**
  23305. * @member {SuperMap.SpatialRelationType} SuperMap.GeoRelationAnalystParameters.prototype.spatialRelationType
  23306. * @description 指定的空间关系类型。
  23307. */
  23308. this.spatialRelationType = null;
  23309. /**
  23310. * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.isBorderInside]
  23311. * @description 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  23312. */
  23313. this.isBorderInside = null;
  23314. /**
  23315. * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.returnFeature]
  23316. * @description 是否返回 Feature 信息。
  23317. */
  23318. this.returnFeature = null;
  23319. /**
  23320. * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=true]
  23321. * @description 是否仅返回满足指定空间关系的空间对象。
  23322. */
  23323. this.returnGeoRelatedOnly = null;
  23324. /**
  23325. * @member {number} [SuperMap.GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=0]
  23326. * @description 分析结果起始记录位置。
  23327. */
  23328. this.startRecord = 0;
  23329. /**
  23330. * @member {number} [SuperMap.GeoRelationAnalystParameters.prototype.expectCount=500]
  23331. * @description 空间关系分析期望返回结果记录数,如果实际不足 500 条结果则返回所有分析结果。
  23332. */
  23333. this.expectCount = 500;
  23334. if (options) {
  23335. Util_Util.extend(this, options);
  23336. }
  23337. this.CLASS_NAME = "SuperMap.GeoRelationAnalystParameters";
  23338. }
  23339. /**
  23340. * @function SuperMap.GeoRelationAnalystParameters.prototype.destroy
  23341. * @description 释放资源,将引用资源的属性置空。
  23342. */
  23343. GeoRelationAnalystParameters_createClass(GeoRelationAnalystParameters, [{
  23344. key: "destroy",
  23345. value: function destroy() {
  23346. var me = this;
  23347. if (me.sourceFilter) {
  23348. me.sourceFilter.destroy();
  23349. }
  23350. me.sourceFilter = null;
  23351. if (me.referenceFilter) {
  23352. me.referenceFilter.destroy();
  23353. }
  23354. me.referenceFilter = null;
  23355. me.dataset = null;
  23356. me.spatialRelationType = null;
  23357. me.isBorderInside = null;
  23358. me.returnFeature = null;
  23359. me.returnGeoRelatedOnly = null;
  23360. me.startRecord = null;
  23361. me.expectCount = null;
  23362. }
  23363. }]);
  23364. return GeoRelationAnalystParameters;
  23365. }();
  23366. SuperMap.GeoRelationAnalystParameters = GeoRelationAnalystParameters_GeoRelationAnalystParameters;
  23367. // CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystService.js
  23368. 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); }
  23369. function GeoRelationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23370. 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); } }
  23371. function GeoRelationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  23372. 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); }
  23373. function GeoRelationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoRelationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  23374. 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); }
  23375. function GeoRelationAnalystService_setPrototypeOf(o, p) { GeoRelationAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoRelationAnalystService_setPrototypeOf(o, p); }
  23376. 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); }; }
  23377. function GeoRelationAnalystService_possibleConstructorReturn(self, call) { if (call && (GeoRelationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoRelationAnalystService_assertThisInitialized(self); }
  23378. function GeoRelationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23379. 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; } }
  23380. function GeoRelationAnalystService_getPrototypeOf(o) { GeoRelationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoRelationAnalystService_getPrototypeOf(o); }
  23381. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  23382. * This program are made available under the terms of the Apache License, Version 2.0
  23383. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23384. /**
  23385. * @class SuperMap.GeoRelationAnalystService
  23386. * @category iServer SpatialAnalyst GeoRelationAnalyst
  23387. * @classdesc 空间关系分析服务类。该类负责将客户设置的空间关系分析服务参数传递给服务端,并接收服务端返回的空间关系分析结果数据。
  23388. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  23389. * @param {Object} options - 参数。</br>
  23390. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  23391. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23392. * @param {Object} [options.headers] - 请求头。
  23393. * @extends {SuperMap.SpatialAnalystBase}
  23394. * @example 实例化该类如下例所示:
  23395. * (start code)
  23396. * function datasetGeoRelationAnalystProcess() {
  23397. * var referenceFilter = new SuperMap.FilterParameter({
  23398. * name:"Frame_R@Changchun",
  23399. * attributeFilter:"SmID>0"});
  23400. * var sourceFilter = new SuperMap.FilterParameter({
  23401. * attributeFilter:"SmID>0"});
  23402. * //初始化服务类
  23403. * var datasetGeoRelationService = new SuperMap.GeoRelationAnalystService(
  23404. * "http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst/"),
  23405. * //构建参数类
  23406. * datasetGeoRelationParameters = new SuperMap.GeoRelationAnalystParameters({
  23407. * dataset: "Park@Changchun",
  23408. * startRecord: 0,
  23409. * expectCount: 20,
  23410. * sourceFilter: sourceFilter,
  23411. * referenceFilter: referenceFilter,
  23412. * spatialRelationType: SuperMap.SpatialRelationType.INTERSECT,
  23413. * isBorderInside: true,
  23414. * returnFeature: true,
  23415. * returnGeoRelatedOnly: true
  23416. * });
  23417. * datasetGeoRelationService.events.on({
  23418. * "processCompleted": datasetGeoRelationAnalystCompleted,
  23419. * "processFailed": datasetGeoRelationAnalystFailed});
  23420. * //执行
  23421. * datasetGeoRelationService.processAsync(datasetGeoRelationParameters);
  23422. * }
  23423. * function Completed(datasetGeoRelationAnalystCompleted){//todo};
  23424. * function Error(datasetGeoRelationAnalystFailed){//todo};
  23425. * (end)
  23426. *
  23427. */
  23428. var GeoRelationAnalystService_GeoRelationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  23429. GeoRelationAnalystService_inherits(GeoRelationAnalystService, _SpatialAnalystBase);
  23430. var _super = GeoRelationAnalystService_createSuper(GeoRelationAnalystService);
  23431. function GeoRelationAnalystService(url, options) {
  23432. var _this;
  23433. GeoRelationAnalystService_classCallCheck(this, GeoRelationAnalystService);
  23434. _this = _super.call(this, url, options);
  23435. _this.CLASS_NAME = "SuperMap.GeoRelationAnalystService";
  23436. return _this;
  23437. }
  23438. /**
  23439. * @function SuperMap.GeoRelationAnalystService.prototype.destroy
  23440. * @override
  23441. */
  23442. GeoRelationAnalystService_createClass(GeoRelationAnalystService, [{
  23443. key: "destroy",
  23444. value: function destroy() {
  23445. GeoRelationAnalystService_get(GeoRelationAnalystService_getPrototypeOf(GeoRelationAnalystService.prototype), "destroy", this).call(this);
  23446. }
  23447. /**
  23448. * @function SuperMap.GeoRelationAnalystService.prototype.processAsync
  23449. * @description 负责将客户端的空间关系分析参数传递到服务端
  23450. * @param {SuperMap.GeoRelationAnalystParameters} parameter - 空间关系分析所需的参数信息。
  23451. */
  23452. }, {
  23453. key: "processAsync",
  23454. value: function processAsync(parameter) {
  23455. if (!(parameter instanceof GeoRelationAnalystParameters_GeoRelationAnalystParameters)) {
  23456. return;
  23457. }
  23458. var me = this;
  23459. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/georelation');
  23460. var jsonParameters = SuperMap.Util.toJSON(parameter);
  23461. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  23462. me.request({
  23463. method: "POST",
  23464. data: jsonParameters,
  23465. scope: me,
  23466. success: me.serviceProcessCompleted,
  23467. failure: me.serviceProcessFailed
  23468. });
  23469. }
  23470. }]);
  23471. return GeoRelationAnalystService;
  23472. }(SpatialAnalystBase_SpatialAnalystBase);
  23473. SuperMap.GeoRelationAnalystService = GeoRelationAnalystService_GeoRelationAnalystService;
  23474. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesParametersBase.js
  23475. function GetFeaturesParametersBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23476. 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); } }
  23477. function GetFeaturesParametersBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesParametersBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesParametersBase_defineProperties(Constructor, staticProps); return Constructor; }
  23478. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  23479. * This program are made available under the terms of the Apache License, Version 2.0
  23480. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23481. /**
  23482. * @class SuperMap.GetFeaturesParametersBase
  23483. * @category iServer Data FeatureResults
  23484. * @classdesc 要素查询参数基类。
  23485. * @param {Object} options - 参数。
  23486. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  23487. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  23488. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  23489. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  23490. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  23491. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  23492. */
  23493. var GetFeaturesParametersBase_GetFeaturesParametersBase = /*#__PURE__*/function () {
  23494. function GetFeaturesParametersBase(options) {
  23495. GetFeaturesParametersBase_classCallCheck(this, GetFeaturesParametersBase);
  23496. /**
  23497. * @member {Array.<string>} SuperMap.GetFeaturesParametersBase.prototype.datasetName
  23498. * @description 数据集集合中的数据集名称列表。
  23499. */
  23500. this.datasetNames = null;
  23501. /**
  23502. * @member {string} SuperMap.GetFeaturesParametersBase.prototype.targetEpsgCode
  23503. * @description 动态投影的目标坐标系对应的 EPSG Code,使用时需设置 returnContent 参数为 true。
  23504. */
  23505. this.targetEpsgCode = null;
  23506. /**
  23507. * @member {Object} SuperMap.GetFeaturesParametersBase.prototype.targetEpsgCode
  23508. * @description 动态投影的目标坐标系。使用时需设置 returnContent 参数为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  23509. */
  23510. this.targetPrj = null;
  23511. /**
  23512. * @member {boolean} [SuperMap.GetFeaturesParametersBase.prototype.returnContent=true]
  23513. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  23514. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  23515. * 如果为 false,则返回的是查询结果资源的 URI。
  23516. */
  23517. this.returnContent = true;
  23518. /**
  23519. * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.fromIndex=0]
  23520. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  23521. */
  23522. this.fromIndex = 0;
  23523. /**
  23524. * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.toIndex=19]
  23525. * @description 查询结果的最大索引号。如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  23526. */
  23527. this.toIndex = 19;
  23528. /**
  23529. * @member {boolean} [SuperMap.GetFeaturesParametersBase.prototype.returnCountOnly=false]
  23530. * @description 只返回查询结果的总数。
  23531. */
  23532. this.returnCountOnly = false;
  23533. /**
  23534. * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.maxFeatures=1000]
  23535. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  23536. */
  23537. this.maxFeatures = null;
  23538. /**
  23539. * @member {Object} SuperMap.GetFeaturesParametersBase.prototype.aggregations
  23540. * @description 聚合查询参数,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  23541. */
  23542. this.aggregations = null;
  23543. Util_Util.extend(this, options);
  23544. this.CLASS_NAME = "SuperMap.GetFeaturesParametersBase";
  23545. }
  23546. /**
  23547. *
  23548. * @function SuperMap.GetFeaturesParametersBase.prototype.destroy
  23549. * @description 释放资源,将引用资源的属性置空。
  23550. */
  23551. GetFeaturesParametersBase_createClass(GetFeaturesParametersBase, [{
  23552. key: "destroy",
  23553. value: function destroy() {
  23554. var me = this;
  23555. me.datasetNames = null;
  23556. me.returnContent = null;
  23557. me.fromIndex = null;
  23558. me.toIndex = null;
  23559. me.maxFeatures = null;
  23560. me.targetEpsgCode = null;
  23561. me.targetPrj = null;
  23562. if (me.aggregation) {
  23563. me.aggregation = null;
  23564. }
  23565. }
  23566. }]);
  23567. return GetFeaturesParametersBase;
  23568. }();
  23569. SuperMap.GetFeaturesParametersBase = GetFeaturesParametersBase_GetFeaturesParametersBase;
  23570. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsParameters.js
  23571. 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); }
  23572. function GetFeaturesByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23573. 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); } }
  23574. function GetFeaturesByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  23575. 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); }
  23576. function GetFeaturesByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  23577. 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); }
  23578. function GetFeaturesByBoundsParameters_setPrototypeOf(o, p) { GetFeaturesByBoundsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsParameters_setPrototypeOf(o, p); }
  23579. 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); }; }
  23580. function GetFeaturesByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBoundsParameters_assertThisInitialized(self); }
  23581. function GetFeaturesByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23582. 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; } }
  23583. function GetFeaturesByBoundsParameters_getPrototypeOf(o) { GetFeaturesByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsParameters_getPrototypeOf(o); }
  23584. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  23585. * This program are made available under the terms of the Apache License, Version 2.0
  23586. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23587. /**
  23588. * @class SuperMap.GetFeaturesByBoundsParameters
  23589. * @category iServer Data FeatureResults
  23590. * @classdesc 数据集范围查询参数类,该类用于设置数据集范围查询的相关参数。
  23591. * @param {Object} options - 参数。
  23592. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 用于查询的范围对象。
  23593. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  23594. * @param {string} [options.attributeFilter] - 范围查询属性过滤条件。
  23595. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  23596. * @param {SuperMap.SpatialQueryMode} [options.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  23597. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  23598. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  23599. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  23600. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  23601. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  23602. * @extends {SuperMap.GetFeaturesParametersBase}
  23603. */
  23604. var GetFeaturesByBoundsParameters_GetFeaturesByBoundsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  23605. GetFeaturesByBoundsParameters_inherits(GetFeaturesByBoundsParameters, _GetFeaturesParameter);
  23606. var _super = GetFeaturesByBoundsParameters_createSuper(GetFeaturesByBoundsParameters);
  23607. function GetFeaturesByBoundsParameters(options) {
  23608. var _this;
  23609. GetFeaturesByBoundsParameters_classCallCheck(this, GetFeaturesByBoundsParameters);
  23610. _this = _super.call(this, options);
  23611. /**
  23612. * @member {string} SuperMap.GetFeaturesByBoundsParameters.prototype.getFeatureMode
  23613. * @description 数据集查询模式。范围查询有 "BOUNDS","BOUNDS_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 BOUNDS_ATTRIBUTEFILTER 访问服务。
  23614. */
  23615. _this.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS;
  23616. /**
  23617. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.GetFeaturesByBoundsParameters.prototype.bounds
  23618. * @description 用于查询的范围对象。
  23619. *
  23620. */
  23621. _this.bounds = null;
  23622. /**
  23623. * @member {Array.<string>} SuperMap.GetFeaturesByBoundsParameters.prototype.fields
  23624. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  23625. */
  23626. _this.fields = null;
  23627. /**
  23628. * @member {string} SuperMap.GetFeaturesByBoundsParameters.prototype.attributeFilter
  23629. * @description 范围查询属性过滤条件。
  23630. */
  23631. _this.attributeFilter = null;
  23632. /**
  23633. * @member {SuperMap.SpatialQueryMode} [SuperMap.GetFeaturesByBoundsParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN]
  23634. * @description 空间查询模式常量。
  23635. */
  23636. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  23637. Util_Util.extend(GetFeaturesByBoundsParameters_assertThisInitialized(_this), options);
  23638. _this.CLASS_NAME = "SuperMap.GetFeaturesByBoundsParameters";
  23639. return _this;
  23640. }
  23641. /**
  23642. * @function SuperMap.GetFeaturesByBoundsParameters.prototype.destroy
  23643. * @override
  23644. */
  23645. GetFeaturesByBoundsParameters_createClass(GetFeaturesByBoundsParameters, [{
  23646. key: "destroy",
  23647. value: function destroy() {
  23648. GetFeaturesByBoundsParameters_get(GetFeaturesByBoundsParameters_getPrototypeOf(GetFeaturesByBoundsParameters.prototype), "destroy", this).call(this);
  23649. var me = this;
  23650. if (me.bounds) {
  23651. me.bounds.destroy();
  23652. me.bounds = null;
  23653. }
  23654. if (me.fields) {
  23655. while (me.fields.length > 0) {
  23656. me.fields.pop();
  23657. }
  23658. me.fields = null;
  23659. }
  23660. me.attributeFilter = null;
  23661. me.spatialQueryMode = null;
  23662. me.getFeatureMode = null;
  23663. }
  23664. /**
  23665. * @function SuperMap.GetFeaturesByBoundsParameters.toJsonParameters
  23666. * @description 将 {@link SuperMap.GetFeaturesByBoundsParameters} 对象参数转换为 JSON 字符串。
  23667. * @param {SuperMap.GetFeaturesByBoundsParameters} params - 范围查询参数。
  23668. * @returns {string} 转化后的 JSON 字符串。
  23669. *
  23670. */
  23671. }], [{
  23672. key: "toJsonParameters",
  23673. value: function toJsonParameters(params) {
  23674. var filterParameter, bounds, parasByBounds;
  23675. bounds = {
  23676. "leftBottom": {
  23677. "x": params.bounds.left,
  23678. "y": params.bounds.bottom
  23679. },
  23680. "rightTop": {
  23681. "x": params.bounds.right,
  23682. "y": params.bounds.top
  23683. }
  23684. };
  23685. parasByBounds = {
  23686. datasetNames: params.datasetNames,
  23687. getFeatureMode: GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS,
  23688. bounds: bounds,
  23689. spatialQueryMode: params.spatialQueryMode
  23690. };
  23691. if (params.fields) {
  23692. filterParameter = new FilterParameter_FilterParameter();
  23693. filterParameter.name = params.datasetNames;
  23694. filterParameter.fields = params.fields;
  23695. parasByBounds.queryParameter = filterParameter;
  23696. }
  23697. if (params.attributeFilter) {
  23698. parasByBounds.attributeFilter = params.attributeFilter;
  23699. parasByBounds.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS_ATTRIBUTEFILTER;
  23700. }
  23701. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  23702. parasByBounds.maxFeatures = params.maxFeatures;
  23703. }
  23704. if (params.targetEpsgCode) {
  23705. parasByBounds.targetEpsgCode = params.targetEpsgCode;
  23706. }
  23707. if (!params.targetEpsgCode && params.targetPrj) {
  23708. parasByBounds.targetPrj = params.targetPrj;
  23709. }
  23710. return Util_Util.toJSON(parasByBounds);
  23711. }
  23712. }]);
  23713. return GetFeaturesByBoundsParameters;
  23714. }(GetFeaturesParametersBase_GetFeaturesParametersBase);
  23715. GetFeaturesByBoundsParameters_GetFeaturesByBoundsParameters.getFeatureMode = {
  23716. "BOUNDS": "BOUNDS",
  23717. "BOUNDS_ATTRIBUTEFILTER": "BOUNDS_ATTRIBUTEFILTER"
  23718. };
  23719. SuperMap.GetFeaturesByBoundsParameters = GetFeaturesByBoundsParameters_GetFeaturesByBoundsParameters;
  23720. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesServiceBase.js
  23721. 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); }
  23722. function GetFeaturesServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23723. 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); } }
  23724. function GetFeaturesServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  23725. 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); }
  23726. function GetFeaturesServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  23727. 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); }
  23728. function GetFeaturesServiceBase_setPrototypeOf(o, p) { GetFeaturesServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesServiceBase_setPrototypeOf(o, p); }
  23729. 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); }; }
  23730. function GetFeaturesServiceBase_possibleConstructorReturn(self, call) { if (call && (GetFeaturesServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesServiceBase_assertThisInitialized(self); }
  23731. function GetFeaturesServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23732. 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; } }
  23733. function GetFeaturesServiceBase_getPrototypeOf(o) { GetFeaturesServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesServiceBase_getPrototypeOf(o); }
  23734. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  23735. * This program are made available under the terms of the Apache License, Version 2.0
  23736. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23737. /**
  23738. * @class SuperMap.GetFeaturesServiceBase
  23739. * @category iServer Data FeatureResults
  23740. * @classdesc 数据服务中数据集查询服务基类。获取结果数据类型为 Object。包含 result 属性,result 的数据格式根据 format 参数决定为 GeoJSON 或者 iServerJSON。
  23741. * @extends SuperMap.CommonServiceBase
  23742. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
  23743. * URL应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/
  23744. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  23745. * @param {Object} options - 参数。
  23746. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  23747. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  23748. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  23749. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23750. * @param {Object} [options.headers] - 请求头。
  23751. * @example
  23752. * var myService = new SuperMap.GetFeaturesServiceBase(url, {
  23753. * eventListeners: {
  23754. * "processCompleted": getFeatureCompleted,
  23755. * "processFailed": getFeatureError
  23756. * }
  23757. * });
  23758. */
  23759. var GetFeaturesServiceBase_GetFeaturesServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  23760. GetFeaturesServiceBase_inherits(GetFeaturesServiceBase, _CommonServiceBase);
  23761. var _super = GetFeaturesServiceBase_createSuper(GetFeaturesServiceBase);
  23762. function GetFeaturesServiceBase(url, options) {
  23763. var _this;
  23764. GetFeaturesServiceBase_classCallCheck(this, GetFeaturesServiceBase);
  23765. _this = _super.call(this, url, options);
  23766. options = options || {};
  23767. /**
  23768. * @member {boolean} [SuperMap.GetFeaturesServiceBase.prototype.returnContent=true]
  23769. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  23770. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  23771. * 如果为 false,则返回的是查询结果资源的 URI。
  23772. */
  23773. _this.returnContent = true;
  23774. /**
  23775. * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.fromIndex=0]
  23776. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  23777. */
  23778. _this.fromIndex = 0;
  23779. /**
  23780. * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.toIndex=19]
  23781. * @description 查询结果的最大索引号。
  23782. * 如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  23783. */
  23784. _this.toIndex = 19;
  23785. /**
  23786. * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.maxFeatures=1000]
  23787. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  23788. */
  23789. _this.maxFeatures = null;
  23790. /**
  23791. * @member {string} [SuperMap.GetFeaturesServiceBase.prototype.format=SuperMap.DataFormat.GEOJSON]
  23792. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。
  23793. * 参数格式为 "ISERVER","GEOJSON"。
  23794. */
  23795. _this.format = DataFormat.GEOJSON;
  23796. Util_Util.extend(GetFeaturesServiceBase_assertThisInitialized(_this), options);
  23797. _this.url = Util_Util.urlPathAppend(_this.url, 'featureResults');
  23798. _this.CLASS_NAME = "SuperMap.GetFeaturesServiceBase";
  23799. return _this;
  23800. }
  23801. /**
  23802. * @function SuperMap.GetFeaturesServiceBase.prototype.destroy
  23803. * @description 释放资源,将引用资源的属性置空。
  23804. */
  23805. GetFeaturesServiceBase_createClass(GetFeaturesServiceBase, [{
  23806. key: "destroy",
  23807. value: function destroy() {
  23808. GetFeaturesServiceBase_get(GetFeaturesServiceBase_getPrototypeOf(GetFeaturesServiceBase.prototype), "destroy", this).call(this);
  23809. var me = this;
  23810. me.returnContent = null;
  23811. me.fromIndex = null;
  23812. me.toIndex = null;
  23813. me.maxFeatures = null;
  23814. me.format = null;
  23815. }
  23816. /**
  23817. * @function SuperMap.GetFeaturesServiceBase.prototype.processAsync
  23818. * @description 将客户端的查询参数传递到服务端。
  23819. * @param {Object} params - 查询参数。
  23820. */
  23821. }, {
  23822. key: "processAsync",
  23823. value: function processAsync(params) {
  23824. if (!params) {
  23825. return;
  23826. }
  23827. var me = this,
  23828. jsonParameters = null,
  23829. firstPara = true;
  23830. me.returnContent = params.returnContent;
  23831. me.fromIndex = params.fromIndex;
  23832. me.toIndex = params.toIndex;
  23833. me.maxFeatures = params.maxFeatures;
  23834. if (me.returnContent) {
  23835. me.url = Util_Util.urlAppend(me.url, 'returnContent=' + me.returnContent);
  23836. firstPara = false;
  23837. }
  23838. var isValidNumber = me.fromIndex != null && me.toIndex != null && !isNaN(me.fromIndex) && !isNaN(me.toIndex);
  23839. if (isValidNumber && me.fromIndex >= 0 && me.toIndex >= 0 && !firstPara) {
  23840. me.url = Util_Util.urlAppend(me.url, "fromIndex=".concat(me.fromIndex, "&toIndex=").concat(me.toIndex));
  23841. }
  23842. if (params.returnCountOnly) {
  23843. me.url = Util_Util.urlAppend(me.url, "&returnCountOnly=" + params.returnContent);
  23844. }
  23845. jsonParameters = me.getJsonParameters(params);
  23846. me.request({
  23847. method: "POST",
  23848. data: jsonParameters,
  23849. scope: me,
  23850. success: me.serviceProcessCompleted,
  23851. failure: me.serviceProcessFailed
  23852. });
  23853. }
  23854. /**
  23855. * @function SuperMap.GetFeaturesServiceBase.prototype.getFeatureComplete
  23856. * @description 查询完成,执行此方法。
  23857. * @param {Object} result - 服务器返回的结果对象。
  23858. */
  23859. }, {
  23860. key: "serviceProcessCompleted",
  23861. value: function serviceProcessCompleted(result) {
  23862. var me = this;
  23863. result = Util_Util.transformResult(result);
  23864. if (me.format === DataFormat.GEOJSON && result.features) {
  23865. var geoJSONFormat = new GeoJSON_GeoJSON();
  23866. result.features = geoJSONFormat.toGeoJSON(result.features);
  23867. }
  23868. me.events.triggerEvent("processCompleted", {
  23869. result: result
  23870. });
  23871. }
  23872. }]);
  23873. return GetFeaturesServiceBase;
  23874. }(CommonServiceBase_CommonServiceBase);
  23875. SuperMap.GetFeaturesServiceBase = GetFeaturesServiceBase_GetFeaturesServiceBase;
  23876. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsService.js
  23877. 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); }
  23878. function GetFeaturesByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23879. 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); } }
  23880. function GetFeaturesByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsService_defineProperties(Constructor, staticProps); return Constructor; }
  23881. 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); }
  23882. function GetFeaturesByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  23883. 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); }
  23884. function GetFeaturesByBoundsService_setPrototypeOf(o, p) { GetFeaturesByBoundsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsService_setPrototypeOf(o, p); }
  23885. 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); }; }
  23886. function GetFeaturesByBoundsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBoundsService_assertThisInitialized(self); }
  23887. function GetFeaturesByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23888. 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; } }
  23889. function GetFeaturesByBoundsService_getPrototypeOf(o) { GetFeaturesByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsService_getPrototypeOf(o); }
  23890. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  23891. * This program are made available under the terms of the Apache License, Version 2.0
  23892. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23893. /**
  23894. * @class SuperMap.GetFeaturesByBoundsService
  23895. * @category iServer Data FeatureResults
  23896. * @classdesc 数据集范围查询服务类,查询与指定范围对象符合一定空间关系的矢量要素。
  23897. * @description 数据集范围查询服务类构造函数。
  23898. * @extends {SuperMap.GetFeaturesServiceBase}
  23899. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  23900. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  23901. * @param {Object} options - 参数。
  23902. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  23903. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  23904. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  23905. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23906. * @param {Object} [options.headers] - 请求头。
  23907. * @example
  23908. * var myGetFeaturesByBoundsService = new SuperMa.GetFeaturesByBoundsService(url, {
  23909. * eventListeners: {
  23910. * "processCompleted": getFeatureCompleted,
  23911. * "processFailed": getFeatureError
  23912. * }
  23913. * });
  23914. * function getFeatureCompleted(object){//todo};
  23915. * function getFeatureError(object){//todo}
  23916. */
  23917. var GetFeaturesByBoundsService_GetFeaturesByBoundsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  23918. GetFeaturesByBoundsService_inherits(GetFeaturesByBoundsService, _GetFeaturesServiceBa);
  23919. var _super = GetFeaturesByBoundsService_createSuper(GetFeaturesByBoundsService);
  23920. function GetFeaturesByBoundsService(url, options) {
  23921. var _this;
  23922. GetFeaturesByBoundsService_classCallCheck(this, GetFeaturesByBoundsService);
  23923. _this = _super.call(this, url, options);
  23924. _this.CLASS_NAME = "SuperMap.GetFeaturesByBoundsService";
  23925. return _this;
  23926. }
  23927. /**
  23928. * @function SuperMap.GetFeaturesByBoundsService.prototype.destroy
  23929. * @override
  23930. */
  23931. GetFeaturesByBoundsService_createClass(GetFeaturesByBoundsService, [{
  23932. key: "destroy",
  23933. value: function destroy() {
  23934. GetFeaturesByBoundsService_get(GetFeaturesByBoundsService_getPrototypeOf(GetFeaturesByBoundsService.prototype), "destroy", this).call(this);
  23935. }
  23936. /**
  23937. * @function SuperMap.GetFeaturesByBoundsService.prototype.getJsonParameters
  23938. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry,Bounds等)。
  23939. * @param params {SuperMap.GetFeaturesByBoundsParameters}
  23940. * @returns {string} 转化后的 JSON 字符串。
  23941. *
  23942. */
  23943. }, {
  23944. key: "getJsonParameters",
  23945. value: function getJsonParameters(params) {
  23946. return GetFeaturesByBoundsParameters_GetFeaturesByBoundsParameters.toJsonParameters(params);
  23947. }
  23948. }]);
  23949. return GetFeaturesByBoundsService;
  23950. }(GetFeaturesServiceBase_GetFeaturesServiceBase);
  23951. SuperMap.GetFeaturesByBoundsService = GetFeaturesByBoundsService_GetFeaturesByBoundsService;
  23952. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferParameters.js
  23953. 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); }
  23954. function GetFeaturesByBufferParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23955. 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); } }
  23956. function GetFeaturesByBufferParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferParameters_defineProperties(Constructor, staticProps); return Constructor; }
  23957. 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); }
  23958. function GetFeaturesByBufferParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  23959. 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); }
  23960. function GetFeaturesByBufferParameters_setPrototypeOf(o, p) { GetFeaturesByBufferParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferParameters_setPrototypeOf(o, p); }
  23961. 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); }; }
  23962. function GetFeaturesByBufferParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBufferParameters_assertThisInitialized(self); }
  23963. function GetFeaturesByBufferParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23964. 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; } }
  23965. function GetFeaturesByBufferParameters_getPrototypeOf(o) { GetFeaturesByBufferParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferParameters_getPrototypeOf(o); }
  23966. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  23967. * This program are made available under the terms of the Apache License, Version 2.0
  23968. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23969. /**
  23970. * @class SuperMap.GetFeaturesByBufferParameters
  23971. * @category iServer Data FeatureResults
  23972. * @classdesc 数据服务中数据集缓冲区查询参数类。
  23973. * @param {Object} options - 参数。
  23974. * @param {number} options.bufferDistance - buffer 距离,单位与所查询图层对应的数据集单位相同。
  23975. * @param {Object} options.geometry - 空间查询条件。</br>
  23976. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  23977. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  23978. * @param {string} [options.attributeFilter] - 属性查询条件。
  23979. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  23980. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  23981. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  23982. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  23983. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  23984. * @extends {SuperMap.GetFeaturesParametersBase}
  23985. */
  23986. var GetFeaturesByBufferParameters_GetFeaturesByBufferParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  23987. GetFeaturesByBufferParameters_inherits(GetFeaturesByBufferParameters, _GetFeaturesParameter);
  23988. var _super = GetFeaturesByBufferParameters_createSuper(GetFeaturesByBufferParameters);
  23989. function GetFeaturesByBufferParameters(options) {
  23990. var _this;
  23991. GetFeaturesByBufferParameters_classCallCheck(this, GetFeaturesByBufferParameters);
  23992. _this = _super.call(this, options);
  23993. /**
  23994. * @member {number} SuperMap.GetFeaturesByBufferParameters.prototype.bufferDistance
  23995. * @description buffer 距离,单位与所查询图层对应的数据集单位相同。
  23996. */
  23997. _this.bufferDistance = null;
  23998. /**
  23999. * @member {string} SuperMap.GetFeaturesByBufferParameters.prototype.attributeFilter
  24000. * @description 属性查询条件。
  24001. */
  24002. _this.attributeFilter = null;
  24003. /**
  24004. * @member {Object} SuperMap.GetFeaturesByBufferParameters.prototype.geometry
  24005. * @description 空间查询条件。 <br>
  24006. * 点类型可以是:{@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>
  24007. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  24008. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  24009. */
  24010. _this.geometry = null;
  24011. /**
  24012. * @member {Array.<string>} SuperMap.GetFeaturesByBufferParameters.prototype.fields
  24013. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  24014. */
  24015. _this.fields = null;
  24016. Util_Util.extend(GetFeaturesByBufferParameters_assertThisInitialized(_this), options);
  24017. _this.CLASS_NAME = "SuperMap.GetFeaturesByBufferParameters";
  24018. return _this;
  24019. }
  24020. /**
  24021. * @function SuperMap.GetFeaturesByBufferParameters.prototype.destroy
  24022. * @override
  24023. */
  24024. GetFeaturesByBufferParameters_createClass(GetFeaturesByBufferParameters, [{
  24025. key: "destroy",
  24026. value: function destroy() {
  24027. GetFeaturesByBufferParameters_get(GetFeaturesByBufferParameters_getPrototypeOf(GetFeaturesByBufferParameters.prototype), "destroy", this).call(this);
  24028. var me = this;
  24029. me.bufferDistance = null;
  24030. me.attributeFilter = null;
  24031. if (me.fields) {
  24032. while (me.fields.length > 0) {
  24033. me.fields.pop();
  24034. }
  24035. me.fields = null;
  24036. }
  24037. if (me.geometry) {
  24038. me.geometry.destroy();
  24039. me.geometry = null;
  24040. }
  24041. }
  24042. /**
  24043. * @function SuperMap.GetFeaturesByBufferParameters.toJsonParameters
  24044. * @description 将 SuperMap.GetFeaturesByBufferParameters 对象转换为 JSON 字符串。
  24045. * @param {SuperMap.GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数对象。
  24046. * @returns {string} 转化后的 JSON 字符串。
  24047. */
  24048. }], [{
  24049. key: "toJsonParameters",
  24050. value: function toJsonParameters(params) {
  24051. var filterParameter, paramsBySql, geometry;
  24052. geometry = ServerGeometry_ServerGeometry.fromGeometry(params.geometry);
  24053. paramsBySql = {
  24054. datasetNames: params.datasetNames,
  24055. getFeatureMode: "BUFFER",
  24056. bufferDistance: params.bufferDistance,
  24057. geometry: geometry
  24058. };
  24059. if (params.fields) {
  24060. filterParameter = new FilterParameter_FilterParameter();
  24061. filterParameter.name = params.datasetNames;
  24062. filterParameter.fields = params.fields;
  24063. paramsBySql.queryParameter = filterParameter;
  24064. }
  24065. if (params.attributeFilter) {
  24066. paramsBySql.attributeFilter = params.attributeFilter;
  24067. paramsBySql.getFeatureMode = "BUFFER_ATTRIBUTEFILTER";
  24068. }
  24069. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  24070. paramsBySql.maxFeatures = params.maxFeatures;
  24071. }
  24072. if (params.targetEpsgCode) {
  24073. paramsBySql.targetEpsgCode = params.targetEpsgCode;
  24074. }
  24075. if (!params.targetEpsgCode && params.targetPrj) {
  24076. paramsBySql.targetPrj = params.targetPrj;
  24077. }
  24078. return Util_Util.toJSON(paramsBySql);
  24079. }
  24080. }]);
  24081. return GetFeaturesByBufferParameters;
  24082. }(GetFeaturesParametersBase_GetFeaturesParametersBase);
  24083. SuperMap.GetFeaturesByBufferParameters = GetFeaturesByBufferParameters_GetFeaturesByBufferParameters;
  24084. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferService.js
  24085. 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); }
  24086. function GetFeaturesByBufferService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24087. 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); } }
  24088. function GetFeaturesByBufferService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferService_defineProperties(Constructor, staticProps); return Constructor; }
  24089. 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); }
  24090. function GetFeaturesByBufferService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferService_getPrototypeOf(object); if (object === null) break; } return object; }
  24091. 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); }
  24092. function GetFeaturesByBufferService_setPrototypeOf(o, p) { GetFeaturesByBufferService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferService_setPrototypeOf(o, p); }
  24093. 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); }; }
  24094. function GetFeaturesByBufferService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBufferService_assertThisInitialized(self); }
  24095. function GetFeaturesByBufferService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24096. 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; } }
  24097. function GetFeaturesByBufferService_getPrototypeOf(o) { GetFeaturesByBufferService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferService_getPrototypeOf(o); }
  24098. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  24099. * This program are made available under the terms of the Apache License, Version 2.0
  24100. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24101. /**
  24102. * @class SuperMap.GetFeaturesByBufferService
  24103. * @category iServer Data FeatureResults
  24104. * @classdesc 数据服务中数据集缓冲区查询服务类。
  24105. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
  24106. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  24107. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  24108. * @param {Object} options - 参数。
  24109. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  24110. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  24111. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  24112. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24113. * @param {Object} [options.headers] - 请求头。
  24114. * @extends {SuperMap.GetFeaturesServiceBase}
  24115. * @example
  24116. * var myGetFeaturesByBufferService = new SuperMap.GetFeaturesByBufferService(url, {
  24117. * eventListeners: {
  24118. * "processCompleted": GetFeaturesCompleted,
  24119. * "processFailed": GetFeaturesError
  24120. * }
  24121. * });
  24122. * function GetFeaturesCompleted(object){//todo};
  24123. * function GetFeaturesError(object){//todo};
  24124. */
  24125. var GetFeaturesByBufferService_GetFeaturesByBufferService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  24126. GetFeaturesByBufferService_inherits(GetFeaturesByBufferService, _GetFeaturesServiceBa);
  24127. var _super = GetFeaturesByBufferService_createSuper(GetFeaturesByBufferService);
  24128. function GetFeaturesByBufferService(url, options) {
  24129. var _this;
  24130. GetFeaturesByBufferService_classCallCheck(this, GetFeaturesByBufferService);
  24131. _this = _super.call(this, url, options);
  24132. _this.CLASS_NAME = "SuperMap.GetFeaturesByBufferService";
  24133. return _this;
  24134. }
  24135. /**
  24136. * @function SuperMap.GetFeaturesByBufferService.prototype.destroy
  24137. * @override
  24138. */
  24139. GetFeaturesByBufferService_createClass(GetFeaturesByBufferService, [{
  24140. key: "destroy",
  24141. value: function destroy() {
  24142. GetFeaturesByBufferService_get(GetFeaturesByBufferService_getPrototypeOf(GetFeaturesByBufferService.prototype), "destroy", this).call(this);
  24143. }
  24144. /**
  24145. * @function SuperMap.GetFeaturesByBufferService.prototype.getJsonParameters
  24146. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(IDs, SQL, Buffer, Geometry等)。
  24147. * @param {SuperMap.GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  24148. * @returns {Object} 转化后的 JSON 字符串。
  24149. */
  24150. }, {
  24151. key: "getJsonParameters",
  24152. value: function getJsonParameters(params) {
  24153. if (!(params instanceof GetFeaturesByBufferParameters_GetFeaturesByBufferParameters)) {
  24154. return;
  24155. }
  24156. return SuperMap.GetFeaturesByBufferParameters.toJsonParameters(params);
  24157. }
  24158. }]);
  24159. return GetFeaturesByBufferService;
  24160. }(GetFeaturesServiceBase_GetFeaturesServiceBase);
  24161. SuperMap.GetFeaturesByBufferService = GetFeaturesByBufferService_GetFeaturesByBufferService;
  24162. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryParameters.js
  24163. 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); }
  24164. function GetFeaturesByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24165. 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); } }
  24166. function GetFeaturesByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  24167. 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); }
  24168. function GetFeaturesByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  24169. 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); }
  24170. function GetFeaturesByGeometryParameters_setPrototypeOf(o, p) { GetFeaturesByGeometryParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryParameters_setPrototypeOf(o, p); }
  24171. 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); }; }
  24172. function GetFeaturesByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByGeometryParameters_assertThisInitialized(self); }
  24173. function GetFeaturesByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24174. 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; } }
  24175. function GetFeaturesByGeometryParameters_getPrototypeOf(o) { GetFeaturesByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryParameters_getPrototypeOf(o); }
  24176. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  24177. * This program are made available under the terms of the Apache License, Version 2.0
  24178. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24179. /**
  24180. * @class SuperMap.GetFeaturesByGeometryParameters
  24181. * @category iServer Data FeatureResults
  24182. * @classdesc 数据集几何查询参数类。该类用于设置数据集几何查询的相关参数。
  24183. * @param {Object} options - 参数。
  24184. * @param {Object} options.geometry - 用于查询的几何对象。
  24185. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  24186. * @param {string} [options.attributeFilter] - 几何查询属性过滤条件。
  24187. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  24188. * @param {SuperMap.SpatialQueryMode} [options.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  24189. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  24190. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  24191. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  24192. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  24193. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  24194. * @extends {SuperMap.GetFeaturesParametersBase}
  24195. */
  24196. var GetFeaturesByGeometryParameters_GetFeaturesByGeometryParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  24197. GetFeaturesByGeometryParameters_inherits(GetFeaturesByGeometryParameters, _GetFeaturesParameter);
  24198. var _super = GetFeaturesByGeometryParameters_createSuper(GetFeaturesByGeometryParameters);
  24199. function GetFeaturesByGeometryParameters(options) {
  24200. var _this;
  24201. GetFeaturesByGeometryParameters_classCallCheck(this, GetFeaturesByGeometryParameters);
  24202. _this = _super.call(this, options);
  24203. /**
  24204. * @member {string} SuperMap.GetFeaturesByGeometryParameters.prototype.getFeatureMode
  24205. * @description 数据集查询模式。几何查询有 "SPATIAL","SPATIAL_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 SPATIAL_ATTRIBUTEFILTER 访问服务。
  24206. */
  24207. _this.getFeatureMode = "SPATIAL";
  24208. /**
  24209. * @member {Object} SuperMap.GetFeaturesByGeometryParameters.prototype.geometry
  24210. * @description 用于查询的几何对象。 </br>
  24211. * 点类型可以是:{@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>
  24212. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  24213. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  24214. */
  24215. _this.geometry = null;
  24216. /**
  24217. * @member {Array.<string>} SuperMap.GetFeaturesByGeometryParameters.prototype.fields
  24218. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  24219. */
  24220. _this.fields = null;
  24221. /**
  24222. * @member {string} SuperMap.GetFeaturesByGeometryParameters.prototype.attributeFilter
  24223. * @description 几何查询属性过滤条件。
  24224. */
  24225. _this.attributeFilter = null;
  24226. /**
  24227. * @member {SuperMap.SpatialQueryMode} [SuperMap.GetFeaturesByGeometryParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN]
  24228. * @description 空间查询模式常量。
  24229. */
  24230. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  24231. Util_Util.extend(GetFeaturesByGeometryParameters_assertThisInitialized(_this), options);
  24232. _this.CLASS_NAME = "SuperMap.GetFeaturesByGeometryParameters";
  24233. return _this;
  24234. }
  24235. /**
  24236. * @function SuperMap.GetFeaturesByGeometryParameters.prototype.destroy
  24237. * @description 释放资源,将引用资源的属性置空。
  24238. */
  24239. GetFeaturesByGeometryParameters_createClass(GetFeaturesByGeometryParameters, [{
  24240. key: "destroy",
  24241. value: function destroy() {
  24242. GetFeaturesByGeometryParameters_get(GetFeaturesByGeometryParameters_getPrototypeOf(GetFeaturesByGeometryParameters.prototype), "destroy", this).call(this);
  24243. var me = this;
  24244. if (me.geometry) {
  24245. me.geometry.destroy();
  24246. me.geometry = null;
  24247. }
  24248. if (me.fields) {
  24249. while (me.fields.length > 0) {
  24250. me.fields.pop();
  24251. }
  24252. me.fields = null;
  24253. }
  24254. me.attributeFilter = null;
  24255. me.spatialQueryMode = null;
  24256. me.getFeatureMode = null;
  24257. }
  24258. /**
  24259. * @function SuperMap.GetFeaturesByGeometryParameters.toJsonParameters
  24260. * @description 将 SuperMap.GetFeaturesByGeometryParameters 对象参数转换为 JSON 字符串。
  24261. * @param {SuperMap.GetFeaturesByGeometryParameters} params - 查询参数对象。
  24262. * @returns {string} 转化后的 JSON 字符串。
  24263. */
  24264. }], [{
  24265. key: "toJsonParameters",
  24266. value: function toJsonParameters(params) {
  24267. var filterParameter, geometry, parasByGeometry;
  24268. geometry = ServerGeometry_ServerGeometry.fromGeometry(params.geometry);
  24269. parasByGeometry = {
  24270. datasetNames: params.datasetNames,
  24271. getFeatureMode: "SPATIAL",
  24272. geometry: geometry,
  24273. spatialQueryMode: params.spatialQueryMode
  24274. };
  24275. if (params.fields) {
  24276. filterParameter = new FilterParameter_FilterParameter();
  24277. filterParameter.name = params.datasetNames;
  24278. filterParameter.fields = params.fields;
  24279. parasByGeometry.queryParameter = filterParameter;
  24280. }
  24281. if (params.attributeFilter) {
  24282. parasByGeometry.attributeFilter = params.attributeFilter;
  24283. parasByGeometry.getFeatureMode = "SPATIAL_ATTRIBUTEFILTER";
  24284. }
  24285. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  24286. parasByGeometry.maxFeatures = params.maxFeatures;
  24287. }
  24288. if (params.targetEpsgCode) {
  24289. parasByGeometry.targetEpsgCode = params.targetEpsgCode;
  24290. }
  24291. if (!params.targetEpsgCode && params.targetPrj) {
  24292. parasByGeometry.targetPrj = params.targetPrj;
  24293. }
  24294. return Util_Util.toJSON(parasByGeometry);
  24295. }
  24296. }]);
  24297. return GetFeaturesByGeometryParameters;
  24298. }(GetFeaturesParametersBase_GetFeaturesParametersBase);
  24299. SuperMap.GetFeaturesByGeometryParameters = GetFeaturesByGeometryParameters_GetFeaturesByGeometryParameters;
  24300. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryService.js
  24301. 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); }
  24302. function GetFeaturesByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24303. 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); } }
  24304. function GetFeaturesByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryService_defineProperties(Constructor, staticProps); return Constructor; }
  24305. 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); }
  24306. function GetFeaturesByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  24307. 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); }
  24308. function GetFeaturesByGeometryService_setPrototypeOf(o, p) { GetFeaturesByGeometryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryService_setPrototypeOf(o, p); }
  24309. 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); }; }
  24310. function GetFeaturesByGeometryService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByGeometryService_assertThisInitialized(self); }
  24311. function GetFeaturesByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24312. 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; } }
  24313. function GetFeaturesByGeometryService_getPrototypeOf(o) { GetFeaturesByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryService_getPrototypeOf(o); }
  24314. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  24315. * This program are made available under the terms of the Apache License, Version 2.0
  24316. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24317. /**
  24318. * @class SuperMap.GetFeaturesByGeometryService
  24319. * @category iServer Data FeatureResults
  24320. * @classdesc 数据集几何查询服务类,查询与指定几何对象符合一定空间关系的矢量要素。
  24321. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务。
  24322. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data;
  24323. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data"
  24324. * @param {Object} options - 参数。</br>
  24325. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  24326. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  24327. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  24328. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24329. * @param {Object} [options.headers] - 请求头。
  24330. * @extends {SuperMap.GetFeaturesServiceBase}
  24331. * @example
  24332. * var myService = new SuperMap.GetFeaturesByGeometryService(url, {
  24333. * eventListeners: {
  24334. * "processCompleted": getFeatureCompleted,
  24335. * "processFailed": getFeatureError
  24336. * }
  24337. * });
  24338. * function getFeatureCompleted(object){//todo};
  24339. * function getFeatureError(object){//todo}
  24340. */
  24341. var GetFeaturesByGeometryService_GetFeaturesByGeometryService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  24342. GetFeaturesByGeometryService_inherits(GetFeaturesByGeometryService, _GetFeaturesServiceBa);
  24343. var _super = GetFeaturesByGeometryService_createSuper(GetFeaturesByGeometryService);
  24344. function GetFeaturesByGeometryService(url, options) {
  24345. var _this;
  24346. GetFeaturesByGeometryService_classCallCheck(this, GetFeaturesByGeometryService);
  24347. _this = _super.call(this, url, options);
  24348. _this.CLASS_NAME = "SuperMap.GetFeaturesByGeometryService";
  24349. return _this;
  24350. }
  24351. /**
  24352. * @function SuperMap.GetFeaturesByGeometryService.prototype.destroy
  24353. * @override
  24354. */
  24355. GetFeaturesByGeometryService_createClass(GetFeaturesByGeometryService, [{
  24356. key: "destroy",
  24357. value: function destroy() {
  24358. GetFeaturesByGeometryService_get(GetFeaturesByGeometryService_getPrototypeOf(GetFeaturesByGeometryService.prototype), "destroy", this).call(this);
  24359. }
  24360. /**
  24361. * @function SuperMap.GetFeaturesByGeometryService.prototype.getJsonParameters
  24362. * @param {SuperMap.GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  24363. * @description 将查询参数转化为 JSON 字符串。
  24364. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  24365. * @returns {Object} 转化后的 JSON 字符串。
  24366. */
  24367. }, {
  24368. key: "getJsonParameters",
  24369. value: function getJsonParameters(params) {
  24370. return GetFeaturesByGeometryParameters_GetFeaturesByGeometryParameters.toJsonParameters(params);
  24371. }
  24372. }]);
  24373. return GetFeaturesByGeometryService;
  24374. }(GetFeaturesServiceBase_GetFeaturesServiceBase);
  24375. SuperMap.GetFeaturesByGeometryService = GetFeaturesByGeometryService_GetFeaturesByGeometryService;
  24376. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsParameters.js
  24377. 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); }
  24378. function GetFeaturesByIDsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24379. 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); } }
  24380. function GetFeaturesByIDsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  24381. 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); }
  24382. function GetFeaturesByIDsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  24383. 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); }
  24384. function GetFeaturesByIDsParameters_setPrototypeOf(o, p) { GetFeaturesByIDsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsParameters_setPrototypeOf(o, p); }
  24385. 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); }; }
  24386. function GetFeaturesByIDsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByIDsParameters_assertThisInitialized(self); }
  24387. function GetFeaturesByIDsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24388. 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; } }
  24389. function GetFeaturesByIDsParameters_getPrototypeOf(o) { GetFeaturesByIDsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsParameters_getPrototypeOf(o); }
  24390. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  24391. * This program are made available under the terms of the Apache License, Version 2.0
  24392. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24393. /**
  24394. * @class SuperMap.GetFeaturesByIDsParameters
  24395. * @category iServer Data FeatureResults
  24396. * @classdesc ID查询参数类。
  24397. * @param {Object} options - 参数。
  24398. * @param {Array.<number>} options.IDs - 所要查询指定的元素 ID 信息。
  24399. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  24400. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  24401. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  24402. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  24403. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  24404. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  24405. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  24406. * @extends {SuperMap.GetFeaturesParametersBase}
  24407. */
  24408. var GetFeaturesByIDsParameters_GetFeaturesByIDsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  24409. GetFeaturesByIDsParameters_inherits(GetFeaturesByIDsParameters, _GetFeaturesParameter);
  24410. var _super = GetFeaturesByIDsParameters_createSuper(GetFeaturesByIDsParameters);
  24411. function GetFeaturesByIDsParameters(options) {
  24412. var _this;
  24413. GetFeaturesByIDsParameters_classCallCheck(this, GetFeaturesByIDsParameters);
  24414. _this = _super.call(this, options);
  24415. /**
  24416. * @member {string} SuperMap.GetFeaturesByIDsParameters.prototype.getFeatureMode
  24417. * @description 数据集查询模式。
  24418. */
  24419. _this.getFeatureMode = "ID";
  24420. /**
  24421. * @member {Array.<number>} SuperMap.GetFeaturesByIDsParameters.prototype.IDs
  24422. * @description 所要查询指定的元素 ID 信息。
  24423. */
  24424. _this.IDs = null;
  24425. /**
  24426. * @member {Array.<string>} SuperMap.GetFeaturesByIDsParameters.prototype.fields
  24427. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  24428. */
  24429. _this.fields = null;
  24430. Util_Util.extend(GetFeaturesByIDsParameters_assertThisInitialized(_this), options);
  24431. _this.CLASS_NAME = "SuperMap.GetFeaturesByIDsParameters";
  24432. return _this;
  24433. }
  24434. /**
  24435. * @function SuperMap.GetFeaturesByIDsParameters.prototype.destroy
  24436. * @override
  24437. */
  24438. GetFeaturesByIDsParameters_createClass(GetFeaturesByIDsParameters, [{
  24439. key: "destroy",
  24440. value: function destroy() {
  24441. GetFeaturesByIDsParameters_get(GetFeaturesByIDsParameters_getPrototypeOf(GetFeaturesByIDsParameters.prototype), "destroy", this).call(this);
  24442. var me = this;
  24443. me.IDs = null;
  24444. me.getFeatureMode = null;
  24445. if (me.fields) {
  24446. while (me.fields.length > 0) {
  24447. me.fields.pop();
  24448. }
  24449. me.fields = null;
  24450. }
  24451. }
  24452. /**
  24453. * @function SuperMap.GetFeaturesByIDsParameters.toJsonParameters
  24454. * @description 将 SuperMap.GetFeaturesByIDsParameters 对象转换为 JSON 字符串。
  24455. * @param {SuperMap.GetFeaturesByIDsParameters} params - ID 查询参数对象。
  24456. * @returns {string} 转化后的 JSON 字符串。
  24457. */
  24458. }], [{
  24459. key: "toJsonParameters",
  24460. value: function toJsonParameters(params) {
  24461. var parasByIDs, filterParameter;
  24462. parasByIDs = {
  24463. datasetNames: params.datasetNames,
  24464. getFeatureMode: "ID",
  24465. ids: params.IDs
  24466. };
  24467. if (params.fields) {
  24468. filterParameter = new FilterParameter_FilterParameter();
  24469. filterParameter.name = params.datasetNames;
  24470. filterParameter.fields = params.fields;
  24471. parasByIDs.queryParameter = filterParameter;
  24472. }
  24473. if (params.targetEpsgCode) {
  24474. parasByIDs.targetEpsgCode = params.targetEpsgCode;
  24475. }
  24476. if (!params.targetEpsgCode && params.targetPrj) {
  24477. parasByIDs.targetPrj = params.targetPrj;
  24478. }
  24479. return Util_Util.toJSON(parasByIDs);
  24480. }
  24481. }]);
  24482. return GetFeaturesByIDsParameters;
  24483. }(GetFeaturesParametersBase_GetFeaturesParametersBase);
  24484. SuperMap.GetFeaturesByIDsParameters = GetFeaturesByIDsParameters_GetFeaturesByIDsParameters;
  24485. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsService.js
  24486. 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); }
  24487. function GetFeaturesByIDsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24488. 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); } }
  24489. function GetFeaturesByIDsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsService_defineProperties(Constructor, staticProps); return Constructor; }
  24490. 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); }
  24491. function GetFeaturesByIDsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsService_getPrototypeOf(object); if (object === null) break; } return object; }
  24492. 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); }
  24493. function GetFeaturesByIDsService_setPrototypeOf(o, p) { GetFeaturesByIDsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsService_setPrototypeOf(o, p); }
  24494. 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); }; }
  24495. function GetFeaturesByIDsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByIDsService_assertThisInitialized(self); }
  24496. function GetFeaturesByIDsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24497. 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; } }
  24498. function GetFeaturesByIDsService_getPrototypeOf(o) { GetFeaturesByIDsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsService_getPrototypeOf(o); }
  24499. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  24500. * This program are made available under the terms of the Apache License, Version 2.0
  24501. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24502. /**
  24503. * @class SuperMap.GetFeaturesByIDsService
  24504. * @category iServer Data FeatureResults
  24505. * @classdesc 数据集ID查询服务类。在数据集集合中查找指定 ID 号对应的空间地物要素。
  24506. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务。
  24507. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  24508. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  24509. * @param {Object} options - 参数。</br>
  24510. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  24511. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  24512. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  24513. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24514. * @param {Object} [options.headers] - 请求头。
  24515. * @extends {SuperMap.GetFeaturesServiceBase}
  24516. * @example
  24517. * var myGetFeaturesByIDsService = new SuperMap.GetFeaturesByIDsService(url, {
  24518. * eventListeners: {
  24519. * "processCompleted": getFeatureCompleted,
  24520. * "processFailed": getFeatureError
  24521. * }
  24522. * });
  24523. * function getFeatureCompleted(object){//todo};
  24524. * function getFeatureError(object){//todo}
  24525. */
  24526. var GetFeaturesByIDsService_GetFeaturesByIDsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  24527. GetFeaturesByIDsService_inherits(GetFeaturesByIDsService, _GetFeaturesServiceBa);
  24528. var _super = GetFeaturesByIDsService_createSuper(GetFeaturesByIDsService);
  24529. function GetFeaturesByIDsService(url, options) {
  24530. var _this;
  24531. GetFeaturesByIDsService_classCallCheck(this, GetFeaturesByIDsService);
  24532. _this = _super.call(this, url, options);
  24533. _this.CLASS_NAME = "SuperMap.GetFeaturesByIDsService";
  24534. return _this;
  24535. }
  24536. /**
  24537. * @function SuperMap.GetFeaturesByIDsService.prototype.destroy
  24538. * @override
  24539. */
  24540. GetFeaturesByIDsService_createClass(GetFeaturesByIDsService, [{
  24541. key: "destroy",
  24542. value: function destroy() {
  24543. GetFeaturesByIDsService_get(GetFeaturesByIDsService_getPrototypeOf(GetFeaturesByIDsService.prototype), "destroy", this).call(this);
  24544. }
  24545. /**
  24546. * @function SuperMap.GetFeaturesByIDsService.prototype.getJsonParameters
  24547. * @description 将查询参数转化为 JSON 字符串。
  24548. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  24549. * @param {SuperMap.GetFeaturesByIDsParameters} params - ID查询参数类。
  24550. * @returns {string} 转化后的 JSON 字符串。
  24551. */
  24552. }, {
  24553. key: "getJsonParameters",
  24554. value: function getJsonParameters(params) {
  24555. return GetFeaturesByIDsParameters_GetFeaturesByIDsParameters.toJsonParameters(params);
  24556. }
  24557. }]);
  24558. return GetFeaturesByIDsService;
  24559. }(GetFeaturesServiceBase_GetFeaturesServiceBase);
  24560. SuperMap.GetFeaturesByIDsService = GetFeaturesByIDsService_GetFeaturesByIDsService;
  24561. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLParameters.js
  24562. 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); }
  24563. function GetFeaturesBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24564. 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); } }
  24565. function GetFeaturesBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLParameters_defineProperties(Constructor, staticProps); return Constructor; }
  24566. 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); }
  24567. function GetFeaturesBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  24568. 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); }
  24569. function GetFeaturesBySQLParameters_setPrototypeOf(o, p) { GetFeaturesBySQLParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLParameters_setPrototypeOf(o, p); }
  24570. 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); }; }
  24571. function GetFeaturesBySQLParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesBySQLParameters_assertThisInitialized(self); }
  24572. function GetFeaturesBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24573. 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; } }
  24574. function GetFeaturesBySQLParameters_getPrototypeOf(o) { GetFeaturesBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLParameters_getPrototypeOf(o); }
  24575. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  24576. * This program are made available under the terms of the Apache License, Version 2.0
  24577. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24578. /**
  24579. * @class SuperMap.GetFeaturesBySQLParameters
  24580. * @category iServer Data FeatureResults
  24581. * @classdesc 数据服务中数据集 SQL 查询参数类。
  24582. * @param {Object} options - 参数。
  24583. * @param {SuperMap.FilterParameter} options.queryParameter - 查询过滤条件参数。
  24584. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  24585. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  24586. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  24587. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  24588. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  24589. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  24590. * @extends {SuperMap.GetFeaturesParametersBase}
  24591. */
  24592. var GetFeaturesBySQLParameters_GetFeaturesBySQLParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  24593. GetFeaturesBySQLParameters_inherits(GetFeaturesBySQLParameters, _GetFeaturesParameter);
  24594. var _super = GetFeaturesBySQLParameters_createSuper(GetFeaturesBySQLParameters);
  24595. function GetFeaturesBySQLParameters(options) {
  24596. var _this;
  24597. GetFeaturesBySQLParameters_classCallCheck(this, GetFeaturesBySQLParameters);
  24598. _this = _super.call(this, options);
  24599. /**
  24600. * @member {string} SuperMap.GetFeaturesBySQLParameters.prototype.getFeatureMode
  24601. * @description 数据集查询模式。
  24602. */
  24603. _this.getFeatureMode = "SQL";
  24604. /**
  24605. * @member {SuperMap.FilterParameter} SuperMap.GetFeaturesBySQLParameters.prototype.queryParameter
  24606. * @description 查询过滤条件参数类。
  24607. */
  24608. _this.queryParameter = null;
  24609. Util_Util.extend(GetFeaturesBySQLParameters_assertThisInitialized(_this), options);
  24610. _this.CLASS_NAME = "SuperMap.GetFeaturesBySQLParameters";
  24611. return _this;
  24612. }
  24613. /**
  24614. * @function SuperMap.GetFeaturesBySQLParameters.prototype.destroy
  24615. * @override
  24616. */
  24617. GetFeaturesBySQLParameters_createClass(GetFeaturesBySQLParameters, [{
  24618. key: "destroy",
  24619. value: function destroy() {
  24620. GetFeaturesBySQLParameters_get(GetFeaturesBySQLParameters_getPrototypeOf(GetFeaturesBySQLParameters.prototype), "destroy", this).call(this);
  24621. var me = this;
  24622. me.getFeatureMode = null;
  24623. if (me.queryParameter) {
  24624. me.queryParameter.destroy();
  24625. me.queryParameter = null;
  24626. }
  24627. }
  24628. /**
  24629. * @function SuperMap.GetFeaturesBySQLParameters.prototype.toJsonParameters
  24630. * @description 将 SuperMap.GetFeaturesBySQLParameters 对象转换为 JSON 字符串。
  24631. * @param {SuperMap.GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数对象。
  24632. * @returns {string} 转化后的 JSON 字符串。
  24633. */
  24634. }], [{
  24635. key: "toJsonParameters",
  24636. value: function toJsonParameters(params) {
  24637. var paramsBySql = {
  24638. datasetNames: params.datasetNames,
  24639. getFeatureMode: "SQL",
  24640. queryParameter: params.queryParameter
  24641. };
  24642. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  24643. paramsBySql.maxFeatures = params.maxFeatures;
  24644. }
  24645. if (params.aggregations) {
  24646. paramsBySql.aggregations = params.aggregations;
  24647. }
  24648. if (params.targetEpsgCode) {
  24649. paramsBySql.targetEpsgCode = params.targetEpsgCode;
  24650. }
  24651. if (!params.targetEpsgCode && params.targetPrj) {
  24652. paramsBySql.targetPrj = params.targetPrj;
  24653. }
  24654. return Util_Util.toJSON(paramsBySql);
  24655. }
  24656. }]);
  24657. return GetFeaturesBySQLParameters;
  24658. }(GetFeaturesParametersBase_GetFeaturesParametersBase);
  24659. SuperMap.GetFeaturesBySQLParameters = GetFeaturesBySQLParameters_GetFeaturesBySQLParameters;
  24660. // CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLService.js
  24661. 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); }
  24662. function GetFeaturesBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24663. 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); } }
  24664. function GetFeaturesBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLService_defineProperties(Constructor, staticProps); return Constructor; }
  24665. 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); }
  24666. function GetFeaturesBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  24667. 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); }
  24668. function GetFeaturesBySQLService_setPrototypeOf(o, p) { GetFeaturesBySQLService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLService_setPrototypeOf(o, p); }
  24669. 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); }; }
  24670. function GetFeaturesBySQLService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesBySQLService_assertThisInitialized(self); }
  24671. function GetFeaturesBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24672. 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; } }
  24673. function GetFeaturesBySQLService_getPrototypeOf(o) { GetFeaturesBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLService_getPrototypeOf(o); }
  24674. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  24675. * This program are made available under the terms of the Apache License, Version 2.0
  24676. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24677. /**
  24678. * @class SuperMap.GetFeaturesBySQLService
  24679. * @constructs SuperMap.GetFeaturesBySQLService
  24680. * @category iServer Data FeatureResults
  24681. * @classdesc 数据服务中数据集 SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  24682. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
  24683. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  24684. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  24685. * @param {Object} options - 参数。</br>
  24686. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  24687. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  24688. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  24689. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24690. * @param {Object} [options.headers] - 请求头。
  24691. * @extends {SuperMap.GetFeaturesServiceBase}
  24692. * @example
  24693. * var myGetFeaturesBySQLService = new SuperMap.GetFeaturesBySQLService(url, {
  24694. * eventListeners: {
  24695. * "processCompleted": GetFeaturesCompleted,
  24696. * "processFailed": GetFeaturesError
  24697. * }
  24698. * });
  24699. * function getFeaturesCompleted(object){//todo};
  24700. * function getFeaturesError(object){//todo};
  24701. *
  24702. */
  24703. var GetFeaturesBySQLService_GetFeaturesBySQLService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  24704. GetFeaturesBySQLService_inherits(GetFeaturesBySQLService, _GetFeaturesServiceBa);
  24705. var _super = GetFeaturesBySQLService_createSuper(GetFeaturesBySQLService);
  24706. function GetFeaturesBySQLService(url, options) {
  24707. var _this;
  24708. GetFeaturesBySQLService_classCallCheck(this, GetFeaturesBySQLService);
  24709. _this = _super.call(this, url, options);
  24710. _this.CLASS_NAME = "SuperMap.GetFeaturesBySQLService";
  24711. return _this;
  24712. }
  24713. /**
  24714. * @function SuperMap.GetFeaturesBySQLService.prototype.destroy
  24715. * @override
  24716. */
  24717. GetFeaturesBySQLService_createClass(GetFeaturesBySQLService, [{
  24718. key: "destroy",
  24719. value: function destroy() {
  24720. GetFeaturesBySQLService_get(GetFeaturesBySQLService_getPrototypeOf(GetFeaturesBySQLService.prototype), "destroy", this).call(this);
  24721. }
  24722. /*
  24723. * @function SuperMap.GetFeaturesBySQLService.prototype.getJsonParameters
  24724. * @description 将查询参数转化为 JSON 字符串。
  24725. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  24726. * @param {SuperMap.GetFeaturesBySQLParameters} params - 数据集SQL查询参数类。
  24727. * @returns {string} 转化后的 JSON 字符串。
  24728. */
  24729. }, {
  24730. key: "getJsonParameters",
  24731. value: function getJsonParameters(params) {
  24732. return GetFeaturesBySQLParameters_GetFeaturesBySQLParameters.toJsonParameters(params);
  24733. }
  24734. }]);
  24735. return GetFeaturesBySQLService;
  24736. }(GetFeaturesServiceBase_GetFeaturesServiceBase);
  24737. SuperMap.GetFeaturesBySQLService = GetFeaturesBySQLService_GetFeaturesBySQLService;
  24738. // CONCATENATED MODULE: ./src/common/iServer/GetFieldsService.js
  24739. 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); }
  24740. function GetFieldsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24741. 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); } }
  24742. function GetFieldsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFieldsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFieldsService_defineProperties(Constructor, staticProps); return Constructor; }
  24743. 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); }
  24744. function GetFieldsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFieldsService_getPrototypeOf(object); if (object === null) break; } return object; }
  24745. 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); }
  24746. function GetFieldsService_setPrototypeOf(o, p) { GetFieldsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFieldsService_setPrototypeOf(o, p); }
  24747. 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); }; }
  24748. function GetFieldsService_possibleConstructorReturn(self, call) { if (call && (GetFieldsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFieldsService_assertThisInitialized(self); }
  24749. function GetFieldsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24750. 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; } }
  24751. function GetFieldsService_getPrototypeOf(o) { GetFieldsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFieldsService_getPrototypeOf(o); }
  24752. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  24753. * This program are made available under the terms of the Apache License, Version 2.0
  24754. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24755. /**
  24756. * @class SuperMap.GetFieldsService
  24757. * @category iServer Data Field
  24758. * @classdesc 字段查询服务,支持查询指定数据集的中所有属性字段(field)的集合。
  24759. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  24760. * @param {Object} options - 参数。</br>
  24761. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  24762. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  24763. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  24764. * @param {string}options.datasource - 要查询的数据集所在的数据源名称。</br>
  24765. * @param {string}options.dataset - 要查询的数据集名称。</br>
  24766. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24767. * @param {Object} [options.headers] - 请求头。
  24768. * @extends {SuperMap.CommonServiceBase}
  24769. * @example
  24770. * var myService = new SuperMap.GetFieldsService(url, {eventListeners: {
  24771. * "processCompleted": getFieldsCompleted,
  24772. * "processFailed": getFieldsError
  24773. * },
  24774. * datasource: "World",
  24775. * dataset: "Countries"
  24776. * };
  24777. *
  24778. */
  24779. var GetFieldsService_GetFieldsService = /*#__PURE__*/function (_CommonServiceBase) {
  24780. GetFieldsService_inherits(GetFieldsService, _CommonServiceBase);
  24781. var _super = GetFieldsService_createSuper(GetFieldsService);
  24782. function GetFieldsService(url, options) {
  24783. var _this;
  24784. GetFieldsService_classCallCheck(this, GetFieldsService);
  24785. _this = _super.call(this, url, options);
  24786. /**
  24787. * @member {string} SuperMap.GetFieldsService.prototype.datasource
  24788. * @description 要查询的数据集所在的数据源名称。
  24789. */
  24790. _this.datasource = null;
  24791. /**
  24792. * @member {string} SuperMap.GetFieldsService.prototype.dataset
  24793. * @description 要查询的数据集名称。
  24794. */
  24795. _this.dataset = null;
  24796. if (options) {
  24797. Util_Util.extend(GetFieldsService_assertThisInitialized(_this), options);
  24798. }
  24799. _this.CLASS_NAME = "SuperMap.GetFieldsService";
  24800. return _this;
  24801. }
  24802. /**
  24803. * @function SuperMap.GetFieldsService.prototype.destroy
  24804. * @override
  24805. */
  24806. GetFieldsService_createClass(GetFieldsService, [{
  24807. key: "destroy",
  24808. value: function destroy() {
  24809. GetFieldsService_get(GetFieldsService_getPrototypeOf(GetFieldsService.prototype), "destroy", this).call(this);
  24810. var me = this;
  24811. me.datasource = null;
  24812. me.dataset = null;
  24813. }
  24814. /**
  24815. * @function SuperMap.GetFieldsService.prototype.processAsync
  24816. * @description 执行服务,查询指定数据集的字段信息。
  24817. */
  24818. }, {
  24819. key: "processAsync",
  24820. value: function processAsync() {
  24821. var me = this;
  24822. me.url = Util_Util.urlPathAppend(me.url, "datasources/".concat(me.datasource, "/datasets/").concat(me.dataset, "/fields"));
  24823. me.request({
  24824. method: "GET",
  24825. data: null,
  24826. scope: me,
  24827. success: me.serviceProcessCompleted,
  24828. failure: me.serviceProcessFailed
  24829. });
  24830. }
  24831. }]);
  24832. return GetFieldsService;
  24833. }(CommonServiceBase_CommonServiceBase);
  24834. SuperMap.GetFieldsService = GetFieldsService_GetFieldsService;
  24835. // CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosParameters.js
  24836. function GetGridCellInfosParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24837. 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); } }
  24838. function GetGridCellInfosParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosParameters_defineProperties(Constructor, staticProps); return Constructor; }
  24839. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  24840. * This program are made available under the terms of the Apache License, Version 2.0
  24841. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24842. /**
  24843. * @class SuperMap.GetGridCellInfosParameters
  24844. * @category iServer Data Grid
  24845. * @classdesc 数据服务栅格查询参数类。
  24846. * @param {Object} options - 参数。
  24847. * @param {string} options.datasetName - 数据集名称。
  24848. * @param {string} options.dataSourceName - 数据源名称。
  24849. * @param {number} options.X - 要查询的地理位置 X 轴。
  24850. * @param {number} options.Y - 要查询的地理位置 Y 轴。
  24851. */
  24852. var GetGridCellInfosParameters_GetGridCellInfosParameters = /*#__PURE__*/function () {
  24853. function GetGridCellInfosParameters(options) {
  24854. GetGridCellInfosParameters_classCallCheck(this, GetGridCellInfosParameters);
  24855. /**
  24856. * @member {string} SuperMap.GetGridCellInfosParameters.prototype.datasetName
  24857. * @description 数据集名称。
  24858. */
  24859. this.datasetName = null;
  24860. /**
  24861. * @member {string} SuperMap.GetGridCellInfosParameters.prototype.dataSourceName
  24862. * @description 数据源名称。
  24863. */
  24864. this.dataSourceName = null;
  24865. /**
  24866. * @member {number} SuperMap.GetGridCellInfosParameters.prototype.X
  24867. * @description 要查询的地理位置 X 轴。
  24868. */
  24869. this.X = null;
  24870. /**
  24871. * @member {number} SuperMap.GetGridCellInfosParameters.prototype.Y
  24872. * @description 要查询的地理位置 Y 轴。
  24873. */
  24874. this.Y = null;
  24875. Util_Util.extend(this, options);
  24876. this.CLASS_NAME = "SuperMap.GetGridCellInfosParameters";
  24877. }
  24878. /**
  24879. * @function SuperMap.GetGridCellInfosParameters.prototype.destroy
  24880. * @description 释放资源,将引用的资源属性置空。
  24881. */
  24882. GetGridCellInfosParameters_createClass(GetGridCellInfosParameters, [{
  24883. key: "destroy",
  24884. value: function destroy() {
  24885. var me = this;
  24886. me.datasetName = null;
  24887. me.dataSourceName = null;
  24888. me.X = null;
  24889. me.Y = null;
  24890. }
  24891. }]);
  24892. return GetGridCellInfosParameters;
  24893. }();
  24894. SuperMap.GetGridCellInfosParameters = GetGridCellInfosParameters_GetGridCellInfosParameters;
  24895. // CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosService.js
  24896. 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); }
  24897. function GetGridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24898. 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); } }
  24899. function GetGridCellInfosService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosService_defineProperties(Constructor, staticProps); return Constructor; }
  24900. 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); }
  24901. function GetGridCellInfosService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetGridCellInfosService_getPrototypeOf(object); if (object === null) break; } return object; }
  24902. 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); }
  24903. function GetGridCellInfosService_setPrototypeOf(o, p) { GetGridCellInfosService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetGridCellInfosService_setPrototypeOf(o, p); }
  24904. 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); }; }
  24905. function GetGridCellInfosService_possibleConstructorReturn(self, call) { if (call && (GetGridCellInfosService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetGridCellInfosService_assertThisInitialized(self); }
  24906. function GetGridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24907. 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; } }
  24908. function GetGridCellInfosService_getPrototypeOf(o) { GetGridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetGridCellInfosService_getPrototypeOf(o); }
  24909. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  24910. * This program are made available under the terms of the Apache License, Version 2.0
  24911. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24912. /**
  24913. * @class SuperMap.GetGridCellInfosService
  24914. * @category iServer Data Grid
  24915. * @classdesc 数据栅格查询服务,支持查询指定地理位置的栅格信息。
  24916. * @param {string} url - 查询服务地址。例如: http://localhost:8090/iserver/services/data-jingjin/rest/data
  24917. * @param {Object} options - 参数。</br>
  24918. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  24919. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  24920. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  24921. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24922. * @param {Object} [options.headers] - 请求头。
  24923. * @extends {SuperMap.CommonServiceBase}
  24924. * @example
  24925. * var myService = new SuperMap.GetGridCellInfosService(url, {eventListeners: {
  24926. * "processCompleted": queryCompleted,
  24927. * "processFailed": queryError
  24928. * }
  24929. * });
  24930. *
  24931. */
  24932. var GetGridCellInfosService_GetGridCellInfosService = /*#__PURE__*/function (_CommonServiceBase) {
  24933. GetGridCellInfosService_inherits(GetGridCellInfosService, _CommonServiceBase);
  24934. var _super = GetGridCellInfosService_createSuper(GetGridCellInfosService);
  24935. function GetGridCellInfosService(url, options) {
  24936. var _this;
  24937. GetGridCellInfosService_classCallCheck(this, GetGridCellInfosService);
  24938. _this = _super.call(this, url, options);
  24939. /**
  24940. * @member {string} SuperMap.GetGridCellInfosService.prototype.datasetName
  24941. * @description 数据集名称。
  24942. */
  24943. _this.datasetName = null;
  24944. /**
  24945. * @member {string} SuperMap.GetGridCellInfosService.prototype.dataSourceName
  24946. * @description 数据源名称。
  24947. */
  24948. _this.dataSourceName = null;
  24949. /**
  24950. * @member {string} SuperMap.GetGridCellInfosService.prototype.datasetType
  24951. * @description 数据集类型。
  24952. */
  24953. _this.datasetType = null;
  24954. /**
  24955. * @member {number} SuperMap.GetGridCellInfosService.prototype.X
  24956. * @description 要查询的地理位置X轴
  24957. */
  24958. _this.X = null;
  24959. /**
  24960. * @member {number} SuperMap.GetGridCellInfosService.prototype.Y
  24961. * @description 要查询的地理位置Y轴
  24962. */
  24963. _this.Y = null;
  24964. if (options) {
  24965. Util_Util.extend(GetGridCellInfosService_assertThisInitialized(_this), options);
  24966. }
  24967. _this.CLASS_NAME = "SuperMap.GetGridCellInfosService";
  24968. return _this;
  24969. }
  24970. /**
  24971. * @function SuperMap.GetGridCellInfosService.prototype.destroy
  24972. * @override
  24973. */
  24974. GetGridCellInfosService_createClass(GetGridCellInfosService, [{
  24975. key: "destroy",
  24976. value: function destroy() {
  24977. GetGridCellInfosService_get(GetGridCellInfosService_getPrototypeOf(GetGridCellInfosService.prototype), "destroy", this).call(this);
  24978. var me = this;
  24979. me.X = null;
  24980. me.Y = null;
  24981. me.datasetName = null;
  24982. me.dataSourceName = null;
  24983. me.datasetType = null;
  24984. }
  24985. /**
  24986. * @function SuperMap.GetGridCellInfosService.prototype.processAsync
  24987. * @description 执行服务,查询数据集信息。
  24988. * @param {SuperMap.GetGridCellInfosParameters} params - 查询参数。
  24989. */
  24990. }, {
  24991. key: "processAsync",
  24992. value: function processAsync(params) {
  24993. if (!(params instanceof GetGridCellInfosParameters_GetGridCellInfosParameters)) {
  24994. return;
  24995. }
  24996. Util_Util.extend(this, params);
  24997. var me = this;
  24998. me.url = Util_Util.urlPathAppend(me.url, "datasources/".concat(me.dataSourceName, "/datasets/").concat(me.datasetName));
  24999. me.queryRequest(me.getDatasetInfoCompleted, me.getDatasetInfoFailed);
  25000. }
  25001. /**
  25002. * @function SuperMap.GetGridCellInfosService.prototype.queryRequest
  25003. * @description 执行服务,查询。
  25004. * @callback {function} successFun - 成功后执行的函数。
  25005. * @callback {function} failedFunc - 失败后执行的函数。
  25006. */
  25007. }, {
  25008. key: "queryRequest",
  25009. value: function queryRequest(successFun, failedFunc) {
  25010. var me = this;
  25011. me.request({
  25012. method: "GET",
  25013. data: null,
  25014. scope: me,
  25015. success: successFun,
  25016. failure: failedFunc
  25017. });
  25018. }
  25019. /**
  25020. * @function SuperMap.GetGridCellInfosService.prototype.getDatasetInfoCompleted
  25021. * @description 数据集查询完成,执行此方法。
  25022. * @param {Object} result - 服务器返回的结果对象。
  25023. */
  25024. }, {
  25025. key: "getDatasetInfoCompleted",
  25026. value: function getDatasetInfoCompleted(result) {
  25027. var me = this;
  25028. result = Util_Util.transformResult(result);
  25029. me.datasetType = result.datasetInfo.type;
  25030. me.queryGridInfos();
  25031. }
  25032. /**
  25033. * @function SuperMap.GetGridCellInfosService.prototype.queryGridInfos
  25034. * @description 执行服务,查询数据集栅格信息信息。
  25035. */
  25036. }, {
  25037. key: "queryGridInfos",
  25038. value: function queryGridInfos() {
  25039. var me = this;
  25040. me.url = Util_Util.urlPathAppend(me.url, me.datasetType == 'GRID' ? 'gridValue' : 'imageValue');
  25041. if (me.X != null && me.Y != null) {
  25042. me.url = Util_Util.urlAppend(me.url, "x=".concat(me.X, "&y=").concat(me.Y));
  25043. }
  25044. me.queryRequest(me.serviceProcessCompleted, me.serviceProcessFailed);
  25045. }
  25046. /**
  25047. * @function SuperMap.GetGridCellInfosService.prototype.getDatasetInfoFailed
  25048. * @description 数据集查询失败,执行此方法。
  25049. * @param {Object} result - 服务器返回的结果对象。
  25050. */
  25051. }, {
  25052. key: "getDatasetInfoFailed",
  25053. value: function getDatasetInfoFailed(result) {
  25054. var me = this;
  25055. me.serviceProcessFailed(result);
  25056. }
  25057. }]);
  25058. return GetGridCellInfosService;
  25059. }(CommonServiceBase_CommonServiceBase);
  25060. SuperMap.GetGridCellInfosService = GetGridCellInfosService_GetGridCellInfosService;
  25061. // CONCATENATED MODULE: ./src/common/iServer/ThemeMemoryData.js
  25062. function ThemeMemoryData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25063. 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); } }
  25064. function ThemeMemoryData_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeMemoryData_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeMemoryData_defineProperties(Constructor, staticProps); return Constructor; }
  25065. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  25066. * This program are made available under the terms of the Apache License, Version 2.0
  25067. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25068. /**
  25069. * @class SuperMap.ThemeMemoryData
  25070. * @category iServer Map Theme
  25071. * @classdesc 专题图内存数据类。
  25072. * @param {Array} srcData - 原始值数组。
  25073. * @param {Array} targetData - 外部值数组。
  25074. */
  25075. var ThemeMemoryData = /*#__PURE__*/function () {
  25076. function ThemeMemoryData(srcData, targetData) {
  25077. ThemeMemoryData_classCallCheck(this, ThemeMemoryData);
  25078. /**
  25079. * @member {Array} SuperMap.ThemeMemoryData.prototype.srcData
  25080. * @description 原始值数组,该属性值将被 targetData 属性所指定的值替换掉,然后制作专题图,但数据库中的值并不会改变。
  25081. */
  25082. this.srcData = srcData;
  25083. /**
  25084. * @member {Array} SuperMap.ThemeMemoryData.prototype.targetData
  25085. * @description 外部值数组,即用于制作专题图的内存数据,设定该属性值后,会将 srcData 属性所指定的原始值替换掉制作专题图,但数据库中的值并不会改变。
  25086. */
  25087. this.targetData = targetData;
  25088. this.CLASS_NAME = "SuperMap.ThemeMemoryData";
  25089. }
  25090. /**
  25091. * @function SuperMap.ThemeMemoryData.prototype.destroy
  25092. * @description 释放资源,将引用资源的属性置空。
  25093. */
  25094. ThemeMemoryData_createClass(ThemeMemoryData, [{
  25095. key: "destroy",
  25096. value: function destroy() {
  25097. var me = this;
  25098. me.srcData = null;
  25099. me.targetData = null;
  25100. }
  25101. /**
  25102. * @function SuperMap.ThemeMemoryData.prototype.toJSON
  25103. * @description 将 SuperMap.ThemeMemoryData 对象转化为 JSON 字符串。
  25104. * @returns {string} 返回转换后的 JSON 字符串。
  25105. */
  25106. }, {
  25107. key: "toJSON",
  25108. value: function toJSON() {
  25109. if (this.srcData && this.targetData) {
  25110. var memoryDataStr = "";
  25111. var count = Math.min(this.srcData.length, this.targetData.length);
  25112. for (var i = 0; i < count; i++) {
  25113. memoryDataStr += "\'" + this.srcData[i] + "\':\'" + this.targetData[i] + "\',";
  25114. } //去除多余的逗号
  25115. if (i > 0) {
  25116. memoryDataStr = memoryDataStr.substring(0, memoryDataStr.length - 1);
  25117. }
  25118. return "{" + memoryDataStr + "}";
  25119. } else {
  25120. return null;
  25121. }
  25122. }
  25123. }]);
  25124. return ThemeMemoryData;
  25125. }();
  25126. SuperMap.ThemeMemoryData = ThemeMemoryData;
  25127. // CONCATENATED MODULE: ./src/common/iServer/Theme.js
  25128. function Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25129. 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); } }
  25130. function Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) Theme_defineProperties(Constructor, staticProps); return Constructor; }
  25131. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  25132. * This program are made available under the terms of the Apache License, Version 2.0
  25133. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25134. /**
  25135. * @class SuperMap.Theme
  25136. * @category iServer Map Theme
  25137. * @classdesc 专题图基类。
  25138. * @param {string} type - 专题图类型。
  25139. * @param {Object} options - 参数。
  25140. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  25141. */
  25142. var Theme_Theme = /*#__PURE__*/function () {
  25143. function Theme(type, options) {
  25144. Theme_classCallCheck(this, Theme);
  25145. if (!type) {
  25146. return this;
  25147. }
  25148. /**
  25149. * @member {SuperMap.ThemeMemoryData} SuperMap.Theme.prototype.memoryData
  25150. * @description 专题图内存数据。<br>
  25151. * 用内存数据制作专题图的方式与表达式制作专题图的方式互斥,前者优先级较高。
  25152. * 第一个参数代表专题值,即数据集中用来做专题图的字段或表达式的值;第二个参数代表外部值。在制作专题图时,会用外部值代替专题值来制作相应的专题图。
  25153. */
  25154. this.memoryData = null;
  25155. /**
  25156. * @member {string} SuperMap.Theme.prototype.type
  25157. * @description 专题图类型。
  25158. */
  25159. this.type = type;
  25160. if (options) {
  25161. Util_Util.extend(this, options);
  25162. }
  25163. this.CLASS_NAME = "SuperMap.Theme";
  25164. }
  25165. /**
  25166. * @function SuperMap.Theme.prototype.destroy
  25167. * @description 释放资源,将引用资源的属性置空。
  25168. */
  25169. Theme_createClass(Theme, [{
  25170. key: "destroy",
  25171. value: function destroy() {
  25172. var me = this;
  25173. if (me.memoryData) {
  25174. me.memoryData.destroy();
  25175. me.memoryData = null;
  25176. }
  25177. me.type = null;
  25178. }
  25179. /**
  25180. * @function SuperMap.Theme.prototype.toServerJSONObject
  25181. * @description 转换成对应的 JSON 格式对象。
  25182. * @returns {Object} 对应的 JSON 格式对象。
  25183. */
  25184. }, {
  25185. key: "toServerJSONObject",
  25186. value: function toServerJSONObject() {
  25187. //return 子类实现
  25188. return;
  25189. }
  25190. }]);
  25191. return Theme;
  25192. }();
  25193. SuperMap.Theme = Theme_Theme;
  25194. // CONCATENATED MODULE: ./src/common/iServer/ServerTextStyle.js
  25195. function ServerTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25196. 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); } }
  25197. function ServerTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTextStyle_defineProperties(Constructor, staticProps); return Constructor; }
  25198. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  25199. * This program are made available under the terms of the Apache License, Version 2.0
  25200. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25201. /**
  25202. * @class SuperMap.ServerTextStyle
  25203. * @category iServer Map Theme
  25204. * @classdesc 服务端文本风格类。
  25205. * @description 该类用于定义文本风格的相关属性。
  25206. * @param {Object} options - 参数。
  25207. * @param {SuperMap.TextAlignment} [options.align=SuperMap.TextAlignment.BASELINECENTER] - 文本的对齐方式。
  25208. * @param {SuperMap.ServerColor} [options.backColor] - 文本的背景色。默认 backColor = new ServerColor(255, 255, 255)。
  25209. * @param {SuperMap.ServerColor} [options.foreColor] - 文本的前景色。默认 foreColor = new ServerColor(0, 0, 0)。
  25210. * @param {boolean} [options.backOpaque=false] - 文本背景是否不透明。
  25211. * @param {boolean} [options.sizeFixed=true] - 文本大小是否固定。
  25212. * @param {number} [options.fontHeight=6] - 文本字体的高度。
  25213. * @param {number} [options.fontWidth=0] - 文本字体的宽度。
  25214. * @param {number} [options.fontWeight=400] - 文本字体的磅数。
  25215. * @param {string} [options.fontName='Times New Roman'] - 文本字体的名称。
  25216. * @param {boolean} [options.bold=false] - 文本是否为粗体字。
  25217. * @param {boolean} [options.italic=false] - 文本是否采用斜体。
  25218. * @param {number} [options.italicAngle=0] - 字体倾斜角度。
  25219. * @param {boolean} [options.shadow=false] - 文本是否有阴影。
  25220. * @param {boolean} [options.strikeout=false] - 文本字体是否加删除线。
  25221. * @param {boolean} [options.outline=false] - 是否以轮廓的方式来显示文本的背景。
  25222. * @param {number} [options.opaqueRate=0] - 注记文字的不透明度。
  25223. * @param {boolean} [options.underline=false] - 文本字体是否加下划线。
  25224. * @param {number} [options.rotation=0.0] - 文本旋转的角度。
  25225. */
  25226. var ServerTextStyle_ServerTextStyle = /*#__PURE__*/function () {
  25227. function ServerTextStyle(options) {
  25228. ServerTextStyle_classCallCheck(this, ServerTextStyle);
  25229. /**
  25230. * @member {SuperMap.TextAlignment} [SuperMap.ServerTextStyle.prototype.align= SuperMap.TextAlignment.BASELINECENTER]
  25231. * @description 文本的对齐方式。
  25232. */
  25233. this.align = TextAlignment.BASELINECENTER;
  25234. /**
  25235. * @member {SuperMap.ServerColor} [SuperMap.ServerTextStyle.prototype.backColor=(255, 255, 255)]
  25236. * @description 文本的背景色。
  25237. */
  25238. this.backColor = new ServerColor(255, 255, 255);
  25239. /**
  25240. * @member {SuperMap.ServerColor} [SuperMap.ServerTextStyle.prototype.foreColor=(0, 0, 0)]
  25241. * @description 文本的前景色。
  25242. */
  25243. this.foreColor = new ServerColor(0, 0, 0);
  25244. /**
  25245. * @member {boolean} [SuperMap.ServerTextStyle.prototype.backOpaque=false]
  25246. * @description 文本背景是否不透明。true 表示文本背景不透明。
  25247. */
  25248. this.backOpaque = false;
  25249. /**
  25250. * @member {boolean} [SuperMap.ServerTextStyle.prototype.sizeFixed=true]
  25251. * @description 文本大小是否固定。设置为 true,表示图片为固定像素大小,具体大小请参考 fontHeight。当设为 false 时,图片会随着地图缩放而缩放。
  25252. */
  25253. this.sizeFixed = true;
  25254. /**
  25255. * @member {number} [SuperMap.ServerTextStyle.prototype.fontHeight=6]
  25256. * @description 文本字体的高度,单位与 sizeFixed 有关,当 sizeFixed 为 False 时,即非固定文本大小时使用地图坐标单位,
  25257. * 如地理坐标系下的地图中单位为度;当 sizeFixed 为 True 时,单位为毫米(mm)。
  25258. */
  25259. this.fontHeight = 6;
  25260. /**
  25261. * @member {number} [SuperMap.ServerTextStyle.prototype.fontWidth=0]
  25262. * @description 文本字体的宽度。字体的宽度以英文字符为标准,由于一个中文字符相当于两个英文字符。
  25263. */
  25264. this.fontWidth = 0;
  25265. /**
  25266. * @member {number} [SuperMap.ServerTextStyle.prototype.fontWeight=400]
  25267. * @description 文本字体的磅数。表示粗体的具体数值。取值范围为从0-900之间的整百数。
  25268. */
  25269. this.fontWeight = 400;
  25270. /**
  25271. * @member {string} [SuperMap.ServerTextStyle.prototype.fontName="Times New Roman"]
  25272. * @description 文本字体的名称。
  25273. */
  25274. this.fontName = "Times New Roman";
  25275. /**
  25276. * @member {boolean} [SuperMap.ServerTextStyle.prototype.bold=false]
  25277. * @description 文本是否为粗体字。true 表示为粗体。false 表示文本不是粗体字。
  25278. */
  25279. this.bold = false;
  25280. /**
  25281. * @member {boolean} [SuperMap.ServerTextStyle.prototype.italic=false]
  25282. * @description 文本是否采用斜体。true 表示采用斜体。
  25283. */
  25284. this.italic = false;
  25285. /**
  25286. * @member {number} [SuperMap.ServerTextStyle.prototype.italicAngle=0]
  25287. * @description 字体倾斜角度。正负度之间,以度为单位,精确到0.1度。当倾斜角度为0度,为系统默认的字体倾斜样式。
  25288. * 正负度是指以纵轴为起始零度线,其纵轴左侧为正,右侧为负。允许的最大角度为60,最小-60。大于60按照60处理,小于-60按照-60处理。目前只对标签专题图有效。
  25289. */
  25290. this.italicAngle = 0;
  25291. /**
  25292. * @member {boolean} [SuperMap.ServerTextStyle.prototype.shadow=false]
  25293. * @description 文本是否有阴影。true 表示给文本增加阴影。false 表示文本没有阴影。
  25294. */
  25295. this.shadow = false;
  25296. /**
  25297. * @member {boolean} [SuperMap.ServerTextStyle.prototype.strikeout=false]
  25298. * @description 文本字体是否加删除线。true 表示加删除线。false 表示文本字体不加删除线。
  25299. */
  25300. this.strikeout = false;
  25301. /**
  25302. * @member {boolean} [SuperMap.ServerTextStyle.prototype.outline=false]
  25303. * @description 是否以轮廓的方式来显示文本的背景。true 表示以轮廓的方式来显示文本的背景。false 表示不以轮廓的方式来显示文本的背景。
  25304. */
  25305. this.outline = false;
  25306. /**
  25307. * @member {number} [SuperMap.ServerTextStyle.prototype.opaqueRate=0]
  25308. * @description 注记文字的不透明度。不透明度的范围为0-100。0表示透明。
  25309. */
  25310. this.opaqueRate = 0;
  25311. /**
  25312. * @member {boolean} [SuperMap.ServerTextStyle.prototype.underline=false]
  25313. * @description 文本字体是否加下划线。true 表示加下划线。
  25314. */
  25315. this.underline = false;
  25316. /**
  25317. * @member {number} [SuperMap.ServerTextStyle.prototype.rotation=0.0]
  25318. * @description 文本旋转的角度。逆时针方向为正方向,单位为度,精确到0.1度。
  25319. */
  25320. this.rotation = 0.0;
  25321. if (options) {
  25322. Util_Util.extend(this, options);
  25323. }
  25324. this.CLASS_NAME = "SuperMap.ServerTextStyle";
  25325. }
  25326. /**
  25327. * @function SuperMap.ServerTextStyle.prototype.destroy
  25328. * @description 释放资源,将引用资源的属性置空。
  25329. */
  25330. ServerTextStyle_createClass(ServerTextStyle, [{
  25331. key: "destroy",
  25332. value: function destroy() {
  25333. var me = this;
  25334. me.align = null;
  25335. if (me.backColor) {
  25336. me.backColor.destroy();
  25337. me.backColor = null;
  25338. }
  25339. if (me.foreColor) {
  25340. me.foreColor.destroy();
  25341. me.foreColor = null;
  25342. }
  25343. me.backOpaque = null;
  25344. me.sizeFixed = null;
  25345. me.fontHeight = null;
  25346. me.fontWidth = null;
  25347. me.fontWeight = null;
  25348. me.fontName = null;
  25349. me.bold = null;
  25350. me.italic = null;
  25351. me.italicAngle = null;
  25352. me.shadow = null;
  25353. me.strikeout = null;
  25354. me.outline = null;
  25355. me.opaqueRate = null;
  25356. me.underline = null;
  25357. me.rotation = null;
  25358. }
  25359. /**
  25360. * @function SuperMap.ServerTextStyle.fromObj
  25361. * @description 从传入对象获服务端文本风格类。
  25362. * @param {Object} obj - 传入对象
  25363. * @returns {SuperMap.ServerTextStyle} 返回服务端文本风格对象
  25364. */
  25365. }], [{
  25366. key: "fromObj",
  25367. value: function fromObj(obj) {
  25368. var res = new ServerTextStyle(obj);
  25369. Util_Util.copy(res, obj);
  25370. res.backColor = ServerColor.fromJson(obj.backColor);
  25371. res.foreColor = ServerColor.fromJson(obj.foreColor);
  25372. return res;
  25373. }
  25374. }]);
  25375. return ServerTextStyle;
  25376. }();
  25377. SuperMap.ServerTextStyle = ServerTextStyle_ServerTextStyle;
  25378. // CONCATENATED MODULE: ./src/common/iServer/ThemeLabelItem.js
  25379. function ThemeLabelItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25380. 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); } }
  25381. function ThemeLabelItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelItem_defineProperties(Constructor, staticProps); return Constructor; }
  25382. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  25383. * This program are made available under the terms of the Apache License, Version 2.0
  25384. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25385. /**
  25386. * @class SuperMap.ThemeLabelItem
  25387. * @category iServer Map Theme
  25388. * @classdesc 分段标签专题图的子项。
  25389. * @description 标签专题图用专题值对点、线、面等对象做标注,值得注意的是,分段标签专题图允许用户通过 rangeExpression
  25390. * 字段指定用于分段的数值型字段,同一范围段内的标签具有相同的显示风格,其中每一个范围段就是一个专题图子项,
  25391. * 每一个子项都具有其名称、风格、起始值和终止值。注意:每个分段所表示的范围为 [Start, End)。例如:标签专题图的分段点有两个子项,
  25392. * 他们所代表的分段区间分别为[0,5),[5,10)。那么需要分别设置 SuperMap.ThemeLabelItem[0].start=0,
  25393. * SuperMap.ThemeLabelItem[0].end=5,SuperMap.ThemeLabelItem[1].start=5,SuperMap.ThemeLabelItem[1].end=10。
  25394. * @param {Object} options - 参数。
  25395. * @param {string} [options.caption] - 专题图子项的名称。
  25396. * @param {number} [options.end=0] - 标签专题图子项的终止值。
  25397. * @param {number} [options.start=0] - 标签专题图子项的分段起始值。
  25398. * @param {boolean} [options.visible=true] - 标签专题图子项是否可见。
  25399. * @param {SuperMap.ServerTextStyle} [options.style] - 标签专题图子项文本的显示风格。
  25400. */
  25401. var ThemeLabelItem_ThemeLabelItem = /*#__PURE__*/function () {
  25402. function ThemeLabelItem(options) {
  25403. ThemeLabelItem_classCallCheck(this, ThemeLabelItem);
  25404. /**
  25405. * @member {string} [SuperMap.ThemeLabelItem.prototype.caption]
  25406. * @description 标签专题子项的标题。
  25407. */
  25408. this.caption = null;
  25409. /**
  25410. * @member {number} [SuperMap.ThemeLabelItem.prototype.end=0]
  25411. * @description 标签专题图子项的终止值。如果该子项是分段中最后一个子项,那么该终止值就是分段的最大值;
  25412. * 如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常。
  25413. */
  25414. this.end = 0;
  25415. /**
  25416. * @member {number} [SuperMap.ThemeLabelItem.prototype.start=0]
  25417. * @description 标签专题图子项的分段起始值。如果该子项是分段中第一项,那么该起始值就是分段的最小值;
  25418. * 如果该子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  25419. */
  25420. this.start = 0;
  25421. /**
  25422. * @member {boolean} [SuperMap.ThemeLabelItem.prototype.visible=true]
  25423. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  25424. */
  25425. this.visible = true;
  25426. /**
  25427. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeLabelItem.prototype.style
  25428. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  25429. * uniformMixedStyle(标签文本的复合风格),SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  25430. */
  25431. this.style = new ServerTextStyle_ServerTextStyle();
  25432. if (options) {
  25433. Util_Util.extend(this, options);
  25434. }
  25435. this.CLASS_NAME = "SuperMap.ThemeLabelItem";
  25436. }
  25437. /**
  25438. * @function SuperMap.ThemeLabelItem.prototype.destroy
  25439. * @description 释放资源,将引用资源的属性置空。
  25440. */
  25441. ThemeLabelItem_createClass(ThemeLabelItem, [{
  25442. key: "destroy",
  25443. value: function destroy() {
  25444. var me = this;
  25445. me.caption = null;
  25446. me.end = null;
  25447. me.start = null;
  25448. if (me.style) {
  25449. me.style.destroy();
  25450. me.style = null;
  25451. }
  25452. me.visible = null;
  25453. }
  25454. /**
  25455. * @function SuperMap.ThemeLabelItem.fromObj
  25456. * @description 从传入对象获取分段标签专题图的子项类。
  25457. * @param {Object} obj - 传入对象。
  25458. * @returns {SuperMap.ThemeLabelItem} ThemeLabelItem 对象。
  25459. */
  25460. }], [{
  25461. key: "fromObj",
  25462. value: function fromObj(obj) {
  25463. if (!obj) {
  25464. return;
  25465. }
  25466. var t = new ThemeLabelItem();
  25467. Util_Util.copy(t, obj);
  25468. return t;
  25469. }
  25470. }]);
  25471. return ThemeLabelItem;
  25472. }();
  25473. SuperMap.ThemeLabelItem = ThemeLabelItem_ThemeLabelItem;
  25474. // CONCATENATED MODULE: ./src/common/iServer/ThemeUniqueItem.js
  25475. function ThemeUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25476. 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); } }
  25477. function ThemeUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
  25478. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  25479. * This program are made available under the terms of the Apache License, Version 2.0
  25480. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25481. /**
  25482. * @class SuperMap.ThemeUniqueItem
  25483. * @category iServer Map Theme
  25484. * @classdesc 单值专题图子项类。
  25485. * @description 单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,Name 字段代表
  25486. * 省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有 5 种不同值,则该行政区划图有 5 个专题图子项。
  25487. * @param {Object} options - 参数。
  25488. * @param {string} options.unique - 单值专题图子项的单值。
  25489. * @param {string} [options.caption] - 单值专题图子项的标题。
  25490. * @param {SuperMap.ServerStyle} [options.style] - 单值专题图子项的风格。
  25491. * @param {boolean} [options.visible=true] - 单值专题图子项是否可见。
  25492. */
  25493. var ThemeUniqueItem_ThemeUniqueItem = /*#__PURE__*/function () {
  25494. function ThemeUniqueItem(options) {
  25495. ThemeUniqueItem_classCallCheck(this, ThemeUniqueItem);
  25496. /**
  25497. * @member {string} [SuperMap.ThemeUniqueItem.prototype.caption]
  25498. * @description 单值专题图子项的标题。
  25499. */
  25500. this.caption = null;
  25501. /**
  25502. * @member {SuperMap.ServerStyle} [SuperMap.ThemeUniqueItem.prototype.style]
  25503. * @description 单值专题图子项的显示风格。
  25504. */
  25505. this.style = new ServerStyle_ServerStyle();
  25506. /**
  25507. * @member {string} SuperMap.ThemeUniqueItem.prototype.unique
  25508. * @description 单值专题图子项的值,可以为数字、字符串等。
  25509. */
  25510. this.unique = null;
  25511. /**
  25512. * @member {boolean} [SuperMap.ThemeUniqueItem.prototype.visible=true]
  25513. * @description 单值专题图子项的可见性。
  25514. */
  25515. this.visible = true;
  25516. if (options) {
  25517. Util_Util.extend(this, options);
  25518. }
  25519. this.CLASS_NAME = "SuperMap.ThemeUniqueItem";
  25520. }
  25521. /**
  25522. * @function SuperMap.ThemeUniqueItem.prototype.destroy
  25523. * @description 释放资源,将引用资源的属性置空。
  25524. */
  25525. ThemeUniqueItem_createClass(ThemeUniqueItem, [{
  25526. key: "destroy",
  25527. value: function destroy() {
  25528. var me = this;
  25529. me.caption = null;
  25530. me.unique = null;
  25531. if (me.style) {
  25532. me.style.destroy();
  25533. me.style = null;
  25534. }
  25535. me.visible = null;
  25536. }
  25537. /**
  25538. * @function SuperMap.ThemeUniqueItem.prototype.toServerJSONObject
  25539. * @description 转换成对应的 JSON 格式对象。
  25540. * @returns {Object} 对应的 JSON 格式对象。
  25541. */
  25542. }, {
  25543. key: "toServerJSONObject",
  25544. value: function toServerJSONObject() {
  25545. var obj = {};
  25546. obj = Util_Util.copyAttributes(obj, this);
  25547. if (obj.style) {
  25548. if (obj.style.toServerJSONObject) {
  25549. obj.style = obj.style.toServerJSONObject();
  25550. }
  25551. }
  25552. return obj;
  25553. }
  25554. /**
  25555. * @function SuperMap.ThemeUniqueItem.fromObj
  25556. * @description 从传入对象获取单值专题图子项类。
  25557. * @param {Object} obj - 传入对象。
  25558. * @returns {SuperMap.ThemeUniqueItem} ThemeUniqueItem 对象。
  25559. */
  25560. }], [{
  25561. key: "fromObj",
  25562. value: function fromObj(obj) {
  25563. var res = new ThemeUniqueItem();
  25564. Util_Util.copy(res, obj);
  25565. res.style = ServerStyle_ServerStyle.fromJson(obj.style);
  25566. return res;
  25567. }
  25568. }]);
  25569. return ThemeUniqueItem;
  25570. }();
  25571. SuperMap.ThemeUniqueItem = ThemeUniqueItem_ThemeUniqueItem;
  25572. // CONCATENATED MODULE: ./src/common/iServer/ThemeFlow.js
  25573. function ThemeFlow_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25574. 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); } }
  25575. function ThemeFlow_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeFlow_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeFlow_defineProperties(Constructor, staticProps); return Constructor; }
  25576. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  25577. * This program are made available under the terms of the Apache License, Version 2.0
  25578. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25579. /**
  25580. * @class SuperMap.ThemeFlow
  25581. * @category iServer Map Theme
  25582. * @classdesc 标签或符号流动显示和牵引线风格设置类。
  25583. * 通过该类可以设置专题图中符号是否流动显示、是否使用牵引线以及牵引线风格。
  25584. * @param {Object} options - 参数。
  25585. * @param {boolean} [options.flowEnabled=false] - 是否流动显示标签或符号。
  25586. * @param {boolean} [options.leaderLineDisplayed=false] - 是否显示标签或符号和它标注的对象之间的牵引线。
  25587. * @param {SuperMap.ServerStyle} [options.leaderLineStyle] - 标签或符号与其标注对象之间牵引线的风格。
  25588. */
  25589. var ThemeFlow_ThemeFlow = /*#__PURE__*/function () {
  25590. function ThemeFlow(options) {
  25591. ThemeFlow_classCallCheck(this, ThemeFlow);
  25592. /**
  25593. * @member {boolean} [SuperMap.ThemeFlow.prototype.flowEnabled=false]
  25594. * @description 是否流动显示标签或符号。<br>
  25595. * 对于标签专题图而言,对于跨越比较大的区域和线条状的几何对象,在一个地图窗口中不能完全显示的情况下,如果其标签位置比较固定,
  25596. * 在当前地图窗口中该对象的标签不可见,则需要通过平移地图来查看对象的标签信息。如果采用了流动显示的效果,在当前地图窗口中,对象即使是部分显示,
  25597. * 其标签也会显示在当前地图窗口中。当平移地图时,对象的标签会随之移动,以保证在当前地图窗口中部分或全部显示的对象其标签都可见,从而可以方便地查看各要素的标签信息。
  25598. */
  25599. this.flowEnabled = false;
  25600. /**
  25601. * @member {boolean} [SuperMap.ThemeFlow.prototype.leaderLineDisplayed=false]
  25602. * @description 是否显示标签或符号和它标注的对象之间的牵引线。false表示不显示标签或符号和它标注的对象之间的牵引线。<br>
  25603. * 只有当 flowEnabled 为 true 时,牵引线才起作用。在当标签流动显示时,其位置不固定,由于牵引线始终指向要素的内点,
  25604. * 因而通过牵引线显示功能可以找到流动的标签或符号实际对应的要素。或者渲染符号偏移它所指向的对象时,图与对象之间可以采用牵引线进行连接。
  25605. */
  25606. this.leaderLineDisplayed = false;
  25607. /**
  25608. * @member {SuperMap.ServerStyle} SuperMap.ThemeFlow.prototype.leaderLineStyle
  25609. * @description 标签或符号与其标注对象之间牵引线的风格。
  25610. */
  25611. this.leaderLineStyle = new ServerStyle_ServerStyle();
  25612. if (options) {
  25613. Util_Util.extend(this, options);
  25614. }
  25615. this.CLASS_NAME = "SuperMap.ThemeFlow";
  25616. }
  25617. /**
  25618. * @function SuperMap.ThemeFlow.prototype.destroy
  25619. * @description 释放资源,将引用资源的属性置空。
  25620. */
  25621. ThemeFlow_createClass(ThemeFlow, [{
  25622. key: "destroy",
  25623. value: function destroy() {
  25624. var me = this;
  25625. me.flowEnabled = null;
  25626. me.leaderLineDisplayed = null;
  25627. if (me.leaderLineStyle) {
  25628. me.leaderLineStyle.destroy();
  25629. me.leaderLineStyle = null;
  25630. }
  25631. }
  25632. /**
  25633. * @function SuperMap.ThemeFlow.fromObj
  25634. * @description 从传入对象获取标签或符号流动显示和牵引线风格设置类。
  25635. * @param {Object} obj - 传入对象。
  25636. * @returns {SuperMap.ThemeFlow} ThemeFlow 对象。
  25637. */
  25638. }], [{
  25639. key: "fromObj",
  25640. value: function fromObj(obj) {
  25641. if (!obj) {
  25642. return;
  25643. }
  25644. var res = new ThemeFlow();
  25645. Util_Util.copy(res, obj);
  25646. res.leaderLineStyle = ServerStyle_ServerStyle.fromJson(obj.leaderLineStyle);
  25647. return res;
  25648. }
  25649. }]);
  25650. return ThemeFlow;
  25651. }();
  25652. SuperMap.ThemeFlow = ThemeFlow_ThemeFlow;
  25653. // CONCATENATED MODULE: ./src/common/iServer/ThemeOffset.js
  25654. function ThemeOffset_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25655. 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); } }
  25656. function ThemeOffset_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeOffset_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeOffset_defineProperties(Constructor, staticProps); return Constructor; }
  25657. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  25658. * This program are made available under the terms of the Apache License, Version 2.0
  25659. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25660. /**
  25661. * @class SuperMap.ThemeOffset
  25662. * @category iServer Map Theme
  25663. * @classdesc 专题图中文本或符号相对于要素内点的偏移量设置类。
  25664. * 通过该类可以设置专题图中标记文本或符号的偏移量以及偏移量是否随地图缩放而改变。
  25665. * @param {Object} options - 参数。
  25666. * @param {boolean} [options.offsetFixed=false] - 当前专题图是否固定标记文本或符号的偏移量。
  25667. * @param {string} [options.offsetX='0.0'] - 专题图中文本或符号相对于要素内点的水平偏移量。
  25668. * @param {string} [options.offsetY='0.0'] - 专题图中文本或符号相对于要素内点的垂直偏移量。
  25669. */
  25670. var ThemeOffset_ThemeOffset = /*#__PURE__*/function () {
  25671. function ThemeOffset(options) {
  25672. ThemeOffset_classCallCheck(this, ThemeOffset);
  25673. /**
  25674. * @member {boolean} [SuperMap.ThemeOffset.prototype.offsetFixed=false]
  25675. * @description 当前专题图是否固定标记文本或符号的偏移量。所谓固定偏移量,则文本或符号的偏移量不随地图的缩放而变化。
  25676. */
  25677. this.offsetFixed = false;
  25678. /**
  25679. * @member {string} [SuperMap.ThemeOffset.prototype.offsetX=0.0]
  25680. * @description 专题图中文本或符号相对于要素内点的水平偏移量。偏移量的单位为地图单位。
  25681. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么水平偏移量为2。
  25682. */
  25683. this.offsetX = "0.0";
  25684. /**
  25685. * @member {string} [SuperMap.ThemeOffset.prototype.offsetY=0.0]
  25686. * @description 专题图中文本或符号相对于要素内点的垂直偏移量。偏移量的单位为地图单位。
  25687. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么垂直偏移量为2。
  25688. */
  25689. this.offsetY = "0.0";
  25690. if (options) {
  25691. Util_Util.extend(this, options);
  25692. }
  25693. this.CLASS_NAME = "SuperMap.ThemeOffset";
  25694. }
  25695. /**
  25696. * @function SuperMap.ThemeOffset.prototype.destroy
  25697. * @description 释放资源,将引用资源的属性置空。
  25698. */
  25699. ThemeOffset_createClass(ThemeOffset, [{
  25700. key: "destroy",
  25701. value: function destroy() {
  25702. var me = this;
  25703. me.offsetFixed = null;
  25704. me.offsetX = null;
  25705. me.offsetY = null;
  25706. }
  25707. /**
  25708. * @function SuperMap.ThemeOffset.fromObj
  25709. * @description 从传入对象获取专题图中文本或符号相对于要素内点的偏移量设置类。
  25710. * @param {Object} obj - 传入对象。
  25711. * @returns {SuperMap.ThemeOffset} ThemeOffset 对象。
  25712. */
  25713. }], [{
  25714. key: "fromObj",
  25715. value: function fromObj(obj) {
  25716. if (!obj) {
  25717. return;
  25718. }
  25719. var res = new ThemeOffset();
  25720. Util_Util.copy(res, obj);
  25721. return res;
  25722. }
  25723. }]);
  25724. return ThemeOffset;
  25725. }();
  25726. SuperMap.ThemeOffset = ThemeOffset_ThemeOffset;
  25727. // CONCATENATED MODULE: ./src/common/iServer/LabelMixedTextStyle.js
  25728. function LabelMixedTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25729. 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); } }
  25730. function LabelMixedTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelMixedTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelMixedTextStyle_defineProperties(Constructor, staticProps); return Constructor; }
  25731. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  25732. * This program are made available under the terms of the Apache License, Version 2.0
  25733. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25734. /**
  25735. * @class SuperMap.LabelMixedTextStyle
  25736. * @category iServer Map Theme
  25737. * @classdesc 标签文本复合风格类
  25738. * @description 该类主要用于对标签专题图中标签的文本内容进行风格设置。通过该类用户可以使标签的文字显示不同的风格,比如文本 “喜马拉雅山”,通过本类可以将前三个字用红色显示,后两个字用蓝色显示。对同一文本设置不同的风格实质上是对文本的字符进行分段,同一分段内的字符具有相同的显示风格。对字符分段有两种方式,一种是利用分隔符对文本进行分段;另一种是根据分段索引值进行分段。<br>
  25739. * 1. 利用分隔符对文本进行分段: 比如文本 “5&109” 被分隔符 “&” 分为 “5” 和 “109” 两部分,
  25740. * 在显示时,“5” 和分隔符 “&” 使用同一个风格,字符串 “109” 使用相同的风格。<br>
  25741. * 2. 利用分段索引值进行分段: 文本中字符的索引值是以0开始的整数,比如文本 “珠穆朗玛峰”,
  25742. * 第一个字符(“珠”)的索引值为 0,第二个字符(“穆”)的索引值为 1,以此类推;当设置分段索引值为 1,3,4,9 时,
  25743. * 字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),可以看出索引号为 0 的字符(即“珠” )在第一个分段内,
  25744. * 索引号为 1,2 的字符(即“穆”、“朗”)位于第二个分段内,索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  25745. * @param {Object} options - 参数。
  25746. * @param {SuperMap.ServerTextStyle} [options.defaultStyle] - 默认的文本复合风格。
  25747. * @param {string} [options.separator] - 文本的分隔符。
  25748. * @param {boolean} [options.separatorEnabled=false] - 文本的分隔符是否有效。
  25749. * @param {Array.<number>} [options.splitIndexes] - 分段索引值,分段索引值用来对文本中的字符进行分段。
  25750. * @param {Array.<SuperMap.ServerTextStyle>} [options.styles] - 文本样式集合。
  25751. */
  25752. var LabelMixedTextStyle_LabelMixedTextStyle = /*#__PURE__*/function () {
  25753. function LabelMixedTextStyle(options) {
  25754. LabelMixedTextStyle_classCallCheck(this, LabelMixedTextStyle);
  25755. /**
  25756. * @member {SuperMap.ServerTextStyle} SuperMap.LabelMixedTextStyle.prototype.defaultStyle
  25757. * @description 默认的文本复合风格,即 SuperMap.ServerTextStyle 各字段的默认值。
  25758. */
  25759. this.defaultStyle = null;
  25760. /**
  25761. * @member {string} SuperMap.LabelMixedTextStyle.prototype.separator
  25762. * @description 文本的分隔符,分隔符的风格与前一个字符的风格一样。文本的分隔符是一个将文本分割开的符号,
  25763. * 比如文本 “5_109” 被 “_” 隔符为 “5” 和 “109” 两部分,假设有风格数组:style1、style2。
  25764. * 在显示时,“5” 和分隔符 “_” 使用 Style1 风格渲染,字符串 “109” 使用 Style2 的风格。
  25765. */
  25766. this.separator = null;
  25767. /**
  25768. * @member {boolean} [SuperMap.LabelMixedTextStyle.prototype.separatorEnabled=false]
  25769. * @description 文本的分隔符是否有效。分隔符有效时利用分隔符对文本进行分段;无效时根据文本中字符的位置进行分段。
  25770. * 分段后,同一分段内的字符具有相同的显示风格。
  25771. */
  25772. this.separatorEnabled = false;
  25773. /**
  25774. * @member {Array.<number>} SuperMap.LabelMixedTextStyle.prototype.splitIndexes
  25775. * @description 分段索引值,分段索引值用来对文本中的字符进行分段。
  25776. * 文本中字符的索引值是以 0 开始的整数,比如文本“珠穆朗玛峰”,第一个字符(“珠”)的索引值为0,第二个字符(“穆”)的索引值为 1,
  25777. * 以此类推;当设置分段索引值数组为 [1,3,4,9] 时,字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),
  25778. * 可以看出索引号为 0 的字符(即 “珠”)在第一个分段内,索引号为 1,2 的字符(即 “穆”、“朗”)位于第二个分段内,
  25779. * 索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  25780. */
  25781. this.splitIndexes = null;
  25782. /**
  25783. * @member {Array.<SuperMap.ServerTextStyle>} SuperMap.LabelMixedTextStyle.prototype.styles
  25784. * @description 文本样式集合。文本样式集合中的样式根据索引与不同分段一一对应,
  25785. * 如果有分段没有风格对应则使用 defaultStyle。
  25786. */
  25787. this.styles = new ServerTextStyle_ServerTextStyle();
  25788. if (options) {
  25789. Util_Util.extend(this, options);
  25790. }
  25791. this.CLASS_NAME = "SuperMap.LabelMixedTextStyle";
  25792. }
  25793. /**
  25794. * @function SuperMap.LabelMixedTextStyle.prototype.destroy
  25795. * @description 释放资源,将引用资源的属性置空。
  25796. */
  25797. LabelMixedTextStyle_createClass(LabelMixedTextStyle, [{
  25798. key: "destroy",
  25799. value: function destroy() {
  25800. var me = this;
  25801. if (me.defaultStyle) {
  25802. me.defaultStyle.destroy();
  25803. me.defaultStyle = null;
  25804. }
  25805. me.separator = null;
  25806. me.separatorEnabled = null;
  25807. if (me.splitIndexes) {
  25808. me.splitIndexes = null;
  25809. }
  25810. if (me.styles) {
  25811. for (var i = 0, styles = me.styles, len = styles.length; i < len; i++) {
  25812. styles[i].destroy();
  25813. }
  25814. me.styles = null;
  25815. }
  25816. }
  25817. /**
  25818. * @function SuperMap.LabelMixedTextStyle.fromObj
  25819. * @description 从传入对象获取标签文本复合风格类。
  25820. * @param {Object} obj - 传入对象。
  25821. * @returns {SuperMap.LabelMixedTextStyle} 返回新的 LabelMixedTextStyle 对象。
  25822. */
  25823. }], [{
  25824. key: "fromObj",
  25825. value: function fromObj(obj) {
  25826. if (!obj) {
  25827. return;
  25828. }
  25829. var res = new LabelMixedTextStyle();
  25830. var stys = obj.styles;
  25831. Util_Util.copy(res, obj);
  25832. res.defaultStyle = new ServerTextStyle_ServerTextStyle(obj.defaultStyle);
  25833. if (stys) {
  25834. res.styles = [];
  25835. for (var i = 0, len = stys.length; i < len; i++) {
  25836. res.styles.push(new ServerTextStyle_ServerTextStyle(stys[i]));
  25837. }
  25838. }
  25839. return res;
  25840. }
  25841. }]);
  25842. return LabelMixedTextStyle;
  25843. }();
  25844. SuperMap.LabelMixedTextStyle = LabelMixedTextStyle_LabelMixedTextStyle;
  25845. // CONCATENATED MODULE: ./src/common/iServer/ThemeLabelText.js
  25846. function ThemeLabelText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25847. 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); } }
  25848. function ThemeLabelText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelText_defineProperties(Constructor, staticProps); return Constructor; }
  25849. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  25850. * This program are made available under the terms of the Apache License, Version 2.0
  25851. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25852. /**
  25853. * @class SuperMap.ThemeLabelText
  25854. * @category iServer Map Theme
  25855. * @classdesc 标签中文本风格类。
  25856. * 通过该类可以设置标签中的文本字体大小和显示风格。
  25857. * @param {Object} options - 参数。
  25858. * @param {number} [options.maxTextHeight=0] - 标签中文本的最大高度。
  25859. * @param {number} [options.maxTextWidth=0] - 标签中文本的最大宽度。
  25860. * @param {number} [options.minTextHeight=0] - 标签中文本的最小高度。
  25861. * @param {number} [options.minTextWidth=0] - 标签中文本的最小宽度。
  25862. * @param {SuperMap.ServerTextStyle} [options.uniformStyle] - 统一文本风格。
  25863. * @param {SuperMap.LabelMixedTextStyle} [options.uniformMixedStyle] - 标签专题图统一的文本复合风格。
  25864. */
  25865. var ThemeLabelText_ThemeLabelText = /*#__PURE__*/function () {
  25866. function ThemeLabelText(options) {
  25867. ThemeLabelText_classCallCheck(this, ThemeLabelText);
  25868. /**
  25869. * @member {number} [SuperMap.ThemeLabelText.prototype.maxTextHeight=0]
  25870. * @description 标签中文本的最大高度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  25871. * 当放大后的文本高度超过最大高度之后就不再放大。高度单位为 0.1 毫米。
  25872. */
  25873. this.maxTextHeight = 0;
  25874. /**
  25875. * @member {number} [SuperMap.ThemeLabelText.prototype.maxTextWidth=0]
  25876. * @description 标签中文本的最大宽度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  25877. * 当放大后的文本宽度超过最大高度之后就不再放大。宽度单位为 0.1 毫米。
  25878. */
  25879. this.maxTextWidth = 0;
  25880. /**
  25881. * @member {number} [SuperMap.ThemeLabelText.prototype.minTextHeight=0]
  25882. * @description 标签中文本的最小高度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  25883. * 当缩小后的文本高度小于最小高度之后就不再缩小。高度单位为 0.1 毫米。
  25884. */
  25885. this.minTextHeight = 0;
  25886. /**
  25887. * @member {number} [SuperMap.ThemeLabelText.prototype.minTextWidth=0]
  25888. * @description 标签中文本的最小宽度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  25889. * 当缩小后的文本宽度小于最小宽度之后就不再缩小。宽度单位为 0.1 毫米。
  25890. */
  25891. this.minTextWidth = 0;
  25892. /**
  25893. * @member {SuperMap.ServerTextStyle} [SuperMap.ThemeLabelText.prototype.uniformStyle]
  25894. * @description 统一文本风格。当标签专题图子项的个数大于等于1时,
  25895. * uniformStyle 不起作用,各标签的风格使用子项中设置的风格。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  25896. * SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  25897. */
  25898. this.uniformStyle = new ServerTextStyle_ServerTextStyle();
  25899. /**
  25900. *@member {SuperMap.LabelMixedTextStyle} [SuperMap.ThemeLabelText.prototype.uniformMixedStyle]
  25901. *@description 标签专题图统一的文本复合风格。通过该类可以使同一个标
  25902. * 签中的文字使用多种风格显示。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  25903. * SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  25904. */
  25905. this.uniformMixedStyle = null;
  25906. if (options) {
  25907. Util_Util.extend(this, options);
  25908. }
  25909. this.CLASS_NAME = "SuperMap.ThemeLabelText";
  25910. }
  25911. /**
  25912. * @function SuperMap.ThemeLabelText.prototype.destroy
  25913. * @description 释放资源,将引用资源的属性置空。
  25914. */
  25915. ThemeLabelText_createClass(ThemeLabelText, [{
  25916. key: "destroy",
  25917. value: function destroy() {
  25918. var me = this;
  25919. me.maxTextHeight = null;
  25920. me.maxTextWidth = null;
  25921. me.minTextHeight = null;
  25922. me.minTextWidth = null;
  25923. if (me.uniformStyle) {
  25924. me.uniformStyle.destroy();
  25925. me.uniformStyle = null;
  25926. }
  25927. if (me.uniformMixedStyle) {
  25928. me.uniformMixedStyle.destroy();
  25929. me.uniformMixedStyle = null;
  25930. }
  25931. }
  25932. /**
  25933. * @function SuperMap.ThemeLabelText.fromObj
  25934. * @description 从传入对象获取标签中文本风格类。
  25935. * @param {Object} obj - 传入对象。
  25936. * @returns {SuperMap.ThemeLabelText} ThemeLabelText 对象。
  25937. */
  25938. }], [{
  25939. key: "fromObj",
  25940. value: function fromObj(obj) {
  25941. if (!obj) {
  25942. return;
  25943. }
  25944. var res = new ThemeLabelText();
  25945. Util_Util.copy(res, obj);
  25946. res.uniformStyle = ServerTextStyle_ServerTextStyle.fromObj(obj.uniformStyle);
  25947. res.uniformMixedStyle = LabelMixedTextStyle_LabelMixedTextStyle.fromObj(obj.uniformMixedStyle);
  25948. return res;
  25949. }
  25950. }]);
  25951. return ThemeLabelText;
  25952. }();
  25953. SuperMap.ThemeLabelText = ThemeLabelText_ThemeLabelText;
  25954. // CONCATENATED MODULE: ./src/common/iServer/ThemeLabelAlongLine.js
  25955. function ThemeLabelAlongLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25956. 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); } }
  25957. function ThemeLabelAlongLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelAlongLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelAlongLine_defineProperties(Constructor, staticProps); return Constructor; }
  25958. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  25959. * This program are made available under the terms of the Apache License, Version 2.0
  25960. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25961. /**
  25962. * @class SuperMap.ThemeLabelAlongLine
  25963. * @category iServer Map Theme
  25964. * @classdesc 标签沿线标注样式类。
  25965. * @param {Object} options - 参数。
  25966. * @param {boolean} [options.isAlongLine=true] - 是否沿线显示文本。
  25967. * @param {SuperMap.AlongLineDirection} [options.alongLineDirection=SuperMap.AlongLineDirection.LB_TO_RT] - 标签沿线标注方向。
  25968. * @param {boolean} [options.angleFixed=false] - 当沿线显示文本时,是否将文本角度固定。
  25969. * @param {boolean} [options.repeatedLabelAvoided=false] - 沿线循环标注时是否避免标签重复标注。
  25970. * @param {boolean} [options.repeatIntervalFixed=false] - 循环标注间隔是否固定。
  25971. * @param {number} [options.labelRepeatInterval=0] - 沿线且循环标注时循环标注的间隔。
  25972. */
  25973. var ThemeLabelAlongLine_ThemeLabelAlongLine = /*#__PURE__*/function () {
  25974. function ThemeLabelAlongLine(options) {
  25975. ThemeLabelAlongLine_classCallCheck(this, ThemeLabelAlongLine);
  25976. /**
  25977. * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.isAlongLine=true]
  25978. * @description 是否沿线显示文本。true 表示沿线显示文本,false 表示正常显示文本。
  25979. */
  25980. this.isAlongLine = true;
  25981. /**
  25982. * @member {SuperMap.AlongLineDirection} [SuperMap.ThemeLabelAlongLine.prototype.alongLineDirection=SuperMap.AlongLineDirection.LB_TO_RT]
  25983. * @description 标签沿线标注方向。
  25984. */
  25985. this.alongLineDirection = AlongLineDirection.LB_TO_RT;
  25986. /**
  25987. * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.angleFixed=false]
  25988. * @description 当沿线显示文本时,是否将文本角度固定。true 表示按固定文本角度显示文本,false 表示按照沿线角度显示文本。
  25989. * 如果固定角度,则所有标签均按所设置的文本风格中字体的旋转角度来显示,不考虑沿线标注的方向;
  25990. * 如果不固定角度,在显示标签时会同时考虑字体的旋转角度和沿线标注的方向。
  25991. */
  25992. this.angleFixed = false;
  25993. /**
  25994. * @member {boolean} SuperMap.ThemeLabelAlongLine.prototype.repeatedLabelAvoided
  25995. * @description 沿线循环标注时是否避免标签重复标注。
  25996. */
  25997. this.repeatedLabelAvoided = false;
  25998. /**
  25999. * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.repeatIntervalFixed=false]
  26000. * @description 循环标注间隔是否固定。true 表示使用固定循环标注间隔,即使用逻辑坐标来显示循环标注间隔;
  26001. * false 表示循环标注间隔随地图的缩放而变化,即使用地理坐标来显示循环标注间隔。
  26002. */
  26003. this.repeatIntervalFixed = false;
  26004. /**
  26005. * @member {number} [SuperMap.ThemeLabelAlongLine.prototype.labelRepeatInterval=0]
  26006. * @description 沿线且循环标注时循环标注的间隔。长度的单位与地图的地理单位一致。只有设定 RepeatedLabelAvoided 为 true
  26007. * 的时候,labelRepeatInterval 属性才有效。
  26008. */
  26009. this.labelRepeatInterval = 0;
  26010. if (options) {
  26011. Util_Util.extend(this, options);
  26012. }
  26013. this.CLASS_NAME = "SuperMap.ThemeLabelAlongLine";
  26014. }
  26015. /**
  26016. * @function SuperMap.ThemeLabelAlongLine.prototype.destroy
  26017. * @description 释放资源,将引用资源的属性置空。
  26018. */
  26019. ThemeLabelAlongLine_createClass(ThemeLabelAlongLine, [{
  26020. key: "destroy",
  26021. value: function destroy() {
  26022. var me = this;
  26023. me.isAlongLine = null;
  26024. me.alongLineDirection = null;
  26025. me.angleFixed = null;
  26026. me.repeatedLabelAvoided = null;
  26027. me.repeatIntervalFixed = null;
  26028. me.labelRepeatInterval = null;
  26029. }
  26030. /**
  26031. * @function SuperMap.ThemeLabelAlongLine.fromObj
  26032. * @description 从传入对象获取标签沿线标注样式类。
  26033. * @param {Object} obj - 传入对象。
  26034. * @returns {SuperMap.ThemeLabelAlongLine} ThemeLabelAlongLine 对象。
  26035. */
  26036. }], [{
  26037. key: "fromObj",
  26038. value: function fromObj(obj) {
  26039. if (!obj) {
  26040. return;
  26041. }
  26042. var t = new ThemeLabelAlongLine();
  26043. Util_Util.copy(t, obj);
  26044. return t;
  26045. }
  26046. }]);
  26047. return ThemeLabelAlongLine;
  26048. }();
  26049. SuperMap.ThemeLabelAlongLine = ThemeLabelAlongLine_ThemeLabelAlongLine;
  26050. // CONCATENATED MODULE: ./src/common/iServer/ThemeLabelBackground.js
  26051. function ThemeLabelBackground_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26052. 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); } }
  26053. function ThemeLabelBackground_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelBackground_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelBackground_defineProperties(Constructor, staticProps); return Constructor; }
  26054. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  26055. * This program are made available under the terms of the Apache License, Version 2.0
  26056. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26057. /**
  26058. * @class SuperMap.ThemeLabelBackground
  26059. * @category iServer Map Theme
  26060. * @classdesc 标签背景风格类。通过该类可以设置标签的背景形状和风格。
  26061. * @param {Object} options - 参数。
  26062. * @param {SuperMap.LabelBackShape} [options.labelBackShape=SuperMap.LabelBackShape.NONE] - 标签专题图中标签背景风格。
  26063. * @param {SuperMap.ServerStyle} [options.backStyle=SuperMap.LabelBackShape.NONE] - 标签专题图中标签背景的形状枚举类。
  26064. */
  26065. var ThemeLabelBackground_ThemeLabelBackground = /*#__PURE__*/function () {
  26066. function ThemeLabelBackground(options) {
  26067. ThemeLabelBackground_classCallCheck(this, ThemeLabelBackground);
  26068. /**
  26069. * @member {SuperMap.LabelBackShape} [SuperMap.ThemeLabelBackground.prototype.labelBackShape=SuperMap.LabelBackShape.NONE]
  26070. * @description 标签专题图中标签背景风格。当背景形状
  26071. * labelBackShape 属性设为 NONE(即无背景形状) 时,backStyle 属性无效。
  26072. */
  26073. this.labelBackShape = LabelBackShape.NONE;
  26074. /**
  26075. * @member {SuperMap.ServerStyle} [SuperMap.ThemeLabelBackground.prototype.backStyle=SuperMap.LabelBackShape.NON]
  26076. * @description 标签专题图中标签背景的形状枚举类。背景类型可
  26077. * 以是矩形、圆角矩形、菱形、椭圆形、三角形和符号等,即不使用任何的形状作为标签的背景。
  26078. */
  26079. this.backStyle = new ServerStyle_ServerStyle();
  26080. if (options) {
  26081. Util_Util.extend(this, options);
  26082. }
  26083. this.CLASS_NAME = "SuperMap.ThemeLabelBackground";
  26084. }
  26085. /**
  26086. * @function SuperMap.ThemeLabelBackground.prototype.destroy
  26087. * @description 释放资源,将引用资源的属性置空。
  26088. */
  26089. ThemeLabelBackground_createClass(ThemeLabelBackground, [{
  26090. key: "destroy",
  26091. value: function destroy() {
  26092. var me = this;
  26093. me.labelBackShape = null;
  26094. if (me.backStyle) {
  26095. me.backStyle.destroy();
  26096. me.backStyle = null;
  26097. }
  26098. }
  26099. /**
  26100. * @function SuperMap.ThemeLabelBackground.fromObj
  26101. * @description 从传入对象获取标签背景风格类。
  26102. * @param {Object} obj - 传入对象。
  26103. * @returns {SuperMap.ThemeLabelBackground} ThemeLabelBackground 对象。
  26104. */
  26105. }], [{
  26106. key: "fromObj",
  26107. value: function fromObj(obj) {
  26108. if (!obj) {
  26109. return;
  26110. }
  26111. var t = new ThemeLabelBackground();
  26112. t.labelBackShape = obj.labelBackShape;
  26113. t.backStyle = ServerStyle_ServerStyle.fromJson(obj.backStyle);
  26114. return t;
  26115. }
  26116. }]);
  26117. return ThemeLabelBackground;
  26118. }();
  26119. SuperMap.ThemeLabelBackground = ThemeLabelBackground_ThemeLabelBackground;
  26120. // CONCATENATED MODULE: ./src/common/iServer/ThemeLabel.js
  26121. 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); }
  26122. function ThemeLabel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26123. 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); } }
  26124. function ThemeLabel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabel_defineProperties(Constructor, staticProps); return Constructor; }
  26125. 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); }
  26126. function ThemeLabel_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeLabel_getPrototypeOf(object); if (object === null) break; } return object; }
  26127. 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); }
  26128. function ThemeLabel_setPrototypeOf(o, p) { ThemeLabel_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeLabel_setPrototypeOf(o, p); }
  26129. 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); }; }
  26130. function ThemeLabel_possibleConstructorReturn(self, call) { if (call && (ThemeLabel_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeLabel_assertThisInitialized(self); }
  26131. function ThemeLabel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26132. 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; } }
  26133. function ThemeLabel_getPrototypeOf(o) { ThemeLabel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeLabel_getPrototypeOf(o); }
  26134. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  26135. * This program are made available under the terms of the Apache License, Version 2.0
  26136. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26137. /**
  26138. * @class SuperMap.ThemeLabel
  26139. * @category iServer Map Theme
  26140. * @classdesc 标签专题图类。
  26141. * @extends SuperMap.Theme
  26142. * @param {Object} options - 参数。
  26143. * @param {Array.<SuperMap.ThemeUniqueItem>} options.items - 分段标签专题图的子项数组。
  26144. * @param {string} options.labelExpression - 标注字段表达式。
  26145. * @param {Array.<SuperMap.LabelMatrixCell>} options.matrixCells - 矩阵标签元素数组。
  26146. * @param {SuperMap.ThemeLabelAlongLine} [options.alongLine] - 标签沿线标注方向样式类。
  26147. * @param {SuperMap.ThemeLabelBackground} [options.background] - 标签专题图中标签的背景风格类。
  26148. * @param {SuperMap.ThemeFlow} [options.flow] - 标签专题图标签流动显示与牵引线设置类。
  26149. * @param {SuperMap.LabelOverLengthMode} [options.labelOverLengthMode=SuperMap.LabelOverLengthMode.NONE] - 标签专题图中超长标签的处理模式枚举类。
  26150. * @param {number} [options.maxLabelLength=256] - 标签在每一行显示的最大长度。
  26151. * @param {number} [options.numericPrecision=0] - 通过该字段设置其显示的精度。
  26152. * @param {SuperMap.ThemeOffset} [options.offset] - 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  26153. * @param {boolean} [options.overlapAvoided=true] - 是否允许以文本避让方式显示文本。
  26154. * @param {string} [options.rangeExpression] - 制作分段标签专题的分段字段或字段表达式。
  26155. * @param {boolean} [options.smallGeometryLabeled=false] - 是否显示长度大于被标注对象本身长度的标签。
  26156. * @param {SuperMap.ThemeLabelText} options.text - 标签中文本风格。
  26157. * @param {number} [options.textSpace=0] - 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  26158. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  26159. */
  26160. var ThemeLabel_ThemeLabel = /*#__PURE__*/function (_Theme) {
  26161. ThemeLabel_inherits(ThemeLabel, _Theme);
  26162. var _super = ThemeLabel_createSuper(ThemeLabel);
  26163. function ThemeLabel(options) {
  26164. var _this;
  26165. ThemeLabel_classCallCheck(this, ThemeLabel);
  26166. _this = _super.call(this, "LABEL", options);
  26167. /**
  26168. * @member {SuperMap.ThemeLabelAlongLine} [SuperMap.ThemeLabel.prototype.alongLine]
  26169. * @description 标签沿线标注方向样式类。
  26170. * 在该类中可以设置标签是否沿线标注以及沿线标注的多种方式。沿线标注属性只适用于线数据集专题图。
  26171. */
  26172. _this.alongLine = new ThemeLabelAlongLine_ThemeLabelAlongLine();
  26173. /**
  26174. * @member {SuperMap.ThemeLabelBackground} [SuperMap.ThemeLabel.prototype.background]
  26175. * @description 标签专题图中标签的背景风格类。通过该字段可以设置标签的背景形状和风格。
  26176. */
  26177. _this.background = new ThemeLabelBackground_ThemeLabelBackground();
  26178. /**
  26179. * @member {SuperMap.ThemeFlow} [SuperMap.ThemeLabel.prototype.flow]
  26180. * @description 标签专题图标签流动显示与牵引线设置类。通过该字段可以设置标签是否流动显示和牵引线风格。
  26181. */
  26182. _this.flow = new ThemeFlow_ThemeFlow();
  26183. /**
  26184. * @member {Array.<SuperMap.ThemeUniqueItem>} [SuperMap.ThemeLabel.prototype.items]
  26185. * @description 分段标签专题图的子项数组。分段标签专题图使用 rangeExpression
  26186. * 指定数字型的字段作为分段数据,items 中的每个子对象的 [start,end) 分段值必须来源于属性 rangeExpression 的字段值。每个子项拥有自己的风格。
  26187. */
  26188. _this.items = null;
  26189. /**
  26190. * @member {Array.<SuperMap.ThemeLabelUniqueItem>} SuperMap.ThemeLabel.prototype.uniqueItems
  26191. * @description 单值标签专题图子项数组。单值标签专题图使用 uniqueExpression单值标签专题图子项集合。
  26192. */
  26193. _this.uniqueItems = null;
  26194. /**
  26195. * @member {string} SuperMap.ThemeLabel.prototype.labelExpression
  26196. * @description 标注字段表达式。系统将 labelExpression 对应的字段或字段表达式的值以标签的形式显示在图层中。
  26197. */
  26198. _this.labelExpression = null;
  26199. /**
  26200. * @member {SuperMap.LabelOverLengthMode} [SuperMap.ThemeLabel.prototype.labelOverLengthMode=SuperMap.LabelOverLengthMode.NONE] - 标签专题图中超长标签的处理模式枚举类。
  26201. * @description 对于标签的长度超过设置的标签最大长度 maxLabelLength 时称为超长标签。
  26202. */
  26203. _this.labelOverLengthMode = LabelOverLengthMode.NONE;
  26204. /**
  26205. * @member {Array.<SuperMap.LabelMatrixCell>} SuperMap.ThemeLabel.prototype.matrixCells
  26206. * @description 矩阵标签元素数组,用于制作矩阵标签专题图。
  26207. * 数组中可以放置符号类型的矩阵标签元素和图片类型的矩阵标签元素。
  26208. */
  26209. _this.matrixCells = null;
  26210. /**
  26211. * @member {number} [SuperMap.ThemeLabel.prototype.maxLabelLength=256]
  26212. * @description 标签在每一行显示的最大长度,一个中文为两个字符。
  26213. * 如果超过最大长度,可以采用两种方式来处理,一种是换行的模式进行显示,另一种是以省略号方式显示。单位为字符。
  26214. */
  26215. _this.maxLabelLength = 256;
  26216. /**
  26217. * @member {number} [SuperMap.ThemeLabel.prototype.numericPrecision=0]
  26218. * @description 如果显示的标签内容为数字,通过该字段设置其显示的精度。例如标签对应的数字是8071.64529347,
  26219. * 如果该属性为0时,显示8071;为1时,显示8071.6;为3时,则是8071.645。
  26220. */
  26221. _this.numericPrecision = 0;
  26222. /**
  26223. * @member {SuperMap.ThemeOffset} [SuperMap.ThemeLabel.prototype.offset]
  26224. * @description 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  26225. */
  26226. _this.offset = new ThemeOffset_ThemeOffset();
  26227. /**
  26228. * @member {boolean} [SuperMap.ThemeLabel.prototype.overlapAvoided=true]
  26229. * @description 是否允许以文本避让方式显示文本。true 表示自动避免文本叠盖。只针对该标签专题图层中的文本数据。
  26230. * 在标签重叠度很大的情况下,即使使用自动避让功能,可能也无法完全避免标签重叠现象。
  26231. */
  26232. _this.overlapAvoided = true;
  26233. /**
  26234. * @member {string} SuperMap.ThemeLabel.prototype.rangeExpression
  26235. * @description 制作分段标签专题的分段字段或字段表达式。该表达式对应的字段(或者字段表达式)的值应该为数值型。
  26236. * 该字段与 items 分段子项联合使用,每个子项的起始值 [start,end)来源于 rangeExpression 字段值。
  26237. * 最后 labelExpression 指定的标签字段(标签专题图要显示的具体内容)会根据分段子项的风格进行分段显示。
  26238. */
  26239. _this.rangeExpression = null;
  26240. /**
  26241. * @member {string} SuperMap.ThemeLabel.prototype.uniqueExpression
  26242. * @description 用于制作单值专题图的字段或字段表达式。
  26243. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。必须与labelExpression一起使用。
  26244. */
  26245. _this.uniqueExpression = null;
  26246. /**
  26247. * @member {boolean} [SuperMap.ThemeLabel.prototype.smallGeometryLabeled=false]
  26248. * @description 是否显示长度大于被标注对象本身长度的标签。在标签的长度大于线或者面对象本身的长度时,
  26249. * 如果该值为 true,则标签文字会叠加在一起显示,为了清楚完整的显示该标签,
  26250. * 可以采用换行模式来显示标签,但必须保证每行的长度小于对象本身的长度。
  26251. */
  26252. _this.smallGeometryLabeled = false;
  26253. /**
  26254. * @member {SuperMap.ThemeLabelText} SuperMap.ThemeLabel.prototype.text
  26255. * @description 标签中文本风格。
  26256. */
  26257. _this.text = new ThemeLabelText_ThemeLabelText();
  26258. /**
  26259. * @member {number} [SuperMap.ThemeLabel.prototype.textSpace=0]
  26260. * @description 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  26261. */
  26262. _this.textSpace = 0;
  26263. if (options) {
  26264. Util_Util.extend(ThemeLabel_assertThisInitialized(_this), options);
  26265. }
  26266. _this.CLASS_NAME = "SuperMap.ThemeLabel";
  26267. return _this;
  26268. }
  26269. /**
  26270. * @function SuperMap.ThemeLabel.prototype.destroy
  26271. * @override
  26272. */
  26273. ThemeLabel_createClass(ThemeLabel, [{
  26274. key: "destroy",
  26275. value: function destroy() {
  26276. ThemeLabel_get(ThemeLabel_getPrototypeOf(ThemeLabel.prototype), "destroy", this).call(this);
  26277. var me = this;
  26278. me.alongLine = null;
  26279. if (me.background) {
  26280. me.background.destroy();
  26281. me.background = null;
  26282. }
  26283. me.flow = null;
  26284. if (me.items) {
  26285. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  26286. items[i].destroy();
  26287. }
  26288. me.items = null;
  26289. }
  26290. if (me.uniqueItems) {
  26291. for (var j = 0, uniqueItems = me.uniqueItems, uniqueLen = uniqueItems.length; j < uniqueLen; j++) {
  26292. uniqueItems[j].destory();
  26293. }
  26294. me.uniqueItems = null;
  26295. }
  26296. me.labelExpression = null;
  26297. me.labelOverLengthMode = null;
  26298. me.matrixCells = null;
  26299. me.maxLabelLength = null;
  26300. me.numericPrecision = null;
  26301. me.overlapAvoided = null;
  26302. me.rangeExpression = null;
  26303. me.uniqueExpression = null;
  26304. if (me.offset) {
  26305. me.offset.destroy();
  26306. me.offset = null;
  26307. }
  26308. me.overlapAvoided = null;
  26309. me.smallGeometryLabeled = null;
  26310. if (me.text) {
  26311. me.text.destroy();
  26312. me.text = null;
  26313. }
  26314. me.textSpace = null;
  26315. }
  26316. /**
  26317. * @function SuperMap.ThemeLabel.prototype.toJSON
  26318. * @description 将themeLabel对象转化为 JSON 字符串。
  26319. * @returns {string} 返回转换后的 JSON 字符串。
  26320. */
  26321. }, {
  26322. key: "toJSON",
  26323. value: function toJSON() {
  26324. return Util_Util.toJSON(this.toServerJSONObject());
  26325. }
  26326. /**
  26327. * @function SuperMap.ThemeLabel.prototype.toServerJSONObject
  26328. * @description 转换成对应的 JSON 格式对象。
  26329. * @returns {Object} 对应的 JSON 格式对象。
  26330. */
  26331. }, {
  26332. key: "toServerJSONObject",
  26333. value: function toServerJSONObject() {
  26334. var obj = {};
  26335. obj.type = this.type;
  26336. obj.memoryData = this.memoryData;
  26337. if (this.alongLine) {
  26338. obj.alongLine = this.alongLine.isAlongLine;
  26339. obj.alongLineDirection = this.alongLine.alongLineDirection;
  26340. obj.angleFixed = this.alongLine.angleFixed;
  26341. obj.isLabelRepeated = this.alongLine.isLabelRepeated;
  26342. obj.labelRepeatInterval = this.alongLine.labelRepeatInterval;
  26343. obj.repeatedLabelAvoided = this.alongLine.repeatedLabelAvoided;
  26344. obj.repeatIntervalFixed = this.alongLine.repeatIntervalFixed;
  26345. }
  26346. if (this.offset) {
  26347. obj.offsetFixed = this.offset.offsetFixed;
  26348. obj.offsetX = this.offset.offsetX;
  26349. obj.offsetY = this.offset.offsetY;
  26350. }
  26351. if (this.flow) {
  26352. obj.flowEnabled = this.flow.flowEnabled;
  26353. obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
  26354. obj.leaderLineStyle = this.flow.leaderLineStyle;
  26355. }
  26356. if (this.text) {
  26357. obj.maxTextHeight = this.text.maxTextHeight;
  26358. obj.maxTextWidth = this.text.maxTextWidth;
  26359. obj.minTextHeight = this.text.minTextHeight;
  26360. obj.minTextWidth = this.text.minTextWidth;
  26361. obj.uniformStyle = this.text.uniformStyle;
  26362. obj.uniformMixedStyle = this.text.uniformMixedStyle;
  26363. }
  26364. if (this.background) {
  26365. obj.labelBackShape = this.background.labelBackShape;
  26366. obj.backStyle = this.background.backStyle;
  26367. }
  26368. obj.labelOverLengthMode = this.labelOverLengthMode;
  26369. obj.maxLabelLength = this.maxLabelLength;
  26370. obj.smallGeometryLabeled = this.smallGeometryLabeled;
  26371. obj.rangeExpression = this.rangeExpression;
  26372. obj.uniqueExpression = this.uniqueExpression;
  26373. obj.numericPrecision = this.numericPrecision;
  26374. obj.items = this.items;
  26375. obj.uniqueItems = this.uniqueItems;
  26376. obj.labelExpression = this.labelExpression;
  26377. obj.overlapAvoided = this.overlapAvoided;
  26378. obj.matrixCells = this.matrixCells;
  26379. obj.textSpace = this.textSpace;
  26380. return obj;
  26381. }
  26382. /**
  26383. * @function SuperMap.ThemeLabel.fromObj
  26384. * @description 从传入对象获取标签专题图类。
  26385. * @param {Object} obj - 传入对象。
  26386. * @returns {SuperMap.ThemeLabel} ThemeLabel 对象。
  26387. */
  26388. }], [{
  26389. key: "fromObj",
  26390. value: function fromObj(obj) {
  26391. if (!obj) {
  26392. return;
  26393. }
  26394. var lab = new ThemeLabel();
  26395. var itemsL = obj.items,
  26396. itemsU = obj.uniqueItems,
  26397. cells = obj.matrixCells;
  26398. obj.matrixCells = null;
  26399. Util_Util.copy(lab, obj);
  26400. lab.alongLine = ThemeLabelAlongLine_ThemeLabelAlongLine.fromObj(obj);
  26401. lab.background = ThemeLabelBackground_ThemeLabelBackground.fromObj(obj);
  26402. lab.flow = new ThemeFlow_ThemeFlow({
  26403. flowEnabled: obj.flowEnabled,
  26404. leaderLineDisplayed: obj.leaderLineDisplayed,
  26405. leaderLineStyle: obj.leaderLineStyle
  26406. });
  26407. if (itemsL) {
  26408. lab.items = [];
  26409. for (var i = 0, len = itemsL.length; i < len; i++) {
  26410. lab.items.push(ThemeLabelItem_ThemeLabelItem.fromObj(itemsL[i]));
  26411. }
  26412. }
  26413. if (itemsU) {
  26414. lab.uniqueItems = [];
  26415. for (var j = 0, uniqueLen = itemsU.length; j < uniqueLen; j++) {
  26416. lab.uniqueItems.push(ThemeUniqueItem_ThemeUniqueItem.fromObj(itemsU[j]));
  26417. }
  26418. }
  26419. if (cells) {
  26420. lab.matrixCells = [];
  26421. for (var _i = 0, _len = cells.length; _i < _len; _i++) {//TODO
  26422. //lab.matrixCells.push(SuperMap.LabelMatrixCell.fromObj(cells[i]));
  26423. }
  26424. }
  26425. lab.offset = ThemeOffset_ThemeOffset.fromObj(obj);
  26426. lab.text = ThemeLabelText_ThemeLabelText.fromObj(obj);
  26427. return lab;
  26428. }
  26429. }]);
  26430. return ThemeLabel;
  26431. }(Theme_Theme);
  26432. SuperMap.ThemeLabel = ThemeLabel_ThemeLabel;
  26433. // CONCATENATED MODULE: ./src/common/iServer/ThemeUnique.js
  26434. 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); }
  26435. function ThemeUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26436. 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); } }
  26437. function ThemeUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUnique_defineProperties(Constructor, staticProps); return Constructor; }
  26438. 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); }
  26439. function ThemeUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  26440. 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); }
  26441. function ThemeUnique_setPrototypeOf(o, p) { ThemeUnique_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeUnique_setPrototypeOf(o, p); }
  26442. 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); }; }
  26443. function ThemeUnique_possibleConstructorReturn(self, call) { if (call && (ThemeUnique_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeUnique_assertThisInitialized(self); }
  26444. function ThemeUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26445. 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; } }
  26446. function ThemeUnique_getPrototypeOf(o) { ThemeUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeUnique_getPrototypeOf(o); }
  26447. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  26448. * This program are made available under the terms of the Apache License, Version 2.0
  26449. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26450. /**
  26451. * @class SuperMap.ThemeUnique
  26452. * @category iServer Map Theme
  26453. * @classdesc 单值专题图。
  26454. * @description 单值专题图是利用不同的颜色或符号(线型、填充)表示图层中某一属性信息的不同属性值,属性值相同的要素具有相同的渲染风格。单值专题图多用于具有分类属性的地图上,
  26455. * 比如土壤类型分布图、土地利用图、行政区划图等。单值专题图着重表示现象质的差别,一般不表示数量的特征。尤其是有交叉或重叠现象时,此类不推荐使用,例如:民族分布区等。
  26456. * @extends {SuperMap.Theme}
  26457. * @param {Object} options - 参数。
  26458. * @param {Array.<SuperMap.ThemeUniqueItem>} options.items - 单值专题图子项类数组。
  26459. * @param {string} options.uniqueExpression - 用于制作单值专题图的字段或字段表达式。
  26460. * @param {SuperMap.ServerStyle} [options.defaultStyle] - 未参与单值专题图制作的对象的显示风格。
  26461. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  26462. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  26463. */
  26464. var ThemeUnique_ThemeUnique = /*#__PURE__*/function (_Theme) {
  26465. ThemeUnique_inherits(ThemeUnique, _Theme);
  26466. var _super = ThemeUnique_createSuper(ThemeUnique);
  26467. function ThemeUnique(options) {
  26468. var _this;
  26469. ThemeUnique_classCallCheck(this, ThemeUnique);
  26470. _this = _super.call(this, "UNIQUE", options);
  26471. /**
  26472. * @member {SuperMap.ServerStyle} SuperMap.ThemeUnique.prototype.defaultStyle
  26473. * @description 未参与单值专题图制作的对象的显示风格。
  26474. * 通过单值专题图子项数组 (items)可以指定某些要素参与单值专题图制作,对于那些没有被包含的要素,即不参加单值专题表达的要素,使用该风格显示。
  26475. */
  26476. _this.defaultStyle = new ServerStyle_ServerStyle();
  26477. /**
  26478. * @member {Array.<SuperMap.ThemeUniqueItem>} SuperMap.ThemeUnique.prototype.items
  26479. * @description 单值专题图子项类数组。
  26480. * 单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,
  26481. * Name 字段代表省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有5种不同值,则该行政区划图有 5 个专题图子项。
  26482. */
  26483. _this.items = null;
  26484. /**
  26485. * @member {string} SuperMap.ThemeUnique.prototype.uniqueExpression
  26486. * @description 用于制作单值专题图的字段或字段表达式。
  26487. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。
  26488. */
  26489. _this.uniqueExpression = null;
  26490. /**
  26491. * @member {SuperMap.ColorGradientType} [SuperMap.ThemeUnique.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  26492. * @description 渐变颜色枚举类。
  26493. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  26494. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色方案完成填充。
  26495. * 但如果为某几个子项的风格进行单独设置后(设置了 ThemeUniqueItem 或 ThemeRangeItem 类中Style属性),
  26496. * 该配色方案对于这几个子项将不起作用。
  26497. */
  26498. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  26499. if (options) {
  26500. Util_Util.extend(ThemeUnique_assertThisInitialized(_this), options);
  26501. }
  26502. _this.CLASS_NAME = "SuperMap.ThemeUnique";
  26503. return _this;
  26504. }
  26505. /**
  26506. * @function SuperMap.ThemeUnique.prototype.destroy
  26507. * @override
  26508. */
  26509. ThemeUnique_createClass(ThemeUnique, [{
  26510. key: "destroy",
  26511. value: function destroy() {
  26512. ThemeUnique_get(ThemeUnique_getPrototypeOf(ThemeUnique.prototype), "destroy", this).call(this);
  26513. var me = this;
  26514. me.uniqueExpression = null;
  26515. me.colorGradientType = null;
  26516. if (me.items) {
  26517. if (me.items.length > 0) {
  26518. for (var item in me.items) {
  26519. me.items[item].destroy();
  26520. me.items[item] = null;
  26521. }
  26522. }
  26523. me.items = null;
  26524. }
  26525. if (me.defaultStyle) {
  26526. me.defaultStyle.destroy();
  26527. me.defaultStyle = null;
  26528. }
  26529. }
  26530. /**
  26531. * @function SuperMap.ThemeUnique.prototype.toServerJSONObject
  26532. * @description 转换成对应的 JSON 格式对象。
  26533. * @returns {Object} 对应的 JSON 格式对象。
  26534. */
  26535. }, {
  26536. key: "toServerJSONObject",
  26537. value: function toServerJSONObject() {
  26538. var obj = {};
  26539. obj = Util_Util.copyAttributes(obj, this);
  26540. if (obj.defaultStyle) {
  26541. if (obj.defaultStyle.toServerJSONObject) {
  26542. obj.defaultStyle = obj.defaultStyle.toServerJSONObject();
  26543. }
  26544. }
  26545. if (obj.items) {
  26546. var items = [],
  26547. len = obj.items.length;
  26548. for (var i = 0; i < len; i++) {
  26549. items.push(obj.items[i].toServerJSONObject());
  26550. }
  26551. obj.items = items;
  26552. }
  26553. return obj;
  26554. }
  26555. /**
  26556. * @function SuperMap.ThemeUnique.fromObj
  26557. * @description 从传入对象获取单值专题图类。
  26558. * @param {Object} obj - 传入对象。
  26559. * @returns {SuperMap.ThemeUnique} ThemeUnique 对象。
  26560. */
  26561. }], [{
  26562. key: "fromObj",
  26563. value: function fromObj(obj) {
  26564. var res = new ThemeUnique();
  26565. var uItems = obj.items;
  26566. var len = uItems ? uItems.length : 0;
  26567. Util_Util.extend(res, obj);
  26568. res.items = [];
  26569. res.defaultStyle = ServerStyle_ServerStyle.fromJson(obj.defaultStyle);
  26570. for (var i = 0; i < len; i++) {
  26571. res.items.push(ThemeUniqueItem_ThemeUniqueItem.fromObj(uItems[i]));
  26572. }
  26573. return res;
  26574. }
  26575. }]);
  26576. return ThemeUnique;
  26577. }(Theme_Theme);
  26578. SuperMap.ThemeUnique = ThemeUnique_ThemeUnique;
  26579. // CONCATENATED MODULE: ./src/common/iServer/ThemeGraphAxes.js
  26580. function ThemeGraphAxes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26581. 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); } }
  26582. function ThemeGraphAxes_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphAxes_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphAxes_defineProperties(Constructor, staticProps); return Constructor; }
  26583. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  26584. * This program are made available under the terms of the Apache License, Version 2.0
  26585. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26586. /**
  26587. * @class SuperMap.ThemeGraphAxes
  26588. * @category iServer Map Theme
  26589. * @classdesc 统计专题图坐标轴样式类。
  26590. * @param {Object} options - 参数。
  26591. * @param {SuperMap.ServerColor} [options.axesColor=(0, 0, 0)] - 坐标轴颜色。
  26592. * @param {boolean} [options.axesDisplayed=false] - 是否显示坐标轴。
  26593. * @param {boolean} [options.axesGridDisplayed=false] - 是否在统计图坐标轴上显示网格。
  26594. * @param {boolean} [options.axesTextDisplayed=false] - 是否显示坐标轴的文本标注。
  26595. * @param {SuperMap.ServerTextStyle} [options.axesTextStyle] - 统计符号的最大最小尺寸。
  26596. */
  26597. var ThemeGraphAxes_ThemeGraphAxes = /*#__PURE__*/function () {
  26598. function ThemeGraphAxes(options) {
  26599. ThemeGraphAxes_classCallCheck(this, ThemeGraphAxes);
  26600. /**
  26601. * @member {SuperMap.ServerColor} [SuperMap.ThemeGraphAxes.prototype.axesColor=(0, 0, 0)]
  26602. * @description 坐标轴颜色。当 axesDisplayed = true 时有效。
  26603. */
  26604. this.axesColor = new ServerColor(0, 0, 0);
  26605. /**
  26606. * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesDisplayed=false]
  26607. * @description 是否显示坐标轴。<br>
  26608. * 由于饼状图和环状图无坐标轴,故该属性以及所有与坐标轴设置相关的属性都不适用于它们。并且只有当该值为 true 时,其它设置坐标轴的属性才起作用。
  26609. */
  26610. this.axesDisplayed = false;
  26611. /**
  26612. * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesGridDisplayed=false]
  26613. * @description 是否在统计图坐标轴上显示网格。
  26614. */
  26615. this.axesGridDisplayed = false;
  26616. /**
  26617. * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesTextDisplayed=false]
  26618. * @description 是否显示坐标轴的文本标注。
  26619. */
  26620. this.axesTextDisplayed = false;
  26621. /**
  26622. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeGraphAxes.prototype.axesTextStyle
  26623. * @description 坐标轴文本风格。当 axesTextDisplayed = true 时有效。
  26624. */
  26625. this.axesTextStyle = new ServerTextStyle_ServerTextStyle();
  26626. if (options) {
  26627. Util_Util.extend(this, options);
  26628. }
  26629. this.CLASS_NAME = "SuperMap.ThemeGraphAxes";
  26630. }
  26631. /**
  26632. * @function SuperMap.ThemeGraphAxes.prototype.destroy
  26633. * @description 释放资源,将引用资源的属性置空。
  26634. */
  26635. ThemeGraphAxes_createClass(ThemeGraphAxes, [{
  26636. key: "destroy",
  26637. value: function destroy() {
  26638. var me = this;
  26639. if (me.axesColor) {
  26640. me.axesColor.destroy();
  26641. me.axesColor = null;
  26642. }
  26643. me.axesDisplayed = null;
  26644. me.axesGridDisplayed = null;
  26645. me.axesTextDisplayed = null;
  26646. if (me.axesTextStyle) {
  26647. me.axesTextStyle.destroy();
  26648. me.axesTextStyle = null;
  26649. }
  26650. }
  26651. /**
  26652. * @function SuperMap.ThemeGraphAxes.fromObj
  26653. * @description 从传入对象获取统计专题图坐标轴样式类。
  26654. * @param {Object} obj - 传入对象。
  26655. * @returns {SuperMap.ThemeGraphAxes} ThemeGraphAxes 对象。
  26656. */
  26657. }], [{
  26658. key: "fromObj",
  26659. value: function fromObj(obj) {
  26660. if (!obj) {
  26661. return;
  26662. }
  26663. var res = new ThemeGraphAxes();
  26664. Util_Util.copy(res, obj);
  26665. res.axesColor = ServerColor.fromJson(obj.axesColor);
  26666. res.axesTextStyle = ServerTextStyle_ServerTextStyle.fromObj(obj.axesTextStyle);
  26667. return res;
  26668. }
  26669. }]);
  26670. return ThemeGraphAxes;
  26671. }();
  26672. SuperMap.ThemeGraphAxes = ThemeGraphAxes_ThemeGraphAxes;
  26673. // CONCATENATED MODULE: ./src/common/iServer/ThemeGraphSize.js
  26674. function ThemeGraphSize_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26675. 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); } }
  26676. function ThemeGraphSize_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphSize_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphSize_defineProperties(Constructor, staticProps); return Constructor; }
  26677. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  26678. * This program are made available under the terms of the Apache License, Version 2.0
  26679. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26680. /**
  26681. * @class SuperMap.ThemeGraphSize
  26682. * @category iServer Map Theme
  26683. * @classdesc 统计专题图符号尺寸类。
  26684. * @param {Object} options - 参数。
  26685. * @param {number} [options.maxGraphSize=0] - 统计图中显示的最大图表尺寸基准值。
  26686. * @param {number} [options.minGraphSize=0] - 统计图中显示的最小图表尺寸基准值。
  26687. */
  26688. var ThemeGraphSize_ThemeGraphSize = /*#__PURE__*/function () {
  26689. function ThemeGraphSize(options) {
  26690. ThemeGraphSize_classCallCheck(this, ThemeGraphSize);
  26691. /**
  26692. * @member {number} [SuperMap.ThemeGraphSize.prototype.maxGraphSize=0]
  26693. * @description 获取或设置统计图中显示的最大图表尺寸基准值,单位为像素。
  26694. */
  26695. this.maxGraphSize = 0;
  26696. /**
  26697. * @member {number} [SuperMap.ThemeGraphSize.prototype.minGraphSize=0]
  26698. * @description 获取或设置统计图中显示的最小图表尺寸基准值,单位为像素。
  26699. */
  26700. this.minGraphSize = 0;
  26701. if (options) {
  26702. Util_Util.extend(this, options);
  26703. }
  26704. this.CLASS_NAME = "SuperMap.ThemeGraphSize";
  26705. }
  26706. /**
  26707. * @function SuperMap.ThemeGraphSize.prototype.destroy
  26708. * @description 释放资源,将引用资源的属性置空。
  26709. */
  26710. ThemeGraphSize_createClass(ThemeGraphSize, [{
  26711. key: "destroy",
  26712. value: function destroy() {
  26713. var me = this;
  26714. me.maxGraphSize = null;
  26715. me.minGraphSize = null;
  26716. }
  26717. /**
  26718. * @function SuperMap.ThemeGraphSize.fromObj
  26719. * @description 从传入对象获统计专题图符号尺寸类。
  26720. * @param {Object} obj - 传入对象。
  26721. * @returns {SuperMap.ThemeGraphSize} ThemeGraphSize 对象。
  26722. */
  26723. }], [{
  26724. key: "fromObj",
  26725. value: function fromObj(obj) {
  26726. var res = new ThemeGraphSize();
  26727. Util_Util.copy(res, obj);
  26728. return res;
  26729. }
  26730. }]);
  26731. return ThemeGraphSize;
  26732. }();
  26733. SuperMap.ThemeGraphSize = ThemeGraphSize_ThemeGraphSize;
  26734. // CONCATENATED MODULE: ./src/common/iServer/ThemeGraphText.js
  26735. function ThemeGraphText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26736. 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); } }
  26737. function ThemeGraphText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphText_defineProperties(Constructor, staticProps); return Constructor; }
  26738. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  26739. * This program are made available under the terms of the Apache License, Version 2.0
  26740. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26741. /**
  26742. * @class SuperMap.ThemeGraphText
  26743. * @category iServer Map Theme
  26744. * @classdesc 统计图文字标注风格类。
  26745. * @param {Object} options - 可选参数。
  26746. * @param {boolean} [options.graphTextDisplayed=false] - 是否显示统计图上的文字标注。
  26747. * @param {SuperMap.ThemeGraphTextFormat} [options.graphTextFormat=SuperMap.ThemeGraphTextFormat.CAPTION] - 统计专题图文本显示格式。
  26748. * @param {SuperMap.ServerTextStyle} [options.graphTextStyle] - 统计图上的文字标注风格。
  26749. */
  26750. var ThemeGraphText_ThemeGraphText = /*#__PURE__*/function () {
  26751. function ThemeGraphText(options) {
  26752. ThemeGraphText_classCallCheck(this, ThemeGraphText);
  26753. /**
  26754. * @member {boolean} [SuperMap.ThemeGraphText.prototype.graphTextDisplayed=false]
  26755. * @description 是否显示统计图上的文字标注。
  26756. */
  26757. this.graphTextDisplayed = false;
  26758. /**
  26759. * @member {SuperMap.ThemeGraphTextFormat} [SuperMap.ThemeGraphText.prototype.graphTextFormat=SuperMap.ThemeGraphTextFormat.CAPTION]
  26760. * @description 统计专题图文本显示格式。
  26761. * 文本显示格式包括百分数、真实数值、标题、标题+百分数、标题+真实数值。
  26762. */
  26763. this.graphTextFormat = ThemeGraphTextFormat.CAPTION;
  26764. /**
  26765. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeGraphText.prototype.graphTextStyle
  26766. * @description 统计图上的文字标注风格。
  26767. */
  26768. this.graphTextStyle = new ServerTextStyle_ServerTextStyle();
  26769. if (options) {
  26770. Util_Util.extend(this, options);
  26771. }
  26772. this.CLASS_NAME = "SuperMap.ThemeGraphText";
  26773. }
  26774. /**
  26775. * @function SuperMap.ThemeGraphText.prototype.destroy
  26776. * @description 释放资源,将引用资源的属性置空。
  26777. */
  26778. ThemeGraphText_createClass(ThemeGraphText, [{
  26779. key: "destroy",
  26780. value: function destroy() {
  26781. var me = this;
  26782. me.graphTextDisplayed = null;
  26783. me.graphTextFormat = null;
  26784. if (me.graphTextStyle) {
  26785. me.graphTextStyle.destroy();
  26786. me.graphTextStyle = null;
  26787. }
  26788. }
  26789. /**
  26790. * @function SuperMap.ThemeGraphText.fromObj
  26791. * @description 从传入对象获取统计图文字标注风格类。
  26792. * @param {Object} obj - 传入对象。
  26793. * @returns {SuperMap.ThemeGraphText} ThemeGraphText 对象。
  26794. */
  26795. }], [{
  26796. key: "fromObj",
  26797. value: function fromObj(obj) {
  26798. var res = new ThemeGraphText();
  26799. Util_Util.copy(res, obj);
  26800. res.graphTextStyle = ServerTextStyle_ServerTextStyle.fromObj(obj.graphTextStyle);
  26801. return res;
  26802. }
  26803. }]);
  26804. return ThemeGraphText;
  26805. }();
  26806. SuperMap.ThemeGraphText = ThemeGraphText_ThemeGraphText;
  26807. // CONCATENATED MODULE: ./src/common/iServer/ThemeGraphItem.js
  26808. function ThemeGraphItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26809. 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); } }
  26810. function ThemeGraphItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphItem_defineProperties(Constructor, staticProps); return Constructor; }
  26811. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  26812. * This program are made available under the terms of the Apache License, Version 2.0
  26813. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26814. /**
  26815. * @class SuperMap.ThemeGraphItem
  26816. * @category iServer Map Theme
  26817. * @classdesc 统计专题图子项类。
  26818. * @param {Object} options - 参数。
  26819. * @param {string} [options.caption] - 专题图子项的名称。
  26820. * @param {string} options.graphExpression - 统计专题图的专题变量。
  26821. * @param {Array.<number>} [options.memoryDoubleValues] - 内存数组方式制作专题图时的值数组。
  26822. * @param {SuperMap.ServerStyle} [options.uniformStyle] - 统计专题图子项的显示风格
  26823. */
  26824. var ThemeGraphItem_ThemeGraphItem = /*#__PURE__*/function () {
  26825. function ThemeGraphItem(options) {
  26826. ThemeGraphItem_classCallCheck(this, ThemeGraphItem);
  26827. /**
  26828. * @member {string} [SuperMap.ThemeGraphItem.prototype.caption]
  26829. * @description 专题图子项的名称。
  26830. */
  26831. this.caption = null;
  26832. /**
  26833. * @member {string} SuperMap.ThemeGraphItem.prototype.graphExpression
  26834. * @description 统计专题图的专题变量。专题变量可以是一个字段或字段表达式。字段必须为数值型;表达式只能为数值型的字段间的运算。
  26835. */
  26836. this.graphExpression = null;
  26837. /**
  26838. * @member {Array.<number>} [SuperMap.ThemeGraphItem.prototype.memoryDoubleValues]
  26839. * @description 内存数组方式制作专题图时的值数组。<br>
  26840. * 内存数组方式制作专题图时,只对 SmID 值在键数组({@link SuperMap.ThemeGraph.memoryKeys})中的记录制作专题图。
  26841. * 值数组的数值个数必须与键数组中数值的个数一致。 值数组中的值将代替原来的专题值来制作统计专题图。
  26842. * 比如:利用面积字段和周长字段(即有两个统计专题图子项 )作为专题变量制作统计专题图。
  26843. */
  26844. this.memoryDoubleValues = null;
  26845. /**
  26846. * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraphItem.prototype.uniformStyle]
  26847. * @description 统计专题图子项的显示风格。
  26848. * 每一个统计专题图子项都对应一种显示风格。
  26849. */
  26850. this.uniformStyle = new ServerStyle_ServerStyle();
  26851. if (options) {
  26852. Util_Util.extend(this, options);
  26853. }
  26854. this.CLASS_NAME = "SuperMap.ThemeGraphItem";
  26855. }
  26856. /**
  26857. * @function SuperMap.ThemeGraphItem.prototype.destroy
  26858. * @description 释放资源,将引用资源的属性置空。
  26859. */
  26860. ThemeGraphItem_createClass(ThemeGraphItem, [{
  26861. key: "destroy",
  26862. value: function destroy() {
  26863. var me = this;
  26864. me.caption = null;
  26865. me.graphExpression = null;
  26866. me.memoryDoubleValues = null;
  26867. me.uniformStyle = null;
  26868. }
  26869. /**
  26870. * @function SuperMap.ThemeGraphItem.fromObj
  26871. * @description 从传入对象获取统计专题图子项类。
  26872. * @param {Object} obj - 传入对象。
  26873. * @returns {SuperMap.ThemeGraphItem} ThemeGraphItem 对象。
  26874. */
  26875. }], [{
  26876. key: "fromObj",
  26877. value: function fromObj(obj) {
  26878. if (!obj) {
  26879. return;
  26880. }
  26881. var res = new ThemeGraphItem();
  26882. Util_Util.copy(res, obj);
  26883. res.uniformStyle = ServerStyle_ServerStyle.fromJson(obj.uniformStyle);
  26884. return res;
  26885. }
  26886. }]);
  26887. return ThemeGraphItem;
  26888. }();
  26889. SuperMap.ThemeGraphItem = ThemeGraphItem_ThemeGraphItem;
  26890. // CONCATENATED MODULE: ./src/common/iServer/ThemeGraph.js
  26891. 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); }
  26892. function ThemeGraph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26893. 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); } }
  26894. function ThemeGraph_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraph_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraph_defineProperties(Constructor, staticProps); return Constructor; }
  26895. 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); }
  26896. function ThemeGraph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraph_getPrototypeOf(object); if (object === null) break; } return object; }
  26897. 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); }
  26898. function ThemeGraph_setPrototypeOf(o, p) { ThemeGraph_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraph_setPrototypeOf(o, p); }
  26899. 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); }; }
  26900. function ThemeGraph_possibleConstructorReturn(self, call) { if (call && (ThemeGraph_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGraph_assertThisInitialized(self); }
  26901. function ThemeGraph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26902. 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; } }
  26903. function ThemeGraph_getPrototypeOf(o) { ThemeGraph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraph_getPrototypeOf(o); }
  26904. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  26905. * This program are made available under the terms of the Apache License, Version 2.0
  26906. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26907. /**
  26908. * @class SuperMap.ThemeGraph
  26909. * @category iServer Map Theme
  26910. * @classdesc 统计专题图类。
  26911. * @extends {SuperMap.Theme}
  26912. * @param {Object} options - 参数。
  26913. * @param {Array.<SuperMap.ThemeGraphItem>} options.items - 统计专题图子项集合。
  26914. * @param {number} [options.barWidth=0] - 柱状专题图中每一个柱的宽度。
  26915. * @param {SuperMap.ThemeFlow} [options.flow] - 统计专题图流动显示与牵引线设置。
  26916. * @param {SuperMap.GraduatedMode} [options.graduatedMode=SuperMap.GraduatedMode.CONSTANT] - 统计图中地理要素的值与图表尺寸间的映射关系。
  26917. * @param {SuperMap.ThemeGraphAxes} [options.graphAxes] - 统计图中坐标轴样式相关信息。
  26918. * @param {SuperMap.ThemeGraphSize} [options.graphSize=0] - 统计符号的最大最小尺寸。
  26919. * @param {boolean} [options.graphSizeFixed=false] - 缩放地图时统计图符号是否固定大小。
  26920. * @param {SuperMap.ThemeGraphText} [options.graphText] - 统计图上的文字是否可以见以及文字标注风格。
  26921. * @param {SuperMap.GraphAxesTextDisplayMode} [options.graphAxesTextDisplayMode=SuperMap.GraphAxesTextDisplayMode.NONE] - 统计专题图坐标轴文本显示模式。
  26922. * @param {SuperMap.ThemeGraphType} [options.graphType=SuperMap.ThemeGraphType.AREA] - 统计专题图类型。
  26923. * @param {Array.<number>} [options.memoryKeys] - 以内存数组方式制作专题图时的键数组。
  26924. * @param {boolean} [options.negativeDisplayed=false] - 专题图中是否显示属性为负值的数据。
  26925. * @param {SuperMap.ThemeOffset} [options.offset] - 统计图相对于要素内点的偏移量。
  26926. * @param {boolean} [options.overlapAvoided=true] - 统计图是否采用避让方式显示。
  26927. * @param {number} [options.roseAngle=0] - 统计图中玫瑰图或三维玫瑰图用于等分的角度。
  26928. * @param {number} [options.startAngle=0] - 饼状统计图扇形的起始角度。
  26929. */
  26930. var ThemeGraph_ThemeGraph = /*#__PURE__*/function (_Theme) {
  26931. ThemeGraph_inherits(ThemeGraph, _Theme);
  26932. var _super = ThemeGraph_createSuper(ThemeGraph);
  26933. function ThemeGraph(options) {
  26934. var _this;
  26935. ThemeGraph_classCallCheck(this, ThemeGraph);
  26936. _this = _super.call(this, "GRAPH", options);
  26937. /**
  26938. * @member {number} [SuperMap.ThemeGraph.prototype.barWidth=0]
  26939. * @description 柱状专题图中每一个柱的宽度。使用地图坐标单位。
  26940. * 只有选择的统计图类型为柱状图(柱状图、三维柱状图、堆叠柱状图、三维堆叠柱状图)时,此项才可设置。
  26941. */
  26942. _this.barWidth = 0;
  26943. /**
  26944. * @member {SuperMap.ThemeFlow} SuperMap.ThemeGraph.prototype.flow
  26945. * @description 统计专题图流动显示与牵引线设置。
  26946. * 通过该字段可以设置统计符号是否流动显示和牵引线风格。
  26947. */
  26948. _this.flow = new ThemeFlow_ThemeFlow();
  26949. /**
  26950. * @member {SuperMap.GraduatedMode} [SuperMap.ThemeGraph.prototype.graduatedMode=SuperMap.GraduatedMode.CONSTANT]
  26951. * @description 统计图中地理要素的值与图表尺寸间的映射关系(常数、对数、平方根),即分级方式。
  26952. * 分级主要是为了减少制作统计专题图中数据大小之间的差异,使得统计图的视觉效果比较好,同时不同类别之间的比较也还是有意义的。
  26953. * 提供三种分级模式:常数、对数和平方根,对于有值为负数的字段,不可以采用对数和平方根的分级方式。不同的等级方式用于确定符号大小的数值是不相同的。
  26954. */
  26955. _this.graduatedMode = GraduatedMode.CONSTANT;
  26956. /**
  26957. * @member {SuperMap.ThemeGraphAxes} SuperMap.ThemeGraph.prototype.graphAxes
  26958. * @description 用于设置统计图中坐标轴样式相关信息,如坐标轴颜色、是否显示、坐标文本样式等。
  26959. */
  26960. _this.graphAxes = new ThemeGraphAxes_ThemeGraphAxes();
  26961. /**
  26962. * @member {SuperMap.ThemeGraphSize} [SuperMap.ThemeGraph.prototype.graphSize=0]
  26963. * @description 用于设置统计符号的最大最小尺寸。
  26964. */
  26965. _this.graphSize = new ThemeGraphSize_ThemeGraphSize();
  26966. /**
  26967. * @member {boolean} [SuperMap.ThemeGraph.prototype.graphSizeFixed=false]
  26968. * @description 缩放地图时统计图符号是否固定大小。即统计图符号将随地图缩放。
  26969. */
  26970. _this.graphSizeFixed = false;
  26971. /**
  26972. * @member {SuperMap.ThemeGraphText} SuperMap.ThemeGraph.prototype.graphText
  26973. * @description 统计图上的文字是否可以见以及文字标注风格。
  26974. */
  26975. _this.graphText = new ThemeGraphText_ThemeGraphText();
  26976. /**
  26977. * @member {SuperMap.ThemeGraphType} [SuperMap.ThemeGraph.prototype.graphType=SuperMap.ThemeGraphType.AREA]
  26978. * @description 统计专题图类型。SuperMap 提供了多种类型的统计图,
  26979. * 分别为面积图、阶梯图、折线图、点状图、柱状图、三维柱状图、饼图、三维饼图、玫瑰图、三维玫瑰图、堆叠柱状图、三维堆叠柱状图、环状图。默认为面积图。
  26980. */
  26981. _this.graphType = ThemeGraphType.AREA;
  26982. /**
  26983. * @member {SuperMap.GraphAxesTextDisplayMode} [SuperMap.ThemeGraph.prototype.graphAxesTextDisplayMode=SuperMap.GraphAxesTextDisplayMode.NONE]
  26984. * @description 统计专题图坐标轴文本显示模式。
  26985. */
  26986. _this.graphAxesTextDisplayMode = GraphAxesTextDisplayMode.NONE;
  26987. /**
  26988. * @member {Array.<SuperMap.ThemeGraphItem>} SuperMap.ThemeGraph.prototype.items
  26989. * @description 统计专题图子项集合。
  26990. * 统计专题图可以基于多个变量,反映多种属性,即可以将多个专题变量的值绘制在一个统计图上。每一个专题变量对应的统计图即为一个专题图子项。
  26991. * 对于每个专题图子项可以为其设置标题、风格,甚至可以将该子项再制作成范围分段专题图。
  26992. */
  26993. _this.items = null;
  26994. /**
  26995. * @member {Array.<number>} SuperMap.ThemeGraph.prototype.memoryKeys
  26996. * @description 以内存数组方式制作专题图时的键数组。
  26997. * 键数组内的数值代表 SmID 值,它与 SuperMap.ThemeGraphItem 类中的值数组(SuperMap.ThemeGraphItem.memoryDoubleValues)要关联起来应用。
  26998. * 键数组中数值的个数必须要与值数组的数值个数一致。值数组中的值将代替原来的专题值来制作统计专题图。
  26999. * 目前所有的专题图都支持以内存数组的方式制作专题图,但统计专题图与其他专题图指定内存数组的方式不同,
  27000. * 统计专题图使用 memoryKeys 指定内存数组,而其他专题图则使用 memoryData 来指定内存数组。
  27001. * @example
  27002. * memoryKeys 的使用方法如下:
  27003. * function addThemeGraph() {
  27004. * removeTheme();
  27005. * //创建统计专题图对象,SuperMap.ThemeGraph 必设 items。
  27006. * //专题图参数 ThemeParameters 必设 theme(即以设置好的分段专题图对象)、dataSourceName 和 datasetName
  27007. * var style1 = new SuperMap.ServerStyle({
  27008. * fillForeColor: new SuperMap.ServerColor(92,73,234),
  27009. * lineWidth: 0.1
  27010. * }),
  27011. * style2 = new SuperMap.ServerStyle({
  27012. * fillForeColor: new SuperMap.ServerColor(211,111,240),
  27013. * lineWidth: 0.1
  27014. * }),
  27015. * item1 = new SuperMap.ThemeGraphItem({
  27016. * memoryDoubleValues:[1.18,0.95,0.37,1.31,0.8,1.5],
  27017. * caption: "1992-1995人口增长率",
  27018. * graphExpression: "Pop_Rate95",
  27019. * uniformStyle: style1
  27020. * }),
  27021. * item2 = new SuperMap.ThemeGraphItem({
  27022. * //以内存数组方式制作专题图时的值数组
  27023. * memoryDoubleValues:[2.71,0,0.74,3.1,2.2,3.5],
  27024. * caption: "1995-1999人口增长率", //专题图子项的名称
  27025. * graphExpression: "Pop_Rate99", //统计专题图的专题变量
  27026. * uniformStyle: style2 //统计专题图子项的显示风格
  27027. * }),
  27028. * themeGraph = new SuperMap.ThemeGraph({
  27029. * //以内存数组方式制作专题图时的键数组,键数组内的数值代表 SmID 值
  27030. * memoryKeys:[1,2,4,8,10,12],
  27031. * items: new Array(item1,item2),
  27032. * barWidth: 0.03,
  27033. * //统计图中地理要素的值与图表尺寸间的映射关系为平方根
  27034. * graduatedMode: SuperMap.GraduatedMode.SQUAREROOT,
  27035. * //graphAxes用于设置统计图中坐标轴样式相关信息
  27036. * graphAxes: new SuperMap.ThemeGraphAxes({
  27037. * axesDisplayed: true
  27038. * }),
  27039. * graphSize: new SuperMap.ThemeGraphSize({
  27040. * maxGraphSize: 1,
  27041. * minGraphSize: 0.35
  27042. * }),
  27043. * //统计图上的文字是否可以见以及文字标注风格
  27044. * graphText: new SuperMap.ThemeGraphText({
  27045. * graphTextDisplayed: true,
  27046. * graphTextFormat: SuperMap.ThemeGraphTextFormat.VALUE,
  27047. * graphTextStyle: new SuperMap.ServerTextStyle({
  27048. * sizeFixed: true,
  27049. * fontHeight: 9,
  27050. * fontWidth: 5
  27051. * })
  27052. * }),
  27053. * //统计专题图类型为三维柱状图
  27054. * graphType: SuperMap.ThemeGraphType.BAR3D
  27055. * }),
  27056. * //专题图参数对象
  27057. * themeParameters = new SuperMap.ThemeParameters({
  27058. * themes: [themeGraph],
  27059. * dataSourceNames: ["Jingjin"],
  27060. * datasetNames: ["BaseMap_R"]
  27061. * }),
  27062. * //与服务端交互
  27063. * themeService=new SuperMap.ThemeService(url, {
  27064. * eventListeners: {
  27065. * "processCompleted": ThemeCompleted,
  27066. * "processFailed": themeFailed
  27067. * }
  27068. * });
  27069. * themeService.processAsync(themeParameters);
  27070. * }
  27071. */
  27072. _this.memoryKeys = null;
  27073. /**
  27074. * @member {boolean} [SuperMap.ThemeGraph.prototype.negativeDisplayed=false]
  27075. * @description 专题图中是否显示属性为负值的数据。true 表示显示;falese 不显示。
  27076. */
  27077. _this.negativeDisplayed = false;
  27078. /**
  27079. * @member {SuperMap.ThemeOffset} SuperMap.ThemeGraph.prototype.offset
  27080. * @description 用于设置统计图相对于要素内点的偏移量。
  27081. */
  27082. _this.offset = new ThemeOffset_ThemeOffset();
  27083. /**
  27084. * @member {boolean} SuperMap.ThemeGraph.prototype.overlapAvoided
  27085. * @description 统计图是否采用避让方式显示。<br>
  27086. * 1.对数据集制作统计专题图:当统计图采用避让方式显示时,如果 overlapAvoided 为 true,则在统计图重叠度很大的情况下,
  27087. * 会出现无法完全避免统计图重叠的现象;如果 overlapAvoided 为 false,会过滤掉一些统计图,从而保证所有的统计图均不重叠。<br>
  27088. * 2.对数据集同时制作统计专题图和标签专题图:当统计图不显示子项文本时,标签专题图的标签即使和统计图重叠,两者也都可正常显示;
  27089. * 当统计图显示子项文本时,如果统计图中的子项文本和标签专题图中的标签不重叠,则两者均正常显示;如果重叠,则会过滤掉统计图的子项文本,只显示标签。
  27090. */
  27091. _this.overlapAvoided = true;
  27092. /**
  27093. * @member {number} [SuperMap.ThemeGraph.prototype.roseAngle=0]
  27094. * @description 统计图中玫瑰图或三维玫瑰图用于等分的角度,默认为 0 度,精确到 0.1 度。在角度为0或者大于 360 度的情况下均使用 360 度来等分制作统计图的字段数。
  27095. */
  27096. _this.roseAngle = 0;
  27097. /**
  27098. * @member {number} [SuperMap.ThemeGraph.prototype.startAngle=0]
  27099. * @description 饼状统计图扇形的起始角度。精确到 0.1 度,以水平方向为正向。只有选择的统计图类型为饼状图(饼图、三维饼图、玫瑰图、三维玫瑰图)时,此项才可设置。
  27100. */
  27101. _this.startAngle = 0;
  27102. if (options) {
  27103. Util_Util.extend(ThemeGraph_assertThisInitialized(_this), options);
  27104. }
  27105. _this.CLASS_NAME = "SuperMap.ThemeGraph";
  27106. return _this;
  27107. }
  27108. /**
  27109. * @function SuperMap.ThemeGraph.prototype.destroy
  27110. * @override
  27111. */
  27112. ThemeGraph_createClass(ThemeGraph, [{
  27113. key: "destroy",
  27114. value: function destroy() {
  27115. ThemeGraph_get(ThemeGraph_getPrototypeOf(ThemeGraph.prototype), "destroy", this).call(this);
  27116. var me = this;
  27117. me.barWidth = null;
  27118. if (me.flow) {
  27119. me.flow.destroy();
  27120. me.flow = null;
  27121. }
  27122. me.graduatedMode = null;
  27123. if (me.graphAxes) {
  27124. me.graphAxes.destroy();
  27125. me.graphAxes = null;
  27126. }
  27127. if (me.graphSize) {
  27128. me.graphSize.destroy();
  27129. me.graphSize = null;
  27130. }
  27131. me.graphSizeFixed = null;
  27132. if (me.graphText) {
  27133. me.graphText.destroy();
  27134. me.graphText = null;
  27135. }
  27136. me.graphType = null;
  27137. if (me.items) {
  27138. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  27139. items[i].destroy();
  27140. }
  27141. me.items = null;
  27142. }
  27143. me.memoryKeys = null;
  27144. me.negativeDisplayed = null;
  27145. if (me.offset) {
  27146. me.offset.destroy();
  27147. me.offset = null;
  27148. }
  27149. me.overlapAvoided = null;
  27150. me.roseAngle = null;
  27151. me.startAngle = null;
  27152. me.graphAxesTextDisplayMode = null;
  27153. }
  27154. /**
  27155. * @function SuperMap.ThemeGraph.prototype.toJSON
  27156. * @description 将 SuperMap.ThemeGraph 对象转化为 JSON 字符串。
  27157. * @returns {string} 返回转换后的 JSON 字符串。
  27158. */
  27159. }, {
  27160. key: "toJSON",
  27161. value: function toJSON() {
  27162. return Util_Util.toJSON(this.toServerJSONObject());
  27163. }
  27164. /**
  27165. * @function SuperMap.ThemeGraph.prototype.toServerJSONObject
  27166. * @description 转换成对应的 JSON 格式对象。
  27167. * @returns {Object} 对应的 JSON 格式对象。
  27168. */
  27169. }, {
  27170. key: "toServerJSONObject",
  27171. value: function toServerJSONObject() {
  27172. var obj = {};
  27173. obj.type = this.type;
  27174. if (this.graphText) {
  27175. obj.graphTextDisplayed = this.graphText.graphTextDisplayed;
  27176. obj.graphTextFormat = this.graphText.graphTextFormat;
  27177. obj.graphTextStyle = this.graphText.graphTextStyle;
  27178. }
  27179. if (this.flow) {
  27180. obj.flowEnabled = this.flow.flowEnabled;
  27181. obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
  27182. obj.leaderLineStyle = this.flow.leaderLineStyle;
  27183. }
  27184. if (this.graphAxes) {
  27185. obj.axesColor = this.graphAxes.axesColor;
  27186. obj.axesDisplayed = this.graphAxes.axesDisplayed;
  27187. obj.axesGridDisplayed = this.graphAxes.axesGridDisplayed;
  27188. obj.axesTextDisplayed = this.graphAxes.axesTextDisplayed;
  27189. obj.axesTextStyle = this.graphAxes.axesTextStyle;
  27190. }
  27191. if (this.graphSize) {
  27192. obj.maxGraphSize = this.graphSize.maxGraphSize;
  27193. obj.minGraphSize = this.graphSize.minGraphSize;
  27194. }
  27195. if (this.offset) {
  27196. obj.offsetFixed = this.offset.offsetFixed;
  27197. obj.offsetX = this.offset.offsetX;
  27198. obj.offsetY = this.offset.offsetY;
  27199. }
  27200. obj.barWidth = this.barWidth;
  27201. obj.graduatedMode = this.graduatedMode;
  27202. obj.graphSizeFixed = this.graphSizeFixed;
  27203. obj.graphType = this.graphType;
  27204. obj.graphAxesTextDisplayMode = this.graphAxesTextDisplayMode;
  27205. obj.items = this.items;
  27206. obj.memoryKeys = this.memoryKeys;
  27207. obj.negativeDisplayed = this.negativeDisplayed;
  27208. obj.overlapAvoided = this.overlapAvoided;
  27209. obj.roseAngle = this.roseAngle;
  27210. obj.startAngle = this.startAngle;
  27211. return obj;
  27212. }
  27213. /**
  27214. * @function SuperMap.ThemeGraph.fromObj
  27215. * @description 从传入对象获取统计专题图类。
  27216. * @param {Object} obj - 传入对象。
  27217. * @returns {SuperMap.ThemeGraph} ThemeGraph 对象。
  27218. */
  27219. }], [{
  27220. key: "fromObj",
  27221. value: function fromObj(obj) {
  27222. var res = new ThemeGraph();
  27223. var itemsG = obj.items;
  27224. var len = itemsG ? itemsG.length : 0;
  27225. Util_Util.copy(res, obj);
  27226. res.items = [];
  27227. res.flow = ThemeFlow_ThemeFlow.fromObj(obj);
  27228. res.graphAxes = ThemeGraphAxes_ThemeGraphAxes.fromObj(obj);
  27229. res.graphSize = ThemeGraphSize_ThemeGraphSize.fromObj(obj);
  27230. res.graphText = ThemeGraphText_ThemeGraphText.fromObj(obj);
  27231. res.offset = ThemeOffset_ThemeOffset.fromObj(obj);
  27232. for (var i = 0; i < len; i++) {
  27233. res.items.push(ThemeGraphItem_ThemeGraphItem.fromObj(itemsG[i]));
  27234. }
  27235. return res;
  27236. }
  27237. }]);
  27238. return ThemeGraph;
  27239. }(Theme_Theme);
  27240. SuperMap.ThemeGraph = ThemeGraph_ThemeGraph;
  27241. // CONCATENATED MODULE: ./src/common/iServer/ThemeDotDensity.js
  27242. 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); }
  27243. function ThemeDotDensity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27244. 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); } }
  27245. function ThemeDotDensity_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeDotDensity_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeDotDensity_defineProperties(Constructor, staticProps); return Constructor; }
  27246. 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); }
  27247. function ThemeDotDensity_setPrototypeOf(o, p) { ThemeDotDensity_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeDotDensity_setPrototypeOf(o, p); }
  27248. 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); }; }
  27249. function ThemeDotDensity_possibleConstructorReturn(self, call) { if (call && (ThemeDotDensity_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeDotDensity_assertThisInitialized(self); }
  27250. function ThemeDotDensity_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27251. 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; } }
  27252. function ThemeDotDensity_getPrototypeOf(o) { ThemeDotDensity_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeDotDensity_getPrototypeOf(o); }
  27253. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  27254. * This program are made available under the terms of the Apache License, Version 2.0
  27255. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27256. /**
  27257. * @class SuperMap.ThemeDotDensity
  27258. * @category iServer Map Theme
  27259. * @classdesc 点密度专题图。
  27260. * @description 点密度专题图用一定大小、形状相同的点表示现象分布范围、数量特征和分布密度。点的多少和所代表的意义由地图的内容确定。
  27261. * 点密度专题图利用图层的某一数值属性信息(专题值)映射为不同等级,每一级别使用不同数量或表现为密度的点符号来表示。
  27262. * 该专题值在各个分区内的分布情况,体现不同区域的相对数量差异。多用于具有数量特征的地图上,
  27263. * 比如表示不同地区的粮食产量、GDP、人口等的分级,主要针对区域或面状的要素,因而,点密度专题图适用于面数据集。
  27264. * 注意:点密度专题图中点的分布是随机的,并不代表实际的分布位置。即使在相关设置完全相同的情况下,
  27265. * 每次制作出的专题图,点的数量相同,但点的位置都有差异。
  27266. * @extends {SuperMap.Theme}
  27267. * @param {Object} options - 参数。
  27268. * @param {string} options.dotExpression - 创建点密度专题图的字段或字段表达式。
  27269. * @param {SuperMap.ServerStyle} [options.style] - 点密度专题图中点的风格。
  27270. * @param {number} [options.value] - 专题图中每一个点所代表的数值。
  27271. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  27272. */
  27273. var ThemeDotDensity_ThemeDotDensity = /*#__PURE__*/function (_Theme) {
  27274. ThemeDotDensity_inherits(ThemeDotDensity, _Theme);
  27275. var _super = ThemeDotDensity_createSuper(ThemeDotDensity);
  27276. function ThemeDotDensity(options) {
  27277. var _this;
  27278. ThemeDotDensity_classCallCheck(this, ThemeDotDensity);
  27279. _this = _super.call(this, "DOTDENSITY", options);
  27280. /**
  27281. * @member {string} SuperMap.ThemeDotDensity.prototype.dotExpression
  27282. * @description 创建点密度专题图的字段或字段表达式。点的数目或密集程度的来源。
  27283. */
  27284. _this.dotExpression = null;
  27285. /**
  27286. * @member {SuperMap.ServerStyle} SuperMap.ThemeDotDensity.prototype.style
  27287. * @description 点密度专题图中点的风格。
  27288. */
  27289. _this.style = new ServerStyle_ServerStyle();
  27290. /**
  27291. * @member {number} SuperMap.ThemeDotDensity.prototype.value
  27292. * @description 专题图中每一个点所代表的数值。<br>
  27293. * 点值的确定与地图比例尺以及点的大小有关。地图比例尺越大,相应的图面范围也越大,
  27294. * 点相应就可以越多,此时点值就可以设置相对小一些。点形状越大,
  27295. * 点值相应就应该设置的小一些。点值过大或过小都是不合适的。
  27296. */
  27297. _this.value = null;
  27298. if (options) {
  27299. Util_Util.extend(ThemeDotDensity_assertThisInitialized(_this), options);
  27300. }
  27301. _this.CLASS_NAME = "SuperMap.ThemeDotDensity";
  27302. return _this;
  27303. }
  27304. /**
  27305. * @function SuperMap.ThemeDotDensity.prototype.destroy
  27306. * @description 释放资源,将引用资源的属性置空。
  27307. */
  27308. ThemeDotDensity_createClass(ThemeDotDensity, [{
  27309. key: "destroy",
  27310. value: function destroy() {
  27311. var me = this;
  27312. me.dotExpression = null;
  27313. me.value = null;
  27314. if (me.style) {
  27315. me.style.destroy();
  27316. me.style = null;
  27317. }
  27318. }
  27319. /**
  27320. * @function SuperMap.ThemeDotDensity.prototype.toServerJSONObject
  27321. * @description 转换成对应的 JSON 格式对象。
  27322. * @returns {Object} 对应的 JSON 格式对象。
  27323. */
  27324. }, {
  27325. key: "toServerJSONObject",
  27326. value: function toServerJSONObject() {
  27327. var obj = {};
  27328. obj = Util_Util.copyAttributes(obj, this);
  27329. if (obj.style) {
  27330. if (obj.style.toServerJSONObject) {
  27331. obj.style = obj.style.toServerJSONObject();
  27332. }
  27333. }
  27334. return obj;
  27335. }
  27336. /**
  27337. * @function SuperMap.ThemeDotDensity.fromObj
  27338. * @description 从传入对象获取点密度专题图中点的风格。
  27339. * @param {Object} obj - 传入对象。
  27340. * @returns {SuperMap.ThemeDotDensity} ThemeDotDensity 对象。
  27341. */
  27342. }], [{
  27343. key: "fromObj",
  27344. value: function fromObj(obj) {
  27345. if (!obj) {
  27346. return;
  27347. }
  27348. var res = new ThemeDotDensity();
  27349. Util_Util.copy(res, obj);
  27350. res.style = ServerStyle_ServerStyle.fromJson(obj.style);
  27351. return res;
  27352. }
  27353. }]);
  27354. return ThemeDotDensity;
  27355. }(Theme_Theme);
  27356. SuperMap.ThemeDotDensity = ThemeDotDensity_ThemeDotDensity;
  27357. // CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbolStyle.js
  27358. function ThemeGraduatedSymbolStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27359. 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); } }
  27360. function ThemeGraduatedSymbolStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor, staticProps); return Constructor; }
  27361. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  27362. * This program are made available under the terms of the Apache License, Version 2.0
  27363. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27364. /**
  27365. * @class SuperMap.ThemeGraduatedSymbolStyle
  27366. * @category iServer Map Theme
  27367. * @classdesc 等级符号专题图正负零值显示风格类。
  27368. * @param {Object} options - 参数。
  27369. * @param {boolean} [options.negativeDisplayed=false] - 是否显示负值。
  27370. * @param {SuperMap.ServerStyle} [options.negativeStyle] - 负值的等级符号风格。
  27371. * @param {SuperMap.ServerStyle} [options.positiveStyle] - 正值的等级符号风格。
  27372. * @param {boolean} [options.zeroDisplayed=false] - 是否显示 0 值。
  27373. * @param {SuperMap.ServerStyle} [options.zeroStyle] - 0 值的等级符号风格。
  27374. */
  27375. var ThemeGraduatedSymbolStyle_ThemeGraduatedSymbolStyle = /*#__PURE__*/function () {
  27376. function ThemeGraduatedSymbolStyle(options) {
  27377. ThemeGraduatedSymbolStyle_classCallCheck(this, ThemeGraduatedSymbolStyle);
  27378. /**
  27379. * @member {boolean} [SuperMap.ThemeGraduatedSymbolStyle.prototype.negativeDisplayed=false]
  27380. * @description 是否显示负值。
  27381. */
  27382. this.negativeDisplayed = false;
  27383. /**
  27384. * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraduatedSymbolStyle.prototype.negativeStyle]
  27385. * @description 负值的等级符号风格。
  27386. */
  27387. this.negativeStyle = new ServerStyle_ServerStyle();
  27388. /**
  27389. * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraduatedSymbolStyle.prototype.positiveStyle]
  27390. * @description 正值的等级符号风格。
  27391. */
  27392. this.positiveStyle = new ServerStyle_ServerStyle();
  27393. /**
  27394. * @member {boolean} [SuperMap.ThemeGraduatedSymbolStyle.prototype.zeroDisplayed=false]
  27395. * @description 是否显示 0 值。
  27396. */
  27397. this.zeroDisplayed = false;
  27398. /**
  27399. * @member {SuperMap.ServerStyle} SuperMap.ThemeGraduatedSymbolStyle.prototype.zeroStyle
  27400. * @description 0 值的等级符号风格。
  27401. */
  27402. this.zeroStyle = new ServerStyle_ServerStyle();
  27403. if (options) {
  27404. Util_Util.extend(this, options);
  27405. }
  27406. this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbolStyle";
  27407. }
  27408. /**
  27409. * @function SuperMap.ThemeGraduatedSymbolStyle.prototype.destroy
  27410. * @description 释放资源,将引用资源的属性置空。
  27411. */
  27412. ThemeGraduatedSymbolStyle_createClass(ThemeGraduatedSymbolStyle, [{
  27413. key: "destroy",
  27414. value: function destroy() {
  27415. var me = this;
  27416. me.negativeDisplayed = null;
  27417. me.negativeStyle = null;
  27418. me.positiveStyle = null;
  27419. me.zeroDisplayed = null;
  27420. me.zeroStyle = null;
  27421. }
  27422. /**
  27423. * @function SuperMap.ThemeGraduatedSymbolStyle.fromObj
  27424. * @description 从传入对象获取等级符号专题图正负零值显示风格类。
  27425. * @param {Object} obj - 传入对象。
  27426. * @returns {SuperMap.ThemeGraduatedSymbolStyle} ThemeGraduatedSymbolStyle 对象。
  27427. */
  27428. }], [{
  27429. key: "fromObj",
  27430. value: function fromObj(obj) {
  27431. if (!obj) {
  27432. return;
  27433. }
  27434. var res = new ThemeGraduatedSymbolStyle();
  27435. Util_Util.copy(res, obj);
  27436. res.negativeStyle = ServerStyle_ServerStyle.fromJson(obj.negativeStyle);
  27437. res.positiveStyle = ServerStyle_ServerStyle.fromJson(obj.positiveStyle);
  27438. res.zeroStyle = ServerStyle_ServerStyle.fromJson(obj.zeroStyle);
  27439. return res;
  27440. }
  27441. }]);
  27442. return ThemeGraduatedSymbolStyle;
  27443. }();
  27444. SuperMap.ThemeGraduatedSymbolStyle = ThemeGraduatedSymbolStyle_ThemeGraduatedSymbolStyle;
  27445. // CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbol.js
  27446. 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); }
  27447. function ThemeGraduatedSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27448. 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); } }
  27449. function ThemeGraduatedSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbol_defineProperties(Constructor, staticProps); return Constructor; }
  27450. 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); }
  27451. function ThemeGraduatedSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraduatedSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  27452. 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); }
  27453. function ThemeGraduatedSymbol_setPrototypeOf(o, p) { ThemeGraduatedSymbol_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraduatedSymbol_setPrototypeOf(o, p); }
  27454. 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); }; }
  27455. function ThemeGraduatedSymbol_possibleConstructorReturn(self, call) { if (call && (ThemeGraduatedSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGraduatedSymbol_assertThisInitialized(self); }
  27456. function ThemeGraduatedSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27457. 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; } }
  27458. function ThemeGraduatedSymbol_getPrototypeOf(o) { ThemeGraduatedSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraduatedSymbol_getPrototypeOf(o); }
  27459. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  27460. * This program are made available under the terms of the Apache License, Version 2.0
  27461. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27462. /**
  27463. * @class SuperMap.ThemeGraduatedSymbol
  27464. * @category iServer Map Theme
  27465. * @classdesc 等级符号专题图。
  27466. * @extends {SuperMap.Theme}
  27467. * @param {Object} options - 参数。
  27468. * @param {SuperMap.ThemeGraduatedSymbolStyle} options.style - 用于设置等级符号图正负和零值显示风格。
  27469. * @param {string} options.expression - 等级符号专题图的字段或字段表达式。
  27470. * @param {number} [options.baseValue=0] - 等级符号专题图的基准值,单位同专题变量的单位。
  27471. * @param {SuperMap.ThemeFlow} [options.flow] - 等级符号专题图符号流动显示与牵引线设置类。
  27472. * @param {SuperMap.GraduatedMode} [options.graduatedMode=SuperMap.GraduatedMode.CONSTANT] - 等级符号专题图分级模式。
  27473. * @param {SuperMap.ThemeOffset} [options.offset] - 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  27474. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  27475. */
  27476. var ThemeGraduatedSymbol_ThemeGraduatedSymbol = /*#__PURE__*/function (_Theme) {
  27477. ThemeGraduatedSymbol_inherits(ThemeGraduatedSymbol, _Theme);
  27478. var _super = ThemeGraduatedSymbol_createSuper(ThemeGraduatedSymbol);
  27479. function ThemeGraduatedSymbol(options) {
  27480. var _this;
  27481. ThemeGraduatedSymbol_classCallCheck(this, ThemeGraduatedSymbol);
  27482. _this = _super.call(this, "GRADUATEDSYMBOL", options);
  27483. /**
  27484. * @member {number} [SuperMap.ThemeGraduatedSymbol.prototype.baseValue=0]
  27485. * @description 等级符号专题图的基准值,单位同专题变量的单位。<br>
  27486. * 依据此值系统会自动根据分级方式计算其余值对应的符号大小,每个符号的显示大小等于
  27487. * ThemeValueSection.positiveStyle(或 zeroStyle,negativeStyle).markerSize * value / basevalue,
  27488. * 其中 value 是 expression 所指定字段对应的值经过分级计算之后的值。默认值为0,建议通过多次尝试设置该值才能达到较好的显示效果。
  27489. */
  27490. _this.baseValue = 0;
  27491. /**
  27492. * @member {string} SuperMap.ThemeGraduatedSymbol.prototype.expression
  27493. * @description 用于创建等级符号专题图的字段或字段表达式,字段或字段表达式应为数值型。
  27494. */
  27495. _this.expression = null;
  27496. /**
  27497. * @member {SuperMap.ThemeFlow} SuperMap.ThemeGraduatedSymbol.prototype.flow
  27498. * @description 等级符号专题图符号流动显示与牵引线设置类。<br>
  27499. * 通过该字段可以设置等级符号是否流动显示和牵引线风格。
  27500. */
  27501. _this.flow = new ThemeFlow_ThemeFlow();
  27502. /**
  27503. * @member {SuperMap.GraduatedMode} [SuperMap.ThemeGraduatedSymbol.prototype.graduatedMode=SuperMap.GraduatedMode.CONSTANT]
  27504. * @description 等级符号专题图分级模式。<br>
  27505. * 分级主要是为了减少制作等级符号专题图中数据大小之间的差异。如果数据之间差距较大,则可以采用对数或者平方根的分级方式来进行,
  27506. * 这样就减少了数据之间的绝对大小的差异,使得等级符号图的视觉效果比较好,同时不同类别之间的比较也是有意义的。
  27507. * 有三种分级模式:常数、对数和平方根,对于有值为负数的字段,在用对数或平方根方式分级时,默认对负数取正。
  27508. * 不同的分级模式用于确定符号大小的数值是不相同的:常数按照字段的原始数据进行;对数则是对每条记录对应的专题变量取自然对数;
  27509. * 平方根则是对其取平方根,然后用最终得到的结果来确定其等级符号的大小。
  27510. */
  27511. _this.graduatedMode = SuperMap.GraduatedMode.CONSTAN;
  27512. /**
  27513. * @member {SuperMap.ThemeOffset} [SuperMap.ThemeGraduatedSymbol.prototype.offset]
  27514. * @description 用于设置等级符号图相对于要素内点的偏移量。
  27515. */
  27516. _this.offset = new ThemeOffset_ThemeOffset();
  27517. /**
  27518. * @member {SuperMap.ThemeGraduatedSymbolStyle} SuperMap.ThemeGraduatedSymbol.prototype.style
  27519. * @description 用于设置等级符号图正负和零值显示风格。
  27520. */
  27521. _this.style = new ThemeGraduatedSymbolStyle_ThemeGraduatedSymbolStyle();
  27522. if (options) {
  27523. Util_Util.extend(ThemeGraduatedSymbol_assertThisInitialized(_this), options);
  27524. }
  27525. _this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbol";
  27526. return _this;
  27527. }
  27528. /**
  27529. * @function SuperMap.ThemeGraduatedSymbol.prototype.destroy
  27530. * @description 释放资源,将引用资源的属性置空。
  27531. */
  27532. ThemeGraduatedSymbol_createClass(ThemeGraduatedSymbol, [{
  27533. key: "destroy",
  27534. value: function destroy() {
  27535. ThemeGraduatedSymbol_get(ThemeGraduatedSymbol_getPrototypeOf(ThemeGraduatedSymbol.prototype), "destroy", this).call(this);
  27536. var me = this;
  27537. me.expression = null;
  27538. if (me.flow) {
  27539. me.flow.destroy();
  27540. me.flow = null;
  27541. }
  27542. me.graduatedMode = GraduatedMode.CONSTANT;
  27543. if (me.offset) {
  27544. me.offset.destroy();
  27545. me.offset = null;
  27546. }
  27547. if (me.style) {
  27548. me.style.destroy();
  27549. me.style = null;
  27550. }
  27551. }
  27552. /**
  27553. * @function SuperMap.ThemeGraduatedSymbol.prototype.toJSON
  27554. * @description 将 themeLabel 对象转化为 JSON 字符串。
  27555. * @returns {string} 返回转换后的 JSON 字符串。
  27556. */
  27557. }, {
  27558. key: "toJSON",
  27559. value: function toJSON() {
  27560. return Util_Util.toJSON(this.toServerJSONObject());
  27561. }
  27562. /**
  27563. * @function SuperMap.ThemeGraduatedSymbol.prototype.toServerJSONObject
  27564. * @description 转换成对应的 JSON 格式对象。
  27565. * @returns {Object} 对应的 JSON 格式对象。
  27566. */
  27567. }, {
  27568. key: "toServerJSONObject",
  27569. value: function toServerJSONObject() {
  27570. var obj = {};
  27571. obj.type = this.type;
  27572. obj.memoryData = this.memoryData;
  27573. obj.baseValue = this.baseValue;
  27574. obj.expression = this.expression;
  27575. obj.graduatedMode = this.graduatedMode;
  27576. if (this.flow) {
  27577. obj.flowEnabled = this.flow.flowEnabled;
  27578. obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
  27579. obj.leaderLineStyle = this.flow.leaderLineStyle;
  27580. }
  27581. if (this.offset) {
  27582. obj.offsetFixed = this.offset.offsetFixed;
  27583. obj.offsetX = this.offset.offsetX;
  27584. obj.offsetY = this.offset.offsetY;
  27585. }
  27586. if (this.style) {
  27587. obj.negativeStyle = this.style.negativeStyle;
  27588. obj.negativeDisplayed = this.style.negativeDisplayed;
  27589. obj.positiveStyle = this.style.positiveStyle;
  27590. obj.zeroDisplayed = this.style.zeroDisplayed;
  27591. obj.zeroStyle = this.style.zeroStyle;
  27592. }
  27593. return obj;
  27594. }
  27595. /**
  27596. * @function SuperMap.ThemeGraduatedSymbol.fromObj
  27597. * @description 从传入对象获取等级符号专题图。
  27598. * @param {Object} obj - 传入对象。
  27599. * @returns {SuperMap.ThemeGraduatedSymbol} 等级符号专题图对象。
  27600. */
  27601. }], [{
  27602. key: "fromObj",
  27603. value: function fromObj(obj) {
  27604. if (!obj) {
  27605. return;
  27606. }
  27607. var res = new SuperMap.ThemeGraduatedSymbol();
  27608. Util_Util.copy(res, obj);
  27609. res.flow = ThemeFlow_ThemeFlow.fromObj(obj);
  27610. res.offset = ThemeOffset_ThemeOffset.fromObj(obj);
  27611. res.style = ThemeGraduatedSymbolStyle_ThemeGraduatedSymbolStyle.fromObj(obj);
  27612. return res;
  27613. }
  27614. }]);
  27615. return ThemeGraduatedSymbol;
  27616. }(Theme_Theme);
  27617. SuperMap.ThemeGraduatedSymbol = ThemeGraduatedSymbol_ThemeGraduatedSymbol;
  27618. // CONCATENATED MODULE: ./src/common/iServer/ThemeRangeItem.js
  27619. function ThemeRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27620. 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); } }
  27621. function ThemeRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRangeItem_defineProperties(Constructor, staticProps); return Constructor; }
  27622. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  27623. * This program are made available under the terms of the Apache License, Version 2.0
  27624. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27625. /**
  27626. * @class SuperMap.ThemeRangeItem
  27627. * @category iServer Map Theme
  27628. * @classdesc 范围分段专题图子项类。
  27629. * @description 在分段专题图中,字段值按照某种分段模式被分成多个范围段,每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  27630. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为[start, end)。
  27631. * @param {Object} options - 参数。
  27632. * @param {string} [options.caption] - 分段专题图子项的标题。
  27633. * @param {number} [options.end=0] - 分段专题图子项的终止值。
  27634. * @param {number} [options.start=0] - 分段专题图子项的起始值。
  27635. * @param {SuperMap.ServerStyle} options.style - 分段专题图子项的风格。
  27636. * @param {boolean} [options.visible=true] - 分段专题图子项是否可见。
  27637. */
  27638. var ThemeRangeItem_ThemeRangeItem = /*#__PURE__*/function () {
  27639. function ThemeRangeItem(options) {
  27640. ThemeRangeItem_classCallCheck(this, ThemeRangeItem);
  27641. /**
  27642. * @member {string} [SuperMap.ThemeRangeItem.prototype.caption]
  27643. * @description 分段专题图子项的标题。
  27644. */
  27645. this.caption = null;
  27646. /**
  27647. * @member {number} [SuperMap.ThemeRangeItem.prototype.end=0]
  27648. * @description 分段专题图子项的终止值,即该段专题值范围的最大值。<br>
  27649. * 如果该子项是分段中最后一个子项,则该终止值应大于分段字段(ThemeRange 类的 rangeExpression 属性)的最大值,若该终止值小于分段字段最大值,
  27650. * 则剩余部分由内部随机定义其颜色;如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常;
  27651. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  27652. */
  27653. this.end = 0;
  27654. /**
  27655. * @member {number} [SuperMap.ThemeRangeItem.prototype.start=0]
  27656. * @description 分段专题图子项的起始值,即该段专题值范围的最小值。<br>
  27657. * 如果该子项是分段中第一个子项,那么该起始值就是分段的最小值;如果子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  27658. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  27659. */
  27660. this.start = 0;
  27661. /**
  27662. * @member {SuperMap.ServerStyle} SuperMap.ThemeRangeItem.prototype.style
  27663. * @description 分段专题图子项的风格。
  27664. * 每一个分段专题图子项都对应一种显示风格。
  27665. */
  27666. this.style = new ServerStyle_ServerStyle();
  27667. /**
  27668. * @member {boolean} [SuperMap.ThemeRangeItem.prototype.visible=true]
  27669. * @description 分段专题图子项是否可见。
  27670. */
  27671. this.visible = true;
  27672. if (options) {
  27673. Util_Util.extend(this, options);
  27674. }
  27675. this.CLASS_NAME = "SuperMap.ThemeRangeItem";
  27676. }
  27677. /**
  27678. * @function SuperMap.ThemeRangeItem.prototype.destroy
  27679. * @description 释放资源,将引用资源的属性置空。
  27680. */
  27681. ThemeRangeItem_createClass(ThemeRangeItem, [{
  27682. key: "destroy",
  27683. value: function destroy() {
  27684. var me = this;
  27685. me.caption = null;
  27686. me.end = null;
  27687. me.start = null;
  27688. if (me.style) {
  27689. me.style.destroy();
  27690. me.style = null;
  27691. }
  27692. me.visible = null;
  27693. }
  27694. /**
  27695. * @function SuperMap.ThemeRangeItem.prototypetoServerJSONObject
  27696. * @description 转换成对应的 JSON 格式对象。
  27697. * @returns {Object} 对应的 JSON 格式对象。
  27698. */
  27699. }, {
  27700. key: "toServerJSONObject",
  27701. value: function toServerJSONObject() {
  27702. var obj = {};
  27703. obj = Util_Util.copyAttributes(obj, this);
  27704. if (obj.style) {
  27705. if (obj.style.toServerJSONObject) {
  27706. obj.style = obj.style.toServerJSONObject();
  27707. }
  27708. }
  27709. return obj;
  27710. }
  27711. /**
  27712. * @function SuperMap.ThemeRangeItem.fromObj
  27713. * @description 从传入对象获取范围分段专题图子项类。
  27714. * @param {Object} obj - 传入对象。
  27715. * @returns {SuperMap.ThemeRangeItem} ThemeRangeItem 对象。
  27716. */
  27717. }], [{
  27718. key: "fromObj",
  27719. value: function fromObj(obj) {
  27720. if (!obj) {
  27721. return;
  27722. }
  27723. var res = new ThemeRangeItem();
  27724. Util_Util.copy(res, obj);
  27725. res.style = ServerStyle_ServerStyle.fromJson(obj.style);
  27726. return res;
  27727. }
  27728. }]);
  27729. return ThemeRangeItem;
  27730. }();
  27731. SuperMap.ThemeRangeItem = ThemeRangeItem_ThemeRangeItem;
  27732. // CONCATENATED MODULE: ./src/common/iServer/ThemeRange.js
  27733. 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); }
  27734. function ThemeRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27735. 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); } }
  27736. function ThemeRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRange_defineProperties(Constructor, staticProps); return Constructor; }
  27737. 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); }
  27738. function ThemeRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeRange_getPrototypeOf(object); if (object === null) break; } return object; }
  27739. 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); }
  27740. function ThemeRange_setPrototypeOf(o, p) { ThemeRange_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeRange_setPrototypeOf(o, p); }
  27741. 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); }; }
  27742. function ThemeRange_possibleConstructorReturn(self, call) { if (call && (ThemeRange_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeRange_assertThisInitialized(self); }
  27743. function ThemeRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27744. 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; } }
  27745. function ThemeRange_getPrototypeOf(o) { ThemeRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeRange_getPrototypeOf(o); }
  27746. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  27747. * This program are made available under the terms of the Apache License, Version 2.0
  27748. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27749. /**
  27750. * @class SuperMap.ThemeRange
  27751. * @category iServer Map Theme
  27752. * @classdesc 范围分段专题图。
  27753. * @description 范围分段专题图是按照指定的分段方法(如:等距离分段法)对字段的属性值进行分段,使用不同的颜色或符号(线型、填充)表示不同范围段落的属性值在整体上的分布情况,体现区域的差异。
  27754. * 在分段专题图中,专题值按照某种分段方式被分成多个范围段,要素根据各自的专题值被分配到其中一个范围段中,在同一个范围段中的要素使用相同的颜色,填充,符号等风格进行显示。
  27755. * 分段专题图所基于的专题变量必须为数值型,分段专题图一般用来反映连续分布现象的数量或程度特征,如降水量的分布,土壤侵蚀强度的分布等。
  27756. * @extends {SuperMap.Theme}
  27757. * @param {Object} options - 参数。
  27758. * @param {Array.<SuperMap.ThemeRangeItem>} options.items - 分段专题图子项数组。
  27759. * @param {string} options.rangeExpression - 分段字段表达式。
  27760. * @param {number} options.rangeParameter - 分段参数。
  27761. * @param {number} options.rangeParameter - 分段参数。
  27762. * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 分段专题图的分段模式。
  27763. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  27764. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  27765. */
  27766. var ThemeRange_ThemeRange = /*#__PURE__*/function (_Theme) {
  27767. ThemeRange_inherits(ThemeRange, _Theme);
  27768. var _super = ThemeRange_createSuper(ThemeRange);
  27769. function ThemeRange(options) {
  27770. var _this;
  27771. ThemeRange_classCallCheck(this, ThemeRange);
  27772. _this = _super.call(this, "RANGE", options);
  27773. /**
  27774. * @member {string} SuperMap.ThemeRange.prototype.precision
  27775. * @description 精准度
  27776. */
  27777. _this.precision = '1.0E-12';
  27778. /**
  27779. * @member {Array.<SuperMap.ThemeRangeItem>} SuperMap.ThemeRange.prototype.items
  27780. * @description 分段专题图子项数组。<br>
  27781. * 在分段专题图中,字段值按照某种分段模式被分成多个范围段,每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  27782. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为 [start, end)。
  27783. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按照您设置的值对分段结果进行调整。
  27784. */
  27785. _this.items = null;
  27786. /**
  27787. * @member {string} SuperMap.ThemeRange.prototype.rangeExpression
  27788. * @description 分段字段表达式。<br>
  27789. * 由于范围分段专题图基于各种分段方法根据一定的距离进行分段,因而范围分段专题图所基于的字段值的数据类型必须为数值型。对于字段表达式,只能为数值型的字段间的运算。
  27790. */
  27791. _this.rangeExpression = null;
  27792. /**
  27793. * @member {SuperMap.RangeMode} [SuperMap.ThemeRange.prototype.rangeMode=SuperMap.RangeMode.EQUALINTERVAL]
  27794. * @description 分段专题图的分段模式。<br>
  27795. * 在分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  27796. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  27797. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  27798. */
  27799. _this.rangeMode = RangeMode.EQUALINTERVAL;
  27800. /**
  27801. * @member {number} SuperMap.ThemeRange.prototype.rangeParameter
  27802. * @description 分段参数。
  27803. * 当分段模式为等距离分段法,平方根分段,对数分段法,计数分段法其中一种模式时,该参数用于设置分段个数;当分段模式为标准差分段法时,
  27804. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  27805. */
  27806. _this.rangeParameter = 0;
  27807. /**
  27808. * @member {SuperMap.ColorGradientType} [SuperMap.ThemeRange.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  27809. * @description 渐变颜色枚举类。<br>
  27810. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  27811. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色
  27812. * 方案完成填*充。但如果为某几个子项的风格进行单独设置后(设置了 {@link SuperMap.ThemeUniqueItem} 或 {@link SuperMap.ThemeRangeItem} 类中Style属性),
  27813. * 该配色方案对于这几个子项将不起作用。
  27814. */
  27815. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  27816. if (options) {
  27817. Util_Util.extend(ThemeRange_assertThisInitialized(_this), options);
  27818. }
  27819. _this.CLASS_NAME = "SuperMap.ThemeRange";
  27820. return _this;
  27821. }
  27822. /**
  27823. * @function SuperMap.ThemeRange.prototype.destroy
  27824. * @override
  27825. */
  27826. ThemeRange_createClass(ThemeRange, [{
  27827. key: "destroy",
  27828. value: function destroy() {
  27829. ThemeRange_get(ThemeRange_getPrototypeOf(ThemeRange.prototype), "destroy", this).call(this);
  27830. var me = this;
  27831. if (me.items) {
  27832. if (me.items.length > 0) {
  27833. for (var item in me.items) {
  27834. me.items[item].destroy();
  27835. me.items[item] = null;
  27836. }
  27837. }
  27838. me.items = null;
  27839. }
  27840. me.rangeExpression = null;
  27841. me.rangeMode = null;
  27842. me.rangeParameter = null;
  27843. me.colorGradientType = null;
  27844. }
  27845. /**
  27846. * @function SuperMap.ThemeRange.fromObj
  27847. * @description 从传入对象获取范围分段专题图类。
  27848. * @param {Object} obj - 传入对象。
  27849. * @returns {SuperMap.ThemeRange} ThemeRange 对象。
  27850. */
  27851. }], [{
  27852. key: "fromObj",
  27853. value: function fromObj(obj) {
  27854. if (!obj) {
  27855. return;
  27856. }
  27857. var res = new ThemeRange();
  27858. Util_Util.copy(res, obj);
  27859. var itemsR = obj.items;
  27860. var len = itemsR ? itemsR.length : 0;
  27861. res.items = [];
  27862. for (var i = 0; i < len; i++) {
  27863. res.items.push(ThemeRangeItem_ThemeRangeItem.fromObj(itemsR[i]));
  27864. }
  27865. return res;
  27866. }
  27867. }]);
  27868. return ThemeRange;
  27869. }(Theme_Theme);
  27870. SuperMap.ThemeRange = ThemeRange_ThemeRange;
  27871. // CONCATENATED MODULE: ./src/common/iServer/UGCLayer.js
  27872. function UGCLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27873. 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); } }
  27874. function UGCLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCLayer_defineProperties(Constructor, staticProps); return Constructor; }
  27875. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  27876. * This program are made available under the terms of the Apache License, Version 2.0
  27877. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27878. /**
  27879. * @class SuperMap.UGCLayer
  27880. * @category iServer Map Layer
  27881. * @classdesc UGC 图层类。
  27882. * @param {Object} options - 参数。
  27883. * @param {SuperMap.Bounds} options.bounds - 图层范围。
  27884. * @param {string} options.name - 图层的名称。
  27885. * @param {SuperMap.UGCLayerType} options.type - 图层类型
  27886. * @param {string} [options.caption] - 图层的标题。
  27887. * @param {string} [options.description] - 图层的描述信息。
  27888. * @param {boolean} [options.queryable] - 图层中的对象是否可以查询。
  27889. * @param {boolean} [options.subUGCLayers] - 是否允许图层的符号大小随图缩放。
  27890. * @param {boolean} [options.visible=false] - 地图对象在同一范围内时,是否重叠显示。
  27891. */
  27892. var UGCLayer_UGCLayer = /*#__PURE__*/function () {
  27893. function UGCLayer(options) {
  27894. UGCLayer_classCallCheck(this, UGCLayer);
  27895. options = options || {};
  27896. /**
  27897. * @member {SuperMap.Bounds} SuperMap.UGCLayer.prototype.bounds
  27898. * @description 图层范围。
  27899. */
  27900. this.bounds = null;
  27901. /**
  27902. * @member {string} [SuperMap.UGCLayer.prototype.caption]
  27903. * @description 图层的标题。默认情况下图层的标题与图层的名称一致。在图例、图层控制列表中显示的图层名称就是该图层的标题值。
  27904. */
  27905. this.caption = null;
  27906. /**
  27907. * @member {string} SuperMap.UGCLayer.prototype.description
  27908. * @description 图层的描述信息。
  27909. */
  27910. this.description = null;
  27911. /**
  27912. * @member {string} SuperMap.UGCLayer.prototype.name
  27913. * @description 图层的名称。图层的名称在图层所在的地图中唯一标识此图层。该属性区分大小写。
  27914. */
  27915. this.name = null;
  27916. /**
  27917. * @member {boolean} SuperMap.UGCLayer.prototype.queryable
  27918. * @description 图层中的对象是否可以查询。
  27919. */
  27920. this.queryable = null;
  27921. /**
  27922. * @member {Array} SuperMap.UGCLayer.prototype.subLayers
  27923. * @description 子图层集。
  27924. */
  27925. this.subLayers = null;
  27926. /**
  27927. * @member {SuperMap.UGCLayerType} SuperMap.UGCLayer.prototype.type
  27928. * @description 图层类型。
  27929. */
  27930. this.type = null;
  27931. /**
  27932. * @member {boolean} SuperMap.UGCLayer.prototype.visible
  27933. * @description 地图对象在同一范围内时,是否重叠显示。
  27934. */
  27935. this.visible = null;
  27936. Util_Util.extend(this, options);
  27937. this.CLASS_NAME = "SuperMap.UGCLayer";
  27938. }
  27939. /**
  27940. * @function SuperMap.UGCLayer.prototype.destroy
  27941. * @description 释放资源,将引用资源的属性置空。
  27942. */
  27943. UGCLayer_createClass(UGCLayer, [{
  27944. key: "destroy",
  27945. value: function destroy() {
  27946. var me = this;
  27947. Util_Util.reset(me);
  27948. }
  27949. /**
  27950. * @function SuperMap.UGCLayer.prototype.fromJson
  27951. * @description 将服务端 JSON 对象转换成当前客户端对象。
  27952. * @param {Object} jsonObject - 要转换的 JSON 对象。
  27953. */
  27954. }, {
  27955. key: "fromJson",
  27956. value: function fromJson(jsonObject) {
  27957. jsonObject = jsonObject ? jsonObject : {};
  27958. Util_Util.extend(this, jsonObject);
  27959. var b = this.bounds;
  27960. if (b) {
  27961. this.bounds = new Bounds_Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  27962. }
  27963. }
  27964. /**
  27965. * @function SuperMap.UGCLayer.prototype.toServerJSONObject
  27966. * @description 转换成对应的 JSON 格式对象。
  27967. * @returns {Object} 对应的 JSON 格式对象。
  27968. */
  27969. }, {
  27970. key: "toServerJSONObject",
  27971. value: function toServerJSONObject() {
  27972. var jsonObject = {};
  27973. jsonObject = Util_Util.copyAttributes(jsonObject, this);
  27974. if (jsonObject.bounds) {
  27975. if (jsonObject.bounds.toServerJSONObject) {
  27976. jsonObject.bounds = jsonObject.bounds.toServerJSONObject();
  27977. }
  27978. }
  27979. return jsonObject;
  27980. }
  27981. }]);
  27982. return UGCLayer;
  27983. }();
  27984. SuperMap.UGCLayer = UGCLayer_UGCLayer;
  27985. // CONCATENATED MODULE: ./src/common/iServer/OverlapDisplayedOptions.js
  27986. function OverlapDisplayedOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27987. 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); } }
  27988. function OverlapDisplayedOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlapDisplayedOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlapDisplayedOptions_defineProperties(Constructor, staticProps); return Constructor; }
  27989. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  27990. * This program are made available under the terms of the Apache License, Version 2.0
  27991. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27992. /**
  27993. * @class SuperMap.OverlapDisplayedOptions
  27994. * @category iServer Map Layer
  27995. * @classdesc 地图压盖过滤显示选项。
  27996. * @description 在文本或专题图元素显示较密集的区域,文本之间或专题元素之间会发生相互压盖的现象,
  27997. * 该类可以分别控制各种类型的对象的压盖显示情况,进而很好地处理地图中各种类型对象的压盖显示问题。
  27998. * @param {Object} options - 参数。
  27999. * @param {boolean} [options.allowPointOverlap=true] - 点和点压盖时是否显示压盖的点对象。
  28000. * @param {boolean} [options.allowPointWithTextDisplay=true] - 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  28001. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  28002. * @param {boolean} [options.allowTextOverlap=false] - 文本压盖时是否显示压盖的文本对象。
  28003. * @param {boolean} [options.allowTextAndPointOverlap=true] - 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  28004. * @param {boolean} [options.allowThemeGraduatedSymbolOverlap=false] - 等级符号元素压盖时是否显示压盖的等级符号元素。
  28005. * @param {boolean} [options.allowThemeGraphOverlap=false] - 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  28006. * @param {number} [options.horizontalOverlappedSpaceSize=0] - 两个对象之间的横向压盖间距,单位为 0.1 毫米,跟 verticalOverlappedSpaceSize 结合使用,
  28007. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  28008. * @param {number} [options.verticalOverlappedSpaceSize=0] - 两个对象之间的纵向压盖间距,单位为 0.1 毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  28009. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  28010. */
  28011. var OverlapDisplayedOptions_OverlapDisplayedOptions = /*#__PURE__*/function () {
  28012. function OverlapDisplayedOptions(options) {
  28013. OverlapDisplayedOptions_classCallCheck(this, OverlapDisplayedOptions);
  28014. options = options || {};
  28015. /**
  28016. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowPointOverlap=true]
  28017. * @description 点和点压盖时是否显示压盖的点对象。
  28018. */
  28019. this.allowPointOverlap = true;
  28020. /**
  28021. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowPointWithTextDisplay=true]
  28022. * @description 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  28023. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  28024. */
  28025. this.allowPointWithTextDisplay = true;
  28026. /**
  28027. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowTextOverlap=false]
  28028. * @description 文本压盖时是否显示压盖的文本对象。
  28029. */
  28030. this.allowTextOverlap = false;
  28031. /**
  28032. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowTextAndPointOverlap=true]
  28033. * @description 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  28034. */
  28035. this.allowTextAndPointOverlap = true;
  28036. /**
  28037. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowThemeGraduatedSymbolOverlap=false]
  28038. * @description 等级符号元素压盖时是否显示压盖的等级符号元素。
  28039. */
  28040. this.allowThemeGraduatedSymbolOverlap = false;
  28041. /**
  28042. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowThemeGraphOverlap=false]
  28043. * @description 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  28044. */
  28045. this.allowThemeGraphOverlap = false;
  28046. /**
  28047. * @member {number} [SuperMap.OverlapDisplayedOptions.prototype.horizontalOverlappedSpaceSize=0]
  28048. * @description 两个对象之间的横向压盖间距,单位为0.1毫米,跟 verticalOverlappedSpaceSize 结合使用,
  28049. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  28050. */
  28051. this.horizontalOverlappedSpaceSize = 0;
  28052. /**
  28053. * @member {number} [SuperMap.OverlapDisplayedOptions.prototype.verticalOverlappedSpaceSize=0]
  28054. * @description 两个对象之间的纵向压盖间距,单位为0.1毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  28055. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  28056. */
  28057. this.verticalOverlappedSpaceSize = 0;
  28058. Util_Util.extend(this, options);
  28059. this.ugcLayer = new UGCLayer_UGCLayer(options);
  28060. this.CLASS_NAME = "SuperMap.OverlapDisplayedOptions";
  28061. }
  28062. /**
  28063. * @function SuperMap.OverlapDisplayedOptions.prototype.destroy
  28064. * @description 释放资源,将资源的属性置空。
  28065. */
  28066. OverlapDisplayedOptions_createClass(OverlapDisplayedOptions, [{
  28067. key: "destroy",
  28068. value: function destroy() {
  28069. Util_Util.reset(this);
  28070. }
  28071. /**
  28072. * @function SuperMap.OverlapDisplayedOptions.prototype.fromJson
  28073. * @description 将服务端 JSON 对象转换成当前客户端对象。
  28074. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28075. */
  28076. }, {
  28077. key: "fromJson",
  28078. value: function fromJson(jsonObject) {
  28079. this.ugcLayer.fromJson.apply(this, [jsonObject]);
  28080. }
  28081. /**
  28082. * @function SuperMap.OverlapDisplayedOptions.prototype.toServerJSONObject
  28083. * @description 转换成对应的 JSON 格式对象。
  28084. * @returns {Object} 对应的 JSON 格式对象。
  28085. */
  28086. }, {
  28087. key: "toServerJSONObject",
  28088. value: function toServerJSONObject() {
  28089. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  28090. return jsonObject;
  28091. }
  28092. /**
  28093. * @function SuperMap.OverlapDisplayedOptions.prototype.toString
  28094. * @description 转换成对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  28095. * @returns {string} 对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  28096. */
  28097. }, {
  28098. key: "toString",
  28099. value: function toString() {
  28100. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  28101. var str = "{";
  28102. for (var attr in jsonObject) {
  28103. if (jsonObject.hasOwnProperty(attr)) {
  28104. str += "'" + attr + "':" + jsonObject[attr] + ",";
  28105. }
  28106. }
  28107. str = str.substr(0, str.length - 1);
  28108. str += "}";
  28109. return str;
  28110. }
  28111. }]);
  28112. return OverlapDisplayedOptions;
  28113. }();
  28114. SuperMap.OverlapDisplayedOptions = OverlapDisplayedOptions_OverlapDisplayedOptions;
  28115. // CONCATENATED MODULE: ./src/common/iServer/UGCMapLayer.js
  28116. 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); }
  28117. function UGCMapLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28118. 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); } }
  28119. function UGCMapLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCMapLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCMapLayer_defineProperties(Constructor, staticProps); return Constructor; }
  28120. 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); }
  28121. function UGCMapLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCMapLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  28122. 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); }
  28123. function UGCMapLayer_setPrototypeOf(o, p) { UGCMapLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCMapLayer_setPrototypeOf(o, p); }
  28124. 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); }; }
  28125. function UGCMapLayer_possibleConstructorReturn(self, call) { if (call && (UGCMapLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UGCMapLayer_assertThisInitialized(self); }
  28126. function UGCMapLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28127. 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; } }
  28128. function UGCMapLayer_getPrototypeOf(o) { UGCMapLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCMapLayer_getPrototypeOf(o); }
  28129. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  28130. * This program are made available under the terms of the Apache License, Version 2.0
  28131. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28132. /**
  28133. * @class SuperMap.UGCMapLayer
  28134. * @category iServer Map Layer
  28135. * @classdesc UGC 地图图层类。
  28136. * @extends {SuperMap.UGCLayer}
  28137. * @param {Object} options - 参数。
  28138. * @param {boolean} [options.completeLineSymbolDisplayed] - 是否显示完整线型。
  28139. * @param {number} [options.maxScale] - 地图最大比例尺。
  28140. * @param {number} [options.minScale] - 地图最小比例尺。
  28141. * @param {number} [options.minVisibleGeometrySize] - 几何对象的最小可见大小,以像素为单位。
  28142. * @param {number} [options.opaqueRate] - 图层的不透明度。
  28143. * @param {boolean} [options.symbolScalable] - 是否允许图层的符号大小随图缩放。
  28144. * @param {number} [options.symbolScale] - 图层的符号缩放基准比例尺。
  28145. * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。
  28146. * @param {SuperMap.OverlapDisplayedOptions} [options.overlapDisplayedOptions] - 地图的压盖过滤显示选项,当overlapDisplayed 为 false 时有效。
  28147. */
  28148. var UGCMapLayer_UGCMapLayer = /*#__PURE__*/function (_UGCLayer) {
  28149. UGCMapLayer_inherits(UGCMapLayer, _UGCLayer);
  28150. var _super = UGCMapLayer_createSuper(UGCMapLayer);
  28151. function UGCMapLayer(options) {
  28152. var _this;
  28153. UGCMapLayer_classCallCheck(this, UGCMapLayer);
  28154. options = options || {};
  28155. _this = _super.call(this, options);
  28156. /**
  28157. * @member {boolean} SuperMap.UGCMapLayer.prototype.completeLineSymbolDisplayed
  28158. * @description 是否显示完整线型。
  28159. */
  28160. _this.completeLineSymbolDisplayed = null;
  28161. /**
  28162. * @member {number} SuperMap.UGCMapLayer.prototype.maxScale
  28163. * @description 地图最大比例尺。
  28164. */
  28165. _this.maxScale = null;
  28166. /**
  28167. * @member {number} SuperMap.UGCMapLayer.prototype.minScale
  28168. * @description 地图最小比例尺。
  28169. */
  28170. _this.minScale = null;
  28171. /**
  28172. * @member {number} SuperMap.UGCMapLayer.prototype.minVisibleGeometrySize
  28173. * @description 几何对象的最小可见大小,以像素为单位。
  28174. */
  28175. _this.minVisibleGeometrySize = null;
  28176. /**
  28177. * @member {number} SuperMap.UGCMapLayer.prototype.opaqueRate
  28178. * @description 图层的不透明度。
  28179. */
  28180. _this.opaqueRate = null;
  28181. /**
  28182. * @member {boolean} SuperMap.UGCMapLayer.prototype.symbolScalable
  28183. * @description 是否允许图层的符号大小随图缩放。
  28184. */
  28185. _this.symbolScalable = null;
  28186. /**
  28187. * @member {number} SuperMap.UGCMapLayer.prototype.symbolScale
  28188. * @description 图层的符号缩放基准比例尺。
  28189. */
  28190. _this.symbolScale = null;
  28191. /**
  28192. * @member {boolean} [SuperMap.UGCMapLayer.prototype.overlapDisplayed=false]
  28193. * @description 地图对象在同一范围内时,是否重叠显示。
  28194. */
  28195. _this.overlapDisplayed = null;
  28196. /**
  28197. * @member {SuperMap.OverlapDisplayedOptions} SuperMap.UGCMapLayer.prototype.overlapDisplayedOptions
  28198. * @description 地图的压盖过滤显示选项,当 overlapDisplayed 为 false 时有效。
  28199. */
  28200. _this.overlapDisplayedOptions = null;
  28201. _this.CLASS_NAME = "SuperMap.UGCMapLayer";
  28202. return _this;
  28203. }
  28204. /**
  28205. * @function SuperMap.UGCMapLayer.prototype.destroy
  28206. * @override
  28207. */
  28208. UGCMapLayer_createClass(UGCMapLayer, [{
  28209. key: "destroy",
  28210. value: function destroy() {
  28211. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "destroy", this).call(this);
  28212. Util_Util.reset(this);
  28213. }
  28214. /**
  28215. * @function SuperMap.UGCMapLayer.prototype.fromJson
  28216. * @description 将服务端 JSON 对象转换成当前客户端对象
  28217. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28218. */
  28219. }, {
  28220. key: "fromJson",
  28221. value: function fromJson(jsonObject) {
  28222. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "fromJson", this).call(this, jsonObject);
  28223. }
  28224. /**
  28225. * @function SuperMap.UGCMapLayer.prototype.toServerJSONObject
  28226. * @description 转换成对应的 JSON 格式对象。
  28227. * @returns {Object} 对应的 JSON 格式对象。
  28228. */
  28229. }, {
  28230. key: "toServerJSONObject",
  28231. value: function toServerJSONObject() {
  28232. return UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "toServerJSONObject", this).call(this);
  28233. }
  28234. }]);
  28235. return UGCMapLayer;
  28236. }(UGCLayer_UGCLayer);
  28237. SuperMap.UGCMapLayer = UGCMapLayer_UGCMapLayer;
  28238. // CONCATENATED MODULE: ./src/common/iServer/UGCSubLayer.js
  28239. 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); }
  28240. function UGCSubLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28241. 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); } }
  28242. function UGCSubLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCSubLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCSubLayer_defineProperties(Constructor, staticProps); return Constructor; }
  28243. 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); }
  28244. function UGCSubLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCSubLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  28245. 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); }
  28246. function UGCSubLayer_setPrototypeOf(o, p) { UGCSubLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCSubLayer_setPrototypeOf(o, p); }
  28247. 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); }; }
  28248. function UGCSubLayer_possibleConstructorReturn(self, call) { if (call && (UGCSubLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UGCSubLayer_assertThisInitialized(self); }
  28249. function UGCSubLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28250. 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; } }
  28251. function UGCSubLayer_getPrototypeOf(o) { UGCSubLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCSubLayer_getPrototypeOf(o); }
  28252. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  28253. * This program are made available under the terms of the Apache License, Version 2.0
  28254. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28255. /**
  28256. * @class SuperMap.UGCSubLayer
  28257. * @category iServer Map Layer
  28258. * @classdesc 地图服务图层属性信息类。影像图层(Image)、专题图层(ServerTheme)、栅格图层(Grid)、矢量图层(Vector)等图层均继承该类。
  28259. * @extends {SuperMap.UGCMapLayer}
  28260. * @param {Object} options - 参数。
  28261. * @param {SuperMap.DatasetInfo} options.datasetInfo - 数据集信息。
  28262. * @param {string} [options.displayFilter] - 图层显示过滤条件。
  28263. * @param {SuperMap.JoinItem} [options.joinItems] - 连接信息类。
  28264. * @param {string} [options.representationField] - 存储制图表达信息的字段。
  28265. * @param {SuperMap.LayerType} [options.ugcLayerType] - 图层类型。
  28266. */
  28267. var UGCSubLayer_UGCSubLayer = /*#__PURE__*/function (_UGCMapLayer) {
  28268. UGCSubLayer_inherits(UGCSubLayer, _UGCMapLayer);
  28269. var _super = UGCSubLayer_createSuper(UGCSubLayer);
  28270. function UGCSubLayer(options) {
  28271. var _this;
  28272. UGCSubLayer_classCallCheck(this, UGCSubLayer);
  28273. options = options || {};
  28274. _this = _super.call(this, options);
  28275. /**
  28276. * @member {SuperMap.DatasetInfo} SuperMap.UGCSubLayer.prototype.datasetInfo
  28277. * @description 数据集信息。
  28278. */
  28279. _this.datasetInfo = null;
  28280. /**
  28281. * @member {string} SuperMap.UGCSubLayer.prototype.displayFilter
  28282. * @description 图层显示过滤条件。
  28283. */
  28284. _this.displayFilter = null;
  28285. /**
  28286. * @member {SuperMap.JoinItem} SuperMap.UGCSubLayer.prototype.joinItems
  28287. * @description 连接信息类。
  28288. */
  28289. _this.joinItems = null;
  28290. /**
  28291. * @member {string} SuperMap.UGCSubLayer.prototype.representationField
  28292. * @description 存储制图表达信息的字段。
  28293. */
  28294. _this.representationField = null;
  28295. /**
  28296. * @member {SuperMap.LayerType} SuperMap.UGCSubLayer.prototype.ugcLayerType
  28297. * @description 图层类型。
  28298. */
  28299. _this.ugcLayerType = null;
  28300. _this.CLASS_NAME = "SuperMap.UGCSubLayer";
  28301. return _this;
  28302. }
  28303. /**
  28304. * @function SuperMap.UGCSubLayer.prototype.fromJson
  28305. * @description 将服务端 JSON 对象转换成当前客户端对象
  28306. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28307. */
  28308. UGCSubLayer_createClass(UGCSubLayer, [{
  28309. key: "fromJson",
  28310. value: function fromJson(jsonObject) {
  28311. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "fromJson", this).call(this, jsonObject);
  28312. if (this.datasetInfo) {
  28313. this.datasetInfo = new DatasetInfo_DatasetInfo(this.datasetInfo);
  28314. }
  28315. if (this.joinItems && this.joinItems.length) {
  28316. var newJoinItems = [];
  28317. for (var i = 0; i < this.joinItems.length; i++) {
  28318. newJoinItems[i] = new JoinItem_JoinItem(this.joinItems[i]);
  28319. }
  28320. this.joinItems = newJoinItems;
  28321. }
  28322. }
  28323. /**
  28324. * @function SuperMap.UGCSubLayer.prototype.destroy
  28325. * @override
  28326. */
  28327. }, {
  28328. key: "destroy",
  28329. value: function destroy() {
  28330. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "destroy", this).call(this);
  28331. Util_Util.reset(this);
  28332. }
  28333. /**
  28334. * @function SuperMap.UGCSubLayer.prototype.toServerJSONObject
  28335. * @description 转换成对应的 JSON 格式对象。
  28336. * @returns {Object} 对应的 JSON 格式对象。
  28337. */
  28338. }, {
  28339. key: "toServerJSONObject",
  28340. value: function toServerJSONObject() {
  28341. var jsonObject = UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "toServerJSONObject", this).call(this);
  28342. if (jsonObject.joinItems) {
  28343. var joinItems = [];
  28344. for (var i = 0; i < jsonObject.joinItems.length; i++) {
  28345. if (jsonObject.joinItems[i].toServerJSONObject) {
  28346. joinItems[i] = jsonObject.joinItems[i].toServerJSONObject();
  28347. }
  28348. }
  28349. jsonObject.joinItems = joinItems;
  28350. }
  28351. if (jsonObject.datasetInfo) {
  28352. if (jsonObject.datasetInfo.toServerJSONObject) {
  28353. jsonObject.datasetInfo = jsonObject.datasetInfo.toServerJSONObject();
  28354. }
  28355. }
  28356. return jsonObject;
  28357. }
  28358. }]);
  28359. return UGCSubLayer;
  28360. }(UGCMapLayer_UGCMapLayer);
  28361. SuperMap.UGCSubLayer = UGCSubLayer_UGCSubLayer;
  28362. // CONCATENATED MODULE: ./src/common/iServer/ServerTheme.js
  28363. 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); }
  28364. function ServerTheme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28365. 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); } }
  28366. function ServerTheme_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTheme_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTheme_defineProperties(Constructor, staticProps); return Constructor; }
  28367. 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); }
  28368. function ServerTheme_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ServerTheme_getPrototypeOf(object); if (object === null) break; } return object; }
  28369. 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); }
  28370. function ServerTheme_setPrototypeOf(o, p) { ServerTheme_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ServerTheme_setPrototypeOf(o, p); }
  28371. 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); }; }
  28372. function ServerTheme_possibleConstructorReturn(self, call) { if (call && (ServerTheme_typeof(call) === "object" || typeof call === "function")) { return call; } return ServerTheme_assertThisInitialized(self); }
  28373. function ServerTheme_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28374. 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; } }
  28375. function ServerTheme_getPrototypeOf(o) { ServerTheme_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ServerTheme_getPrototypeOf(o); }
  28376. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  28377. * This program are made available under the terms of the Apache License, Version 2.0
  28378. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28379. /**
  28380. * @class SuperMap.ServerTheme
  28381. * @category iServer Map Theme
  28382. * @classdesc UGC 专题图图层类。
  28383. * @extends {SuperMap.UGCSubLayer}
  28384. * @param {SuperMap.Theme} theme - 专题图对象。
  28385. * @param {SuperMap.LonLat} themeElementPosition - 专题图元素位置。
  28386. */
  28387. var ServerTheme_ServerTheme = /*#__PURE__*/function (_UGCSubLayer) {
  28388. ServerTheme_inherits(ServerTheme, _UGCSubLayer);
  28389. var _super = ServerTheme_createSuper(ServerTheme);
  28390. function ServerTheme(options) {
  28391. var _this;
  28392. ServerTheme_classCallCheck(this, ServerTheme);
  28393. options = options || {};
  28394. _this = _super.call(this, options);
  28395. /**
  28396. * @member {SuperMap.Theme} SuperMap.ServerTheme.prototype.theme
  28397. * @description 专题图对象。
  28398. */
  28399. _this.theme = null;
  28400. /**
  28401. * @member {SuperMap.LonLat} SuperMap.ServerTheme.prototype.themeElementPosition
  28402. * @description 专题图元素位置。
  28403. */
  28404. _this.themeElementPosition = null;
  28405. _this.CLASS_NAME = "SuperMap.ServerTheme";
  28406. return _this;
  28407. }
  28408. /**
  28409. * @function SuperMap.ServerTheme.prototype.destroy
  28410. * @override
  28411. */
  28412. ServerTheme_createClass(ServerTheme, [{
  28413. key: "destroy",
  28414. value: function destroy() {
  28415. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "destroy", this).call(this);
  28416. Util_Util.reset(this);
  28417. }
  28418. /**
  28419. * @function SuperMap.ServerTheme.prototype.fromJson
  28420. * @description 将服务端 JSON 对象转换成当前客户端对象
  28421. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28422. */
  28423. }, {
  28424. key: "fromJson",
  28425. value: function fromJson(jsonObject) {
  28426. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "fromJson", this).call(this, jsonObject);
  28427. var themeObj = this.theme;
  28428. var themeT = themeObj && themeObj.type;
  28429. switch (themeT) {
  28430. case 'LABEL':
  28431. this.theme = ThemeLabel_ThemeLabel.fromObj(themeObj);
  28432. break;
  28433. case 'UNIQUE':
  28434. this.theme = ThemeUnique_ThemeUnique.fromObj(themeObj);
  28435. break;
  28436. case 'GRAPH':
  28437. this.theme = ThemeGraph_ThemeGraph.fromObj(themeObj);
  28438. break;
  28439. case 'DOTDENSITY':
  28440. this.theme = ThemeDotDensity_ThemeDotDensity.fromObj(themeObj);
  28441. break;
  28442. case 'GRADUATEDSYMBOL':
  28443. this.theme = ThemeGraduatedSymbol_ThemeGraduatedSymbol.fromObj(themeObj);
  28444. break;
  28445. case 'RANGE':
  28446. this.theme = ThemeRange_ThemeRange.fromObj(themeObj);
  28447. break;
  28448. default:
  28449. break;
  28450. }
  28451. if (this.themeElementPosition) {
  28452. //待测试
  28453. this.themeElementPosition = new LonLat_LonLat(this.themeElementPosition.x, this.themeElementPosition.y);
  28454. }
  28455. }
  28456. /**
  28457. * @function SuperMap.ServerTheme.prototype.toServerJSONObject
  28458. * @description 转换成对应的 JSON 格式对象。
  28459. */
  28460. }, {
  28461. key: "toServerJSONObject",
  28462. value: function toServerJSONObject() {
  28463. //普通属性直接赋值
  28464. var jsonObject = ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "toServerJSONObject", this).call(this);
  28465. if (jsonObject.themeElementPosition) {
  28466. if (jsonObject.themeElementPosition.toServerJSONObject) {
  28467. jsonObject.themeElementPosition = jsonObject.themeElementPosition.toServerJSONObject();
  28468. }
  28469. }
  28470. if (jsonObject.theme) {
  28471. if (jsonObject.theme.toServerJSONObject) {
  28472. jsonObject.theme = jsonObject.theme.toServerJSONObject();
  28473. }
  28474. }
  28475. return jsonObject;
  28476. }
  28477. }]);
  28478. return ServerTheme;
  28479. }(UGCSubLayer_UGCSubLayer);
  28480. SuperMap.ServerTheme = ServerTheme_ServerTheme;
  28481. // CONCATENATED MODULE: ./src/common/iServer/Grid.js
  28482. 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); }
  28483. function Grid_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28484. 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); } }
  28485. function Grid_createClass(Constructor, protoProps, staticProps) { if (protoProps) Grid_defineProperties(Constructor.prototype, protoProps); if (staticProps) Grid_defineProperties(Constructor, staticProps); return Constructor; }
  28486. 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); }
  28487. function Grid_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Grid_getPrototypeOf(object); if (object === null) break; } return object; }
  28488. 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); }
  28489. function Grid_setPrototypeOf(o, p) { Grid_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Grid_setPrototypeOf(o, p); }
  28490. 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); }; }
  28491. function Grid_possibleConstructorReturn(self, call) { if (call && (Grid_typeof(call) === "object" || typeof call === "function")) { return call; } return Grid_assertThisInitialized(self); }
  28492. function Grid_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28493. 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; } }
  28494. function Grid_getPrototypeOf(o) { Grid_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Grid_getPrototypeOf(o); }
  28495. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  28496. * This program are made available under the terms of the Apache License, Version 2.0
  28497. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28498. /**
  28499. * @class SuperMap.Grid
  28500. * @category iServer Map Layer
  28501. * @classdesc UGC 栅格图层类。
  28502. * @extends {SuperMap.UGCSubLayer}
  28503. * @param {Object} options - 参数。
  28504. * @param {Array.<Object>} [options.colorDictionary] - 颜色对照表对象。
  28505. * @param {number} [options.brightness] - Grid 图层的亮度。
  28506. * @param {SuperMap.ColorGradientType} [options.colorGradientType] - 颜色渐变枚举。
  28507. * @param {SuperMap.ServerColor} [options.colors] - 颜色表对象。
  28508. * @param {number} [options.contrast] - Grid 图层的对比度。
  28509. * @param {SuperMap.GridType} [options.gridType] - 格网类型。
  28510. * @param {number} [options.horizontalSpacing] - 格网水平间隔大小。
  28511. * @param {boolean} [options.sizeFixed] - 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  28512. * @param {SuperMap.ServerStyle} [options.solidStyle] - 格网实线的样式。
  28513. * @param {SuperMap.ServerColor} [options.specialColor] - 栅格数据集无值数据的颜色。
  28514. * @param {number} [options.specialValue] - 图层的特殊值。
  28515. * @param {boolean} [options.specialValueTransparent] - 图层的特殊值(specialValue)所处区域是否透明。
  28516. * @param {number} [options.verticalSpacing] - 格网垂直间隔大小。
  28517. */
  28518. var Grid_Grid = /*#__PURE__*/function (_UGCSubLayer) {
  28519. Grid_inherits(Grid, _UGCSubLayer);
  28520. var _super = Grid_createSuper(Grid);
  28521. function Grid(options) {
  28522. var _this;
  28523. Grid_classCallCheck(this, Grid);
  28524. options = options || {};
  28525. _this = _super.call(this, options);
  28526. /**
  28527. * @member {Array.<SuperMap.ColorDictionary>} SuperMap.Grid.prototype.colorDictionarys
  28528. * @description 颜色对照表对象。
  28529. */
  28530. _this.colorDictionarys = null;
  28531. /**
  28532. * @member {number} SuperMap.Grid.prototype.brightness
  28533. * @description Grid 图层的亮度。
  28534. */
  28535. _this.brightness = null;
  28536. /**
  28537. * @member {SuperMap.ColorGradientType} SuperMap.Grid.prototype.colorGradientType
  28538. * @description 渐变颜色枚举值。
  28539. */
  28540. _this.colorGradientType = null;
  28541. /**
  28542. * @member {SuperMap.ServerColor} SuperMap.Grid.prototype.colors
  28543. * @description 颜色表对象。
  28544. */
  28545. _this.colors = null;
  28546. /**
  28547. * @member {number} SuperMap.Grid.prototype.contrast
  28548. * @description Grid 图层的对比度。
  28549. */
  28550. _this.contrast = null;
  28551. /**
  28552. * @member {SuperMap.ServerStyle} SuperMap.Grid.prototype.dashStyle
  28553. * @description 栅格数据集特殊值数据的颜色。
  28554. */
  28555. _this.dashStyle = null;
  28556. /**
  28557. * @member {SuperMap.GridType} SuperMap.Grid.prototype.gridType
  28558. * @description 格网类型。
  28559. */
  28560. _this.gridType = null;
  28561. /**
  28562. * @member {number} SuperMap.Grid.prototype.horizontalSpacing
  28563. * @description 格网水平间隔大小。
  28564. */
  28565. _this.horizontalSpacing = null;
  28566. /**
  28567. * @member {boolean} SuperMap.Grid.prototype.sizeFixed
  28568. * @description 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  28569. */
  28570. _this.sizeFixed = null;
  28571. /**
  28572. * @member {SuperMap.ServerStyle} SuperMap.Grid.prototype.solidStyle
  28573. * @description 格网实线的样式。
  28574. */
  28575. _this.solidStyle = null;
  28576. /**
  28577. * @member {SuperMap.ServerColor} SuperMap.Grid.prototype.specialColor
  28578. * @description 栅格数据集无值数据的颜色。
  28579. */
  28580. _this.specialColor = null;
  28581. /**
  28582. * @member {number} SuperMap.Grid.prototype.specialValue
  28583. * @description 图层的特殊值。
  28584. */
  28585. _this.specialValue = null;
  28586. /**
  28587. * @member {boolean} SuperMap.Grid.prototype.specialValueTransparent
  28588. * @description 图层的特殊值(specialValue)所处区域是否透明。
  28589. */
  28590. _this.specialValueTransparent = null;
  28591. /**
  28592. * @member {number} SuperMap.Grid.prototype.verticalSpacing
  28593. * @description 格网垂直间隔大小。
  28594. */
  28595. _this.verticalSpacing = null;
  28596. _this.CLASS_NAME = "SuperMap.Grid";
  28597. return _this;
  28598. }
  28599. /**
  28600. * @function SuperMap.Grid.prototype.destroy
  28601. * @description 释放资源,将引用资源的属性置空。
  28602. */
  28603. Grid_createClass(Grid, [{
  28604. key: "destroy",
  28605. value: function destroy() {
  28606. Grid_get(Grid_getPrototypeOf(Grid.prototype), "destroy", this).call(this);
  28607. Util_Util.reset(this);
  28608. }
  28609. /**
  28610. * @function SuperMap.Grid.prototype.fromJson
  28611. * @description 将服务端 JSON 对象转换成当前客户端对象。
  28612. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28613. */
  28614. }, {
  28615. key: "fromJson",
  28616. value: function fromJson(jsonObject) {
  28617. Grid_get(Grid_getPrototypeOf(Grid.prototype), "fromJson", this).call(this, jsonObject);
  28618. if (this.specialColor) {
  28619. this.specialColor = new ServerColor(this.specialColor.red, this.specialColor.green, this.specialColor.blue);
  28620. }
  28621. if (this.colors) {
  28622. var colors = [],
  28623. color;
  28624. for (var i in this.colors) {
  28625. color = this.colors[i];
  28626. colors.push(new ServerColor(color.red, color.green, color.blue));
  28627. }
  28628. this.colors = colors;
  28629. }
  28630. if (this.dashStyle) {
  28631. this.dashStyle = new ServerStyle_ServerStyle(this.dashStyle);
  28632. }
  28633. if (this.solidStyle) {
  28634. this.solidStyle = new ServerStyle_ServerStyle(this.solidStyle);
  28635. }
  28636. if (this.colorDictionary) {
  28637. var colorDics = [],
  28638. colorDic;
  28639. for (var key in this.colorDictionary) {
  28640. colorDic = this.colorDictionary[key];
  28641. colorDics.push(new ColorDictionary_ColorDictionary({
  28642. elevation: key,
  28643. color: colorDic
  28644. }));
  28645. }
  28646. this.colorDictionarys = colorDics;
  28647. }
  28648. delete this.colorDictionary;
  28649. }
  28650. /**
  28651. * @function SuperMap.Grid.prototype.toServerJSONObject
  28652. * @description 转换成对应的 JSON 对象。
  28653. * @returns JSON 对象。
  28654. */
  28655. }, {
  28656. key: "toServerJSONObject",
  28657. value: function toServerJSONObject() {
  28658. var jsonObject = Grid_get(Grid_getPrototypeOf(Grid.prototype), "toServerJSONObject", this).call(this);
  28659. if (jsonObject.dashStyle) {
  28660. if (jsonObject.dashStyle.toServerJSONObject) {
  28661. jsonObject.dashStyle = jsonObject.dashStyle.toServerJSONObject();
  28662. }
  28663. }
  28664. if (jsonObject.solidStyle) {
  28665. if (jsonObject.solidStyle.toServerJSONObject) {
  28666. jsonObject.solidStyle = jsonObject.solidStyle.toServerJSONObject();
  28667. }
  28668. }
  28669. return jsonObject;
  28670. }
  28671. }]);
  28672. return Grid;
  28673. }(UGCSubLayer_UGCSubLayer);
  28674. SuperMap.Grid = Grid_Grid;
  28675. // CONCATENATED MODULE: ./src/common/iServer/Image.js
  28676. 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); }
  28677. function Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28678. 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); } }
  28679. function Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) Image_defineProperties(Constructor, staticProps); return Constructor; }
  28680. 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); }
  28681. function Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Image_getPrototypeOf(object); if (object === null) break; } return object; }
  28682. 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); }
  28683. function Image_setPrototypeOf(o, p) { Image_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Image_setPrototypeOf(o, p); }
  28684. 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); }; }
  28685. function Image_possibleConstructorReturn(self, call) { if (call && (Image_typeof(call) === "object" || typeof call === "function")) { return call; } return Image_assertThisInitialized(self); }
  28686. function Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28687. 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; } }
  28688. function Image_getPrototypeOf(o) { Image_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Image_getPrototypeOf(o); }
  28689. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  28690. * This program are made available under the terms of the Apache License, Version 2.0
  28691. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28692. /**
  28693. * @class SuperMap.Image
  28694. * @category iServer Map Layer
  28695. * @classdesc UGC 影像图层类
  28696. * @extends {SuperMap.UGCSubLayer}
  28697. * @param {Object} options - 参数。
  28698. * @param {SuperMap.ColorSpaceType} [options.colorSpaceType] - 返回影像图层的色彩显示模式。
  28699. * @param {number} [options.brightness] - 影像图层的亮度。
  28700. * @param {Array.<number>} [options.displayBandIndexes] - 返回当前影像图层显示的波段索引。
  28701. * @param {number} [options.contrast] - 影像图层的对比度。
  28702. * @param {boolean} [options.transparent] - 是否背景透明。
  28703. * @param {SuperMap.ServerColor} [options.transparentColor] - 返回背景透明色。
  28704. * @param {number} [options.transparentColorTolerance] - 背景透明色容限。
  28705. */
  28706. var Image_UGCImage = /*#__PURE__*/function (_UGCSubLayer) {
  28707. Image_inherits(UGCImage, _UGCSubLayer);
  28708. var _super = Image_createSuper(UGCImage);
  28709. function UGCImage(options) {
  28710. var _this;
  28711. Image_classCallCheck(this, UGCImage);
  28712. options = options || {};
  28713. _this = _super.call(this, options);
  28714. /**
  28715. * @member {number} SuperMap.Image.prototype.brightness
  28716. * @description 影像图层的亮度。
  28717. */
  28718. _this.brightness = null;
  28719. /**
  28720. * @member {SuperMap.ColorSpaceType} SuperMap.Image.prototype.colorSpaceType
  28721. * @description 返回影像图层的色彩显示模式。
  28722. */
  28723. _this.colorSpaceType = null;
  28724. /**
  28725. * @member {number} SuperMap.Image.prototype.contrast
  28726. * @description 影像图层的对比度。
  28727. */
  28728. _this.contrast = null;
  28729. /**
  28730. * @member {Array.<number>} SuperMap.Image.prototype.displayBandIndexes
  28731. * @description 返回当前影像图层显示的波段索引。
  28732. */
  28733. _this.displayBandIndexes = null;
  28734. /**
  28735. * @member {boolean} SuperMap.Image.prototype.transparent
  28736. * @description 是否背景透明。
  28737. */
  28738. _this.transparent = null;
  28739. /**
  28740. * @member {SuperMap.ServerColor} SuperMap.Image.prototype.transparentColor
  28741. * @description 返回背景透明色。
  28742. */
  28743. _this.transparentColor = null;
  28744. /**
  28745. * @member {number} SuperMap.Image.prototype.transparentColorTolerance
  28746. * @description 背景透明色容限。
  28747. */
  28748. _this.transparentColorTolerance = null;
  28749. _this.CLASS_NAME = "SuperMap.Image";
  28750. return _this;
  28751. }
  28752. /**
  28753. * @function SuperMap.Image.prototype.destroy
  28754. * @override
  28755. */
  28756. Image_createClass(UGCImage, [{
  28757. key: "destroy",
  28758. value: function destroy() {
  28759. Image_get(Image_getPrototypeOf(UGCImage.prototype), "destroy", this).call(this);
  28760. Util_Util.reset(this);
  28761. }
  28762. /**
  28763. * @function SuperMap.Image.prototype.fromJson
  28764. * @description 将服务端 JSON 对象转换成当前客户端对象。
  28765. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28766. */
  28767. }, {
  28768. key: "fromJson",
  28769. value: function fromJson(jsonObject) {
  28770. Image_get(Image_getPrototypeOf(UGCImage.prototype), "fromJson", this).call(this, jsonObject);
  28771. if (this.transparentColor) {
  28772. this.transparentColor = new ServerColor(this.transparentColor.red, this.transparentColor.green, this.transparentColor.blue);
  28773. }
  28774. }
  28775. /**
  28776. * @function SuperMap.Image.prototype.toServerJSONObject
  28777. * @description 转换成对应的 JSON 格式对象。
  28778. */
  28779. }, {
  28780. key: "toServerJSONObject",
  28781. value: function toServerJSONObject() {
  28782. return Image_get(Image_getPrototypeOf(UGCImage.prototype), "toServerJSONObject", this).call(this);
  28783. }
  28784. }]);
  28785. return UGCImage;
  28786. }(UGCSubLayer_UGCSubLayer);
  28787. SuperMap.Image = Image_UGCImage;
  28788. // CONCATENATED MODULE: ./src/common/iServer/Vector.js
  28789. 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); }
  28790. function iServer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28791. 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); } }
  28792. function iServer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) iServer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) iServer_Vector_defineProperties(Constructor, staticProps); return Constructor; }
  28793. 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); }
  28794. function iServer_Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = iServer_Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  28795. 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); }
  28796. 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); }
  28797. 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); }; }
  28798. function iServer_Vector_possibleConstructorReturn(self, call) { if (call && (iServer_Vector_typeof(call) === "object" || typeof call === "function")) { return call; } return iServer_Vector_assertThisInitialized(self); }
  28799. function iServer_Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28800. 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; } }
  28801. 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); }
  28802. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  28803. * This program are made available under the terms of the Apache License, Version 2.0
  28804. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28805. /**
  28806. * @class SuperMap.Vector
  28807. * @category iServer Map TileFeature
  28808. * @classdesc UGC 矢量图层类。
  28809. * @extends {SuperMap.UGCSubLayer}
  28810. * @param {Object} options - 参数。
  28811. * @param {SuperMap.ServerStyle} [options.style] - 矢量图层的风格。
  28812. */
  28813. var iServer_Vector_Vector = /*#__PURE__*/function (_UGCSubLayer) {
  28814. iServer_Vector_inherits(Vector, _UGCSubLayer);
  28815. var _super = iServer_Vector_createSuper(Vector);
  28816. function Vector(options) {
  28817. var _this;
  28818. iServer_Vector_classCallCheck(this, Vector);
  28819. options = options || {};
  28820. _this = _super.call(this, options);
  28821. /**
  28822. * @member {SuperMap.ServerStyle} SuperMap.Vector.prototype.style
  28823. * @description 矢量图层的风格。
  28824. */
  28825. _this.style = null;
  28826. _this.CLASS_NAME = "SuperMap.Vector";
  28827. return _this;
  28828. }
  28829. /**
  28830. * @function SuperMap.Vector.prototype.destroy
  28831. * @override
  28832. */
  28833. iServer_Vector_createClass(Vector, [{
  28834. key: "destroy",
  28835. value: function destroy() {
  28836. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  28837. Util_Util.reset(this);
  28838. }
  28839. /**
  28840. * @function SuperMap.Vector.prototype.fromJson
  28841. * @description 将服务端 JSON 对象转换成当前客户端对象。
  28842. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28843. */
  28844. }, {
  28845. key: "fromJson",
  28846. value: function fromJson(jsonObject) {
  28847. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "fromJson", this).call(this, jsonObject);
  28848. var sty = this.style;
  28849. if (sty) {
  28850. this.style = new ServerStyle_ServerStyle(sty);
  28851. }
  28852. }
  28853. /**
  28854. * @function SuperMap.Vector.prototype.toServerJSONObject
  28855. * @description 转换成对应的 JSON 格式对象。
  28856. * @returns {Object} 对应的 JSON 格式对象
  28857. */
  28858. }, {
  28859. key: "toServerJSONObject",
  28860. value: function toServerJSONObject() {
  28861. var jsonObject = SuperMap.toServerJSONObject();
  28862. if (jsonObject.style) {
  28863. if (jsonObject.style.toServerJSONObject) {
  28864. jsonObject.style = jsonObject.style.toServerJSONObject();
  28865. }
  28866. }
  28867. return jsonObject;
  28868. }
  28869. }]);
  28870. return Vector;
  28871. }(UGCSubLayer_UGCSubLayer);
  28872. SuperMap.Vector = iServer_Vector_Vector;
  28873. // CONCATENATED MODULE: ./src/common/iServer/GetLayersInfoService.js
  28874. 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); }
  28875. function GetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28876. 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); } }
  28877. function GetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetLayersInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  28878. 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); }
  28879. function GetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  28880. 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); }
  28881. function GetLayersInfoService_setPrototypeOf(o, p) { GetLayersInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetLayersInfoService_setPrototypeOf(o, p); }
  28882. 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); }; }
  28883. function GetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (GetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetLayersInfoService_assertThisInitialized(self); }
  28884. function GetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28885. 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; } }
  28886. function GetLayersInfoService_getPrototypeOf(o) { GetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetLayersInfoService_getPrototypeOf(o); }
  28887. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  28888. * This program are made available under the terms of the Apache License, Version 2.0
  28889. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28890. /**
  28891. * @class SuperMap.GetLayersInfoService
  28892. * @category iServer Map Layer
  28893. * @classdesc 获取图层信息服务类构造函数。
  28894. * @extends {SuperMap.CommonServiceBase}
  28895. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:
  28896. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  28897. * 如 http://localhost:8090/iserver/services/map-world/rest/maps/World 。
  28898. * 如果查询临时图层的信息,请指定完成的url,包含临时图层ID信息,如:
  28899. * http://localhost:8090/iserver/services/map-world/rest/maps/World/tempLayersSet/resourceID
  28900. * @param {Object} options - 参数。
  28901. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  28902. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  28903. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  28904. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  28905. * @param {Object} [options.headers] - 请求头。
  28906. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  28907. */
  28908. var GetLayersInfoService_GetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  28909. GetLayersInfoService_inherits(GetLayersInfoService, _CommonServiceBase);
  28910. var _super = GetLayersInfoService_createSuper(GetLayersInfoService);
  28911. function GetLayersInfoService(url, options) {
  28912. var _this;
  28913. GetLayersInfoService_classCallCheck(this, GetLayersInfoService);
  28914. _this = _super.call(this, url, options);
  28915. /**
  28916. * @member {boolean} SuperMap.GetLayersInfoService.prototype.isTempLayers
  28917. * @description 当前url对应的图层是否是临时图层。
  28918. */
  28919. _this.isTempLayers = false;
  28920. if (options) {
  28921. Util_Util.extend(GetLayersInfoService_assertThisInitialized(_this), options);
  28922. }
  28923. _this.CLASS_NAME = "SuperMap.GetLayersInfoService";
  28924. return _this;
  28925. }
  28926. /**
  28927. * @function SuperMap.GetLayersInfoService.prototype.destroy
  28928. * @override
  28929. */
  28930. GetLayersInfoService_createClass(GetLayersInfoService, [{
  28931. key: "destroy",
  28932. value: function destroy() {
  28933. GetLayersInfoService_get(GetLayersInfoService_getPrototypeOf(GetLayersInfoService.prototype), "destroy", this).call(this);
  28934. Util_Util.reset(this);
  28935. }
  28936. /**
  28937. * @function SuperMap.GetLayersInfoService.prototype.processAsync
  28938. * @description 负责将客户端的更新参数传递到服务端。
  28939. */
  28940. }, {
  28941. key: "processAsync",
  28942. value: function processAsync() {
  28943. var me = this,
  28944. method = "GET";
  28945. if (!me.isTempLayers) {
  28946. me.url = Util_Util.urlPathAppend(me.url, 'layers');
  28947. }
  28948. me.request({
  28949. method: method,
  28950. params: null,
  28951. scope: me,
  28952. success: me.serviceProcessCompleted,
  28953. failure: me.serviceProcessFailed
  28954. });
  28955. }
  28956. /**
  28957. * @function SuperMap.GetLayersInfoService.prototype.serviceProcessCompleted
  28958. * @description 编辑完成,执行此方法。
  28959. * @param {Object} result - 服务器返回的结果对象。
  28960. */
  28961. }, {
  28962. key: "serviceProcessCompleted",
  28963. value: function serviceProcessCompleted(result) {
  28964. var me = this,
  28965. existRes,
  28966. layers,
  28967. len;
  28968. result = Util_Util.transformResult(result);
  28969. existRes = !!result && result.length > 0;
  28970. layers = existRes ? result[0].subLayers.layers : null;
  28971. len = layers ? layers.length : 0;
  28972. me.handleLayers(len, layers);
  28973. me.events.triggerEvent("processCompleted", {
  28974. result: result[0]
  28975. });
  28976. }
  28977. /**
  28978. * TODO 专题图时候可能会用到
  28979. * @function SuperMap.GetLayersInfoService.prototype.handleLayers
  28980. * @description 处理 iServer 新增图层组数据 (subLayers.layers 中可能还会含有 subLayers.layers)
  28981. * @param {number} len - subLayers.layers的长度
  28982. * @param {Array.<number>} layers - subLayers.layers的长度数组
  28983. */
  28984. }, {
  28985. key: "handleLayers",
  28986. value: function handleLayers(len, layers) {
  28987. var me = this,
  28988. tempLayer;
  28989. if (len) {
  28990. for (var i = 0; i < len; i++) {
  28991. if (layers[i].subLayers && layers[i].subLayers.layers && layers[i].subLayers.layers.length > 0) {
  28992. me.handleLayers(layers[i].subLayers.layers.length, layers[i].subLayers.layers);
  28993. } else {
  28994. var type = layers[i].ugcLayerType;
  28995. switch (type) {
  28996. case 'THEME':
  28997. tempLayer = new ServerTheme_ServerTheme();
  28998. tempLayer.fromJson(layers[i]);
  28999. layers[i] = tempLayer;
  29000. break;
  29001. case 'GRID':
  29002. tempLayer = new Grid_Grid();
  29003. tempLayer.fromJson(layers[i]);
  29004. layers[i] = tempLayer;
  29005. break;
  29006. case 'IMAGE':
  29007. tempLayer = new Image_UGCImage();
  29008. tempLayer.fromJson(layers[i]);
  29009. layers[i] = tempLayer;
  29010. break;
  29011. case 'VECTOR':
  29012. tempLayer = new iServer_Vector_Vector();
  29013. tempLayer.fromJson(layers[i]);
  29014. layers[i] = tempLayer;
  29015. break;
  29016. default:
  29017. break;
  29018. }
  29019. }
  29020. }
  29021. }
  29022. }
  29023. }]);
  29024. return GetLayersInfoService;
  29025. }(CommonServiceBase_CommonServiceBase);
  29026. SuperMap.GetLayersInfoService = GetLayersInfoService_GetLayersInfoService;
  29027. // CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystParameters.js
  29028. function InterpolationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29029. 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); } }
  29030. function InterpolationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  29031. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  29032. * This program are made available under the terms of the Apache License, Version 2.0
  29033. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29034. /**
  29035. * @class SuperMap.InterpolationAnalystParameters
  29036. * @category iServer SpatialAnalyst InterpolationAnalyst
  29037. * @classdesc 插值分析参数类。
  29038. * @param {Object} options - 参数。
  29039. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  29040. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  29041. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  29042. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。
  29043. * @param {string} [options.dataset] - 用于做插值分析的数据源中数据集的名称。当插值分析类型(InterpolationAnalystType)为 dataset 时,此参数为必选。
  29044. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  29045. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  29046. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  29047. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  29048. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  29049. * @param {SuperMap.PixelFormat} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  29050. * @param {string} [options.InterpolationAnalystType="dataset"] - 插值分析类型("dataset" 或 "geometry")。
  29051. */
  29052. var InterpolationAnalystParameters_InterpolationAnalystParameters = /*#__PURE__*/function () {
  29053. function InterpolationAnalystParameters(options) {
  29054. InterpolationAnalystParameters_classCallCheck(this, InterpolationAnalystParameters);
  29055. if (!options) {
  29056. return;
  29057. }
  29058. /**
  29059. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.InterpolationAnalystParameters.prototype.bounds
  29060. * @description 插值分析的范围,用于确定结果栅格数据集的范围。
  29061. * 如果缺省,则默认为原数据集的范围。鉴于此插值方法为内插方法,原数据集的范围内的插值结果才相对有参考价值,
  29062. * 因此建议此参数不大于原数据集范围。
  29063. */
  29064. this.bounds = null;
  29065. /**
  29066. * @member {number} [SuperMap.InterpolationAnalystParameters.prototype.searchRadius=0]
  29067. * @description 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  29068. * 计算某个位置的Z 值时,会以该位置为圆心,以查找范围的值为半径,落在这个范围内的采样点都将参与运算。
  29069. * 该值需要根据待插值点数据的分布状况和点数据集范围进行设置。
  29070. */
  29071. this.searchRadius = 0;
  29072. /**
  29073. * @member {string} SuperMap.InterpolationAnalystParameters.prototype.zValueFieldName
  29074. * @description 数据集插值分析中,用于指定进行插值分析的目标字段名,插值分析不支持文本类型的字段。
  29075. * 含义为每个插值点在插值过程中的权重,可以将所有点此字段值设置为 1,即所有点在整体插值中权重相同。
  29076. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  29077. */
  29078. this.zValueFieldName = null;
  29079. /**
  29080. * @member {number} [SuperMap.InterpolationAnalystParameters.prototype.zValueScale=1]
  29081. * @description 用于进行插值分析值的缩放比率。
  29082. * 参加插值分析的值将乘以该参数值后再进行插值,也就是对进行插值分析的值进行统一的扩大或缩小。
  29083. */
  29084. this.zValueScale = 1;
  29085. /**
  29086. * @member {number} SuperMap.InterpolationAnalystParameters.prototype.resolution
  29087. * @description 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  29088. * 该值不能超过待分析数据集的范围边长。
  29089. * 且该值设置时,应该考虑点数据集范围大小来取值,一般为结果栅格行列值(即结果栅格数据集范围除以分辨率),在 500 以内可以较好地体现密度走势。
  29090. */
  29091. this.resolution = null;
  29092. /**
  29093. * @member {SuperMap.FilterParameter} [SuperMap.InterpolationAnalystParameters.prototype.filterQueryParameter]
  29094. * @description 过滤条件,对分析数据集中的点进行过滤,设置为 null 表示对数据集中的所有点进行分析。
  29095. */
  29096. this.filterQueryParameter = null;
  29097. /**
  29098. * @member {string} SuperMap.InterpolationAnalystParameters.prototype.outputDatasetName
  29099. * @description 插值分析结果数据集的名称。
  29100. */
  29101. this.outputDatasetName = null;
  29102. /**
  29103. * @member {string} SuperMap.InterpolationAnalystParameters.prototype.outputDatasourceName
  29104. * @description 插值分析结果数据源的名称。
  29105. */
  29106. this.outputDatasourceName = null;
  29107. /**
  29108. * @member {SuperMap.PixelFormat} [SuperMap.InterpolationAnalystParameters.prototype.pixelFormat]
  29109. * @description 指定结果栅格数据集存储的像素格式。支持存储的像素格式有 BIT16、BIT32、DOUBLE、SINGLE、UBIT1、UBIT4、UBIT8、UBIT24、UBIT32。
  29110. */
  29111. this.pixelFormat = null;
  29112. /**
  29113. * @member {string} [SuperMap.InterpolationAnalystParameters.prototype.dataset]
  29114. * @description 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。
  29115. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此参数为必选。
  29116. */
  29117. this.dataset = null;
  29118. /**
  29119. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [SuperMap.InterpolationAnalystParameters.prototype.inputPoints]
  29120. * @description 用于做插值分析的离散点(离散点包括Z值)集合。
  29121. * 当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  29122. * 通过离散点直接进行插值分析不需要指定输入数据集inputDatasourceName,inputDatasetName以及zValueFieldName。
  29123. */
  29124. this.inputPoints = null;
  29125. /**
  29126. * @member {string} [SuperMap.InterpolationAnalystParameters.prototype.InterpolationAnalystType="dataset"]
  29127. * @description 插值分析类型。差值分析包括数据集插值分析和几何插值分析两类,
  29128. * "dataset" 表示对数据集进行插值分析,"geometry" 表示对离散点数组进行插值分析。
  29129. */
  29130. this.InterpolationAnalystType = "dataset";
  29131. /**
  29132. * @member {Object} SuperMap.InterpolationAnalystParameters.prototype.clipParam
  29133. * @description 对插值分析结果进行裁剪的参数。
  29134. */
  29135. this.clipParam = null;
  29136. Util_Util.extend(this, options);
  29137. this.CLASS_NAME = "SuperMap.InterpolationAnalystParameters";
  29138. }
  29139. /**
  29140. * @function SuperMap.InterpolationAnalystParameters.prototype.destroy
  29141. * @description 释放资源,将引用资源的属性置空。
  29142. */
  29143. InterpolationAnalystParameters_createClass(InterpolationAnalystParameters, [{
  29144. key: "destroy",
  29145. value: function destroy() {
  29146. var me = this;
  29147. me.bounds = null;
  29148. me.searchRadius = null;
  29149. me.zValueFieldName = null;
  29150. me.zValueScale = null;
  29151. me.resolution = null;
  29152. me.filterQueryParameter = null;
  29153. me.outputDatasetName = null;
  29154. me.pixelFormat = null;
  29155. }
  29156. /**
  29157. * @function SuperMap.InterpolationAnalystParameters.toObject
  29158. * @param {SuperMap.InterpolationAnalystParameters} interpolationAnalystParameters - 插值分析参数类。
  29159. * @param {SuperMap.InterpolationAnalystParameters} tempObj - 插值分析参数对象。
  29160. * @description 将插值分析参数对象转换成 JSON 对象。
  29161. * @returns JSON 对象。
  29162. */
  29163. }], [{
  29164. key: "toObject",
  29165. value: function toObject(interpolationAnalystParameters, tempObj) {
  29166. for (var name in interpolationAnalystParameters) {
  29167. if (name === "inputPoints" && interpolationAnalystParameters.InterpolationAnalystType === "geometry") {
  29168. var objs = [];
  29169. for (var i = 0; i < interpolationAnalystParameters.inputPoints.length; i++) {
  29170. var item = interpolationAnalystParameters.inputPoints[i];
  29171. var obj = {
  29172. x: item.x,
  29173. y: item.y,
  29174. z: item.tag
  29175. };
  29176. objs.push(obj);
  29177. }
  29178. tempObj[name] = objs;
  29179. } else {
  29180. tempObj[name] = interpolationAnalystParameters[name];
  29181. }
  29182. }
  29183. }
  29184. }]);
  29185. return InterpolationAnalystParameters;
  29186. }();
  29187. SuperMap.InterpolationAnalystParameters = InterpolationAnalystParameters_InterpolationAnalystParameters;
  29188. // CONCATENATED MODULE: ./src/common/iServer/InterpolationRBFAnalystParameters.js
  29189. 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); }
  29190. function InterpolationRBFAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29191. 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); } }
  29192. function InterpolationRBFAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationRBFAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationRBFAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  29193. 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); }
  29194. function InterpolationRBFAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationRBFAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  29195. 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); }
  29196. function InterpolationRBFAnalystParameters_setPrototypeOf(o, p) { InterpolationRBFAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationRBFAnalystParameters_setPrototypeOf(o, p); }
  29197. 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); }; }
  29198. function InterpolationRBFAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationRBFAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationRBFAnalystParameters_assertThisInitialized(self); }
  29199. function InterpolationRBFAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29200. 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; } }
  29201. function InterpolationRBFAnalystParameters_getPrototypeOf(o) { InterpolationRBFAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationRBFAnalystParameters_getPrototypeOf(o); }
  29202. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  29203. * This program are made available under the terms of the Apache License, Version 2.0
  29204. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29205. /**
  29206. * @class SuperMap.InterpolationRBFAnalystParameters
  29207. * @category iServer SpatialAnalyst InterpolationAnalyst
  29208. * @classdesc 样条插值(径向基函数插值法)分析参数类。
  29209. * @extends {SuperMap.InterpolationAnalystParameters}
  29210. * @param {Object} options - 参数。
  29211. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  29212. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  29213. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  29214. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  29215. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  29216. * @param {number} [options.smooth=0.1] - 光滑系数,该值表示插值函数曲线与点的逼近程度,值域为0到1。
  29217. * @param {number} [options.tension=40] - 张力系数,用于调整结果栅格数据表面的特性。
  29218. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置参与差值运算的点数。
  29219. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  29220. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  29221. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  29222. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  29223. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  29224. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  29225. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  29226. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(InterpolationAnalystType)为 dataset 时。此参数为必选。
  29227. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时。此参数为必选。
  29228. * @example
  29229. * var myInterpolationRBFAnalystParameters = new SuperMap.InterpolationRBFAnalystParameters({
  29230. * dataset:"SamplesP@Interpolation",
  29231. * smooth: 0.1,
  29232. * tension: 40,
  29233. * searchMode: "QUADTREE",
  29234. * maxPointCountForInterpolation: 20,
  29235. * maxPointCountInNode: 5,
  29236. * pixelFormat: "BIT16",
  29237. * zValueFieldName: "AVG_TMP",
  29238. * resolution: 3000,
  29239. * filterQueryParameter: {
  29240. * attributeFilter: ""
  29241. * },
  29242. * outputDatasetName: "myRBF"
  29243. * });
  29244. */
  29245. var InterpolationRBFAnalystParameters_InterpolationRBFAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  29246. InterpolationRBFAnalystParameters_inherits(InterpolationRBFAnalystParameters, _InterpolationAnalyst);
  29247. var _super = InterpolationRBFAnalystParameters_createSuper(InterpolationRBFAnalystParameters);
  29248. function InterpolationRBFAnalystParameters(options) {
  29249. var _this;
  29250. InterpolationRBFAnalystParameters_classCallCheck(this, InterpolationRBFAnalystParameters);
  29251. _this = _super.call(this, options);
  29252. /**
  29253. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.smooth=0.1]
  29254. * @description 光滑系数,值域为 0 到 1,常用取值如 0、0.001、0.01、0.1、和 0.5。
  29255. * 该值表示插值函数曲线与点的逼近程度,此数值越大,函数曲线与点的偏差越大,反之越小。
  29256. */
  29257. _this.smooth = 0.1;
  29258. /**
  29259. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.tension=40]
  29260. * @description 张力系数,常用取值如 0、1、5 和 10。
  29261. * 用于调整结果栅格数据表面的特性,张力越大,插值时每个点对计算结果影响越小,反之越大。
  29262. */
  29263. _this.tension = 40;
  29264. /**
  29265. * @member {SuperMap.SearchMode} SuperMap.InterpolationRBFAnalystParameters.prototype.searchMode
  29266. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。必设参数。
  29267. * 具体如下:
  29268. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  29269. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  29270. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  29271. */
  29272. _this.searchMode = null;
  29273. /**
  29274. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.expectedCount=12]
  29275. * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
  29276. */
  29277. _this.expectedCount = 12;
  29278. /**
  29279. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.maxPointCountForInterpolation=200]
  29280. * @description 【块查找】方式下,最多参与插值的点数。
  29281. */
  29282. _this.maxPointCountForInterpolation = 200;
  29283. /**
  29284. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.maxPointCountInNode=50]
  29285. * @description 【块查找】方式下,单个块内最多参与运算点数。
  29286. */
  29287. _this.maxPointCountInNode = 50;
  29288. if (options) {
  29289. Util_Util.extend(InterpolationRBFAnalystParameters_assertThisInitialized(_this), options);
  29290. }
  29291. _this.CLASS_NAME = "SuperMap.InterpolationRBFAnalystParameters";
  29292. return _this;
  29293. }
  29294. /**
  29295. * @function SuperMap.InterpolationRBFAnalystParameters.prototype.destroy
  29296. * @description 释放资源,将引用资源的属性置空。
  29297. */
  29298. InterpolationRBFAnalystParameters_createClass(InterpolationRBFAnalystParameters, [{
  29299. key: "destroy",
  29300. value: function destroy() {
  29301. InterpolationRBFAnalystParameters_get(InterpolationRBFAnalystParameters_getPrototypeOf(InterpolationRBFAnalystParameters.prototype), "destroy", this).call(this);
  29302. var me = this;
  29303. me.smooth = null;
  29304. me.tension = null;
  29305. me.searchMode = null;
  29306. me.expectedCount = null;
  29307. me.maxPointCountForInterpolation = null;
  29308. me.maxPointCountInNode = null;
  29309. }
  29310. /**
  29311. * @function SuperMap.InterpolationRBFAnalystParameters.toObject
  29312. * @param {SuperMap.InterpolationRBFAnalystParameters} datasetInterpolationRBFAnalystParameters - 样条插值(径向基函数插值法)分析参数类
  29313. * @param {SuperMap.InterpolationRBFAnalystParameters} tempObj - 样条插值(径向基函数插值法)分析参数对象
  29314. * @description 将样条插值(径向基函数插值法)分析参数对象转换为 JSON 对象。
  29315. * @returns JSON 对象。
  29316. */
  29317. }], [{
  29318. key: "toObject",
  29319. value: function toObject(datasetInterpolationRBFAnalystParameters, tempObj) {
  29320. for (var name in datasetInterpolationRBFAnalystParameters) {
  29321. tempObj[name] = datasetInterpolationRBFAnalystParameters[name];
  29322. }
  29323. }
  29324. }]);
  29325. return InterpolationRBFAnalystParameters;
  29326. }(InterpolationAnalystParameters_InterpolationAnalystParameters);
  29327. SuperMap.InterpolationRBFAnalystParameters = InterpolationRBFAnalystParameters_InterpolationRBFAnalystParameters;
  29328. // CONCATENATED MODULE: ./src/common/iServer/InterpolationDensityAnalystParameters.js
  29329. 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); }
  29330. function InterpolationDensityAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29331. 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); } }
  29332. function InterpolationDensityAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationDensityAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationDensityAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  29333. 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); }
  29334. function InterpolationDensityAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationDensityAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  29335. 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); }
  29336. function InterpolationDensityAnalystParameters_setPrototypeOf(o, p) { InterpolationDensityAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationDensityAnalystParameters_setPrototypeOf(o, p); }
  29337. 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); }; }
  29338. function InterpolationDensityAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationDensityAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationDensityAnalystParameters_assertThisInitialized(self); }
  29339. function InterpolationDensityAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29340. 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; } }
  29341. function InterpolationDensityAnalystParameters_getPrototypeOf(o) { InterpolationDensityAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationDensityAnalystParameters_getPrototypeOf(o); }
  29342. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  29343. * This program are made available under the terms of the Apache License, Version 2.0
  29344. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29345. /**
  29346. * @class SuperMap.InterpolationDensityAnalystParameters
  29347. * @category iServer SpatialAnalyst InterpolationAnalyst
  29348. * @classdesc 点密度差值分析参数类。
  29349. * @param {Object} options - 参数。
  29350. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  29351. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  29352. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  29353. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  29354. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型( SuperMap.InterpolationAnalystType)为 dataset 时。此为必选参数。
  29355. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  29356. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  29357. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  29358. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  29359. * @param {string} [options.dataset] - 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,必设参数。
  29360. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(SuperMap.InterpolationAnalystType)为 geometry 时,必设参数。
  29361. * @extends {SuperMap.InterpolationAnalystParameters}
  29362. * @example
  29363. * var myInterpolationDensityAnalystParameters = new SuperMap.InterpolationDensityAnalystParameters({
  29364. * dataset: "SamplesP@Interpolation",
  29365. * searchRadius: "100000",
  29366. * pixelFormat: "BIT16",
  29367. * zValueFieldName: "AVG_TMP",
  29368. * resolution: 3000,
  29369. * filterQueryParameter: {
  29370. * attributeFilter: ""
  29371. * },
  29372. * outputDatasetName: "myDensity"
  29373. * });
  29374. */
  29375. var InterpolationDensityAnalystParameters_InterpolationDensityAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  29376. InterpolationDensityAnalystParameters_inherits(InterpolationDensityAnalystParameters, _InterpolationAnalyst);
  29377. var _super = InterpolationDensityAnalystParameters_createSuper(InterpolationDensityAnalystParameters);
  29378. function InterpolationDensityAnalystParameters(options) {
  29379. var _this;
  29380. InterpolationDensityAnalystParameters_classCallCheck(this, InterpolationDensityAnalystParameters);
  29381. _this = _super.call(this, options);
  29382. if (options) {
  29383. Util_Util.extend(InterpolationDensityAnalystParameters_assertThisInitialized(_this), options);
  29384. }
  29385. _this.CLASS_NAME = "SuperMap.InterpolationDensityAnalystParameters";
  29386. return _this;
  29387. }
  29388. /**
  29389. * @function SuperMap.InterpolationDensityAnalystParameters.prototype.destroy
  29390. * @description 释放资源,将引用资源的属性置空。
  29391. */
  29392. InterpolationDensityAnalystParameters_createClass(InterpolationDensityAnalystParameters, [{
  29393. key: "destroy",
  29394. value: function destroy() {
  29395. InterpolationDensityAnalystParameters_get(InterpolationDensityAnalystParameters_getPrototypeOf(InterpolationDensityAnalystParameters.prototype), "destroy", this).call(this);
  29396. }
  29397. }]);
  29398. return InterpolationDensityAnalystParameters;
  29399. }(InterpolationAnalystParameters_InterpolationAnalystParameters);
  29400. SuperMap.InterpolationDensityAnalystParameters = InterpolationDensityAnalystParameters_InterpolationDensityAnalystParameters;
  29401. // CONCATENATED MODULE: ./src/common/iServer/InterpolationIDWAnalystParameters.js
  29402. 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); }
  29403. function InterpolationIDWAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29404. 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); } }
  29405. function InterpolationIDWAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationIDWAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationIDWAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  29406. 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); }
  29407. function InterpolationIDWAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationIDWAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  29408. 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); }
  29409. function InterpolationIDWAnalystParameters_setPrototypeOf(o, p) { InterpolationIDWAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationIDWAnalystParameters_setPrototypeOf(o, p); }
  29410. 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); }; }
  29411. function InterpolationIDWAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationIDWAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationIDWAnalystParameters_assertThisInitialized(self); }
  29412. function InterpolationIDWAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29413. 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; } }
  29414. function InterpolationIDWAnalystParameters_getPrototypeOf(o) { InterpolationIDWAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationIDWAnalystParameters_getPrototypeOf(o); }
  29415. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  29416. * This program are made available under the terms of the Apache License, Version 2.0
  29417. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29418. /**
  29419. * @class SuperMap.InterpolationIDWAnalystParameters
  29420. * @category iServer SpatialAnalyst InterpolationAnalyst
  29421. * @classdesc 反距离加权插值(IDW)分析参数类。
  29422. * @param {Object} options - 参数。
  29423. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  29424. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  29425. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  29426. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  29427. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  29428. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
  29429. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置查找半径,即参与运算点的查找范围,与点数据集单位相同。
  29430. * @param {number} [options.power=2] - 距离权重计算的幂次。
  29431. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  29432. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  29433. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  29434. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  29435. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,必设参数。
  29436. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(SuperMap.InterpolationAnalystType)为 geometry 时,必设参数。
  29437. * @extends {SuperMap.InterpolationAnalystParameters}
  29438. * @example 例如:
  29439. * var myInterpolationIDWAnalystParameters = new SuperMap.InterpolationIDWAnalystParameters({
  29440. * dataset:"SamplesP@Interpolation",
  29441. * power: 2,
  29442. * searchMode: "KDTREE_FIXED_COUNT",
  29443. * expectedCount: 12,
  29444. * pixelFormat: "BIT16",
  29445. * zValueFieldName: "AVG_TMP",
  29446. * resolution: 3000,
  29447. * filterQueryParameter: {
  29448. * attributeFilter: ""
  29449. * },
  29450. * outputDatasetName: "myIDW"
  29451. * });
  29452. *
  29453. */
  29454. var InterpolationIDWAnalystParameters_InterpolationIDWAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  29455. InterpolationIDWAnalystParameters_inherits(InterpolationIDWAnalystParameters, _InterpolationAnalyst);
  29456. var _super = InterpolationIDWAnalystParameters_createSuper(InterpolationIDWAnalystParameters);
  29457. function InterpolationIDWAnalystParameters(options) {
  29458. var _this;
  29459. InterpolationIDWAnalystParameters_classCallCheck(this, InterpolationIDWAnalystParameters);
  29460. _this = _super.call(this, options);
  29461. /**
  29462. * @member {number} [SuperMap.InterpolationIDWAnalystParameters.prototype.power=2]
  29463. * @description 距离权重计算的幂次。
  29464. * 该值决定了权值下降的速度,幂次越大,随距离的增大权值下降越快,距离预测点越远的点的权值也越小。
  29465. * 理论上,参数值必须大于0,但是0.5到3之间时运算结果更合理,因此推荐值为0.5~3。
  29466. */
  29467. _this.power = 2;
  29468. /**
  29469. * @member {SuperMap.SearchMode} SuperMap.InterpolationIDWAnalystParameters.prototype.searchMode
  29470. * @description 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  29471. * 具体如下:
  29472. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  29473. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  29474. */
  29475. _this.searchMode = null;
  29476. /**
  29477. * @member {number} [SuperMap.InterpolationIDWAnalystParameters.prototype.expectedCount=12]
  29478. * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
  29479. */
  29480. _this.expectedCount = 12;
  29481. if (options) {
  29482. Util_Util.extend(InterpolationIDWAnalystParameters_assertThisInitialized(_this), options);
  29483. }
  29484. _this.CLASS_NAME = "SuperMap.InterpolationIDWAnalystParameters";
  29485. return _this;
  29486. }
  29487. /**
  29488. * @function SuperMap.InterpolationIDWAnalystParameters.prototype.destroy
  29489. * @description 释放资源,将引用资源的属性置空。
  29490. */
  29491. InterpolationIDWAnalystParameters_createClass(InterpolationIDWAnalystParameters, [{
  29492. key: "destroy",
  29493. value: function destroy() {
  29494. InterpolationIDWAnalystParameters_get(InterpolationIDWAnalystParameters_getPrototypeOf(InterpolationIDWAnalystParameters.prototype), "destroy", this).call(this);
  29495. var me = this;
  29496. me.power = null;
  29497. me.searchMode = null;
  29498. me.expectedCount = null;
  29499. }
  29500. }]);
  29501. return InterpolationIDWAnalystParameters;
  29502. }(InterpolationAnalystParameters_InterpolationAnalystParameters);
  29503. SuperMap.InterpolationIDWAnalystParameters = InterpolationIDWAnalystParameters_InterpolationIDWAnalystParameters;
  29504. // CONCATENATED MODULE: ./src/common/iServer/InterpolationKrigingAnalystParameters.js
  29505. 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); }
  29506. function InterpolationKrigingAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29507. 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); } }
  29508. function InterpolationKrigingAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  29509. 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); }
  29510. function InterpolationKrigingAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationKrigingAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  29511. 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); }
  29512. function InterpolationKrigingAnalystParameters_setPrototypeOf(o, p) { InterpolationKrigingAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationKrigingAnalystParameters_setPrototypeOf(o, p); }
  29513. 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); }; }
  29514. function InterpolationKrigingAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationKrigingAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationKrigingAnalystParameters_assertThisInitialized(self); }
  29515. function InterpolationKrigingAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29516. 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; } }
  29517. function InterpolationKrigingAnalystParameters_getPrototypeOf(o) { InterpolationKrigingAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationKrigingAnalystParameters_getPrototypeOf(o); }
  29518. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  29519. * This program are made available under the terms of the Apache License, Version 2.0
  29520. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29521. /**
  29522. * @class SuperMap.InterpolationKrigingAnalystParameters
  29523. * @category iServer SpatialAnalyst InterpolationAnalyst
  29524. * @classdesc 克吕金插值分析参数类。
  29525. * @description 通过该类可以设置克吕金插值分析所需的参数。
  29526. * 克吕金(Kriging)法为地统计学上一种空间数据内插处理方法,主要的目的是利用各数据点间变异数(variance)的大小来推求某一未知点与各已知点的权重关系,
  29527. * 再由各数据点的值和其与未知点的权重关系推求未知点的值。Kriging 法最大的特色不仅是提供一个最小估计误差的预测值,并且可明确的指出误差值的大小。
  29528. * 一般而言,许多地质参数,如地形面,本身即具有连续性,故在一段距离内的任两点必有空间上的关系。反之,在一不规则面上的两点若相距甚远,
  29529. * 则在统计意义上可视为互为独立 (stastically indepedent)。这种随距离而改变的空间上连续性,可用半变异图 (semivariogram) 来表现。
  29530. * 因此,若想由已知的散乱点来推求某一未知点的值,则可利用半变异图推求各已知点与未知点的空间关系,即以下四个参数。
  29531. * 然后,由此空间参数推求半变异数,由各数据点间的半变异数可推求未知点与已知点间的权重关系,进而推求出未知点的值。<br>
  29532. *
  29533. * · 块金值(nugget):当采样点间距为0时,理论上半变异函数值为0,但时间上两采样点非常接近时半变异函数值并不为0,即产生了上图所示的块金效应,
  29534. * 对应的半变异函数值为块金值。块金值可能由于测量误差或者空间变异产生。<br>
  29535. *
  29536. * · 基台值(sill):随着采样点间距的不断增大,半变异函数的值趋向一个稳定的常数,该常数成为基台值。到达基台值后,半变异函数的值不再随采样点间距而改变,
  29537. * 即大于此间距的采样点不再具有空间相关性。<br>
  29538. *
  29539. * · 偏基台值:基台值与块金值的差值。<br>
  29540. *
  29541. * · 自相关阈值(range):也称变程,是半变异函数值达到基台值时,采样点的间距。超过自相关阈值的采样点不再具有空间相关性,将不对预测结果产生影响。<br>
  29542. *
  29543. * 由上述可知,半变异函数是克吕金插值的关键,因此选择合适的半变异函数模型非常重要,SuperMap 提供了以下三种半变异函数模型:<br>
  29544. *
  29545. * · 指数型(EXPONENTIAL):适用于空间相关关系随样本间距的增加成指数递减的情况,其空间自相关关系在样本间距的无穷远处完全消失。<br>
  29546. *
  29547. * · 球型(SPHERICAL):适用于空间自相关关系随样本间距的增加而逐渐减少,直到超出一定的距离时空间自相关关系消失的情况。<br>
  29548. *
  29549. * · 高斯型(GAUSSIAN):适用于半变异函数值渐进地逼近基台值的情况。<br>
  29550. *
  29551. * 半变异函数中,有一个关键参数即插值的字段值的期望(平均值),由于对于此参数的不同处理方法而衍生出了不同的 Kriging 方法。SuperMap的差值功能基于以下三种常用 Kriging 算法:<br>
  29552. *
  29553. * 1. 简单克吕金(Simple Kriging):该方法假定用于插值的字段值的期望(平均值)已知的某一常数。<br>
  29554. *
  29555. * 2. 普通克吕金(Kriging):该方法假定用于插值的字段值的期望(平均值)未知且恒定。它利用一定的数学函数,通过对给定的空间点进行拟合来估算单元格的值,<br>
  29556. * 生成格网数据集。它不仅可以生成一个表面,还可以给出预测结果的精度或者确定性的度量。因此,此方法计算精度较高,常用于地学领域。
  29557. *
  29558. * 3. 泛克吕金(Universal Kriging):该方法假定用于插值的字段值的期望(平均值)是未知的变量。在样点数据中存在某种主导趋势且该趋势可以通过某一个确定<br>
  29559. * 的函数或者多项式进行拟合的情况下,适用泛克吕金插值法。
  29560. *
  29561. * 克吕金法的优点是以空间统计学作为其坚实的理论基础,物理含义明确;不但能估计测定参数的空间变异分布,而且还可以估算参数的方差分布。克吕金法的缺点是计算步骤较烦琐,
  29562. * 计算量大,且变异函数有时需要根据经验人为选定。
  29563. * @param {Object} options - 参数。
  29564. * @param {string} options.type - 克吕金插值的类型。
  29565. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  29566. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  29567. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  29568. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  29569. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  29570. * @param {number} [options.mean] - 【简单克吕金】类型下,插值字段的平均值。
  29571. * @param {number} [options.angle=0] - 克吕金算法中旋转角度值。
  29572. * @param {number} [options.nugget=0] - 克吕金算法中块金效应值。
  29573. * @param {number} [options.range=0] - 克吕金算法中自相关阈值,单位与原数据集单位相同。
  29574. * @param {number} [options.sill=0] - 克吕金算法中基台值。
  29575. * @param {string} [options.variogramMode="SPHERICAL"] - 克吕金插值时的半变函数类型。
  29576. * @param {string} [options.exponent='exp1'] - 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数,可选值为 exp1、exp2。
  29577. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数;【定长查找】方式下,设置查找的最小点数。
  29578. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  29579. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  29580. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  29581. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  29582. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  29583. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  29584. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  29585. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如 ”数据集名称@数据源别名” 形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时。
  29586. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时。
  29587. * @extends {SuperMap.InterpolationAnalystParameters}
  29588. * @example 例如:
  29589. * var myInterpolationKrigingAnalystParameters = new SuperMap.InterpolationKrigingAnalystParameters({
  29590. * dataset:"SamplesP@Interpolation",
  29591. * type: "KRIGING",
  29592. * angle: 0,
  29593. * mean: 5,
  29594. * nugget: 30,
  29595. * range: 50,
  29596. * sill: 300,
  29597. * variogramMode: "EXPONENTIAL",
  29598. * searchMode: "QUADTREE",
  29599. * maxPointCountForInterpolation: 20,
  29600. * maxPointCountInNode: 5,
  29601. * pixelFormat: "BIT16",
  29602. * zValueFieldName: "AVG_TMP",
  29603. * resolution: 30000,
  29604. * filterQueryParameter: {
  29605. * attributeFilter: ""
  29606. * },
  29607. * outputDatasetName: "myKriging"
  29608. * });
  29609. *
  29610. */
  29611. var InterpolationKrigingAnalystParameters_InterpolationKrigingAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  29612. InterpolationKrigingAnalystParameters_inherits(InterpolationKrigingAnalystParameters, _InterpolationAnalyst);
  29613. var _super = InterpolationKrigingAnalystParameters_createSuper(InterpolationKrigingAnalystParameters);
  29614. function InterpolationKrigingAnalystParameters(options) {
  29615. var _this;
  29616. InterpolationKrigingAnalystParameters_classCallCheck(this, InterpolationKrigingAnalystParameters);
  29617. _this = _super.call(this, options);
  29618. /**
  29619. * @member {SuperMap.InterpolationAlgorithmType} SuperMap.InterpolationKrigingAnalystParameters.prototype.type
  29620. * @description 克吕金插值的类型。
  29621. * 具体如下:<br>
  29622. * {KRIGING} 普通克吕金插值法。
  29623. * {SimpleKriging} 简单克吕金插值法。
  29624. * {UniversalKriging} 泛克吕金插值法。
  29625. */
  29626. _this.type = null;
  29627. /**
  29628. * @member {number} SuperMap.InterpolationKrigingAnalystParameters.prototype.mean
  29629. * @description 【简单克吕金】方式下,插值字段的平均值。
  29630. * 即采样点插值字段值总和除以采样点数目。
  29631. */
  29632. _this.mean = null;
  29633. /**
  29634. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.angle=0]
  29635. * @description 克吕金算法中旋转角度值。
  29636. * 此角度值指示了每个查找邻域相对于水平方向逆时针旋转的角度。
  29637. */
  29638. _this.angle = 0;
  29639. /**
  29640. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.nugget=0]
  29641. * @description 克吕金算法中块金效应值。
  29642. */
  29643. _this.nugget = 0;
  29644. /**
  29645. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.range=0]
  29646. * @description 克吕金算法中自相关阈值,单位与原数据集单位相同。
  29647. */
  29648. _this.range = 0;
  29649. /**
  29650. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.sill=0]
  29651. * @description 克吕金算法中基台值。
  29652. */
  29653. _this.sill = 0;
  29654. /**
  29655. * @member {SuperMap.VariogramMode} [SuperMap.InterpolationKrigingAnalystParameters.prototype.variogramMode=SuperMap.VariogramMode.SPHERICAL]
  29656. * @description 克吕金插值时的半变函数类型。
  29657. * 用户所选择的半变函数类型会影响未知点的预测,特别是曲线在原点处的不同形状有重要意义。
  29658. * 曲线在原点处越陡,则较近领域对该预测值的影响就越大,因此输出表面就会越不光滑。
  29659. */
  29660. _this.variogramMode = VariogramMode.SPHERICAL;
  29661. /**
  29662. * @member {SuperMap.Exponent} [SuperMap.InterpolationKrigingAnalystParameters.prototype.exponent=SuperMap.Exponent.EXP1]
  29663. * @description 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数。
  29664. */
  29665. _this.exponent = Exponent.EXP1;
  29666. /**
  29667. * @member {SuperMap.SearchMode} SuperMap.InterpolationKrigingAnalystParameters.prototype.searchMode
  29668. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。必设参数。
  29669. * 简单克吕金和泛克吕金不支持块查找。
  29670. * 具体如下:<br>
  29671. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。<br>
  29672. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。<br>
  29673. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  29674. */
  29675. _this.searchMode = null;
  29676. /**
  29677. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.expectedCount=12]
  29678. * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数,默认值为12。
  29679. * 【定长查找】方式下,设置查找的最小点数,默认值为12。
  29680. */
  29681. _this.expectedCount = 12;
  29682. /**
  29683. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.maxPointCountForInterpolation=200]
  29684. * @description 【块查找】方式下,最多参与插值的点数。
  29685. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  29686. */
  29687. _this.maxPointCountForInterpolation = 200;
  29688. /**
  29689. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.maxPointCountForInterpolation=50]
  29690. * @description 【块查找】方式下,设置单个块内最多参与运算点数。
  29691. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  29692. */
  29693. _this.maxPointCountInNode = 50;
  29694. if (options) {
  29695. Util_Util.extend(InterpolationKrigingAnalystParameters_assertThisInitialized(_this), options);
  29696. }
  29697. _this.CLASS_NAME = "SuperMap.InterpolationKrigingAnalystParameters";
  29698. return _this;
  29699. }
  29700. /**
  29701. * @function SuperMap.InterpolationKrigingAnalystParameters.prototype.destroy
  29702. * @description 释放资源,将引用资源的属性置空。
  29703. */
  29704. InterpolationKrigingAnalystParameters_createClass(InterpolationKrigingAnalystParameters, [{
  29705. key: "destroy",
  29706. value: function destroy() {
  29707. InterpolationKrigingAnalystParameters_get(InterpolationKrigingAnalystParameters_getPrototypeOf(InterpolationKrigingAnalystParameters.prototype), "destroy", this).call(this);
  29708. var me = this;
  29709. me.type = null;
  29710. me.mean = null;
  29711. me.angle = null;
  29712. me.nugget = null;
  29713. me.range = null;
  29714. me.sill = null;
  29715. me.variogramMode = null;
  29716. me.exponent = null;
  29717. me.searchMode = null;
  29718. me.expectedCount = null;
  29719. me.maxPointCountForInterpolation = null;
  29720. me.maxPointCountInNode = null;
  29721. }
  29722. }]);
  29723. return InterpolationKrigingAnalystParameters;
  29724. }(InterpolationAnalystParameters_InterpolationAnalystParameters);
  29725. SuperMap.InterpolationKrigingAnalystParameters = InterpolationKrigingAnalystParameters_InterpolationKrigingAnalystParameters;
  29726. // CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystService.js
  29727. 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); }
  29728. function InterpolationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29729. 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); } }
  29730. function InterpolationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  29731. 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); }
  29732. function InterpolationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  29733. 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); }
  29734. function InterpolationAnalystService_setPrototypeOf(o, p) { InterpolationAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationAnalystService_setPrototypeOf(o, p); }
  29735. 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); }; }
  29736. function InterpolationAnalystService_possibleConstructorReturn(self, call) { if (call && (InterpolationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationAnalystService_assertThisInitialized(self); }
  29737. function InterpolationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29738. 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; } }
  29739. function InterpolationAnalystService_getPrototypeOf(o) { InterpolationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationAnalystService_getPrototypeOf(o); }
  29740. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  29741. * This program are made available under the terms of the Apache License, Version 2.0
  29742. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29743. /**
  29744. * @class SuperMap.InterpolationAnalystService
  29745. * @category iServer SpatialAnalyst InterpolationAnalyst
  29746. * @classdesc 插值分析服务类。
  29747. * 插值分析可以将有限的采样点数据,通过插值算法对采样点周围的数值情况进行预测,可以掌握研究区域内数据的总体分布状况,从而使采样的离散点不仅仅反映其所在位置的数值情况,
  29748. * 还可以反映区域的数值分布。目前SuperMap iServer的插值功能提供从点数据集插值得到栅格数据集的功能,支持以下常用的内插方法,
  29749. * 包括:反距离加权插值、克吕金(Kriging)插值法、样条(径向基函数,Radial Basis Function)插值、点密度插值。
  29750. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  29751. * @param {Object} options - 参数。</br>
  29752. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  29753. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29754. * @param {Object} [options.headers] - 请求头。
  29755. * @extends {SuperMap.SpatialAnalystBase}
  29756. * @example 例如:
  29757. * (start code)
  29758. * var myTInterpolationAnalystService = new SuperMap.InterpolationAnalystService(url);
  29759. * myTInterpolationAnalystService.events.on({
  29760. * "processCompleted": processCompleted,
  29761. * "processFailed": processFailed
  29762. * }
  29763. * );
  29764. * (end)
  29765. *
  29766. */
  29767. var InterpolationAnalystService_InterpolationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  29768. InterpolationAnalystService_inherits(InterpolationAnalystService, _SpatialAnalystBase);
  29769. var _super = InterpolationAnalystService_createSuper(InterpolationAnalystService);
  29770. function InterpolationAnalystService(url, options) {
  29771. var _this;
  29772. InterpolationAnalystService_classCallCheck(this, InterpolationAnalystService);
  29773. _this = _super.call(this, url, options);
  29774. /**
  29775. * @member {string} SuperMap.InterpolationAnalystService.prototype.mode
  29776. * @description 插值分析类型。
  29777. */
  29778. _this.mode = null;
  29779. if (options) {
  29780. Util_Util.extend(InterpolationAnalystService_assertThisInitialized(_this), options);
  29781. }
  29782. return _this;
  29783. }
  29784. /**
  29785. * @function SuperMap.InterpolationAnalystService.prototype.destroy
  29786. * @description 释放资源,将引用资源的属性置空。
  29787. */
  29788. InterpolationAnalystService_createClass(InterpolationAnalystService, [{
  29789. key: "destroy",
  29790. value: function destroy() {
  29791. InterpolationAnalystService_get(InterpolationAnalystService_getPrototypeOf(InterpolationAnalystService.prototype), "destroy", this).call(this);
  29792. this.mode = null;
  29793. this.CLASS_NAME = "SuperMap.InterpolationAnalystService";
  29794. }
  29795. /**
  29796. * @function SuperMap.InterpolationAnalystService.prototype.processAsync
  29797. * @description 负责将客户端的查询参数传递到服务端。
  29798. * @param {SuperMap.InterpolationAnalystParameters} parameter - 插值分析参数类。
  29799. */
  29800. }, {
  29801. key: "processAsync",
  29802. value: function processAsync(parameter) {
  29803. var parameterObject = {};
  29804. var me = this;
  29805. if (parameter instanceof InterpolationDensityAnalystParameters_InterpolationDensityAnalystParameters) {
  29806. me.mode = 'Density';
  29807. if (parameter.InterpolationAnalystType === 'geometry') {
  29808. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/density');
  29809. } else {
  29810. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/density');
  29811. }
  29812. } else if (parameter instanceof InterpolationIDWAnalystParameters_InterpolationIDWAnalystParameters) {
  29813. me.mode = 'IDW';
  29814. if (parameter.InterpolationAnalystType === 'geometry') {
  29815. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/idw');
  29816. } else {
  29817. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/idw');
  29818. }
  29819. } else if (parameter instanceof InterpolationRBFAnalystParameters_InterpolationRBFAnalystParameters) {
  29820. me.mode = 'RBF';
  29821. if (parameter.InterpolationAnalystType === 'geometry') {
  29822. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/rbf');
  29823. } else {
  29824. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/rbf');
  29825. }
  29826. } else if (parameter instanceof InterpolationKrigingAnalystParameters_InterpolationKrigingAnalystParameters) {
  29827. me.mode = 'Kriging';
  29828. if (parameter.InterpolationAnalystType === 'geometry') {
  29829. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/kriging');
  29830. } else {
  29831. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/kriging');
  29832. }
  29833. }
  29834. InterpolationAnalystParameters_InterpolationAnalystParameters.toObject(parameter, parameterObject);
  29835. var jsonParameters = Util_Util.toJSON(parameterObject);
  29836. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  29837. me.request({
  29838. method: "POST",
  29839. data: jsonParameters,
  29840. scope: me,
  29841. success: me.serviceProcessCompleted,
  29842. failure: me.serviceProcessFailed
  29843. });
  29844. }
  29845. }]);
  29846. return InterpolationAnalystService;
  29847. }(SpatialAnalystBase_SpatialAnalystBase);
  29848. SuperMap.InterpolationAnalystService = InterpolationAnalystService_InterpolationAnalystService;
  29849. // CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobParameter.js
  29850. function KernelDensityJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29851. 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); } }
  29852. function KernelDensityJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  29853. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  29854. * This program are made available under the terms of the Apache License, Version 2.0
  29855. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29856. /**
  29857. * @class SuperMap.KernelDensityJobParameter
  29858. * @category iServer ProcessingService DensityAnalyst
  29859. * @classdesc 密度分析任务参数类。
  29860. * @param {Object} options - 参数。
  29861. * @param {string} options.datasetName - 数据集名。
  29862. * @param {string} options.fields - 权重索引。
  29863. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  29864. * @param {number} [options.resolution=80] - 分辨率。
  29865. * @param {number} [options.method=0] - 分析方法。
  29866. * @param {number} [options.meshType=0] - 分析类型。
  29867. * @param {number} [options.radius=300] - 分析的影响半径。
  29868. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  29869. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  29870. */
  29871. var KernelDensityJobParameter_KernelDensityJobParameter = /*#__PURE__*/function () {
  29872. function KernelDensityJobParameter(options) {
  29873. KernelDensityJobParameter_classCallCheck(this, KernelDensityJobParameter);
  29874. if (!options) {
  29875. return;
  29876. }
  29877. /**
  29878. * @member {string} SuperMap.KernelDensityJobParameter.prototype.datasetName
  29879. * @description 数据集名。
  29880. */
  29881. this.datasetName = "";
  29882. /**
  29883. * @member {SuperMap.Bounds|L.Bounds|ol.extent} [SuperMap.KernelDensityJobParameter.prototype.query]
  29884. * @description 分析范围。
  29885. */
  29886. this.query = "";
  29887. /**
  29888. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.resolution=80]
  29889. * @description 网格大小。
  29890. */
  29891. this.resolution = 80;
  29892. /**
  29893. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.method=0]
  29894. * @description 分析方法。
  29895. */
  29896. this.method = 0;
  29897. /**
  29898. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.meshType=0]
  29899. * @description 分析类型。
  29900. */
  29901. this.meshType = 0;
  29902. /**
  29903. * @member {string} SuperMap.KernelDensityJobParameter.prototype.fields
  29904. * @description 权重索引。
  29905. */
  29906. this.fields = "";
  29907. /**
  29908. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.radius=300]
  29909. * @description 分析的影响半径。
  29910. */
  29911. this.radius = 300;
  29912. /**
  29913. * @member {SuperMap.AnalystSizeUnit} [SuperMap.KernelDensityJobParameter.prototype.meshSizeUnit=SuperMap.AnalystSizeUnit.METER]
  29914. * @description 网格大小单位。
  29915. */
  29916. this.meshSizeUnit = AnalystSizeUnit.METER;
  29917. /**
  29918. * @member {SuperMap.AnalystSizeUnit} [SuperMap.KernelDensityJobParameter.prototype.radiusUnit=SuperMap.AnalystSizeUnit.METER]
  29919. * @description 搜索半径单位。
  29920. */
  29921. this.radiusUnit = AnalystSizeUnit.METER;
  29922. /**
  29923. * @member {SuperMap.AnalystAreaUnit} [SuperMap.KernelDensityJobParameter.prototype.areaUnit=SuperMap.AnalystAreaUnit.SQUAREMILE]
  29924. * @description 面积单位。
  29925. */
  29926. this.areaUnit = AnalystAreaUnit.SQUAREMILE;
  29927. /**
  29928. * @member {SuperMap.OutputSetting} SuperMap.KernelDensityJobParameter.prototype.output
  29929. * @description 输出参数设置类
  29930. */
  29931. this.output = null;
  29932. /**
  29933. * @member {SuperMap.MappingParameters} [SuperMap.KernelDensityJobParameter.prototype.mappingParameters]
  29934. * @description 分析后结果可视化的参数类。
  29935. */
  29936. this.mappingParameters = null;
  29937. Util_Util.extend(this, options);
  29938. this.CLASS_NAME = "SuperMap.KernelDensityJobParameter";
  29939. }
  29940. /**
  29941. * @function SuperMap.KernelDensityJobParameter.prototype.destroy
  29942. * @description 释放资源,将引用资源的属性置空。
  29943. */
  29944. KernelDensityJobParameter_createClass(KernelDensityJobParameter, [{
  29945. key: "destroy",
  29946. value: function destroy() {
  29947. this.datasetName = null;
  29948. this.query = null;
  29949. this.resolution = null;
  29950. this.method = null;
  29951. this.radius = null;
  29952. this.meshType = null;
  29953. this.fields = null;
  29954. this.meshSizeUnit = null;
  29955. this.radiusUnit = null;
  29956. this.areaUnit = null;
  29957. if (this.output instanceof OutputSetting_OutputSetting) {
  29958. this.output.destroy();
  29959. this.output = null;
  29960. }
  29961. if (this.mappingParameters instanceof MappingParameters_MappingParameters) {
  29962. this.mappingParameters.destroy();
  29963. this.mappingParameters = null;
  29964. }
  29965. }
  29966. /**
  29967. * @function SuperMap.KernelDensityJobParameter.toObject
  29968. * @param {SuperMap.KernelDensityJobParameter} kernelDensityJobParameter - 密度分析任务参数类。
  29969. * @param {SuperMap.KernelDensityJobParameter} tempObj - 密度分析任务参数对象。
  29970. * @description 将密度分析任务参数对象转换为 JSON 对象。
  29971. * @returns JSON 对象。
  29972. */
  29973. }], [{
  29974. key: "toObject",
  29975. value: function toObject(kernelDensityJobParameter, tempObj) {
  29976. for (var name in kernelDensityJobParameter) {
  29977. if (name === "datasetName") {
  29978. tempObj['input'] = tempObj['input'] || {};
  29979. tempObj['input'][name] = kernelDensityJobParameter[name];
  29980. continue;
  29981. }
  29982. if (name === "output") {
  29983. tempObj['output'] = tempObj['output'] || {};
  29984. tempObj['output'] = kernelDensityJobParameter[name];
  29985. continue;
  29986. }
  29987. tempObj['analyst'] = tempObj['analyst'] || {};
  29988. if (name === 'query' && kernelDensityJobParameter[name]) {
  29989. tempObj['analyst'][name] = kernelDensityJobParameter[name].toBBOX();
  29990. } else {
  29991. tempObj['analyst'][name] = kernelDensityJobParameter[name];
  29992. }
  29993. if (name === 'mappingParameters') {
  29994. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  29995. tempObj['analyst']['mappingParameters'] = kernelDensityJobParameter[name];
  29996. }
  29997. }
  29998. }
  29999. }]);
  30000. return KernelDensityJobParameter;
  30001. }();
  30002. SuperMap.KernelDensityJobParameter = KernelDensityJobParameter_KernelDensityJobParameter;
  30003. // CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobsService.js
  30004. 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); }
  30005. function KernelDensityJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30006. 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); } }
  30007. function KernelDensityJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  30008. 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); }
  30009. function KernelDensityJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = KernelDensityJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  30010. 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); }
  30011. function KernelDensityJobsService_setPrototypeOf(o, p) { KernelDensityJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return KernelDensityJobsService_setPrototypeOf(o, p); }
  30012. 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); }; }
  30013. function KernelDensityJobsService_possibleConstructorReturn(self, call) { if (call && (KernelDensityJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return KernelDensityJobsService_assertThisInitialized(self); }
  30014. function KernelDensityJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30015. 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; } }
  30016. function KernelDensityJobsService_getPrototypeOf(o) { KernelDensityJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return KernelDensityJobsService_getPrototypeOf(o); }
  30017. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30018. * This program are made available under the terms of the Apache License, Version 2.0
  30019. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30020. /**
  30021. * @class SuperMap.KernelDensityJobsService
  30022. * @category iServer ProcessingService DensityAnalyst
  30023. * @classdesc 核密度分析服务类
  30024. * @extends {SuperMap.ProcessingServiceBase}
  30025. * @param {string} url -核密度分析服务地址。
  30026. * @param {Object} options - 交互服务时所需可选参数。
  30027. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30028. * @param {Object} [options.headers] - 请求头。
  30029. */
  30030. var KernelDensityJobsService_KernelDensityJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  30031. KernelDensityJobsService_inherits(KernelDensityJobsService, _ProcessingServiceBas);
  30032. var _super = KernelDensityJobsService_createSuper(KernelDensityJobsService);
  30033. function KernelDensityJobsService(url, options) {
  30034. var _this;
  30035. KernelDensityJobsService_classCallCheck(this, KernelDensityJobsService);
  30036. _this = _super.call(this, url, options);
  30037. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/density');
  30038. _this.CLASS_NAME = "SuperMap.KernelDensityJobsService";
  30039. return _this;
  30040. }
  30041. /**
  30042. * @function SuperMap.KernelDensityJobsService.prototype.destroy
  30043. * @override
  30044. */
  30045. KernelDensityJobsService_createClass(KernelDensityJobsService, [{
  30046. key: "destroy",
  30047. value: function destroy() {
  30048. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "destroy", this).call(this);
  30049. }
  30050. /**
  30051. * @function SuperMap.KernelDensityJobsService.prototype.getKernelDensityJobs
  30052. * @description 获取核密度分析任务
  30053. */
  30054. }, {
  30055. key: "getKernelDensityJobs",
  30056. value: function getKernelDensityJobs() {
  30057. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, this.url);
  30058. }
  30059. /**
  30060. * @function SuperMap.KernelDensityJobsService.prototype.getKernelDensityJobs
  30061. * @description 获取指定id的核密度分析服务
  30062. * @param {string} id - 指定要获取数据的id
  30063. */
  30064. }, {
  30065. key: "getKernelDensityJob",
  30066. value: function getKernelDensityJob(id) {
  30067. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  30068. }
  30069. /**
  30070. * @function SuperMap.KernelDensityJobsService.prototype.addKernelDensityJob
  30071. * @description 新建核密度分析服务
  30072. * @param {SuperMap.KernelDensityJobParameter} params - 创建一个空间分析的请求参数。
  30073. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  30074. */
  30075. }, {
  30076. key: "addKernelDensityJob",
  30077. value: function addKernelDensityJob(params, seconds) {
  30078. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "addJob", this).call(this, this.url, params, KernelDensityJobParameter_KernelDensityJobParameter, seconds);
  30079. }
  30080. }]);
  30081. return KernelDensityJobsService;
  30082. }(ProcessingServiceBase_ProcessingServiceBase);
  30083. SuperMap.KernelDensityJobsService = KernelDensityJobsService_KernelDensityJobsService;
  30084. // CONCATENATED MODULE: ./src/common/iServer/LabelMatrixCell.js
  30085. function LabelMatrixCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30086. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30087. * This program are made available under the terms of the Apache License, Version 2.0
  30088. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30089. /**
  30090. * @class SuperMap.LabelMatrixCell
  30091. * @category iServer Map Theme
  30092. * @classdesc 矩阵标签元素抽象类。
  30093. * @description 该类可以包含 n*n 个矩阵标签元素,矩阵标签元素的类型可以是图片,符号,标签专题图等。
  30094. * 符号类型的矩阵标签元素类、图片类型的矩阵标签元素类和专题图类型的矩阵标签元素类均继承自该类。
  30095. */
  30096. var LabelMatrixCell = function LabelMatrixCell() {
  30097. LabelMatrixCell_classCallCheck(this, LabelMatrixCell);
  30098. this.CLASS_NAME = "LabelMatrixCell";
  30099. };
  30100. SuperMap.LabelMatrixCell = LabelMatrixCell;
  30101. // CONCATENATED MODULE: ./src/common/iServer/LabelImageCell.js
  30102. 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); }
  30103. function LabelImageCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30104. 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); } }
  30105. function LabelImageCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelImageCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelImageCell_defineProperties(Constructor, staticProps); return Constructor; }
  30106. 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); }
  30107. function LabelImageCell_setPrototypeOf(o, p) { LabelImageCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelImageCell_setPrototypeOf(o, p); }
  30108. 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); }; }
  30109. function LabelImageCell_possibleConstructorReturn(self, call) { if (call && (LabelImageCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelImageCell_assertThisInitialized(self); }
  30110. function LabelImageCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30111. 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; } }
  30112. function LabelImageCell_getPrototypeOf(o) { LabelImageCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelImageCell_getPrototypeOf(o); }
  30113. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30114. * This program are made available under the terms of the Apache License, Version 2.0
  30115. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30116. /**
  30117. * @class SuperMap.LabelImageCell
  30118. * @category iServer Map Theme
  30119. * @classdesc 图片类型的矩阵标签元素类。
  30120. * @description 该类继承自 {@link SuperMap.LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  30121. * 矩阵标签专题图是标签专题图(ThemeLabel)的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
  30122. * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  30123. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
  30124. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 是一个二维数组,
  30125. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  30126. * @extends {SuperMap.LabelMatrixCell}
  30127. * @param {Object} options - 参数。
  30128. * @param {number} [options.height=0] - 设置图片的高度,单位为毫米。
  30129. * @param {string} [options.pathField] - 设置矩阵标签元素所使用图片的路径。
  30130. * @param {number} [options.rotation=0.0] - 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  30131. * @param {number} [options.width=0] - 设置图片的宽度,单位为毫米。
  30132. * @param {boolean} [options.sizeFixed=false] - 是否固定图片的大小。
  30133. */
  30134. var LabelImageCell_LabelImageCell = /*#__PURE__*/function (_LabelMatrixCell) {
  30135. LabelImageCell_inherits(LabelImageCell, _LabelMatrixCell);
  30136. var _super = LabelImageCell_createSuper(LabelImageCell);
  30137. function LabelImageCell(options) {
  30138. var _this;
  30139. LabelImageCell_classCallCheck(this, LabelImageCell);
  30140. _this = _super.call(this, options);
  30141. /**
  30142. * @member {number} SuperMap.LabelImageCell.prototype.height
  30143. * @description 设置图片的高度,单位为毫米。
  30144. */
  30145. _this.height = 0;
  30146. /**
  30147. * @member {string} SuperMap.LabelImageCell.prototype.pathField
  30148. * @description 设置矩阵标签元素所使用的图片路径对应的字段名。
  30149. */
  30150. _this.pathField = null;
  30151. /**
  30152. * @member {number} [SuperMap.LabelImageCell.prototype.rotation=0.0]
  30153. * @description 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  30154. */
  30155. _this.rotation = 0.0;
  30156. /**
  30157. * @member {number} SuperMap.LabelImageCell.prototype.width
  30158. * @description 设置图片的宽度,单位为毫米。
  30159. */
  30160. _this.width = 0;
  30161. /**
  30162. * @member {boolean} [SuperMap.LabelImageCell.prototype.sizeFixed=false]
  30163. * @description 是否固定图片的大小。
  30164. */
  30165. _this.sizeFixed = false;
  30166. /**
  30167. * @member {string} SuperMap.LabelImageCell.prototype.type
  30168. * @description 制作矩阵专题图时是必须的。
  30169. */
  30170. _this.type = "IMAGE";
  30171. if (options) {
  30172. Util_Util.extend(LabelImageCell_assertThisInitialized(_this), options);
  30173. }
  30174. _this.CLASS_NAME = "SuperMap.LabelImageCell";
  30175. return _this;
  30176. }
  30177. /**
  30178. * @function SuperMap.LabelImageCell.prototype.destroy
  30179. * @description 释放资源,将引用资源的属性置空。
  30180. */
  30181. LabelImageCell_createClass(LabelImageCell, [{
  30182. key: "destroy",
  30183. value: function destroy() {
  30184. var me = this;
  30185. me.height = null;
  30186. me.pathField = null;
  30187. me.rotation = null;
  30188. me.width = null;
  30189. me.sizeFixed = null;
  30190. }
  30191. }]);
  30192. return LabelImageCell;
  30193. }(LabelMatrixCell);
  30194. SuperMap.LabelImageCell = LabelImageCell_LabelImageCell;
  30195. // CONCATENATED MODULE: ./src/common/iServer/LabelSymbolCell.js
  30196. 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); }
  30197. function LabelSymbolCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30198. 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); } }
  30199. function LabelSymbolCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelSymbolCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelSymbolCell_defineProperties(Constructor, staticProps); return Constructor; }
  30200. 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); }
  30201. function LabelSymbolCell_setPrototypeOf(o, p) { LabelSymbolCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelSymbolCell_setPrototypeOf(o, p); }
  30202. 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); }; }
  30203. function LabelSymbolCell_possibleConstructorReturn(self, call) { if (call && (LabelSymbolCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelSymbolCell_assertThisInitialized(self); }
  30204. function LabelSymbolCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30205. 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; } }
  30206. function LabelSymbolCell_getPrototypeOf(o) { LabelSymbolCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelSymbolCell_getPrototypeOf(o); }
  30207. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30208. * This program are made available under the terms of the Apache License, Version 2.0
  30209. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30210. /**
  30211. * @class SuperMap.LabelSymbolCell
  30212. * @category iServer Map Theme
  30213. * @classdesc 符号类型的矩阵标签元素类。
  30214. * @description 该类继承自 {@link SuperMap.LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  30215. * 矩阵标签专题图是标签专题图({@link SuperMap.ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
  30216. * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  30217. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
  30218. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 属是一个二维数组,
  30219. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  30220. * @extends {SuperMap.LabelMatrixCell}
  30221. * @param {Object} options - 参数。
  30222. * @param {SuperMap.ServerStyle} options.style - 获取或设置符号样式。
  30223. * @param {string} options.symbolIDField - 符号 ID 或符号 ID 所对应的字段名称。
  30224. */
  30225. var LabelSymbolCell_LabelSymbolCell = /*#__PURE__*/function (_LabelMatrixCell) {
  30226. LabelSymbolCell_inherits(LabelSymbolCell, _LabelMatrixCell);
  30227. var _super = LabelSymbolCell_createSuper(LabelSymbolCell);
  30228. function LabelSymbolCell(options) {
  30229. var _this;
  30230. LabelSymbolCell_classCallCheck(this, LabelSymbolCell);
  30231. _this = _super.call(this, options);
  30232. /**
  30233. * @member {SuperMap.ServerStyle} SuperMap.LabelSymbolCell.prototype.style
  30234. * @description 获取或设置符号样式—— {@link SuperMap.ServerStyle} 对象,包括符号大小({@link SuperMap.ServerStyle.markerSize})
  30235. * 和符号旋转({@link SuperMap.ServerStyle.markerAngle})角度,其中用于设置符号 ID 的属性({@link SuperMap.ServerStyle.markerSymbolID})在此处不起作用。
  30236. */
  30237. _this.style = new ServerStyle_ServerStyle();
  30238. /**
  30239. * @member {string} SuperMap.LabelSymbolCell.prototype.symbolIDField
  30240. * @description 获取或设置符号 ID 或符号 ID 所对应的字段名称。
  30241. */
  30242. _this.symbolIDField = null;
  30243. /**
  30244. * @member {string} SuperMap.LabelSymbolCell.prototype.type
  30245. * @description 制作矩阵专题图时是必须的。
  30246. */
  30247. _this.type = "SYMBOL";
  30248. if (options) {
  30249. Util_Util.extend(LabelSymbolCell_assertThisInitialized(_this), options);
  30250. }
  30251. _this.CLASS_NAME = "SuperMap.LabelSymbolCell";
  30252. return _this;
  30253. }
  30254. /**
  30255. * @function SuperMap.LabelSymbolCell.prototype.destroy
  30256. * @description 释放资源,将引用资源的属性置空。
  30257. */
  30258. LabelSymbolCell_createClass(LabelSymbolCell, [{
  30259. key: "destroy",
  30260. value: function destroy() {
  30261. var me = this;
  30262. if (me.style) {
  30263. me.style.destroy();
  30264. me.style = null;
  30265. }
  30266. me.symbolIDField = null;
  30267. }
  30268. }]);
  30269. return LabelSymbolCell;
  30270. }(LabelMatrixCell);
  30271. SuperMap.LabelSymbolCell = LabelSymbolCell_LabelSymbolCell;
  30272. // CONCATENATED MODULE: ./src/common/iServer/LabelThemeCell.js
  30273. 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); }
  30274. function LabelThemeCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30275. 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); } }
  30276. function LabelThemeCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelThemeCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelThemeCell_defineProperties(Constructor, staticProps); return Constructor; }
  30277. 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); }
  30278. function LabelThemeCell_setPrototypeOf(o, p) { LabelThemeCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelThemeCell_setPrototypeOf(o, p); }
  30279. 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); }; }
  30280. function LabelThemeCell_possibleConstructorReturn(self, call) { if (call && (LabelThemeCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelThemeCell_assertThisInitialized(self); }
  30281. function LabelThemeCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30282. 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; } }
  30283. function LabelThemeCell_getPrototypeOf(o) { LabelThemeCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelThemeCell_getPrototypeOf(o); }
  30284. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30285. * This program are made available under the terms of the Apache License, Version 2.0
  30286. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30287. /**
  30288. * @class SuperMap.LabelThemeCell
  30289. * @category iServer Map Theme
  30290. * @classdesc 专题图类型的矩阵标签元素类。
  30291. * @description 该类继承自 {@link SuperMap.LabelMatrixCell} 类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  30292. * 矩阵标签专题图是标签专题图({@link SuperMap.ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
  30293. * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  30294. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
  30295. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 属是一个二维数组,
  30296. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  30297. * @extends {SuperMap.LabelMatrixCell}
  30298. * @param {Object} options -参数。
  30299. * @param {SuperMap.ThemeLabel} options.themeLabel - 使用专题图对象作为矩阵标签的一个元素。
  30300. */
  30301. var LabelThemeCell_LabelThemeCell = /*#__PURE__*/function (_LabelMatrixCell) {
  30302. LabelThemeCell_inherits(LabelThemeCell, _LabelMatrixCell);
  30303. var _super = LabelThemeCell_createSuper(LabelThemeCell);
  30304. function LabelThemeCell(options) {
  30305. var _this;
  30306. LabelThemeCell_classCallCheck(this, LabelThemeCell);
  30307. _this = _super.call(this, options);
  30308. /**
  30309. * @member {SuperMap.ThemeLabel} SuperMap.LabelThemeCell.prototype.themeLabel
  30310. * @description 使用专题图对象作为矩阵标签的一个元素。
  30311. */
  30312. _this.themeLabel = new ThemeLabel_ThemeLabel();
  30313. /**
  30314. * @member {string} SuperMap.LabelThemeCell.prototype.type
  30315. * @description 制作矩阵专题图时是必须的。
  30316. */
  30317. _this.type = "THEME";
  30318. if (options) {
  30319. Util_Util.extend(LabelThemeCell_assertThisInitialized(_this), options);
  30320. }
  30321. _this.CLASS_NAME = " SuperMap.LabelThemeCell";
  30322. return _this;
  30323. }
  30324. /**
  30325. * @function SuperMap.LabelThemeCell.prototype.destroy
  30326. * @description 释放资源,将引用资源的属性置空。
  30327. */
  30328. LabelThemeCell_createClass(LabelThemeCell, [{
  30329. key: "destroy",
  30330. value: function destroy() {
  30331. var me = this;
  30332. if (me.themeLabel) {
  30333. me.themeLabel.destroy();
  30334. me.themeLabel = null;
  30335. }
  30336. }
  30337. }]);
  30338. return LabelThemeCell;
  30339. }(LabelMatrixCell);
  30340. SuperMap.LabelThemeCell = LabelThemeCell_LabelThemeCell;
  30341. // CONCATENATED MODULE: ./src/common/iServer/LayerStatus.js
  30342. function LayerStatus_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30343. 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); } }
  30344. function LayerStatus_createClass(Constructor, protoProps, staticProps) { if (protoProps) LayerStatus_defineProperties(Constructor.prototype, protoProps); if (staticProps) LayerStatus_defineProperties(Constructor, staticProps); return Constructor; }
  30345. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30346. * This program are made available under the terms of the Apache License, Version 2.0
  30347. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30348. /**
  30349. * @class SuperMap.LayerStatus
  30350. * @category iServer Map Theme
  30351. * @classdesc 子图层显示参数类。
  30352. * @description 该类存储了各个子图层的名字和是否可见的状态。
  30353. * @param {Object} options - 参数。
  30354. * @param {string} options.layerName - 获取或设置图层名称。
  30355. * @param {boolean} [options.isVisible=true] - 获取或设置图层是否可见,true 表示可见。
  30356. * @param {string} [options.displayFilter] - 图层显示 SQL 过滤条件。
  30357. */
  30358. var LayerStatus_LayerStatus = /*#__PURE__*/function () {
  30359. function LayerStatus(options) {
  30360. LayerStatus_classCallCheck(this, LayerStatus);
  30361. /**
  30362. * @member {string} SuperMap.LayerStatus.prototype.layerName
  30363. * @description 获取或设置图层名称。
  30364. */
  30365. this.layerName = null;
  30366. /**
  30367. * @member {boolean} SuperMap.LayerStatus.prototype.isVisible
  30368. * @description 获取或设置图层是否可见,true 表示可见。
  30369. */
  30370. this.isVisible = null;
  30371. /**
  30372. * @member {string} [SuperMap.LayerStatus.prototype.displayFilter]
  30373. * @description 图层显示 SQL 过滤条件,如 layerStatus.displayFilter = "smid < 10",表示仅显示 smid 值小于 10 的对象。
  30374. */
  30375. this.displayFilter = null;
  30376. /**
  30377. * @member {Object} [SuperMap.LayerStatus.prototype.fieldValuesDisplayFilter]
  30378. * @property {Array.<number>} values - 要过滤的值。
  30379. * @property {string} fieldName - 要过滤的字段名称只支持数字类型的字段。
  30380. * @property {string} fieldValuesDisplayMode - 目前有两个 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  30381. */
  30382. this.fieldValuesDisplayFilter = null;
  30383. if (options) {
  30384. Util_Util.extend(this, options);
  30385. }
  30386. this.CLASS_NAME = "SuperMap.LayerStatus";
  30387. }
  30388. /**
  30389. * @function SuperMap.LayerStatus.prototype.destroy
  30390. * @description 释放资源,将引用资源的属性置空。
  30391. */
  30392. LayerStatus_createClass(LayerStatus, [{
  30393. key: "destroy",
  30394. value: function destroy() {
  30395. var me = this;
  30396. me.layerName = null;
  30397. me.isVisible = null;
  30398. me.displayFilter = null;
  30399. }
  30400. /**
  30401. * @function SuperMap.LayerStatus.prototype.toJSON
  30402. * @description 生成对应的 JSON。
  30403. * @returns {Object} 对应的 JSON。
  30404. */
  30405. }, {
  30406. key: "toJSON",
  30407. value: function toJSON() {
  30408. var json = '{';
  30409. json += '"type":"UGC",';
  30410. var v = [];
  30411. if (this.layerName) {
  30412. v.push('"name":"' + this.layerName + '"');
  30413. v.push('"visible":' + this.isVisible);
  30414. }
  30415. if (this.displayFilter) {
  30416. v.push('"displayFilter":"' + this.displayFilter + '"');
  30417. }
  30418. if (this.minScale || this.minScale == 0) {
  30419. v.push('"minScale":' + this.minScale);
  30420. }
  30421. if (this.maxScale || this.maxScale == 0) {
  30422. v.push('"maxScale":' + this.maxScale);
  30423. }
  30424. if (this.fieldValuesDisplayFilter) {
  30425. v.push('"fieldValuesDisplayFilter":' + Util_Util.toJSON(this.fieldValuesDisplayFilter));
  30426. }
  30427. json += v;
  30428. json += '}';
  30429. return json;
  30430. }
  30431. }]);
  30432. return LayerStatus;
  30433. }();
  30434. SuperMap.LayerStatus = LayerStatus_LayerStatus;
  30435. // CONCATENATED MODULE: ./src/common/iServer/MapService.js
  30436. 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); }
  30437. function MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30438. 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); } }
  30439. function MapService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapService_defineProperties(Constructor, staticProps); return Constructor; }
  30440. 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); }
  30441. function MapService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapService_getPrototypeOf(object); if (object === null) break; } return object; }
  30442. 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); }
  30443. function MapService_setPrototypeOf(o, p) { MapService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapService_setPrototypeOf(o, p); }
  30444. 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); }; }
  30445. function MapService_possibleConstructorReturn(self, call) { if (call && (MapService_typeof(call) === "object" || typeof call === "function")) { return call; } return MapService_assertThisInitialized(self); }
  30446. function MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30447. 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; } }
  30448. function MapService_getPrototypeOf(o) { MapService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapService_getPrototypeOf(o); }
  30449. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30450. * This program are made available under the terms of the Apache License, Version 2.0
  30451. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30452. /**
  30453. * @class SuperMap.MapService
  30454. * @category iServer Map
  30455. * @classdesc 地图信息服务类。
  30456. * @extends {SuperMap.CommonServiceBase}
  30457. * @example
  30458. * var myMapService = new SuperMap.MapService(url, {
  30459. * eventListeners:{
  30460. * "processCompleted": MapServiceCompleted,
  30461. * "processFailed": MapServiceFailed
  30462. * }
  30463. * });
  30464. *
  30465. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  30466. * @param {Object} options - 参数。
  30467. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  30468. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  30469. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  30470. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30471. * @param {Object} [options.headers] - 请求头。
  30472. */
  30473. var MapService_MapService = /*#__PURE__*/function (_CommonServiceBase) {
  30474. MapService_inherits(MapService, _CommonServiceBase);
  30475. var _super = MapService_createSuper(MapService);
  30476. function MapService(url, options) {
  30477. var _this;
  30478. MapService_classCallCheck(this, MapService);
  30479. _this = _super.call(this, url, options);
  30480. /**
  30481. * @member {string} SuperMap.MapService.prototype.projection
  30482. * @description 根据投影参数获取地图状态信息。如"EPSG:4326"
  30483. */
  30484. _this.projection = null;
  30485. _this.CLASS_NAME = "SuperMap.MapService";
  30486. if (options) {
  30487. Util_Util.extend(MapService_assertThisInitialized(_this), options);
  30488. }
  30489. var me = MapService_assertThisInitialized(_this);
  30490. if (me.projection) {
  30491. var arr = me.projection.split(":");
  30492. if (arr instanceof Array) {
  30493. if (arr.length === 2) {
  30494. me.url = Util_Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[1], "\"}"))));
  30495. }
  30496. if (arr.length === 1) {
  30497. me.url = Util_Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[0], "\"}"))));
  30498. }
  30499. }
  30500. }
  30501. return _this;
  30502. }
  30503. /**
  30504. * @function destroy
  30505. * @description 释放资源,将引用的资源属性置空。
  30506. */
  30507. MapService_createClass(MapService, [{
  30508. key: "destroy",
  30509. value: function destroy() {
  30510. MapService_get(MapService_getPrototypeOf(MapService.prototype), "destroy", this).call(this);
  30511. var me = this;
  30512. if (me.events) {
  30513. me.events.un(me.eventListeners);
  30514. me.events.listeners = null;
  30515. me.events.destroy();
  30516. me.events = null;
  30517. me.eventListeners = null;
  30518. }
  30519. }
  30520. /**
  30521. * @function SuperMap.MapService.prototype.processAsync
  30522. * @description 负责将客户端的设置的参数传递到服务端,与服务端完成异步通讯。
  30523. */
  30524. }, {
  30525. key: "processAsync",
  30526. value: function processAsync() {
  30527. var me = this;
  30528. me.request({
  30529. method: "GET",
  30530. scope: me,
  30531. success: me.serviceProcessCompleted,
  30532. failure: me.serviceProcessFailed
  30533. });
  30534. }
  30535. /*
  30536. * Method: getMapStatusCompleted
  30537. * 获取地图状态完成,执行此方法。
  30538. *
  30539. * Parameters:
  30540. * {Object} result - 服务器返回的结果对象。
  30541. */
  30542. }, {
  30543. key: "serviceProcessCompleted",
  30544. value: function serviceProcessCompleted(result) {
  30545. var me = this;
  30546. result = Util_Util.transformResult(result);
  30547. var codeStatus = result.code >= 200 && result.code < 300 || result.code == 0 || result.code === 304;
  30548. var isCodeValid = result.code && codeStatus;
  30549. if (!result.code || isCodeValid) {
  30550. me.events && me.events.triggerEvent("processCompleted", {
  30551. result: result
  30552. });
  30553. } else {
  30554. ////在没有token是返回的是200,但是其实是没有权限,所以这里也应该是触发失败事件
  30555. me.events.triggerEvent("processFailed", {
  30556. error: result
  30557. });
  30558. }
  30559. }
  30560. }]);
  30561. return MapService;
  30562. }(CommonServiceBase_CommonServiceBase);
  30563. SuperMap.MapService = MapService_MapService;
  30564. // CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisParameters.js
  30565. function MathExpressionAnalysisParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30566. 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); } }
  30567. function MathExpressionAnalysisParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisParameters_defineProperties(Constructor, staticProps); return Constructor; }
  30568. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30569. * This program are made available under the terms of the Apache License, Version 2.0
  30570. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30571. /**
  30572. * @class SuperMap.MathExpressionAnalysisParameters
  30573. * @category iServer SpatialAnalyst GridMathAnalyst
  30574. * @classdesc 栅格代数运算参数类。
  30575. * @param {Object} options - 参数。
  30576. * @param {string} options.dataset - 要用来做栅格代数运算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:BaseMap_P@Jingjin。
  30577. * @param {string} options.resultGridName - 指定结果数据集名称。
  30578. * @param {string} options.expression - 指定的栅格运算表达式。如:[DatasourceAlias1.Raster1]*2-10。
  30579. * @param {string} options.targetDatasource - 指定存储结果数据集的数据源。
  30580. * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.extractRegion] - 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  30581. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  30582. * @param {boolean} [options.isZip=false] - 是否对结果数据集进行压缩处理。
  30583. * @param {boolean} [options.ignoreNoValue=false] - 是否忽略无值栅格数据。true 表示忽略无值数据,即无值栅格不参与运算。
  30584. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  30585. */
  30586. var MathExpressionAnalysisParameters_MathExpressionAnalysisParameters = /*#__PURE__*/function () {
  30587. function MathExpressionAnalysisParameters(options) {
  30588. MathExpressionAnalysisParameters_classCallCheck(this, MathExpressionAnalysisParameters);
  30589. if (!options) {
  30590. return;
  30591. }
  30592. /**
  30593. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.dataset
  30594. * @description 要用来做栅格代数运算数据源中数据集的名称。
  30595. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  30596. *
  30597. */
  30598. this.dataset = null;
  30599. /**
  30600. * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.MathExpressionAnalysisParameters.prototype.extractRegion]
  30601. * @description 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  30602. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  30603. */
  30604. this.extractRegion = null;
  30605. /**
  30606. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.expression
  30607. * @description 指定的栅格运算表达式。如:"[DatasourceAlias1.Raster1]*2-10"。
  30608. */
  30609. this.expression = null;
  30610. /**
  30611. * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.isZip=false]
  30612. * @description 是否对结果数据集进行压缩处理。
  30613. */
  30614. this.isZip = false;
  30615. /**
  30616. * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.ignoreNoValue=false]
  30617. * @description 是否忽略无值栅格数据。
  30618. */
  30619. this.ignoreNoValue = false;
  30620. /**
  30621. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.targetDatasource
  30622. * @description 指定存储结果数据集的数据源。
  30623. */
  30624. this.targetDatasource = null;
  30625. /**
  30626. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.resultGridName
  30627. * @description 指定结果数据集名称。
  30628. */
  30629. this.resultGridName = null;
  30630. /**
  30631. * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.deleteExistResultDataset=false]
  30632. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  30633. */
  30634. this.deleteExistResultDataset = false;
  30635. Util_Util.extend(this, options);
  30636. this.CLASS_NAME = "SuperMap.MathExpressionAnalysisParameters";
  30637. }
  30638. /**
  30639. * @function SuperMap.MathExpressionAnalysisParameters.prototype.destroy
  30640. * @description 释放资源,将引用资源的属性置空。
  30641. */
  30642. MathExpressionAnalysisParameters_createClass(MathExpressionAnalysisParameters, [{
  30643. key: "destroy",
  30644. value: function destroy() {
  30645. var me = this;
  30646. me.dataset = null;
  30647. me.bounds = null;
  30648. me.expression = null;
  30649. me.isZip = true;
  30650. me.ignoreNoValue = true;
  30651. me.targetDatasource = null;
  30652. me.resultGridName = null;
  30653. me.deleteExistResultDataset = null;
  30654. }
  30655. /**
  30656. * @function SuperMap.MathExpressionAnalysisParameters.toObject
  30657. * @param {Object} mathExpressionAnalysisParameters - 栅格代数运算参数。
  30658. * @param {Object} tempObj - 目标对象。
  30659. * @description 生成栅格代数运算对象。
  30660. */
  30661. }], [{
  30662. key: "toObject",
  30663. value: function toObject(mathExpressionAnalysisParameters, tempObj) {
  30664. for (var name in mathExpressionAnalysisParameters) {
  30665. if (name !== "dataset") {
  30666. tempObj[name] = mathExpressionAnalysisParameters[name];
  30667. }
  30668. if (name === "extractRegion") {
  30669. if (mathExpressionAnalysisParameters[name]) {
  30670. var bs = mathExpressionAnalysisParameters[name].components[0].components;
  30671. var region = {},
  30672. points = [],
  30673. type = "REGION";
  30674. var len = bs.length;
  30675. for (var i = 0; i < len - 1; i++) {
  30676. var poi = {};
  30677. poi["x"] = bs[i].x;
  30678. poi["y"] = bs[i].y;
  30679. points.push(poi);
  30680. }
  30681. region["points"] = points;
  30682. region["type"] = type;
  30683. tempObj[name] = region;
  30684. }
  30685. }
  30686. }
  30687. }
  30688. }]);
  30689. return MathExpressionAnalysisParameters;
  30690. }();
  30691. SuperMap.MathExpressionAnalysisParameters = MathExpressionAnalysisParameters_MathExpressionAnalysisParameters;
  30692. // CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisService.js
  30693. 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); }
  30694. function MathExpressionAnalysisService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30695. 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); } }
  30696. function MathExpressionAnalysisService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisService_defineProperties(Constructor, staticProps); return Constructor; }
  30697. 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); }
  30698. function MathExpressionAnalysisService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MathExpressionAnalysisService_getPrototypeOf(object); if (object === null) break; } return object; }
  30699. 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); }
  30700. function MathExpressionAnalysisService_setPrototypeOf(o, p) { MathExpressionAnalysisService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MathExpressionAnalysisService_setPrototypeOf(o, p); }
  30701. 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); }; }
  30702. function MathExpressionAnalysisService_possibleConstructorReturn(self, call) { if (call && (MathExpressionAnalysisService_typeof(call) === "object" || typeof call === "function")) { return call; } return MathExpressionAnalysisService_assertThisInitialized(self); }
  30703. function MathExpressionAnalysisService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30704. 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; } }
  30705. function MathExpressionAnalysisService_getPrototypeOf(o) { MathExpressionAnalysisService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MathExpressionAnalysisService_getPrototypeOf(o); }
  30706. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30707. * This program are made available under the terms of the Apache License, Version 2.0
  30708. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30709. /**
  30710. * @class SuperMap.MathExpressionAnalysisService
  30711. * @category iServer SpatialAnalyst GridMathAnalyst
  30712. * @classdesc 栅格代数运算服务类。
  30713. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  30714. * @param {Object} options - 参数。</br>
  30715. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  30716. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30717. * @param {Object} [options.headers] - 请求头。
  30718. * @extends {SuperMap.SpatialAnalystBase}
  30719. * @example 例如:
  30720. * (start code)
  30721. * var myMathExpressionAnalysisService = new SuperMap.MathExpressionAnalysisService(url);
  30722. * myMathExpressionAnalysisService.on({
  30723. * "processCompleted": processCompleted,
  30724. * "processFailed": processFailed
  30725. * }
  30726. * );
  30727. * (end)
  30728. *
  30729. */
  30730. var MathExpressionAnalysisService_MathExpressionAnalysisService = /*#__PURE__*/function (_SpatialAnalystBase) {
  30731. MathExpressionAnalysisService_inherits(MathExpressionAnalysisService, _SpatialAnalystBase);
  30732. var _super = MathExpressionAnalysisService_createSuper(MathExpressionAnalysisService);
  30733. function MathExpressionAnalysisService(url, options) {
  30734. var _this;
  30735. MathExpressionAnalysisService_classCallCheck(this, MathExpressionAnalysisService);
  30736. _this = _super.call(this, url, options);
  30737. _this.CLASS_NAME = "SuperMap.MathExpressionAnalysisService";
  30738. return _this;
  30739. }
  30740. /**
  30741. * @override
  30742. */
  30743. MathExpressionAnalysisService_createClass(MathExpressionAnalysisService, [{
  30744. key: "destroy",
  30745. value: function destroy() {
  30746. MathExpressionAnalysisService_get(MathExpressionAnalysisService_getPrototypeOf(MathExpressionAnalysisService.prototype), "destroy", this).call(this);
  30747. }
  30748. /**
  30749. * @function SuperMap.MathExpressionAnalysisService.prototype.processAsync
  30750. * @description 负责将客户端的查询参数传递到服务端。
  30751. * @param {SuperMap.MathExpressionAnalysisParameters} parameter - 栅格代数运算参数类。
  30752. */
  30753. }, {
  30754. key: "processAsync",
  30755. value: function processAsync(parameter) {
  30756. var me = this;
  30757. var parameterObject = {};
  30758. if (parameter instanceof MathExpressionAnalysisParameters_MathExpressionAnalysisParameters) {
  30759. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/mathanalyst');
  30760. }
  30761. MathExpressionAnalysisParameters_MathExpressionAnalysisParameters.toObject(parameter, parameterObject);
  30762. var jsonParameters = Util_Util.toJSON(parameterObject);
  30763. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  30764. me.request({
  30765. method: "POST",
  30766. data: jsonParameters,
  30767. scope: me,
  30768. success: me.serviceProcessCompleted,
  30769. failure: me.serviceProcessFailed
  30770. });
  30771. }
  30772. }]);
  30773. return MathExpressionAnalysisService;
  30774. }(SpatialAnalystBase_SpatialAnalystBase);
  30775. SuperMap.MathExpressionAnalysisService = MathExpressionAnalysisService_MathExpressionAnalysisService;
  30776. // CONCATENATED MODULE: ./src/common/iServer/MeasureParameters.js
  30777. function MeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30778. 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); } }
  30779. function MeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureParameters_defineProperties(Constructor, staticProps); return Constructor; }
  30780. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30781. * This program are made available under the terms of the Apache License, Version 2.0
  30782. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30783. /**
  30784. * @class SuperMap.MeasureParameters
  30785. * @category iServer Map Measure
  30786. * @classdesc 量算参数类。
  30787. * @param {Object} geometry - 要量算的几何对象。
  30788. * @param {Object} options - 参数。
  30789. * @param {SuperMap.Unit} [options.unit=SuperMap.Unit.METER] - 量算单位。
  30790. * @param {string} [options.prjCoordSys] - 用来指定该量算操作所使用的投影。
  30791. * @param {string} [options.distanceMode="Geodesic"] - 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  30792. */
  30793. var MeasureParameters_MeasureParameters = /*#__PURE__*/function () {
  30794. function MeasureParameters(geometry, options) {
  30795. MeasureParameters_classCallCheck(this, MeasureParameters);
  30796. if (!geometry) {
  30797. return;
  30798. }
  30799. /**
  30800. * @member {Object} SuperMap.MeasureParameters.prototype.geometry
  30801. * @description 要量算的几何对象。<br>
  30802. * 点类型可以是:{@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>
  30803. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
  30804. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  30805. */
  30806. this.geometry = geometry;
  30807. /**
  30808. * @member {SuperMap.Unit} [SuperMap.MeasureParameters.prototype.unit=SuperMap.Unit.METER]
  30809. * @description 量算单位。即量算结果以米为单位。
  30810. */
  30811. this.unit = Unit.METER;
  30812. /**
  30813. * @member {string} [SuperMap.MeasureParameters.prototype.prjCoordSys]
  30814. * @description 用来指定该量算操作所使用的投影。
  30815. */
  30816. this.prjCoordSys = null;
  30817. /**
  30818. * @member {string} [SuperMap.MeasureParameters.prototype.distanceMode="Geodesic"]
  30819. * @description 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  30820. * @example
  30821. * var param = new SuperMap.MeasureParameters(getmetry,{distanceMode:'Planar'});
  30822. */
  30823. this.distanceMode = null;
  30824. if (options) {
  30825. Util_Util.extend(this, options);
  30826. }
  30827. this.CLASS_NAME = "SuperMap.MeasureParameters";
  30828. }
  30829. /**
  30830. * @function SuperMap.MeasureParameters.prototype.destroy
  30831. * @description 释放资源,将引用资源的属性置空。
  30832. */
  30833. MeasureParameters_createClass(MeasureParameters, [{
  30834. key: "destroy",
  30835. value: function destroy() {
  30836. var me = this;
  30837. me.geometry = null;
  30838. me.unit = null;
  30839. me.prjCoordSys = null;
  30840. }
  30841. }]);
  30842. return MeasureParameters;
  30843. }();
  30844. SuperMap.MeasureParameters = MeasureParameters_MeasureParameters;
  30845. // CONCATENATED MODULE: ./src/common/iServer/MeasureService.js
  30846. 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); }
  30847. function MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30848. 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); } }
  30849. function MeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureService_defineProperties(Constructor, staticProps); return Constructor; }
  30850. 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); }
  30851. function MeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  30852. 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); }
  30853. function MeasureService_setPrototypeOf(o, p) { MeasureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MeasureService_setPrototypeOf(o, p); }
  30854. 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); }; }
  30855. function MeasureService_possibleConstructorReturn(self, call) { if (call && (MeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } return MeasureService_assertThisInitialized(self); }
  30856. function MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30857. 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; } }
  30858. function MeasureService_getPrototypeOf(o) { MeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MeasureService_getPrototypeOf(o); }
  30859. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30860. * This program are made available under the terms of the Apache License, Version 2.0
  30861. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30862. /**
  30863. * @class SuperMap.MeasureService
  30864. * @category iServer Map Measure
  30865. * @classdesc 量算服务类。
  30866. * 该类负责将量算参数传递到服务端,并获取服务端返回的量算结果。
  30867. * @extends {SuperMap.CommonServiceBase}
  30868. * @example
  30869. * var myMeasuerService = new SuperMap.MeasureService(url, {
  30870. * measureMode: SuperMap.MeasureMode.DISTANCE,
  30871. * eventListeners:{
  30872. * "processCompleted": measureCompleted
  30873. * }
  30874. * });
  30875. * @param {string} url - 服务访问的地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  30876. * @param {Object} options - 参数。
  30877. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  30878. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  30879. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  30880. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30881. * @param {Object} [options.headers] - 请求头。
  30882. * @param {MeasureMode} options.measureMode - 量算模式,包括距离量算模式和面积量算模式。
  30883. */
  30884. var MeasureService_MeasureService = /*#__PURE__*/function (_CommonServiceBase) {
  30885. MeasureService_inherits(MeasureService, _CommonServiceBase);
  30886. var _super = MeasureService_createSuper(MeasureService);
  30887. function MeasureService(url, options) {
  30888. var _this;
  30889. MeasureService_classCallCheck(this, MeasureService);
  30890. _this = _super.call(this, url, options);
  30891. /**
  30892. * @member {SuperMap.MeasureMode} [SuperMap.MeasureService.prototype.measureMode=MeasureMode.DISTANCE]
  30893. * @description 量算模式,包括距离量算模式和面积量算模式。
  30894. */
  30895. _this.measureMode = MeasureMode.DISTANCE;
  30896. if (options) {
  30897. Util_Util.extend(MeasureService_assertThisInitialized(_this), options);
  30898. }
  30899. _this.CLASS_NAME = "SuperMap.MeasureService";
  30900. return _this;
  30901. }
  30902. /**
  30903. * @override
  30904. */
  30905. MeasureService_createClass(MeasureService, [{
  30906. key: "destroy",
  30907. value: function destroy() {
  30908. MeasureService_get(MeasureService_getPrototypeOf(MeasureService.prototype), "destroy", this).call(this);
  30909. var me = this;
  30910. me.measureMode = null;
  30911. }
  30912. /**
  30913. * @function SuperMap.MeasureService.prototype.processAsync
  30914. * @description 负责将客户端的量算参数传递到服务端。
  30915. * @param {SuperMap.MeasureParameters} params - 量算参数。
  30916. */
  30917. }, {
  30918. key: "processAsync",
  30919. value: function processAsync(params) {
  30920. if (!(params instanceof MeasureParameters_MeasureParameters)) {
  30921. return;
  30922. }
  30923. var me = this,
  30924. geometry = params.geometry,
  30925. pointsCount = 0,
  30926. point2ds = null;
  30927. if (!geometry) {
  30928. return;
  30929. }
  30930. me.url = Util_Util.urlPathAppend(me.url, me.measureMode === MeasureMode.AREA ? 'area' : 'distance');
  30931. var serverGeometry = ServerGeometry_ServerGeometry.fromGeometry(geometry);
  30932. if (!serverGeometry) {
  30933. return;
  30934. }
  30935. pointsCount = serverGeometry.parts[0];
  30936. point2ds = serverGeometry.points.splice(0, pointsCount);
  30937. var prjCoordSysTemp, prjCodeTemp, paramsTemp;
  30938. if (params.prjCoordSys) {
  30939. if (MeasureService_typeof(params.prjCoordSys) === "object") {
  30940. prjCodeTemp = params.prjCoordSys.projCode;
  30941. prjCoordSysTemp = '{"epsgCode"' + prjCodeTemp.substring(prjCodeTemp.indexOf(":"), prjCodeTemp.length) + "}";
  30942. } else if (typeof params.prjCoordSys === "string") {
  30943. prjCoordSysTemp = '{"epsgCode"' + params.prjCoordSys.substring(params.prjCoordSys.indexOf(":"), params.prjCoordSys.length) + "}";
  30944. }
  30945. paramsTemp = {
  30946. "point2Ds": Util_Util.toJSON(point2ds),
  30947. "unit": params.unit,
  30948. "prjCoordSys": prjCoordSysTemp
  30949. };
  30950. } else {
  30951. paramsTemp = {
  30952. "point2Ds": Util_Util.toJSON(point2ds),
  30953. "unit": params.unit
  30954. };
  30955. }
  30956. me.request({
  30957. method: "GET",
  30958. params: paramsTemp,
  30959. scope: me,
  30960. success: me.serviceProcessCompleted,
  30961. failure: me.serviceProcessFailed
  30962. });
  30963. }
  30964. }]);
  30965. return MeasureService;
  30966. }(CommonServiceBase_CommonServiceBase);
  30967. SuperMap.MeasureService = MeasureService_MeasureService;
  30968. // CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystService.js
  30969. 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); }
  30970. function OverlayAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30971. 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); } }
  30972. function OverlayAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  30973. 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); }
  30974. function OverlayAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  30975. 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); }
  30976. function OverlayAnalystService_setPrototypeOf(o, p) { OverlayAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayAnalystService_setPrototypeOf(o, p); }
  30977. 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); }; }
  30978. function OverlayAnalystService_possibleConstructorReturn(self, call) { if (call && (OverlayAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return OverlayAnalystService_assertThisInitialized(self); }
  30979. function OverlayAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30980. 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; } }
  30981. function OverlayAnalystService_getPrototypeOf(o) { OverlayAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayAnalystService_getPrototypeOf(o); }
  30982. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  30983. * This program are made available under the terms of the Apache License, Version 2.0
  30984. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30985. /**
  30986. * @class SuperMap.OverlayAnalystService
  30987. * @category iServer SpatialAnalyst OverlayAnalyst
  30988. * @classdesc 叠加分析服务类。
  30989. * 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  30990. * 叠加分析结果通过该类支持的事件的监听函数参数获取
  30991. * @param {string} url - 服务的访问地址。如http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  30992. * @param {Object} options - 参数。</br>
  30993. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  30994. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30995. * @param {Object} [options.headers] - 请求头。
  30996. * @extends {SuperMap.CommonServiceBase}
  30997. * @example 例如:
  30998. * (start code)
  30999. * var myOverlayAnalystService = new SuperMap.OverlayAnalystService(url, {
  31000. * eventListeners: {
  31001. * "processCompleted": OverlayCompleted,
  31002. * "processFailed": OverlayFailed
  31003. * }
  31004. * });
  31005. * (end)
  31006. */
  31007. var OverlayAnalystService_OverlayAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  31008. OverlayAnalystService_inherits(OverlayAnalystService, _SpatialAnalystBase);
  31009. var _super = OverlayAnalystService_createSuper(OverlayAnalystService);
  31010. function OverlayAnalystService(url, options) {
  31011. var _this;
  31012. OverlayAnalystService_classCallCheck(this, OverlayAnalystService);
  31013. _this = _super.call(this, url, options);
  31014. /**
  31015. * @member {string} SuperMap.OverlayAnalystService.prototype.mode
  31016. * @description 叠加分析类型
  31017. */
  31018. _this.mode = null;
  31019. if (options) {
  31020. Util_Util.extend(OverlayAnalystService_assertThisInitialized(_this), options);
  31021. }
  31022. _this.CLASS_NAME = "SuperMap.OverlayAnalystService";
  31023. return _this;
  31024. }
  31025. /**
  31026. * @override
  31027. */
  31028. OverlayAnalystService_createClass(OverlayAnalystService, [{
  31029. key: "destroy",
  31030. value: function destroy() {
  31031. OverlayAnalystService_get(OverlayAnalystService_getPrototypeOf(OverlayAnalystService.prototype), "destroy", this).call(this);
  31032. this.mode = null;
  31033. }
  31034. /**
  31035. * @function SuperMap.OverlayAnalystService.prototype.processAsync
  31036. * @description 负责将客户端的查询参数传递到服务端。
  31037. * @param {SuperMap.OverlayAnalystParameters} parameter - 叠加分析参数类。
  31038. */
  31039. }, {
  31040. key: "processAsync",
  31041. value: function processAsync(parameter) {
  31042. var parameterObject = {};
  31043. var me = this;
  31044. if (parameter instanceof DatasetOverlayAnalystParameters_DatasetOverlayAnalystParameters) {
  31045. me.mode = "datasets";
  31046. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.sourceDataset + '/overlay');
  31047. DatasetOverlayAnalystParameters_DatasetOverlayAnalystParameters.toObject(parameter, parameterObject);
  31048. } else if (parameter instanceof GeometryOverlayAnalystParameters_GeometryOverlayAnalystParameters) {
  31049. me.mode = "geometry"; //支持传入多个几何要素进行叠加分析
  31050. if (parameter.operateGeometries && parameter.sourceGeometries) {
  31051. me.url = Util_Util.urlPathAppend(me.url, 'geometry/overlay/batch');
  31052. me.url = Util_Util.urlAppend(me.url, 'ignoreAnalystParam=true');
  31053. } else {
  31054. me.url = Util_Util.urlPathAppend(me.url, 'geometry/overlay');
  31055. }
  31056. GeometryOverlayAnalystParameters_GeometryOverlayAnalystParameters.toObject(parameter, parameterObject);
  31057. }
  31058. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  31059. var jsonParameters = Util_Util.toJSON(parameterObject);
  31060. me.request({
  31061. method: "POST",
  31062. data: jsonParameters,
  31063. scope: me,
  31064. success: me.serviceProcessCompleted,
  31065. failure: me.serviceProcessFailed
  31066. });
  31067. }
  31068. }]);
  31069. return OverlayAnalystService;
  31070. }(SpatialAnalystBase_SpatialAnalystBase);
  31071. SuperMap.OverlayAnalystService = OverlayAnalystService_OverlayAnalystService;
  31072. // CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobParameter.js
  31073. function OverlayGeoJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31074. 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); } }
  31075. function OverlayGeoJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  31076. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  31077. * This program are made available under the terms of the Apache License, Version 2.0
  31078. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31079. /**
  31080. * @class SuperMap.OverlayGeoJobParameter
  31081. * @category iServer ProcessingService OverlayAnalyst
  31082. * @classdesc 叠加分析任务参数类。
  31083. * @param {Object} options - 参数。
  31084. * @param {string} options.datasetName - 数据集名。
  31085. * @param {string} options.datasetOverlay - 叠加对象所在的数据集名称。
  31086. * @param {string} options.srcFields - 输入数据需要保留的字段。
  31087. * @param {string} [options.overlayFields] - 叠加数据需要保留的字段。对分析模式为 clip、update、erase 时,此参数无效。
  31088. * @param {string} [options.mode] - 叠加分析模式。
  31089. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  31090. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  31091. */
  31092. var OverlayGeoJobParameter_OverlayGeoJobParameter = /*#__PURE__*/function () {
  31093. function OverlayGeoJobParameter(options) {
  31094. OverlayGeoJobParameter_classCallCheck(this, OverlayGeoJobParameter);
  31095. if (!options) {
  31096. return;
  31097. }
  31098. /**
  31099. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.datasetName
  31100. * @description 数据集名。
  31101. */
  31102. this.datasetName = "";
  31103. /**
  31104. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.datasetOverlay
  31105. * @description 叠加对象所在的数据集名称。
  31106. */
  31107. this.datasetOverlay = "";
  31108. /**
  31109. * @member {string} [SuperMap.OverlayGeoJobParameter.prototype.mode]
  31110. * @description 叠加分析模式。
  31111. */
  31112. this.mode = "";
  31113. /**
  31114. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.srcFields
  31115. * @description 输入数据需要保留的字段。
  31116. */
  31117. this.srcFields = "";
  31118. /**
  31119. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.overlayFields
  31120. * @description 叠加数据需要保留的字段,对分析模式为 clip、update、erase 时,此参数无效。
  31121. */
  31122. this.overlayFields = "";
  31123. /**
  31124. * @member {SuperMap.OutputSetting} [SuperMap.OverlayGeoJobParameter.prototype.output]
  31125. * @description 输出参数设置类。
  31126. */
  31127. this.output = null;
  31128. /**
  31129. * @member {SuperMap.MappingParameters} [SuperMap.OverlayGeoJobParameter.prototype.mappingParameters]
  31130. * @description 分析后结果可视化的参数类。
  31131. */
  31132. this.mappingParameters = null;
  31133. Util_Util.extend(this, options);
  31134. this.CLASS_NAME = "SuperMap.OverlayGeoJobParameter";
  31135. }
  31136. /**
  31137. * @function SuperMap.OverlayGeoJobParameter.destroy
  31138. * @override
  31139. */
  31140. OverlayGeoJobParameter_createClass(OverlayGeoJobParameter, [{
  31141. key: "destroy",
  31142. value: function destroy() {
  31143. this.datasetName = null;
  31144. this.datasetOverlay = null;
  31145. this.mode = null;
  31146. this.srcFields = null;
  31147. this.overlayFields = null;
  31148. if (this.output instanceof OutputSetting_OutputSetting) {
  31149. this.output.destroy();
  31150. this.output = null;
  31151. }
  31152. if (this.mappingParameters instanceof MappingParameters_MappingParameters) {
  31153. this.mappingParameters.destroy();
  31154. this.mappingParameters = null;
  31155. }
  31156. }
  31157. /**
  31158. * @function SuperMap.OverlayGeoJobParameter.toObject
  31159. * @param {Object} OverlayGeoJobParameter - 点聚合分析任务参数。
  31160. * @param {Object} tempObj - 目标对象。
  31161. * @description 生成点聚合分析任务对象。
  31162. */
  31163. }], [{
  31164. key: "toObject",
  31165. value: function toObject(OverlayGeoJobParameter, tempObj) {
  31166. for (var name in OverlayGeoJobParameter) {
  31167. if (name == "datasetName") {
  31168. tempObj['input'] = tempObj['input'] || {};
  31169. tempObj['input'][name] = OverlayGeoJobParameter[name];
  31170. continue;
  31171. }
  31172. if (name === "output") {
  31173. tempObj['output'] = tempObj['output'] || {};
  31174. tempObj['output'] = OverlayGeoJobParameter[name];
  31175. continue;
  31176. }
  31177. tempObj['analyst'] = tempObj['analyst'] || {};
  31178. tempObj['analyst'][name] = OverlayGeoJobParameter[name];
  31179. if (name === 'mappingParameters') {
  31180. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  31181. tempObj['analyst']['mappingParameters'] = OverlayGeoJobParameter[name];
  31182. }
  31183. }
  31184. }
  31185. }]);
  31186. return OverlayGeoJobParameter;
  31187. }();
  31188. SuperMap.OverlayGeoJobParameter = OverlayGeoJobParameter_OverlayGeoJobParameter;
  31189. // CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobsService.js
  31190. 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); }
  31191. function OverlayGeoJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31192. 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); } }
  31193. function OverlayGeoJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  31194. 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); }
  31195. function OverlayGeoJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayGeoJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  31196. 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); }
  31197. function OverlayGeoJobsService_setPrototypeOf(o, p) { OverlayGeoJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayGeoJobsService_setPrototypeOf(o, p); }
  31198. 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); }; }
  31199. function OverlayGeoJobsService_possibleConstructorReturn(self, call) { if (call && (OverlayGeoJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return OverlayGeoJobsService_assertThisInitialized(self); }
  31200. function OverlayGeoJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31201. 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; } }
  31202. function OverlayGeoJobsService_getPrototypeOf(o) { OverlayGeoJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayGeoJobsService_getPrototypeOf(o); }
  31203. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  31204. * This program are made available under the terms of the Apache License, Version 2.0
  31205. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31206. /**
  31207. * @class SuperMap.OverlayGeoJobsService
  31208. * @category iServer ProcessingService OverlayAnalyst
  31209. * @classdesc 叠加分析任务类。
  31210. * @param {string} url - 叠加分析任务地址。
  31211. * @param {Object} options - 参数。
  31212. * @param {SuperMap.Events} options.events - 处理所有事件的对象。
  31213. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  31214. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  31215. * @param {number} options.index - 服务访问地址在数组中的位置。
  31216. * @param {number} options.length - 服务访问地址数组长度。
  31217. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31218. * @param {Object} [options.headers] - 请求头。
  31219. */
  31220. var OverlayGeoJobsService_OverlayGeoJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  31221. OverlayGeoJobsService_inherits(OverlayGeoJobsService, _ProcessingServiceBas);
  31222. var _super = OverlayGeoJobsService_createSuper(OverlayGeoJobsService);
  31223. function OverlayGeoJobsService(url, options) {
  31224. var _this;
  31225. OverlayGeoJobsService_classCallCheck(this, OverlayGeoJobsService);
  31226. _this = _super.call(this, url, options);
  31227. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/overlay');
  31228. _this.CLASS_NAME = 'SuperMap.OverlayGeoJobsService';
  31229. return _this;
  31230. }
  31231. /**
  31232. * @override
  31233. */
  31234. OverlayGeoJobsService_createClass(OverlayGeoJobsService, [{
  31235. key: "destroy",
  31236. value: function destroy() {
  31237. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "destroy", this).call(this);
  31238. }
  31239. /**
  31240. * @function SuperMap.OverlayGeoJobsService.prototype.getOverlayGeoJobs
  31241. * @description 获取叠加分析任务
  31242. */
  31243. }, {
  31244. key: "getOverlayGeoJobs",
  31245. value: function getOverlayGeoJobs() {
  31246. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, this.url);
  31247. }
  31248. /**
  31249. * @function SuperMap.OverlayGeoJobsService.prototype.getOverlayGeoJob
  31250. * @description 获取指定id的叠加分析任务
  31251. * @param {string} id - 指定要获取数据的id
  31252. */
  31253. }, {
  31254. key: "getOverlayGeoJob",
  31255. value: function getOverlayGeoJob(id) {
  31256. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  31257. }
  31258. /**
  31259. * @function SuperMap.OverlayGeoJobsService.prototype.addOverlayGeoJob
  31260. * @description 新建点叠加析服务
  31261. * @param {SuperMap.OverlayGeoJobParameter} params - 创建一个叠加分析的请求参数。
  31262. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  31263. */
  31264. }, {
  31265. key: "addOverlayGeoJob",
  31266. value: function addOverlayGeoJob(params, seconds) {
  31267. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "addJob", this).call(this, this.url, params, OverlayGeoJobParameter_OverlayGeoJobParameter, seconds);
  31268. }
  31269. }]);
  31270. return OverlayGeoJobsService;
  31271. }(ProcessingServiceBase_ProcessingServiceBase);
  31272. SuperMap.OverlayGeoJobsService = OverlayGeoJobsService_OverlayGeoJobsService;
  31273. // CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsParameters.js
  31274. 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); }
  31275. function QueryByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31276. 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); } }
  31277. function QueryByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31278. 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); }
  31279. function QueryByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31280. 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); }
  31281. function QueryByBoundsParameters_setPrototypeOf(o, p) { QueryByBoundsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsParameters_setPrototypeOf(o, p); }
  31282. 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); }; }
  31283. function QueryByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByBoundsParameters_assertThisInitialized(self); }
  31284. function QueryByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31285. 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; } }
  31286. function QueryByBoundsParameters_getPrototypeOf(o) { QueryByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsParameters_getPrototypeOf(o); }
  31287. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  31288. * This program are made available under the terms of the Apache License, Version 2.0
  31289. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31290. /**
  31291. * @class SuperMap.QueryByBoundsParameters
  31292. * @category iServer Map QueryResults
  31293. * @classdesc Bounds 查询参数类。该类用于设置 Bounds 查询的相关参数。
  31294. * @extends {SuperMap.QueryParameters}
  31295. * @param {Object} options - 参数。
  31296. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 指定的查询范围。
  31297. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  31298. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  31299. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  31300. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  31301. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  31302. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  31303. * @param {number} [options.startRecord=0] - 查询起始记录号。
  31304. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  31305. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  31306. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  31307. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  31308. */
  31309. var QueryByBoundsParameters_QueryByBoundsParameters = /*#__PURE__*/function (_QueryParameters) {
  31310. QueryByBoundsParameters_inherits(QueryByBoundsParameters, _QueryParameters);
  31311. var _super = QueryByBoundsParameters_createSuper(QueryByBoundsParameters);
  31312. function QueryByBoundsParameters(options) {
  31313. var _this;
  31314. QueryByBoundsParameters_classCallCheck(this, QueryByBoundsParameters);
  31315. if (!options) {
  31316. return QueryByBoundsParameters_possibleConstructorReturn(_this);
  31317. }
  31318. _this = _super.call(this, options);
  31319. /**
  31320. * @member {boolean} [SuperMap.QueryByBoundsParameters.prototype.returnContent=true]
  31321. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  31322. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  31323. * 为 false,则返回的是查询结果资源的 URI。
  31324. */
  31325. _this.returnContent = true;
  31326. /**
  31327. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.QueryByBoundsParameters.prototype.bounds
  31328. * @description 指定的查询范围。
  31329. */
  31330. _this.bounds = null;
  31331. Util_Util.extend(QueryByBoundsParameters_assertThisInitialized(_this), options);
  31332. _this.CLASS_NAME = "SuperMap.QueryByBoundsParameters";
  31333. return _this;
  31334. }
  31335. /**
  31336. * @function SuperMap.QueryByBoundsParameters.prototype.destroy
  31337. * @description 释放资源,将引用资源的属性置空。
  31338. */
  31339. QueryByBoundsParameters_createClass(QueryByBoundsParameters, [{
  31340. key: "destroy",
  31341. value: function destroy() {
  31342. QueryByBoundsParameters_get(QueryByBoundsParameters_getPrototypeOf(QueryByBoundsParameters.prototype), "destroy", this).call(this);
  31343. var me = this;
  31344. me.returnContent = null;
  31345. if (me.bounds) {
  31346. me.bounds = null;
  31347. }
  31348. }
  31349. }]);
  31350. return QueryByBoundsParameters;
  31351. }(QueryParameters_QueryParameters);
  31352. SuperMap.QueryByBoundsParameters = QueryByBoundsParameters_QueryByBoundsParameters;
  31353. // CONCATENATED MODULE: ./src/common/iServer/QueryService.js
  31354. 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); }
  31355. function QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31356. 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); } }
  31357. function QueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryService_defineProperties(Constructor, staticProps); return Constructor; }
  31358. 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); }
  31359. function QueryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryService_getPrototypeOf(object); if (object === null) break; } return object; }
  31360. 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); }
  31361. function QueryService_setPrototypeOf(o, p) { QueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryService_setPrototypeOf(o, p); }
  31362. 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); }; }
  31363. function QueryService_possibleConstructorReturn(self, call) { if (call && (QueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryService_assertThisInitialized(self); }
  31364. function QueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31365. 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; } }
  31366. function QueryService_getPrototypeOf(o) { QueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryService_getPrototypeOf(o); }
  31367. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  31368. * This program are made available under the terms of the Apache License, Version 2.0
  31369. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31370. /**
  31371. * @class SuperMap.QueryService
  31372. * @category iServer Map QueryResults
  31373. * @classdesc 查询服务基类。
  31374. * @extends {SuperMap.CommonServiceBase}
  31375. * @param {string} url - 服务地址。请求地图查询服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  31376. * @param {Object} options - 参数。
  31377. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  31378. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  31379. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  31380. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31381. * @param {Object} [options.headers] - 请求头。
  31382. * @example
  31383. * var myService = new SuperMap.QueryService(url, {
  31384. * eventListeners: {
  31385. * "processCompleted": queryCompleted,
  31386. * "processFailed": queryError
  31387. * }
  31388. * };
  31389. */
  31390. var QueryService_QueryService = /*#__PURE__*/function (_CommonServiceBase) {
  31391. QueryService_inherits(QueryService, _CommonServiceBase);
  31392. var _super = QueryService_createSuper(QueryService);
  31393. /**
  31394. * @function SuperMap.QueryService.prototype.constructor
  31395. * @description 查询服务基类构造函数。
  31396. * @param {string} url - 服务地址。请求地图查询服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  31397. * @param {Object} options -参数。
  31398. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31399. */
  31400. function QueryService(url, options) {
  31401. var _this;
  31402. QueryService_classCallCheck(this, QueryService);
  31403. _this = _super.call(this, url, options);
  31404. /**
  31405. * @member {boolean} SuperMap.QueryService.prototype.returnContent
  31406. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  31407. */
  31408. _this.returnContent = false;
  31409. /**
  31410. * @member {string} SuperMap.QueryService.prototype.format
  31411. * @description 查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"。
  31412. */
  31413. _this.format = DataFormat.GEOJSON;
  31414. _this.returnFeatureWithFieldCaption = false;
  31415. if (options) {
  31416. Util_Util.extend(QueryService_assertThisInitialized(_this), options);
  31417. }
  31418. _this.CLASS_NAME = "SuperMap.QueryService";
  31419. if (!_this.url) {
  31420. return QueryService_possibleConstructorReturn(_this);
  31421. }
  31422. if (options && options.format) {
  31423. _this.format = options.format.toUpperCase();
  31424. }
  31425. _this.url = Util_Util.urlPathAppend(_this.url, 'queryResults');
  31426. return _this;
  31427. }
  31428. /**
  31429. * @function SuperMap.QueryService.prototype.destroy
  31430. * @description 释放资源,将引用资源的属性置空。
  31431. */
  31432. QueryService_createClass(QueryService, [{
  31433. key: "destroy",
  31434. value: function destroy() {
  31435. QueryService_get(QueryService_getPrototypeOf(QueryService.prototype), "destroy", this).call(this);
  31436. var me = this;
  31437. me.returnContent = null;
  31438. me.format = null;
  31439. }
  31440. /**
  31441. * @function SuperMap.QueryService.prototype.processAsync
  31442. * @description 负责将客户端的查询参数传递到服务端。
  31443. * @param {SuperMap.QueryParameters} params - 查询参数。
  31444. */
  31445. }, {
  31446. key: "processAsync",
  31447. value: function processAsync(params) {
  31448. if (!(params instanceof QueryParameters_QueryParameters)) {
  31449. return;
  31450. }
  31451. var me = this,
  31452. returnCustomResult = null,
  31453. jsonParameters = null;
  31454. me.returnContent = params.returnContent;
  31455. jsonParameters = me.getJsonParameters(params);
  31456. if (me.returnContent) {
  31457. me.url = Util_Util.urlAppend(me.url, 'returnContent=' + me.returnContent);
  31458. } else {
  31459. //仅供三维使用 获取高亮图片的bounds
  31460. returnCustomResult = params.returnCustomResult;
  31461. if (returnCustomResult) {
  31462. me.url = Util_Util.urlAppend(me.url, 'returnCustomResult=' + returnCustomResult);
  31463. }
  31464. }
  31465. me.returnFeatureWithFieldCaption = params.returnFeatureWithFieldCaption;
  31466. me.request({
  31467. method: "POST",
  31468. data: jsonParameters,
  31469. scope: me,
  31470. success: me.serviceProcessCompleted,
  31471. failure: me.serviceProcessFailed
  31472. });
  31473. }
  31474. /**
  31475. * @function SuperMap.QueryService.prototype.serviceProcessCompleted
  31476. * @description 查询完成,执行此方法。
  31477. * @param {Object} result - 服务器返回的结果对象。
  31478. */
  31479. }, {
  31480. key: "serviceProcessCompleted",
  31481. value: function serviceProcessCompleted(result) {
  31482. var me = this;
  31483. result = Util_Util.transformResult(result);
  31484. var geoJSONFormat = new GeoJSON_GeoJSON();
  31485. if (result && result.recordsets) {
  31486. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  31487. if (recordsets[i].features) {
  31488. if (me.returnFeatureWithFieldCaption === true) {
  31489. recordsets[i].features.map(function (feature) {
  31490. feature.fieldNames = recordsets[i].fieldCaptions;
  31491. return feature;
  31492. });
  31493. }
  31494. if (me.format === DataFormat.GEOJSON) {
  31495. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  31496. }
  31497. }
  31498. }
  31499. }
  31500. me.events.triggerEvent("processCompleted", {
  31501. result: result
  31502. });
  31503. }
  31504. /**
  31505. * @function SuperMap.QueryService.prototype.getQueryParameters
  31506. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  31507. * @param {Object} params - JSON 字符串表示的查询参数。
  31508. * @returns {SuperMap.QueryParameters} 返回转化后的 QueryParameters 对象。
  31509. */
  31510. }, {
  31511. key: "getQueryParameters",
  31512. value: function getQueryParameters(params) {
  31513. return new QueryParameters_QueryParameters({
  31514. customParams: params.customParams,
  31515. expectCount: params.expectCount,
  31516. networkType: params.networkType,
  31517. queryOption: params.queryOption,
  31518. queryParams: params.queryParams,
  31519. startRecord: params.startRecord,
  31520. prjCoordSys: params.prjCoordSys,
  31521. holdTime: params.holdTime
  31522. });
  31523. }
  31524. }]);
  31525. return QueryService;
  31526. }(CommonServiceBase_CommonServiceBase);
  31527. SuperMap.QueryService = QueryService_QueryService;
  31528. // CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsService.js
  31529. 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); }
  31530. function QueryByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31531. 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); } }
  31532. function QueryByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsService_defineProperties(Constructor, staticProps); return Constructor; }
  31533. 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); }
  31534. function QueryByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  31535. 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); }
  31536. function QueryByBoundsService_setPrototypeOf(o, p) { QueryByBoundsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsService_setPrototypeOf(o, p); }
  31537. 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); }; }
  31538. function QueryByBoundsService_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByBoundsService_assertThisInitialized(self); }
  31539. function QueryByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31540. 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; } }
  31541. function QueryByBoundsService_getPrototypeOf(o) { QueryByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsService_getPrototypeOf(o); }
  31542. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  31543. * This program are made available under the terms of the Apache License, Version 2.0
  31544. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31545. /**
  31546. * @class SuperMap.QueryByBoundsService
  31547. * @category iServer Map QueryResults
  31548. * @classdesc Bounds 查询服务类。
  31549. * @augments {SuperMap.QueryService}
  31550. * @example
  31551. * (start end)
  31552. * var myQueryByBoundsService = new SuperMap.QueryByBoundsService(url, {
  31553. * eventListeners: {
  31554. * "processCompleted": queryCompleted,
  31555. * "processFailed": queryError
  31556. * }
  31557. * });
  31558. * function queryCompleted(object){//todo};
  31559. * function queryError(object){//todo};
  31560. * (end)
  31561. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  31562. * @param {Object} options - 参数。<br>
  31563. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  31564. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  31565. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  31566. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31567. * @param {Object} [options.headers] - 请求头。
  31568. */
  31569. var QueryByBoundsService_QueryByBoundsService = /*#__PURE__*/function (_QueryService) {
  31570. QueryByBoundsService_inherits(QueryByBoundsService, _QueryService);
  31571. var _super = QueryByBoundsService_createSuper(QueryByBoundsService);
  31572. function QueryByBoundsService(url, options) {
  31573. var _this;
  31574. QueryByBoundsService_classCallCheck(this, QueryByBoundsService);
  31575. _this = _super.call(this, url, options);
  31576. _this.CLASS_NAME = "SuperMap.QueryByBoundsService";
  31577. return _this;
  31578. }
  31579. /**
  31580. * @override
  31581. */
  31582. QueryByBoundsService_createClass(QueryByBoundsService, [{
  31583. key: "destroy",
  31584. value: function destroy() {
  31585. QueryByBoundsService_get(QueryByBoundsService_getPrototypeOf(QueryByBoundsService.prototype), "destroy", this).call(this);
  31586. }
  31587. /**
  31588. * @function SuperMap.QueryByBoundsService.prototype.getJsonParameters
  31589. * @description 将查询参数转化为 JSON 字符串。
  31590. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds 等)。
  31591. * @param {SuperMap.QueryByBoundsParameters} params - Bounds 查询参数。
  31592. * @returns {Object} 转化后的 JSON 字符串。
  31593. */
  31594. }, {
  31595. key: "getJsonParameters",
  31596. value: function getJsonParameters(params) {
  31597. if (!(params instanceof QueryByBoundsParameters_QueryByBoundsParameters)) {
  31598. return null;
  31599. }
  31600. var me = this,
  31601. jsonParameters = "",
  31602. qp = null,
  31603. bounds = params.bounds;
  31604. qp = me.getQueryParameters(params);
  31605. jsonParameters += "'queryMode':'BoundsQuery','queryParameters':";
  31606. jsonParameters += Util_Util.toJSON(qp);
  31607. jsonParameters += ",'bounds': {'rightTop':{'y':" + bounds.top + ",'x':" + bounds.right + "},'leftBottom':{'y':" + bounds.bottom + ",'x':" + bounds.left + "}}";
  31608. jsonParameters = "{" + jsonParameters + "}";
  31609. return jsonParameters;
  31610. }
  31611. }]);
  31612. return QueryByBoundsService;
  31613. }(QueryService_QueryService);
  31614. SuperMap.QueryByBoundsService = QueryByBoundsService_QueryByBoundsService;
  31615. // CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceParameters.js
  31616. 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); }
  31617. function QueryByDistanceParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31618. 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); } }
  31619. function QueryByDistanceParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31620. 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); }
  31621. function QueryByDistanceParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31622. 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); }
  31623. function QueryByDistanceParameters_setPrototypeOf(o, p) { QueryByDistanceParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceParameters_setPrototypeOf(o, p); }
  31624. 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); }; }
  31625. function QueryByDistanceParameters_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByDistanceParameters_assertThisInitialized(self); }
  31626. function QueryByDistanceParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31627. 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; } }
  31628. function QueryByDistanceParameters_getPrototypeOf(o) { QueryByDistanceParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceParameters_getPrototypeOf(o); }
  31629. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  31630. * This program are made available under the terms of the Apache License, Version 2.0
  31631. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31632. /**
  31633. * @class SuperMap.QueryByDistanceParameters
  31634. * @category iServer Map QueryResults
  31635. * @classdesc Distance 查询参数类。
  31636. * 该类用于设置 Distance 查询的相关参数。
  31637. * @extends {SuperMap.QueryParameters}
  31638. * @param {Object} options - 参数。
  31639. * @param {Object} options.geometry - 用于查询的几何对象。
  31640. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  31641. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  31642. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  31643. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  31644. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  31645. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  31646. * @param {number} [options.startRecord=0] - 查询起始记录号。
  31647. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  31648. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  31649. * @param {number} [options.distance=0] - 查询距离。
  31650. * @param {boolean} [options.isNearest=false] - 是否为最近距离查询。
  31651. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  31652. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  31653. */
  31654. var QueryByDistanceParameters_QueryByDistanceParameters = /*#__PURE__*/function (_QueryParameters) {
  31655. QueryByDistanceParameters_inherits(QueryByDistanceParameters, _QueryParameters);
  31656. var _super = QueryByDistanceParameters_createSuper(QueryByDistanceParameters);
  31657. function QueryByDistanceParameters(options) {
  31658. var _this;
  31659. QueryByDistanceParameters_classCallCheck(this, QueryByDistanceParameters);
  31660. if (!options) {
  31661. return QueryByDistanceParameters_possibleConstructorReturn(_this);
  31662. }
  31663. _this = _super.call(this, options);
  31664. /**
  31665. * @member {number} [SuperMap.QueryByDistanceParameters.prototype.distance=0]
  31666. * @description 查询距离,单位与所查询图层对应的数据集单位相同。
  31667. * 当查找最近地物时,该属性无效。
  31668. */
  31669. _this.distance = 0;
  31670. /**
  31671. * @member SuperMap.QueryByDistanceParameters.prototype.geometry
  31672. * @description 用于查询的地理对象。<br>
  31673. * 点类型可以是:{@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>
  31674. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
  31675. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  31676. */
  31677. _this.geometry = null;
  31678. /**
  31679. * @member {boolean} [SuperMap.QueryByDistanceParameters.prototype.isNearest=false]
  31680. * @description 是否为最近距离查询。<br>
  31681. * 建议该属性与 expectCount(继承自 {@link SuperMap.QueryParameters})属性联合使用。
  31682. * 当该属性为 true 时,即表示查找最近地物,如果查询结果数大于期望返回的结果记录数(expectCount),
  31683. * 则查找结果为查询总记录中距离中心最近的 expectCount 个地物。
  31684. * 当该属性为不为 true 时,如果查询结果数大于期望返回的结果记录数(expectCount),
  31685. * 则查找结果为从查询总记录中随机抽取的 expectCount 个地物。
  31686. * 目前查询结果不支持按远近距离排序。
  31687. */
  31688. _this.isNearest = null;
  31689. /**
  31690. * @member {boolean} [SuperMap.QueryByDistanceParameters.prototype.returnContent=true]
  31691. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  31692. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  31693. * 为 false,则返回的是查询结果资源的 URI。
  31694. */
  31695. _this.returnContent = true;
  31696. Util_Util.extend(QueryByDistanceParameters_assertThisInitialized(_this), options);
  31697. _this.CLASS_NAME = "SuperMap.QueryByDistanceParameters";
  31698. return _this;
  31699. }
  31700. /**
  31701. * @function SuperMap.QueryByDistanceParameters.prototype.destroy
  31702. * @description 释放资源,将引用资源的属性置空。
  31703. */
  31704. QueryByDistanceParameters_createClass(QueryByDistanceParameters, [{
  31705. key: "destroy",
  31706. value: function destroy() {
  31707. QueryByDistanceParameters_get(QueryByDistanceParameters_getPrototypeOf(QueryByDistanceParameters.prototype), "destroy", this).call(this);
  31708. var me = this;
  31709. me.returnContent = null;
  31710. me.distance = null;
  31711. me.isNearest = null;
  31712. if (me.geometry) {
  31713. me.geometry.destroy();
  31714. me.geometry = null;
  31715. }
  31716. }
  31717. }]);
  31718. return QueryByDistanceParameters;
  31719. }(QueryParameters_QueryParameters);
  31720. SuperMap.QueryByDistanceParameters = QueryByDistanceParameters_QueryByDistanceParameters;
  31721. // CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceService.js
  31722. 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); }
  31723. function QueryByDistanceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31724. 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); } }
  31725. function QueryByDistanceService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceService_defineProperties(Constructor, staticProps); return Constructor; }
  31726. 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); }
  31727. function QueryByDistanceService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceService_getPrototypeOf(object); if (object === null) break; } return object; }
  31728. 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); }
  31729. function QueryByDistanceService_setPrototypeOf(o, p) { QueryByDistanceService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceService_setPrototypeOf(o, p); }
  31730. 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); }; }
  31731. function QueryByDistanceService_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByDistanceService_assertThisInitialized(self); }
  31732. function QueryByDistanceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31733. 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; } }
  31734. function QueryByDistanceService_getPrototypeOf(o) { QueryByDistanceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceService_getPrototypeOf(o); }
  31735. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  31736. * This program are made available under the terms of the Apache License, Version 2.0
  31737. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31738. /**
  31739. * @class SuperMap.QueryByDistanceService
  31740. * @category iServer Map QueryResults
  31741. * @classdesc Distance查询服务类。
  31742. * @extends {SuperMap.QueryService}
  31743. * @example
  31744. * var myQueryByDistService = new SuperMap.QueryByDistanceService(url, {
  31745. * eventListeners: {
  31746. * "processCompleted": queryCompleted,
  31747. * "processFailed": queryError
  31748. * }
  31749. * });
  31750. * function queryCompleted(object){//todo};
  31751. * function queryError(object){//todo};
  31752. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  31753. * @param {Object} options - 参数。
  31754. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  31755. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  31756. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  31757. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31758. * @param {Object} [options.headers] - 请求头。
  31759. */
  31760. var QueryByDistanceService_QueryByDistanceService = /*#__PURE__*/function (_QueryService) {
  31761. QueryByDistanceService_inherits(QueryByDistanceService, _QueryService);
  31762. var _super = QueryByDistanceService_createSuper(QueryByDistanceService);
  31763. function QueryByDistanceService(url, options) {
  31764. var _this;
  31765. QueryByDistanceService_classCallCheck(this, QueryByDistanceService);
  31766. _this = _super.call(this, url, options);
  31767. _this.CLASS_NAME = "SuperMap.QueryByDistanceService";
  31768. return _this;
  31769. }
  31770. /**
  31771. * @override
  31772. */
  31773. QueryByDistanceService_createClass(QueryByDistanceService, [{
  31774. key: "destroy",
  31775. value: function destroy() {
  31776. QueryByDistanceService_get(QueryByDistanceService_getPrototypeOf(QueryByDistanceService.prototype), "destroy", this).call(this);
  31777. }
  31778. /**
  31779. * @function SuperMap.QueryByDistanceService.prototype.getJsonParameters
  31780. * @description 将查询参数转化为 JSON 字符串。
  31781. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  31782. * @param {SuperMap.QueryByDistanceParameters} params - Distance 查询参数类。
  31783. * @returns {Object} 转化后的 JSON 字符串。
  31784. */
  31785. }, {
  31786. key: "getJsonParameters",
  31787. value: function getJsonParameters(params) {
  31788. if (!(params instanceof QueryByDistanceParameters_QueryByDistanceParameters)) {
  31789. return;
  31790. }
  31791. var me = this,
  31792. jsonParameters = "",
  31793. qp = me.getQueryParameters(params);
  31794. var sg = ServerGeometry_ServerGeometry.fromGeometry(params.geometry);
  31795. jsonParameters += params.isNearest ? "'queryMode':'FindNearest','queryParameters':" : "'queryMode':'DistanceQuery','queryParameters':";
  31796. jsonParameters += Util_Util.toJSON(qp);
  31797. jsonParameters += ",'geometry':" + Util_Util.toJSON(sg) + ",'distance':" + params.distance;
  31798. jsonParameters = "{" + jsonParameters + "}";
  31799. return jsonParameters;
  31800. }
  31801. }]);
  31802. return QueryByDistanceService;
  31803. }(QueryService_QueryService);
  31804. SuperMap.QueryByDistanceService = QueryByDistanceService_QueryByDistanceService;
  31805. // CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryParameters.js
  31806. 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); }
  31807. function QueryByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31808. 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); } }
  31809. function QueryByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31810. 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); }
  31811. function QueryByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31812. 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); }
  31813. function QueryByGeometryParameters_setPrototypeOf(o, p) { QueryByGeometryParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryParameters_setPrototypeOf(o, p); }
  31814. 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); }; }
  31815. function QueryByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByGeometryParameters_assertThisInitialized(self); }
  31816. function QueryByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31817. 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; } }
  31818. function QueryByGeometryParameters_getPrototypeOf(o) { QueryByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryParameters_getPrototypeOf(o); }
  31819. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  31820. * This program are made available under the terms of the Apache License, Version 2.0
  31821. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31822. /**
  31823. * @class SuperMap.QueryByGeometryParameters
  31824. * @category iServer Map QueryResults
  31825. * @classdesc Geometry 查询参数类。
  31826. * 该类用于设置 Geometry查询的相关参数。
  31827. * @extends {SuperMap.QueryParameters}
  31828. * @param {Object} options - 参数。
  31829. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  31830. * @param {Object} options.geometry - 用于查询的几何对象。
  31831. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  31832. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  31833. * @param {Object} [options.prjCoordSys] -自定义参数,供SuperMap Online提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  31834. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  31835. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  31836. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  31837. * @param {number} [options.startRecord=0] - 查询起始记录号。
  31838. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  31839. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  31840. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  31841. * @param {SuperMap.SpatialQueryMode} [spatialQueryMode=SuperMap.SpatialQueryMode.INTERSECT] - 空间查询模式。
  31842. */
  31843. var QueryByGeometryParameters_QueryByGeometryParameters = /*#__PURE__*/function (_QueryParameters) {
  31844. QueryByGeometryParameters_inherits(QueryByGeometryParameters, _QueryParameters);
  31845. var _super = QueryByGeometryParameters_createSuper(QueryByGeometryParameters);
  31846. function QueryByGeometryParameters(options) {
  31847. var _this;
  31848. QueryByGeometryParameters_classCallCheck(this, QueryByGeometryParameters);
  31849. if (!options) {
  31850. return QueryByGeometryParameters_possibleConstructorReturn(_this);
  31851. }
  31852. _this = _super.call(this, options);
  31853. /**
  31854. * @member {boolean} [SuperMap.QueryByGeometryParameters.prototype.returnContent=true]
  31855. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。<br>
  31856. * 如果为 true,则直接返回新创建资源,即查询结果的表述。<br>
  31857. * 为 false,则返回的是查询结果资源的 URI。
  31858. */
  31859. _this.returnContent = true;
  31860. /**
  31861. * @member {Object} SuperMap.QueryByGeometryParameters.prototype.geometry
  31862. * @description 用于查询的几何对象。<br>
  31863. * 点类型可以是:{@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>
  31864. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
  31865. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  31866. */
  31867. _this.geometry = null;
  31868. /**
  31869. * @member {SuperMap.SpatialQueryMode} [SuperMap.QueryByGeometryParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.INTERSECT]
  31870. * @description 空间查询模式。
  31871. */
  31872. _this.spatialQueryMode = SpatialQueryMode.INTERSECT;
  31873. Util_Util.extend(QueryByGeometryParameters_assertThisInitialized(_this), options);
  31874. _this.CLASS_NAME = "SuperMap.QueryByGeometryParameters";
  31875. return _this;
  31876. }
  31877. /**
  31878. * @function SuperMap.QueryByGeometryParameters.prototype.destroy
  31879. * @description 释放资源,将引用资源的属性置空。
  31880. */
  31881. QueryByGeometryParameters_createClass(QueryByGeometryParameters, [{
  31882. key: "destroy",
  31883. value: function destroy() {
  31884. QueryByGeometryParameters_get(QueryByGeometryParameters_getPrototypeOf(QueryByGeometryParameters.prototype), "destroy", this).call(this);
  31885. var me = this;
  31886. me.returnContent = null;
  31887. me.geometry = null;
  31888. me.spatialQueryMode = null;
  31889. }
  31890. }]);
  31891. return QueryByGeometryParameters;
  31892. }(QueryParameters_QueryParameters);
  31893. SuperMap.QueryByGeometryParameters = QueryByGeometryParameters_QueryByGeometryParameters;
  31894. // CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryService.js
  31895. 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); }
  31896. function QueryByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31897. 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); } }
  31898. function QueryByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryService_defineProperties(Constructor, staticProps); return Constructor; }
  31899. 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); }
  31900. function QueryByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  31901. 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); }
  31902. function QueryByGeometryService_setPrototypeOf(o, p) { QueryByGeometryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryService_setPrototypeOf(o, p); }
  31903. 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); }; }
  31904. function QueryByGeometryService_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByGeometryService_assertThisInitialized(self); }
  31905. function QueryByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31906. 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; } }
  31907. function QueryByGeometryService_getPrototypeOf(o) { QueryByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryService_getPrototypeOf(o); }
  31908. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  31909. * This program are made available under the terms of the Apache License, Version 2.0
  31910. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31911. /**
  31912. * @class SuperMap.QueryByGeometryService
  31913. * @category iServer Map QueryResults
  31914. * @classdesc Geometry查询服务类。
  31915. * @extends {SuperMap.QueryService}
  31916. * @example
  31917. * var myQueryByGeometryService = new SuperMap.QueryByGeometryService(url, {
  31918. * eventListeners: {
  31919. * "processCompleted": queryCompleted,
  31920. * "processFailed": queryError
  31921. * }
  31922. * });
  31923. * function queryCompleted(object){//todo};
  31924. * function queryError(object){//todo};
  31925. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  31926. * @param {Object} options - 参数。
  31927. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  31928. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  31929. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  31930. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31931. * @param {Object} [options.headers] - 请求头。
  31932. */
  31933. var QueryByGeometryService_QueryByGeometryService = /*#__PURE__*/function (_QueryService) {
  31934. QueryByGeometryService_inherits(QueryByGeometryService, _QueryService);
  31935. var _super = QueryByGeometryService_createSuper(QueryByGeometryService);
  31936. /**
  31937. * @function SuperMap.QueryByGeometryService.prototype.constructor
  31938. * @description Geometry 查询服务类构造函数。
  31939. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  31940. * @param {Object} options - 参数。
  31941. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31942. */
  31943. function QueryByGeometryService(url, options) {
  31944. var _this;
  31945. QueryByGeometryService_classCallCheck(this, QueryByGeometryService);
  31946. _this = _super.call(this, url, options);
  31947. _this.CLASS_NAME = "SuperMap.QueryByGeometryService";
  31948. return _this;
  31949. }
  31950. /**
  31951. * @override
  31952. */
  31953. QueryByGeometryService_createClass(QueryByGeometryService, [{
  31954. key: "destroy",
  31955. value: function destroy() {
  31956. QueryByGeometryService_get(QueryByGeometryService_getPrototypeOf(QueryByGeometryService.prototype), "destroy", this).call(this);
  31957. }
  31958. /**
  31959. * @function SuperMap.QueryByGeometryService.prototype.getJsonParameters
  31960. * @description 将查询参数转化为 JSON 字符串。
  31961. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  31962. * @param {SuperMap.QueryByGeometryParameters} params - Geometry 查询参数类。
  31963. * @returns {Object} 转化后的 JSON 字符串。
  31964. */
  31965. }, {
  31966. key: "getJsonParameters",
  31967. value: function getJsonParameters(params) {
  31968. if (!(params instanceof QueryByGeometryParameters_QueryByGeometryParameters)) {
  31969. return;
  31970. }
  31971. var me = this,
  31972. jsonParameters = "",
  31973. qp = null,
  31974. geometry = params.geometry,
  31975. sg = ServerGeometry_ServerGeometry.fromGeometry(geometry);
  31976. qp = me.getQueryParameters(params);
  31977. jsonParameters += "'queryMode':'SpatialQuery','queryParameters':";
  31978. jsonParameters += Util_Util.toJSON(qp) + ",'geometry':" + Util_Util.toJSON(sg) + ",'spatialQueryMode':" + Util_Util.toJSON(params.spatialQueryMode);
  31979. jsonParameters = "{" + jsonParameters + "}";
  31980. return jsonParameters;
  31981. }
  31982. }]);
  31983. return QueryByGeometryService;
  31984. }(QueryService_QueryService);
  31985. SuperMap.QueryByGeometryService = QueryByGeometryService_QueryByGeometryService;
  31986. // CONCATENATED MODULE: ./src/common/iServer/QueryBySQLParameters.js
  31987. 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); }
  31988. function QueryBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31989. 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); } }
  31990. function QueryBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31991. 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); }
  31992. function QueryBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31993. 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); }
  31994. function QueryBySQLParameters_setPrototypeOf(o, p) { QueryBySQLParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLParameters_setPrototypeOf(o, p); }
  31995. 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); }; }
  31996. function QueryBySQLParameters_possibleConstructorReturn(self, call) { if (call && (QueryBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryBySQLParameters_assertThisInitialized(self); }
  31997. function QueryBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31998. 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; } }
  31999. function QueryBySQLParameters_getPrototypeOf(o) { QueryBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLParameters_getPrototypeOf(o); }
  32000. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  32001. * This program are made available under the terms of the Apache License, Version 2.0
  32002. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32003. /**
  32004. * @class SuperMap.QueryBySQLParameters
  32005. * @category iServer Map QueryResults
  32006. * @classdesc SQL 查询参数类。
  32007. * 该类用于设置 SQL 查询的相关参数。
  32008. * @extends {SuperMap.QueryParameters}
  32009. * @param {Object} options - 参数。
  32010. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  32011. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  32012. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  32013. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  32014. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  32015. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  32016. * @param {number} [options.startRecord=0] - 查询起始记录号。
  32017. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  32018. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  32019. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  32020. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  32021. */
  32022. var QueryBySQLParameters_QueryBySQLParameters = /*#__PURE__*/function (_QueryParameters) {
  32023. QueryBySQLParameters_inherits(QueryBySQLParameters, _QueryParameters);
  32024. var _super = QueryBySQLParameters_createSuper(QueryBySQLParameters);
  32025. function QueryBySQLParameters(options) {
  32026. var _this;
  32027. QueryBySQLParameters_classCallCheck(this, QueryBySQLParameters);
  32028. if (!options) {
  32029. return QueryBySQLParameters_possibleConstructorReturn(_this);
  32030. }
  32031. _this = _super.call(this, options);
  32032. /**
  32033. * @member {boolean} [SuperMap.QueryBySQLParameters.prototype.returnContent=true]
  32034. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  32035. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  32036. * 为 false,则返回的是查询结果资源的 URI。
  32037. */
  32038. _this.returnContent = true;
  32039. Util_Util.extend(QueryBySQLParameters_assertThisInitialized(_this), options);
  32040. _this.CLASS_NAME = "SuperMap.QueryBySQLParameters";
  32041. return _this;
  32042. }
  32043. /**
  32044. * @function SuperMap.QueryBySQLParameters.prototype.destroy
  32045. * @description 释放资源,将引用资源的属性置空。
  32046. */
  32047. QueryBySQLParameters_createClass(QueryBySQLParameters, [{
  32048. key: "destroy",
  32049. value: function destroy() {
  32050. QueryBySQLParameters_get(QueryBySQLParameters_getPrototypeOf(QueryBySQLParameters.prototype), "destroy", this).call(this);
  32051. var me = this;
  32052. me.returnContent = null;
  32053. }
  32054. }]);
  32055. return QueryBySQLParameters;
  32056. }(QueryParameters_QueryParameters);
  32057. SuperMap.QueryBySQLParameters = QueryBySQLParameters_QueryBySQLParameters;
  32058. // CONCATENATED MODULE: ./src/common/iServer/QueryBySQLService.js
  32059. 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); }
  32060. function QueryBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32061. 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); } }
  32062. function QueryBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLService_defineProperties(Constructor, staticProps); return Constructor; }
  32063. 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); }
  32064. function QueryBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  32065. 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); }
  32066. function QueryBySQLService_setPrototypeOf(o, p) { QueryBySQLService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLService_setPrototypeOf(o, p); }
  32067. 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); }; }
  32068. function QueryBySQLService_possibleConstructorReturn(self, call) { if (call && (QueryBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryBySQLService_assertThisInitialized(self); }
  32069. function QueryBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32070. 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; } }
  32071. function QueryBySQLService_getPrototypeOf(o) { QueryBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLService_getPrototypeOf(o); }
  32072. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  32073. * This program are made available under the terms of the Apache License, Version 2.0
  32074. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32075. /**
  32076. * @class SuperMap.QueryBySQLService
  32077. * @category iServer Map QueryResults
  32078. * @classdesc SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  32079. * @extends {SuperMap.QueryService}
  32080. * @example
  32081. * var queryParam = new SuperMap.FilterParameter({
  32082. * name: "Countries@World.1",
  32083. * attributeFilter: "Pop_1994>1000000000 and SmArea>900"
  32084. * });
  32085. * var queryBySQLParams = new SuperMap.QueryBySQLParameters({
  32086. * queryParams: [queryParam]
  32087. * });
  32088. * var myQueryBySQLService = new SuperMap.QueryBySQLService(url, {eventListeners: {
  32089. * "processCompleted": queryCompleted,
  32090. * "processFailed": queryError
  32091. * }
  32092. * });
  32093. * queryBySQLService.processAsync(queryBySQLParams);
  32094. * function queryCompleted(object){//todo};
  32095. * function queryError(object){//todo};
  32096. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  32097. * @param {Object} options - 参数。
  32098. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  32099. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  32100. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  32101. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32102. * @param {Object} [options.headers] - 请求头。
  32103. */
  32104. var QueryBySQLService_QueryBySQLService = /*#__PURE__*/function (_QueryService) {
  32105. QueryBySQLService_inherits(QueryBySQLService, _QueryService);
  32106. var _super = QueryBySQLService_createSuper(QueryBySQLService);
  32107. /**
  32108. * @function SuperMap.QueryBySQLService.prototype.constructor
  32109. * @description SQL 查询服务类构造函数。
  32110. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  32111. * @param {Object} options - 参数。
  32112. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  32113. */
  32114. function QueryBySQLService(url, options) {
  32115. var _this;
  32116. QueryBySQLService_classCallCheck(this, QueryBySQLService);
  32117. _this = _super.call(this, url, options);
  32118. _this.CLASS_NAME = "SuperMap.QueryBySQLService";
  32119. return _this;
  32120. }
  32121. /**
  32122. * @override
  32123. */
  32124. QueryBySQLService_createClass(QueryBySQLService, [{
  32125. key: "destroy",
  32126. value: function destroy() {
  32127. QueryBySQLService_get(QueryBySQLService_getPrototypeOf(QueryBySQLService.prototype), "destroy", this).call(this);
  32128. }
  32129. /**
  32130. * @function SuperMap.QueryBySQLService.prototype.getJsonParameters
  32131. * @description 将查询参数转化为 JSON 字符串。
  32132. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  32133. * @param {SuperMap.QueryBySQLParameters} params - SQL 查询参数类。
  32134. * @returns {Object} 转化后的 JSON 字符串。
  32135. */
  32136. }, {
  32137. key: "getJsonParameters",
  32138. value: function getJsonParameters(params) {
  32139. if (!(params instanceof QueryBySQLParameters_QueryBySQLParameters)) {
  32140. return;
  32141. }
  32142. var me = this,
  32143. jsonParameters = "",
  32144. qp = null;
  32145. qp = me.getQueryParameters(params);
  32146. jsonParameters += "'queryMode':'SqlQuery','queryParameters':";
  32147. jsonParameters += Util_Util.toJSON(qp);
  32148. jsonParameters = "{" + jsonParameters + "}";
  32149. return jsonParameters;
  32150. }
  32151. }]);
  32152. return QueryBySQLService;
  32153. }(QueryService_QueryService);
  32154. SuperMap.QueryBySQLService = QueryBySQLService_QueryBySQLService;
  32155. // CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureParameters.js
  32156. function RouteCalculateMeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32157. 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); } }
  32158. function RouteCalculateMeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureParameters_defineProperties(Constructor, staticProps); return Constructor; }
  32159. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  32160. * This program are made available under the terms of the Apache License, Version 2.0
  32161. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32162. /**
  32163. * @class SuperMap.RouteCalculateMeasureParameters
  32164. * @category iServer SpatialAnalyst RouteCalculateMeasure
  32165. * @classdesc 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  32166. * @param {Object} options - 参数。
  32167. * @param {(SuperMap.Route|L.Polyline|ol.geom.LineString)} options.sourceRoute - 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  32168. * @param {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point)} options.point - 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  32169. * @param {float} [options.tolerance] - 容限值。
  32170. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。
  32171. */
  32172. var RouteCalculateMeasureParameters_RouteCalculateMeasureParameters = /*#__PURE__*/function () {
  32173. function RouteCalculateMeasureParameters(options) {
  32174. RouteCalculateMeasureParameters_classCallCheck(this, RouteCalculateMeasureParameters);
  32175. if (!options) {
  32176. return this;
  32177. }
  32178. /**
  32179. * @member {(SuperMap.Route|L.Polyline|ol.geom.LineString)} SuperMap.RouteCalculateMeasureParameters.prototype.sourceRoute
  32180. * @description 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  32181. */
  32182. this.sourceRoute = null;
  32183. /**
  32184. * @member {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point)} SuperMap.RouteCalculateMeasureParameters.prototype.point
  32185. * @description 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  32186. */
  32187. this.point = null;
  32188. /**
  32189. * @member {float} [SuperMap.RouteCalculateMeasureParameters.prototype.tolerance]
  32190. * @description 容限值。
  32191. */
  32192. this.tolerance = null;
  32193. /**
  32194. * @member {boolean} [SuperMap.RouteCalculateMeasureParameters.prototype.isIgnoreGap=false]
  32195. * @description 是否忽略子对象之间的距离。
  32196. */
  32197. this.isIgnoreGap = false;
  32198. Util_Util.extend(this, options);
  32199. this.CLASS_NAME = "SuperMap.RouteCalculateMeasureParameters";
  32200. }
  32201. /**
  32202. * @function SuperMap.RouteCalculateMeasureParameters.prototype.destroy
  32203. * @description 释放资源,将引用资源的属性置空。
  32204. */
  32205. RouteCalculateMeasureParameters_createClass(RouteCalculateMeasureParameters, [{
  32206. key: "destroy",
  32207. value: function destroy() {
  32208. var me = this;
  32209. me.sourceRoute = null;
  32210. me.point = null;
  32211. if (me.tolerance) {
  32212. me.tolerance = null;
  32213. }
  32214. if (me.isIgnoreGap) {
  32215. me.isIgnoreGap = false;
  32216. }
  32217. }
  32218. }]);
  32219. return RouteCalculateMeasureParameters;
  32220. }();
  32221. SuperMap.RouteCalculateMeasureParameters = RouteCalculateMeasureParameters_RouteCalculateMeasureParameters;
  32222. // CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureService.js
  32223. 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); }
  32224. function RouteCalculateMeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32225. 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); } }
  32226. function RouteCalculateMeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureService_defineProperties(Constructor, staticProps); return Constructor; }
  32227. 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); }
  32228. function RouteCalculateMeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteCalculateMeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  32229. 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); }
  32230. function RouteCalculateMeasureService_setPrototypeOf(o, p) { RouteCalculateMeasureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteCalculateMeasureService_setPrototypeOf(o, p); }
  32231. 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); }; }
  32232. function RouteCalculateMeasureService_possibleConstructorReturn(self, call) { if (call && (RouteCalculateMeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } return RouteCalculateMeasureService_assertThisInitialized(self); }
  32233. function RouteCalculateMeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32234. 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; } }
  32235. function RouteCalculateMeasureService_getPrototypeOf(o) { RouteCalculateMeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteCalculateMeasureService_getPrototypeOf(o); }
  32236. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  32237. * This program are made available under the terms of the Apache License, Version 2.0
  32238. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32239. /**
  32240. * @class SuperMap.RouteCalculateMeasureService
  32241. * @category iServer SpatialAnalyst RouteCalculateMeasure
  32242. * @classdesc 基于路由对象计算指定点 M 值操作的服务类。
  32243. * 该类负责将客户设置的计算指定点的 M 值参数传递给服务端,并接收服务端返回的
  32244. * 指定点的 M 值。通过该类支持的事件的监听函数参数获取。
  32245. * @extends {SuperMap.SpatialAnalystBase}
  32246. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  32247. * @param {Object} options - 参数。
  32248. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  32249. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32250. * @param {Object} [options.headers] - 请求头。
  32251. * @example 实例化该类如下例所示:
  32252. * (start code)
  32253. * var parameters = new SuperMap.RouteCalculateMeasureParameters({
  32254. * "sourceRoute":{
  32255. * "type":"LINEM",
  32256. * "parts":[4],
  32257. * "points":[
  32258. * {
  32259. * "measure":0,
  32260. * "y":-6674.466867067764,
  32261. * "x":3817.3527876130133
  32262. * },
  32263. * {
  32264. * "measure":199.57954019411724,
  32265. * "y":-6670.830929417594,
  32266. * "x":3617.806369901496
  32267. * },
  32268. * {
  32269. * "measure":609.3656478634477,
  32270. * "y":-6877.837541432356,
  32271. * "x":3264.1498746678444
  32272. * },
  32273. * {
  32274. * "measure":936.0174126282958,
  32275. * "y":-7038.687780615184,
  32276. * "x":2979.846206068903
  32277. * }
  32278. * ]
  32279. * },
  32280. * "tolerance":1,
  32281. * "point":{
  32282. * "x":3330.7754269417,
  32283. * "y":-6838.8394457216
  32284. * },
  32285. * "isIgnoreGap":false
  32286. * });
  32287. *
  32288. * var routeCalculateMeasureService = new SuperMap.RouteCalculateMeasureService(spatialAnalystURL, {
  32289. * eventListeners:{
  32290. * processCompleted:calculateCompleted,
  32291. * processFailed:calculateFailded
  32292. * }
  32293. * );
  32294. * routeCalculateMeasureService.processAsync(parameters);
  32295. *
  32296. * //执行
  32297. * function calculateCompleted(){todo}
  32298. * function calculateFailded(){todo}
  32299. * (end)
  32300. *
  32301. */
  32302. var RouteCalculateMeasureService_RouteCalculateMeasureService = /*#__PURE__*/function (_SpatialAnalystBase) {
  32303. RouteCalculateMeasureService_inherits(RouteCalculateMeasureService, _SpatialAnalystBase);
  32304. var _super = RouteCalculateMeasureService_createSuper(RouteCalculateMeasureService);
  32305. function RouteCalculateMeasureService(url, options) {
  32306. var _this;
  32307. RouteCalculateMeasureService_classCallCheck(this, RouteCalculateMeasureService);
  32308. _this = _super.call(this, url, options);
  32309. _this.CLASS_NAME = "SuperMap.RouteCalculateMeasureService";
  32310. return _this;
  32311. }
  32312. /**
  32313. * @override
  32314. */
  32315. RouteCalculateMeasureService_createClass(RouteCalculateMeasureService, [{
  32316. key: "destroy",
  32317. value: function destroy() {
  32318. RouteCalculateMeasureService_get(RouteCalculateMeasureService_getPrototypeOf(RouteCalculateMeasureService.prototype), "destroy", this).call(this);
  32319. }
  32320. /**
  32321. * @function SuperMap.RouteCalculateMeasureService.prototype.processAsync
  32322. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  32323. * @param {SuperMap.RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  32324. */
  32325. }, {
  32326. key: "processAsync",
  32327. value: function processAsync(params) {
  32328. if (!(params instanceof RouteCalculateMeasureParameters_RouteCalculateMeasureParameters)) {
  32329. return;
  32330. }
  32331. var me = this,
  32332. jsonParameters;
  32333. jsonParameters = me.getJsonParameters(params);
  32334. me.request({
  32335. method: "POST",
  32336. data: jsonParameters,
  32337. scope: me,
  32338. success: me.serviceProcessCompleted,
  32339. failure: me.serviceProcessFailed
  32340. });
  32341. }
  32342. /**
  32343. * @function SuperMap.RouteCalculateMeasureService.prototype.getJsonParameters
  32344. * @description 将参数转化为 JSON 字符串。
  32345. * @param {SuperMap.RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  32346. * @returns {Object} 转化后的 JSON 字符串。
  32347. */
  32348. }, {
  32349. key: "getJsonParameters",
  32350. value: function getJsonParameters(params) {
  32351. var jsonParameters,
  32352. jsonStr = "geometry/calculatemeasure",
  32353. me = this;
  32354. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  32355. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  32356. jsonParameters = Util_Util.toJSON(params);
  32357. return jsonParameters;
  32358. }
  32359. }]);
  32360. return RouteCalculateMeasureService;
  32361. }(SpatialAnalystBase_SpatialAnalystBase);
  32362. SuperMap.RouteCalculateMeasureService = RouteCalculateMeasureService_RouteCalculateMeasureService;
  32363. // CONCATENATED MODULE: ./src/common/iServer/RouteLocatorParameters.js
  32364. function RouteLocatorParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32365. 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); } }
  32366. function RouteLocatorParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorParameters_defineProperties(Constructor, staticProps); return Constructor; }
  32367. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  32368. * This program are made available under the terms of the Apache License, Version 2.0
  32369. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32370. /**
  32371. * @class SuperMap.RouteLocatorParameters
  32372. * @category iServer SpatialAnalyst RouteLocator
  32373. * @classdesc 路由对象定位空间对象的参数类。
  32374. * 参数有两种方式,分别为 Geometry 和 Dataset 两种,前者需要指定 sourceRoute 对象作为参数,后者需要 dataset,routeIDField,routeID 三个参数
  32375. * 如果用户两种参数均设置,优先选择 Dataset 方式。
  32376. * @param {Object} options - 参数。
  32377. * @param {(SuperMap.Route|L.Polyline|ol.geom.LineString)} options.sourceRoute - 路由对象。
  32378. * @param {float} options.measure - 定位点的 M 值。只当路由对象定位点时有意义。
  32379. * @param {string} [options.type] - 类型:点 or 线。
  32380. * @param {float} [options.offset=0] - 定位点偏移量。只当路由对象定位点时有意义。
  32381. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。即不忽略子对象之间的距离。
  32382. * @param {float} [options.startMeasure] - 定位线的起始 M 值。只当路由对象定位线时有意义。
  32383. * @param {float} [options.endMeasure] - 定位线的终止 M 值。只当路由对象定位线时有意义。
  32384. */
  32385. var RouteLocatorParameters_RouteLocatorParameters = /*#__PURE__*/function () {
  32386. function RouteLocatorParameters(options) {
  32387. RouteLocatorParameters_classCallCheck(this, RouteLocatorParameters);
  32388. if (!options) {
  32389. return this;
  32390. }
  32391. /**
  32392. * @member {(SuperMap.Route|L.Polyline|ol.geom.LineString)} SuperMap.RouteLocatorParameters.prototype.sourceRoute
  32393. * @description 路由对象。
  32394. */
  32395. this.sourceRoute = null;
  32396. /**
  32397. * @member {string} SuperMap.RouteLocatorParameters.prototype.dataset
  32398. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  32399. */
  32400. this.dataset = null;
  32401. /**
  32402. * @member {string} SuperMap.RouteLocatorParameters.prototype.routeIDField
  32403. * @description 路由对象所在的字段名称。
  32404. *
  32405. */
  32406. this.routeIDField = null;
  32407. /**
  32408. * @member {number} SuperMap.RouteLocatorParameters.prototype.routeID
  32409. * @description 路由对象标识。
  32410. *
  32411. */
  32412. this.routeID = null;
  32413. /**
  32414. * @member {string} [SuperMap.RouteLocatorParameters.prototype.type]
  32415. * @description 类型:点 or 线。
  32416. * 可选值为:
  32417. * LINE :根据起始 M 值及终止 M 值定位线对象。
  32418. * POINT : 根据 M 值定位点对象。
  32419. */
  32420. this.type = null;
  32421. /**
  32422. * @member {float} SuperMap.RouteLocatorParameters.prototype.measure
  32423. * @description 定位点的 M 值。只当路由对象定位点时有意义。
  32424. */
  32425. this.measure = null;
  32426. /**
  32427. * @member {float} [SuperMap.RouteLocatorParameters.prototype.offset=0]
  32428. * @description 定位点偏移量。只当路由对象定位点时有意义。
  32429. */
  32430. this.offset = 0;
  32431. /**
  32432. * @member {boolean} [SuperMap.RouteLocatorParameters.prototype.isIgnoreGap=false]
  32433. * @description 是否忽略子对象之间的距离。
  32434. */
  32435. this.isIgnoreGap = false;
  32436. /**
  32437. * @member {float} [SuperMap.RouteLocatorParameters.prototype.startMeasure]
  32438. * @description 定位线的起始 M 值。只当路由对象定位线时有意义。
  32439. */
  32440. this.startMeasure = null;
  32441. /**
  32442. * @member {float} [SuperMap.RouteLocatorParameters.prototype.endMeasure]
  32443. * @description 定位线的终止 M 值。只当路由对象定位线时有意义。
  32444. */
  32445. this.endMeasure = null;
  32446. var routeFromClient = options.sourceRoute;
  32447. var routeHandle = {};
  32448. if (routeFromClient && routeFromClient instanceof Geometry_Geometry && routeFromClient.components) {
  32449. routeHandle.type = routeFromClient.type;
  32450. routeHandle.parts = routeFromClient.parts;
  32451. var parts = [];
  32452. for (var i = 0, len = routeFromClient.components.length; i < len; i++) {
  32453. parts = parts.concat(routeFromClient.components[i].components);
  32454. }
  32455. routeHandle.points = parts;
  32456. options.sourceRoute = routeHandle;
  32457. }
  32458. Util_Util.extend(this, options);
  32459. this.CLASS_NAME = "SuperMap.RouteLocatorParameters";
  32460. }
  32461. /**
  32462. * @function SuperMap.RouteLocatorParameters.prototype.destroy
  32463. * @description 释放资源,将引用资源的属性置空。
  32464. */
  32465. RouteLocatorParameters_createClass(RouteLocatorParameters, [{
  32466. key: "destroy",
  32467. value: function destroy() {
  32468. var me = this;
  32469. me.sourceRoute = null;
  32470. me.type = null;
  32471. me.measure = null;
  32472. me.offset = 0;
  32473. me.isIgnoreGap = false;
  32474. me.startMeasure = null;
  32475. me.endMeasure = null;
  32476. me.dataset = null;
  32477. me.routeID = null;
  32478. me.routeIDField = null;
  32479. }
  32480. }]);
  32481. return RouteLocatorParameters;
  32482. }();
  32483. SuperMap.RouteLocatorParameters = RouteLocatorParameters_RouteLocatorParameters;
  32484. // CONCATENATED MODULE: ./src/common/iServer/RouteLocatorService.js
  32485. 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); }
  32486. function RouteLocatorService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32487. 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); } }
  32488. function RouteLocatorService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorService_defineProperties(Constructor, staticProps); return Constructor; }
  32489. 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); }
  32490. function RouteLocatorService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteLocatorService_getPrototypeOf(object); if (object === null) break; } return object; }
  32491. 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); }
  32492. function RouteLocatorService_setPrototypeOf(o, p) { RouteLocatorService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteLocatorService_setPrototypeOf(o, p); }
  32493. 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); }; }
  32494. function RouteLocatorService_possibleConstructorReturn(self, call) { if (call && (RouteLocatorService_typeof(call) === "object" || typeof call === "function")) { return call; } return RouteLocatorService_assertThisInitialized(self); }
  32495. function RouteLocatorService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32496. 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; } }
  32497. function RouteLocatorService_getPrototypeOf(o) { RouteLocatorService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteLocatorService_getPrototypeOf(o); }
  32498. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  32499. * This program are made available under the terms of the Apache License, Version 2.0
  32500. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32501. /**
  32502. * @class SuperMap.RouteLocatorService
  32503. * @category iServer SpatialAnalyst RouteLocator
  32504. * @classdesc 路由对象定位空间对象的服务类。
  32505. * @extends {SuperMap.SpatialAnalystBase}
  32506. * @param {string} url -服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  32507. * @param {Object} options - 参数。</br>
  32508. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  32509. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32510. * @param {Object} [options.headers] - 请求头。
  32511. * @example 实例化该类如下例所示:
  32512. * (start code)
  32513. * var routeLocatorParameters_point = new SuperMap.RouteLocatorParameters({
  32514. * "sourceRoute":{
  32515. * "type":"LINEM",
  32516. * "parts":[4],
  32517. * "points":[
  32518. * {
  32519. * "measure":0,
  32520. * "y":-6674.466867067764,
  32521. * "x":3817.3527876130133
  32522. * },
  32523. * {
  32524. * "measure":199.57954019411724,
  32525. * "y":-6670.830929417594,
  32526. * "x":3617.806369901496
  32527. * },
  32528. * {
  32529. * "measure":609.3656478634477,
  32530. * "y":-6877.837541432356,
  32531. * "x":3264.1498746678444
  32532. * },
  32533. * {
  32534. * "measure":936.0174126282958,
  32535. * "y":-7038.687780615184,
  32536. * "x":2979.846206068903
  32537. * }
  32538. * ]
  32539. * },
  32540. * "type":"POINT",
  32541. * "measure":10,
  32542. * "offset":3,
  32543. * "isIgnoreGap":true
  32544. * });
  32545. * var routeLocatorService = new SuperMap.RouteLocatorService(spatialAnalystURL, {
  32546. * eventListeners:{
  32547. * processCompleted:routeLocatorCompleted,
  32548. * processFailed:routeLocatorFailded
  32549. * }
  32550. * );
  32551. * routeLocatorService.processAsync(routeLocatorParameters_point);
  32552. *
  32553. * //执行
  32554. * function routeLocatorCompleted(){todo}
  32555. * function routeLocatorFailded(){todo}
  32556. * (end)
  32557. *
  32558. */
  32559. var RouteLocatorService_RouteLocatorService = /*#__PURE__*/function (_SpatialAnalystBase) {
  32560. RouteLocatorService_inherits(RouteLocatorService, _SpatialAnalystBase);
  32561. var _super = RouteLocatorService_createSuper(RouteLocatorService);
  32562. function RouteLocatorService(url, options) {
  32563. var _this;
  32564. RouteLocatorService_classCallCheck(this, RouteLocatorService);
  32565. _this = _super.call(this, url, options);
  32566. _this.CLASS_NAME = "SuperMap.RouteLocatorService";
  32567. return _this;
  32568. }
  32569. /**
  32570. * @override
  32571. */
  32572. RouteLocatorService_createClass(RouteLocatorService, [{
  32573. key: "destroy",
  32574. value: function destroy() {
  32575. RouteLocatorService_get(RouteLocatorService_getPrototypeOf(RouteLocatorService.prototype), "destroy", this).call(this);
  32576. }
  32577. /**
  32578. * @function SuperMap.RouteLocatorService.prototype.processAsync
  32579. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  32580. * @param {SuperMap.RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  32581. */
  32582. }, {
  32583. key: "processAsync",
  32584. value: function processAsync(params) {
  32585. if (!(params instanceof RouteLocatorParameters_RouteLocatorParameters)) {
  32586. return;
  32587. }
  32588. var me = this,
  32589. jsonParameters;
  32590. jsonParameters = me.getJsonParameters(params);
  32591. me.request({
  32592. method: "POST",
  32593. data: jsonParameters,
  32594. scope: me,
  32595. success: me.serviceProcessCompleted,
  32596. failure: me.serviceProcessFailed
  32597. });
  32598. }
  32599. /**
  32600. * @function SuperMap.RouteLocatorService.prototype.processAsync
  32601. * @description 将参数转化为 JSON 字符串。
  32602. * @param {SuperMap.RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  32603. * @returns {Object} 转化后的JSON字符串。
  32604. */
  32605. }, {
  32606. key: "getJsonParameters",
  32607. value: function getJsonParameters(params) {
  32608. var jsonParameters,
  32609. jsonStr = "geometry/routelocator",
  32610. me = this;
  32611. if (params.dataset) {
  32612. jsonStr = "datasets/" + params.dataset + "/linearreferencing/routelocator";
  32613. params.sourceRoute = null;
  32614. }
  32615. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  32616. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  32617. jsonParameters = Util_Util.toJSON(params);
  32618. return jsonParameters;
  32619. }
  32620. }]);
  32621. return RouteLocatorService;
  32622. }(SpatialAnalystBase_SpatialAnalystBase);
  32623. SuperMap.RouteLocatorService = RouteLocatorService_RouteLocatorService;
  32624. // CONCATENATED MODULE: ./src/common/iServer/ServerFeature.js
  32625. function ServerFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32626. 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); } }
  32627. function ServerFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerFeature_defineProperties(Constructor, staticProps); return Constructor; }
  32628. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  32629. * This program are made available under the terms of the Apache License, Version 2.0
  32630. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32631. /**
  32632. * @class SuperMap.ServerFeature
  32633. * @category iServer
  32634. * @classdesc 服务端矢量要素类。该类描述了服务端返回的矢量要素的相关信息,包括字段和几何信息。
  32635. * @param {Object} options - 参数。
  32636. * @param {SuperMap.ServerGeometry} geometry - 矢量要素的几何信息。
  32637. * @param {Array.<string>} [options.fieldNames] - 矢量要素的属性字段名集合。
  32638. * @param {Array.<string>} [options.fieldValues] - 矢量要素的属性字段值集合。
  32639. */
  32640. var ServerFeature_ServerFeature = /*#__PURE__*/function () {
  32641. function ServerFeature(options) {
  32642. ServerFeature_classCallCheck(this, ServerFeature);
  32643. /**
  32644. * @member {Array.<string>} [SuperMap.ServerFeature.prototype.fieldNames]
  32645. * @description 矢量要素的属性字段名集合。
  32646. */
  32647. this.fieldNames = null;
  32648. /**
  32649. * @member {Array.<string>} [SuperMap.ServerFeature.prototype.fieldValues]
  32650. * @description 矢量要素的属性字段值集合。
  32651. */
  32652. this.fieldValues = null;
  32653. /**
  32654. * @member {SuperMap.ServerGeometry} SuperMap.ServerFeature.prototype.geometry
  32655. * @description 矢量要素的几何信息。
  32656. */
  32657. this.geometry = null;
  32658. if (options) {
  32659. Util_Util.extend(this, options);
  32660. }
  32661. this.CLASS_NAME = "SuperMap.ServerFeature";
  32662. }
  32663. /**
  32664. * @function SuperMap.ServerFeature.prototype.destroy
  32665. * @description 释放资源,将引用资源的属性置空。
  32666. */
  32667. ServerFeature_createClass(ServerFeature, [{
  32668. key: "destroy",
  32669. value: function destroy() {
  32670. var me = this;
  32671. me.fieldNames = null;
  32672. me.fieldValues = null;
  32673. if (me.geometry) {
  32674. me.geometry.destroy();
  32675. me.geometry = null;
  32676. }
  32677. }
  32678. /**
  32679. * @function SuperMap.ServerFeature.prototype.toFeature
  32680. * @description 将服务端矢量要素 ServerFeature 转换为客户端矢量要素 Feature。
  32681. * @returns {SuperMap.Vector} 转换后的客户端矢量要素。
  32682. */
  32683. }, {
  32684. key: "toFeature",
  32685. value: function toFeature() {
  32686. var names,
  32687. values,
  32688. geo,
  32689. attr = {},
  32690. me = this,
  32691. feature;
  32692. names = me.fieldNames;
  32693. values = me.fieldValues;
  32694. for (var i in names) {
  32695. attr[names[i]] = values[i];
  32696. }
  32697. if (me.geometry) {
  32698. geo = me.geometry.toGeometry();
  32699. }
  32700. feature = new Vector_Vector(geo, attr);
  32701. if (me.geometry && me.geometry.id) {
  32702. feature.fid = me.geometry.id;
  32703. }
  32704. return feature;
  32705. }
  32706. /**
  32707. * @function SuperMap.ServerFeature.prototype.fromJson
  32708. * @description 将 JSON 对象表示服务端矢量要素转换为 ServerFeature。
  32709. * @param {Object} jsonObject - 要转换的 JSON 对象。
  32710. * @returns {SuperMap.ServerFeature} 转化后的 ServerFeature 对象。
  32711. */
  32712. }], [{
  32713. key: "fromJson",
  32714. value: function fromJson(jsonObject) {
  32715. var geo = null;
  32716. if (!jsonObject) {
  32717. return;
  32718. }
  32719. geo = jsonObject.geometry;
  32720. if (geo) {
  32721. geo = ServerGeometry_ServerGeometry.fromJson(geo);
  32722. }
  32723. return new ServerFeature({
  32724. fieldNames: jsonObject.fieldNames,
  32725. fieldValues: jsonObject.fieldValues,
  32726. geometry: geo
  32727. });
  32728. }
  32729. }]);
  32730. return ServerFeature;
  32731. }();
  32732. SuperMap.ServerFeature = ServerFeature_ServerFeature;
  32733. // CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoParameters.js
  32734. function SetLayerInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32735. 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); } }
  32736. function SetLayerInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoParameters_defineProperties(Constructor, staticProps); return Constructor; }
  32737. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  32738. * This program are made available under the terms of the Apache License, Version 2.0
  32739. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32740. /**
  32741. * @class SuperMap.SetLayerInfoParameters
  32742. * @category iServer Map TempLayersSet
  32743. * @classdesc 设置图层信息参数类.
  32744. * @param {Object} options - 参数。
  32745. * @param {string} options.resourceID - 临时图层的资源 ID。
  32746. * @param {string} options.tempLayerName - 临时图层下的子图层名。
  32747. * @param {string} options.layerInfo - 要更新的图层信息。
  32748. */
  32749. var SetLayerInfoParameters_SetLayerInfoParameters = /*#__PURE__*/function () {
  32750. function SetLayerInfoParameters(options) {
  32751. SetLayerInfoParameters_classCallCheck(this, SetLayerInfoParameters);
  32752. options = options || {};
  32753. /**
  32754. * @member {string} SuperMap.SetLayerInfoParameters.prototype.resourceID
  32755. * @description 临时图层的资源 ID。
  32756. */
  32757. this.resourceID = null;
  32758. /**
  32759. * @member {string} SuperMap.SetLayerInfoParameters.prototype.tempLayerName
  32760. * @description 临时图层下子图层(或者其子图层)名,如:Countries@World.3@@World。
  32761. */
  32762. this.tempLayerName = null;
  32763. /**
  32764. * @member {Object} SuperMap.SetLayerInfoParameters.prototype.layerInfo
  32765. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  32766. */
  32767. this.layerInfo = null;
  32768. Util_Util.extend(this, options);
  32769. this.CLASS_NAME = "SuperMap.SetLayerInfoParameters";
  32770. }
  32771. /**
  32772. * @function SuperMap.SetLayerInfoParameters.prototype.destroy
  32773. * @description 释放资源,将引用资源的属性置空。
  32774. */
  32775. SetLayerInfoParameters_createClass(SetLayerInfoParameters, [{
  32776. key: "destroy",
  32777. value: function destroy() {
  32778. var me = this;
  32779. me.resourceID = null;
  32780. me.tempLayerName = null;
  32781. me.layerInfo = null;
  32782. }
  32783. }]);
  32784. return SetLayerInfoParameters;
  32785. }();
  32786. SuperMap.SetLayerInfoParameters = SetLayerInfoParameters_SetLayerInfoParameters;
  32787. // CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoService.js
  32788. 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); }
  32789. function SetLayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32790. 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); } }
  32791. function SetLayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  32792. 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); }
  32793. function SetLayerInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  32794. 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); }
  32795. function SetLayerInfoService_setPrototypeOf(o, p) { SetLayerInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerInfoService_setPrototypeOf(o, p); }
  32796. 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); }; }
  32797. function SetLayerInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayerInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayerInfoService_assertThisInitialized(self); }
  32798. function SetLayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32799. 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; } }
  32800. function SetLayerInfoService_getPrototypeOf(o) { SetLayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerInfoService_getPrototypeOf(o); }
  32801. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  32802. * This program are made available under the terms of the Apache License, Version 2.0
  32803. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32804. /**
  32805. * @class SuperMap.SetLayerInfoService
  32806. * @category iServer Map TempLayersSet
  32807. * @classdesc 设置图层信息服务类。可以实现临时图层中子图层的修改
  32808. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  32809. * @extends {SuperMap.CommonServiceBase}
  32810. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:
  32811. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World";
  32812. * @param {Object} options - 参数。
  32813. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  32814. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  32815. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  32816. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32817. * @param {Object} [options.headers] - 请求头。
  32818. */
  32819. var SetLayerInfoService_SetLayerInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  32820. SetLayerInfoService_inherits(SetLayerInfoService, _CommonServiceBase);
  32821. var _super = SetLayerInfoService_createSuper(SetLayerInfoService);
  32822. function SetLayerInfoService(url, options) {
  32823. var _this;
  32824. SetLayerInfoService_classCallCheck(this, SetLayerInfoService);
  32825. _this = _super.call(this, url, options);
  32826. if (options) {
  32827. Util_Util.extend(SetLayerInfoService_assertThisInitialized(_this), options);
  32828. }
  32829. _this.CLASS_NAME = "SuperMap.SetLayerInfoService";
  32830. return _this;
  32831. }
  32832. /**
  32833. * @override
  32834. */
  32835. SetLayerInfoService_createClass(SetLayerInfoService, [{
  32836. key: "destroy",
  32837. value: function destroy() {
  32838. SetLayerInfoService_get(SetLayerInfoService_getPrototypeOf(SetLayerInfoService.prototype), "destroy", this).call(this);
  32839. Util_Util.reset(this);
  32840. }
  32841. /**
  32842. * @function SuperMap.SetLayerInfoService.prototype.processAsync
  32843. * @description 负责将客户端的更新参数传递到服务端。
  32844. * @param {Object} params - 修改后的图层资源信息。
  32845. * 该参数可以使用获取图层信息服务<{@link SuperMap.GetLayersInfoService}>返回图层信息,解析结果result.subLayers.layers[i],然后对其属性进行修改来获取。
  32846. */
  32847. }, {
  32848. key: "processAsync",
  32849. value: function processAsync(params) {
  32850. if (!params) {
  32851. return;
  32852. }
  32853. var me = this;
  32854. var jsonParamsStr = Util_Util.toJSON(params);
  32855. me.request({
  32856. method: "PUT",
  32857. data: jsonParamsStr,
  32858. scope: me,
  32859. success: me.serviceProcessCompleted,
  32860. failure: me.serviceProcessFailed
  32861. });
  32862. }
  32863. }]);
  32864. return SetLayerInfoService;
  32865. }(CommonServiceBase_CommonServiceBase);
  32866. SuperMap.SetLayerInfoService = SetLayerInfoService_SetLayerInfoService;
  32867. // CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoParameters.js
  32868. function SetLayersInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32869. 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); } }
  32870. function SetLayersInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoParameters_defineProperties(Constructor, staticProps); return Constructor; }
  32871. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  32872. * This program are made available under the terms of the Apache License, Version 2.0
  32873. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32874. /**
  32875. * @class SuperMap.SetLayersInfoParameters
  32876. * @category iServer Map TempLayersSet
  32877. * @classdesc 设置图层信息参数类。
  32878. * @param {Object} options - 参数。
  32879. * @param {boolean} [options.isTempLayers=false] - 是否是临时图层。
  32880. * @param {string} options.resourceID - 临时图层资源 ID。
  32881. * @param {string} options.layersInfo - 要更新的图层信息。
  32882. */
  32883. var SetLayersInfoParameters_SetLayersInfoParameters = /*#__PURE__*/function () {
  32884. function SetLayersInfoParameters(options) {
  32885. SetLayersInfoParameters_classCallCheck(this, SetLayersInfoParameters);
  32886. options = options || {};
  32887. /**
  32888. * @member {boolean} [SuperMap.SetLayersInfoParameters.prototype.isTempLayers=false]
  32889. * @description 是否是临时图层。
  32890. */
  32891. this.isTempLayers = null;
  32892. /**
  32893. * @member {string} SuperMap.SetLayersInfoParameters.prototype.resourceID
  32894. * @description 临时图层资源 ID,
  32895. */
  32896. this.resourceID = null;
  32897. /**
  32898. * @member {Object} SuperMap.SetLayersInfoParameters.prototype.layersInfo
  32899. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  32900. */
  32901. this.layersInfo = null;
  32902. Util_Util.extend(this, options);
  32903. this.CLASS_NAME = "SuperMap.SetLayersInfoParameters";
  32904. }
  32905. /**
  32906. * @function SuperMap.SetLayersInfoParameters.prototype.destroy
  32907. * @description 释放资源,将引用资源的属性置空。
  32908. */
  32909. SetLayersInfoParameters_createClass(SetLayersInfoParameters, [{
  32910. key: "destroy",
  32911. value: function destroy() {
  32912. var me = this;
  32913. me.isTempLayers = null;
  32914. me.resourceID = null;
  32915. me.layersInfo = null;
  32916. }
  32917. }]);
  32918. return SetLayersInfoParameters;
  32919. }();
  32920. SuperMap.SetLayersInfoParameters = SetLayersInfoParameters_SetLayersInfoParameters;
  32921. // CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoService.js
  32922. 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); }
  32923. function SetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32924. 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); } }
  32925. function SetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  32926. 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); }
  32927. function SetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  32928. 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); }
  32929. function SetLayersInfoService_setPrototypeOf(o, p) { SetLayersInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayersInfoService_setPrototypeOf(o, p); }
  32930. 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); }; }
  32931. function SetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayersInfoService_assertThisInitialized(self); }
  32932. function SetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32933. 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; } }
  32934. function SetLayersInfoService_getPrototypeOf(o) { SetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayersInfoService_getPrototypeOf(o); }
  32935. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  32936. * This program are made available under the terms of the Apache License, Version 2.0
  32937. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32938. /**
  32939. * @class SuperMap.SetLayersInfoService
  32940. * @category iServer Map TempLayersSet
  32941. * @classdesc 设置图层信息服务类。可以实现创建新的临时图层和对现有临时图层的修改,
  32942. * 当 isTempLayers 为 false的时候执行创建临时图层。当 isTempLayers 为 ture 并且临时图层资源 resourceID 被设置有效时执行对临时图层的编辑。
  32943. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  32944. * @extends {SuperMap.CommonServiceBase}
  32945. * @param url - {string} 与客户端交互的地图服务地址。请求地图服务,URL 应为:
  32946. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  32947. * @param {Object} options - 参数。
  32948. * @param {string} options.resourceID - 图层资源ID,临时图层的资源ID标记。
  32949. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  32950. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  32951. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  32952. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  32953. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32954. * @param {Object} [options.headers] - 请求头。
  32955. */
  32956. var SetLayersInfoService_SetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  32957. SetLayersInfoService_inherits(SetLayersInfoService, _CommonServiceBase);
  32958. var _super = SetLayersInfoService_createSuper(SetLayersInfoService);
  32959. function SetLayersInfoService(url, options) {
  32960. var _this;
  32961. SetLayersInfoService_classCallCheck(this, SetLayersInfoService);
  32962. _this = _super.call(this, url, options);
  32963. /**
  32964. * @member {string} SuperMap.SetLayersInfoService.prototype.resourceID
  32965. * @description 图层资源ID,临时图层的资源ID标记。
  32966. */
  32967. _this.resourceID = null;
  32968. /**
  32969. * @function {boolean} SuperMap.SetLayersInfoService.prototype.isTempLayers
  32970. * @description 当前url对应的图层是否是临时图层。
  32971. */
  32972. _this.isTempLayers = false;
  32973. if (options) {
  32974. SuperMap.Util.extend(SetLayersInfoService_assertThisInitialized(_this), options);
  32975. }
  32976. _this.CLASS_NAME = "SuperMap.SetLayersInfoService";
  32977. return _this;
  32978. }
  32979. /**
  32980. * @override
  32981. */
  32982. SetLayersInfoService_createClass(SetLayersInfoService, [{
  32983. key: "destroy",
  32984. value: function destroy() {
  32985. SetLayersInfoService_get(SetLayersInfoService_getPrototypeOf(SetLayersInfoService.prototype), "destroy", this).call(this);
  32986. Util_Util.reset(this);
  32987. }
  32988. /**
  32989. * @function SuperMap.SetLayersInfoService.prototype.processAsync
  32990. * @description 负责将客户端的更新参数传递到服务端。
  32991. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务 <{@link SuperMap.GetLayersInfoService}>返回图层信息,然后对其属性进行修改来获取。
  32992. */
  32993. }, {
  32994. key: "processAsync",
  32995. value: function processAsync(params) {
  32996. if (!params) {
  32997. return;
  32998. }
  32999. var jsonParams,
  33000. subLayers = [],
  33001. me = this,
  33002. method = ""; //创建临时图层和设置修改临时图层信息对应不同的资源URL
  33003. if (me.isTempLayers) {
  33004. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + me.resourceID);
  33005. method = "PUT";
  33006. } else {
  33007. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet");
  33008. method = "POST";
  33009. }
  33010. if (!params.subLayers) {
  33011. params.subLayers = {
  33012. layers: []
  33013. };
  33014. }
  33015. if (!params.subLayers.layers) {
  33016. params.subLayers.layers = [];
  33017. }
  33018. var layers = params.subLayers.layers,
  33019. len = layers.length;
  33020. for (var i in layers) {
  33021. if (layers[i].ugcLayerType === "GRID") {
  33022. var colorDictionary = {};
  33023. var colorDics = layers[i].colorDictionarys;
  33024. for (var j in colorDics) {
  33025. var key = colorDics[j].elevation;
  33026. colorDictionary[key] = colorDics[j].color;
  33027. }
  33028. }
  33029. layers[i].colorDictionary = colorDictionary;
  33030. delete layers[i].colorDictionarys;
  33031. }
  33032. for (var _i = 0; _i < len; _i++) {
  33033. if (layers[_i].toJsonObject) {
  33034. //将图层信息转换成服务端能识别的简单json对象
  33035. subLayers.push(layers[_i].toJsonObject());
  33036. } else {
  33037. subLayers.push(layers[_i]);
  33038. }
  33039. }
  33040. jsonParams = Util_Util.extend(jsonParams, params);
  33041. jsonParams.subLayers = {
  33042. "layers": subLayers
  33043. };
  33044. jsonParams.object = null;
  33045. var jsonParamsStr = Util_Util.toJSON([jsonParams]);
  33046. me.request({
  33047. method: method,
  33048. data: jsonParamsStr,
  33049. scope: me,
  33050. success: me.serviceProcessCompleted,
  33051. failure: me.serviceProcessFailed
  33052. });
  33053. }
  33054. }]);
  33055. return SetLayersInfoService;
  33056. }(CommonServiceBase_CommonServiceBase);
  33057. SuperMap.SetLayersInfoService = SetLayersInfoService_SetLayersInfoService;
  33058. // CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusParameters.js
  33059. function SetLayerStatusParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33060. 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); } }
  33061. function SetLayerStatusParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusParameters_defineProperties(Constructor, staticProps); return Constructor; }
  33062. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  33063. * This program are made available under the terms of the Apache License, Version 2.0
  33064. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33065. /**
  33066. * @class SuperMap.SetLayerStatusParameters
  33067. * @category iServer Map TempLayersSet
  33068. * @classdesc 子图层显示控制参数类,该类存储了各子图层是否可见的状态。
  33069. * 注意在 SuperMap iClient 系列产品中所说的图层与 SuperMap Deskpro 的地图对应,子图层与 SuperMap Deskpro 的图层对应。
  33070. * @param {Object} options - 参数。
  33071. * @param {Array.<SuperMap.LayerStatus>} options.layerStatusList - 获取或设置图层可见状态({@link SuperMap.LayerStatus})集合,
  33072. * 集合中的每个 {@link SuperMap.LayerStatus} 对象代表一个子图层的可视状态。
  33073. * @param {number} [options.holdTime=15] - 获取或设置资源在服务端保存的时间。
  33074. * @param {string} [options.resourceID] - 获取或设置资源服务 ID。
  33075. */
  33076. var SetLayerStatusParameters_SetLayerStatusParameters = /*#__PURE__*/function () {
  33077. function SetLayerStatusParameters(options) {
  33078. SetLayerStatusParameters_classCallCheck(this, SetLayerStatusParameters);
  33079. /**
  33080. * @member {Array.<SuperMap.LayerStatus>} SuperMap.SetLayerStatusParameters.prototype.layerStatusList
  33081. * @description 获取或设置图层可见状态({@link SuperMap.LayerStatus})集合,集合中的每个 {@link SuperMap.LayerStatus} 对象代表一个子图层的可视状态。
  33082. */
  33083. this.layerStatusList = [];
  33084. /**
  33085. * @member {number} [SuperMap.SetLayerStatusParameters.prototype.holdTime=15]
  33086. * @description 获取或设置资源在服务端保存的时间。单位为分钟。
  33087. */
  33088. this.holdTime = 15;
  33089. /**
  33090. * @member {string} SuperMap.SetLayerStatusParameters.prototype.resourceID
  33091. * @description 获取或设置资源服务ID。如果设置该参数则会在指定的 TempLayer 进行图层的显示控制;
  33092. * 如果不设置该参数,则会首先创建一个 TempLayer ,然后在新创建的 TempLayer 进行图层的显示控制。
  33093. */
  33094. this.resourceID = null;
  33095. if (options) {
  33096. Util_Util.extend(this, options);
  33097. }
  33098. }
  33099. /**
  33100. * @function SuperMap.SetLayerStatusParameters.prototype.destroy
  33101. * @description 释放资源,将引用资源的属性置空。
  33102. */
  33103. SetLayerStatusParameters_createClass(SetLayerStatusParameters, [{
  33104. key: "destroy",
  33105. value: function destroy() {
  33106. var me = this;
  33107. me.layerStatusList = null;
  33108. me.holdTime = null;
  33109. me.resourceID = null;
  33110. }
  33111. /**
  33112. * @function SuperMap.SetLayerStatusParameters.prototype.toJSON
  33113. * @description 生成 JSON。
  33114. * @returns {Object} 对应的 JSON 对象。
  33115. */
  33116. }, {
  33117. key: "toJSON",
  33118. value: function toJSON() {
  33119. var json = '{';
  33120. json += '"layers":[';
  33121. var v = [];
  33122. for (var i = 0, len = this.layerStatusList.length; i < len; i++) {
  33123. v.push(this.layerStatusList[i].toJSON());
  33124. }
  33125. json += v;
  33126. json += ']';
  33127. json += '}';
  33128. return json;
  33129. }
  33130. }]);
  33131. return SetLayerStatusParameters;
  33132. }();
  33133. SuperMap.SetLayerStatusParameters = SetLayerStatusParameters_SetLayerStatusParameters;
  33134. // CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusService.js
  33135. 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); }
  33136. function SetLayerStatusService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33137. 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); } }
  33138. function SetLayerStatusService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusService_defineProperties(Constructor, staticProps); return Constructor; }
  33139. 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); }
  33140. function SetLayerStatusService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerStatusService_getPrototypeOf(object); if (object === null) break; } return object; }
  33141. 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); }
  33142. function SetLayerStatusService_setPrototypeOf(o, p) { SetLayerStatusService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerStatusService_setPrototypeOf(o, p); }
  33143. 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); }; }
  33144. function SetLayerStatusService_possibleConstructorReturn(self, call) { if (call && (SetLayerStatusService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayerStatusService_assertThisInitialized(self); }
  33145. function SetLayerStatusService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33146. 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; } }
  33147. function SetLayerStatusService_getPrototypeOf(o) { SetLayerStatusService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerStatusService_getPrototypeOf(o); }
  33148. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  33149. * This program are made available under the terms of the Apache License, Version 2.0
  33150. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33151. /**
  33152. * @class SuperMap.SetLayerStatusService
  33153. * @category iServer Map TempLayersSet
  33154. * @classdesc 子图层显示控制服务类。该类负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  33155. * 用户获取服务端返回的各子图层显示状态有两种方式:
  33156. * 一种是通过监听 SetLayerEvent.PROCESS_COMPLETE 事件;
  33157. * 一种是使用 AsyncResponder 类实现异步处理。
  33158. * @extends {SuperMap.CommonServiceBase}
  33159. * @param {string} url - 地图服务访问地址。请求地图服务,URL 应为:
  33160. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  33161. * @param {Object} options - 参数。
  33162. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  33163. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  33164. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  33165. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33166. * @param {Object} [options.headers] - 请求头。
  33167. */
  33168. var SetLayerStatusService_SetLayerStatusService = /*#__PURE__*/function (_CommonServiceBase) {
  33169. SetLayerStatusService_inherits(SetLayerStatusService, _CommonServiceBase);
  33170. var _super = SetLayerStatusService_createSuper(SetLayerStatusService);
  33171. function SetLayerStatusService(url, options) {
  33172. var _this;
  33173. SetLayerStatusService_classCallCheck(this, SetLayerStatusService);
  33174. _this = _super.call(this, url, options);
  33175. _this.lastparams = null;
  33176. _this.mapUrl = url;
  33177. if (options) {
  33178. Util_Util.extend(SetLayerStatusService_assertThisInitialized(_this), options);
  33179. }
  33180. _this.CLASS_NAME = "SuperMap.SetLayerStatusService";
  33181. return _this;
  33182. }
  33183. /**
  33184. * @override
  33185. */
  33186. SetLayerStatusService_createClass(SetLayerStatusService, [{
  33187. key: "destroy",
  33188. value: function destroy() {
  33189. SetLayerStatusService_get(SetLayerStatusService_getPrototypeOf(SetLayerStatusService.prototype), "destroy", this).call(this);
  33190. Util_Util.reset(this);
  33191. }
  33192. /**
  33193. * @function SuperMap.SetLayerStatusService.prototype.processAsync
  33194. * @description 负责将客户端的更新参数传递到服务端。
  33195. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务{@link SuperMap.SetLayerStatusParameters}
  33196. * 返回图层信息,然后对其属性进行修改来获取。
  33197. */
  33198. }, {
  33199. key: "processAsync",
  33200. value: function processAsync(params) {
  33201. if (!(params instanceof SetLayerStatusParameters_SetLayerStatusParameters)) {
  33202. return;
  33203. }
  33204. var me = this,
  33205. method = "POST";
  33206. me.url = me.mapUrl;
  33207. if (params.resourceID == null) {
  33208. me.url = Util_Util.urlPathAppend(me.url, 'tempLayersSet');
  33209. me.lastparams = params;
  33210. me.request({
  33211. method: method,
  33212. scope: me,
  33213. success: me.createTempLayerComplete,
  33214. failure: me.serviceProcessFailed
  33215. });
  33216. } else {
  33217. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + params.resourceID);
  33218. me.url = Util_Util.urlAppend(me.url, "elementRemain=true&reference=" + params.resourceID + "&holdTime=" + params.holdTime.toString());
  33219. var jsonParameters = '[{';
  33220. jsonParameters += '"type":"UGC",';
  33221. if (params.layerStatusList != null && params.layerStatusList.length > 0) {
  33222. jsonParameters += '"subLayers":' + params.toJSON();
  33223. }
  33224. jsonParameters += ',"visible":' + true + ',';
  33225. jsonParameters += '"name":"' + this.getMapName(this.mapUrl) + '"';
  33226. jsonParameters += '}]';
  33227. me.request({
  33228. method: "PUT",
  33229. data: jsonParameters,
  33230. scope: me,
  33231. success: me.serviceProcessCompleted,
  33232. failure: me.serviceProcessFailed
  33233. });
  33234. }
  33235. }
  33236. /**
  33237. * @function SuperMap.SetLayerStatusService.prototype.createTempLayerComplete
  33238. * @description 设置完成,执行此方法。
  33239. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  33240. */
  33241. }, {
  33242. key: "createTempLayerComplete",
  33243. value: function createTempLayerComplete(result) {
  33244. var me = this;
  33245. result = Util_Util.transformResult(result);
  33246. if (result.succeed) {
  33247. me.lastparams.resourceID = result.newResourceID;
  33248. }
  33249. me.processAsync(me.lastparams);
  33250. }
  33251. /**
  33252. * @function SuperMap.SetLayerStatusService.prototype.getMapName
  33253. * @description 获取地图名称。
  33254. * @param {Object} url - 服务地址。
  33255. */
  33256. }, {
  33257. key: "getMapName",
  33258. value: function getMapName(url) {
  33259. var mapUrl = url;
  33260. if (mapUrl.charAt(mapUrl.length - 1) === "/") {
  33261. mapUrl = mapUrl.substr(0, mapUrl.length - 1);
  33262. }
  33263. var index = mapUrl.lastIndexOf("/");
  33264. var mapName = mapUrl.substring(index + 1, mapUrl.length);
  33265. return mapName;
  33266. }
  33267. /**
  33268. * @function SuperMap.SetLayerStatusService.prototype.setLayerCompleted
  33269. * @description 设置完成,执行此方法。
  33270. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  33271. */
  33272. }, {
  33273. key: "serviceProcessCompleted",
  33274. value: function serviceProcessCompleted(result) {
  33275. var me = this;
  33276. result = Util_Util.transformResult(result);
  33277. if (result != null && me.lastparams != null) {
  33278. result.newResourceID = me.lastparams.resourceID;
  33279. }
  33280. me.events.triggerEvent("processCompleted", {
  33281. result: result
  33282. });
  33283. }
  33284. }]);
  33285. return SetLayerStatusService;
  33286. }(CommonServiceBase_CommonServiceBase);
  33287. SuperMap.SetLayerStatusService = SetLayerStatusService_SetLayerStatusService;
  33288. // CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsParameter.js
  33289. function SingleObjectQueryJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33290. 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); } }
  33291. function SingleObjectQueryJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  33292. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  33293. * This program are made available under the terms of the Apache License, Version 2.0
  33294. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33295. /**
  33296. * @class SuperMap.SingleObjectQueryJobsParameter
  33297. * @category iServer ProcessingService Query
  33298. * @classdesc 单对象空间查询分析任务参数类。
  33299. * @param {Object} options - 参数。
  33300. * @param {string} options.datasetName - 数据集名。
  33301. * @param {string} options.datasetQuery - 查询对象所在的数据集名称。
  33302. * @param {SuperMap.SpatialQueryMode} [options.mode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式。
  33303. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  33304. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  33305. */
  33306. var SingleObjectQueryJobsParameter_SingleObjectQueryJobsParameter = /*#__PURE__*/function () {
  33307. function SingleObjectQueryJobsParameter(options) {
  33308. SingleObjectQueryJobsParameter_classCallCheck(this, SingleObjectQueryJobsParameter);
  33309. if (!options) {
  33310. return;
  33311. }
  33312. /**
  33313. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.datasetName
  33314. * @description 数据集名。
  33315. */
  33316. this.datasetName = "";
  33317. /**
  33318. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.datasetQuery
  33319. * @description 查询对象所在的数据集名称。
  33320. */
  33321. this.datasetQuery = "";
  33322. /**
  33323. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.geometryQuery
  33324. * @description 查询对象所在的几何对象。
  33325. */
  33326. this.geometryQuery = "";
  33327. /**
  33328. * @member {SuperMap.SpatialQueryMode} [SuperMap.SingleObjectQueryJobsParameter.prototype.mode=SuperMap.SpatialQueryMode.CONTAIN]
  33329. * @description 空间查询模式 。
  33330. */
  33331. this.mode = SpatialQueryMode.CONTAIN;
  33332. /**
  33333. * @member {SuperMap.OutputSetting} [SuperMap.SingleObjectQueryJobsParameter.prototype.output]
  33334. * @description 输出参数设置类。
  33335. */
  33336. this.output = null;
  33337. /**
  33338. * @member {SuperMap.MappingParameters} [SuperMap.SingleObjectQueryJobsParameter.prototype.mappingParameters]
  33339. * @description 分析后结果可视化的参数类。
  33340. */
  33341. this.mappingParameters = null;
  33342. Util_Util.extend(this, options);
  33343. this.CLASS_NAME = "SuperMap.SingleObjectQueryJobsParameter";
  33344. }
  33345. /**
  33346. * @function SuperMap.SingleObjectQueryJobsParameter.prototype.destroy
  33347. * @description 释放资源,将引用资源的属性置空。
  33348. */
  33349. SingleObjectQueryJobsParameter_createClass(SingleObjectQueryJobsParameter, [{
  33350. key: "destroy",
  33351. value: function destroy() {
  33352. this.datasetName = null;
  33353. this.datasetQuery = null;
  33354. this.geometryQuery = null;
  33355. this.mode = null;
  33356. if (this.output instanceof OutputSetting_OutputSetting) {
  33357. this.output.destroy();
  33358. this.output = null;
  33359. }
  33360. if (this.mappingParameters instanceof MappingParameters_MappingParameters) {
  33361. this.mappingParameters.destroy();
  33362. this.mappingParameters = null;
  33363. }
  33364. }
  33365. /**
  33366. * @function SuperMap.SingleObjectQueryJobsParameter.toObject
  33367. * @param {Object} singleObjectQueryJobsParameter - 单对象空间查询分析任务参数。
  33368. * @param {Object} tempObj - 目标对象。
  33369. * @description 生成单对象空间查询分析任务对象。
  33370. */
  33371. }], [{
  33372. key: "toObject",
  33373. value: function toObject(singleObjectQueryJobsParameter, tempObj) {
  33374. for (var name in singleObjectQueryJobsParameter) {
  33375. if (name === "datasetName") {
  33376. tempObj['input'] = tempObj['input'] || {};
  33377. tempObj['input'][name] = singleObjectQueryJobsParameter[name];
  33378. continue;
  33379. }
  33380. if (name === "output") {
  33381. tempObj['output'] = tempObj['output'] || {};
  33382. tempObj['output'] = singleObjectQueryJobsParameter[name];
  33383. continue;
  33384. }
  33385. tempObj['analyst'] = tempObj['analyst'] || {};
  33386. tempObj['analyst'][name] = singleObjectQueryJobsParameter[name];
  33387. if (name === 'mappingParameters') {
  33388. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  33389. tempObj['analyst']['mappingParameters'] = singleObjectQueryJobsParameter[name];
  33390. }
  33391. }
  33392. }
  33393. }]);
  33394. return SingleObjectQueryJobsParameter;
  33395. }();
  33396. SuperMap.SingleObjectQueryJobsParameter = SingleObjectQueryJobsParameter_SingleObjectQueryJobsParameter;
  33397. // CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsService.js
  33398. 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); }
  33399. function SingleObjectQueryJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33400. 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); } }
  33401. function SingleObjectQueryJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  33402. 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); }
  33403. function SingleObjectQueryJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SingleObjectQueryJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  33404. 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); }
  33405. function SingleObjectQueryJobsService_setPrototypeOf(o, p) { SingleObjectQueryJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SingleObjectQueryJobsService_setPrototypeOf(o, p); }
  33406. 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); }; }
  33407. function SingleObjectQueryJobsService_possibleConstructorReturn(self, call) { if (call && (SingleObjectQueryJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SingleObjectQueryJobsService_assertThisInitialized(self); }
  33408. function SingleObjectQueryJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33409. 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; } }
  33410. function SingleObjectQueryJobsService_getPrototypeOf(o) { SingleObjectQueryJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SingleObjectQueryJobsService_getPrototypeOf(o); }
  33411. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  33412. * This program are made available under the terms of the Apache License, Version 2.0
  33413. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33414. /**
  33415. * @class SuperMap.SingleObjectQueryJobsService
  33416. * @category iServer ProcessingService Query
  33417. * @classdesc 单对象查询分析服务类
  33418. * @extends {SuperMap.ProcessingServiceBase}
  33419. * @param {string} url - 单对象空间查询分析服务地址。
  33420. * @param {Object} options - 参数。
  33421. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33422. * @param {Object} [options.headers] - 请求头。
  33423. */
  33424. var SingleObjectQueryJobsService_SingleObjectQueryJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  33425. SingleObjectQueryJobsService_inherits(SingleObjectQueryJobsService, _ProcessingServiceBas);
  33426. var _super = SingleObjectQueryJobsService_createSuper(SingleObjectQueryJobsService);
  33427. function SingleObjectQueryJobsService(url, options) {
  33428. var _this;
  33429. SingleObjectQueryJobsService_classCallCheck(this, SingleObjectQueryJobsService);
  33430. _this = _super.call(this, url, options);
  33431. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/query');
  33432. _this.CLASS_NAME = 'SuperMap.SingleObjectQueryJobsService';
  33433. return _this;
  33434. }
  33435. /**
  33436. *@override
  33437. */
  33438. SingleObjectQueryJobsService_createClass(SingleObjectQueryJobsService, [{
  33439. key: "destroy",
  33440. value: function destroy() {
  33441. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "destroy", this).call(this);
  33442. }
  33443. /**
  33444. * @function SuperMap.SingleObjectQueryJobsService.protitype.getQueryJobs
  33445. * @description 获取单对象空间查询分析所有任务
  33446. */
  33447. }, {
  33448. key: "getQueryJobs",
  33449. value: function getQueryJobs() {
  33450. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, this.url);
  33451. }
  33452. /**
  33453. * @function SuperMap.KernelDensityJobsService.protitype.getQueryJob
  33454. * @description 获取指定id的单对象空间查询分析服务
  33455. * @param {string} id - 指定要获取数据的id
  33456. */
  33457. }, {
  33458. key: "getQueryJob",
  33459. value: function getQueryJob(id) {
  33460. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  33461. }
  33462. /**
  33463. * @function SuperMap.SingleObjectQueryJobsService.protitype.addQueryJob
  33464. * @description 新建单对象空间查询分析服务
  33465. * @param {SuperMap.SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
  33466. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  33467. */
  33468. }, {
  33469. key: "addQueryJob",
  33470. value: function addQueryJob(params, seconds) {
  33471. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "addJob", this).call(this, this.url, params, SingleObjectQueryJobsParameter_SingleObjectQueryJobsParameter, seconds);
  33472. }
  33473. }]);
  33474. return SingleObjectQueryJobsService;
  33475. }(ProcessingServiceBase_ProcessingServiceBase);
  33476. SuperMap.SingleObjectQueryJobsService = SingleObjectQueryJobsService_SingleObjectQueryJobsService;
  33477. // CONCATENATED MODULE: ./src/common/iServer/StopQueryParameters.js
  33478. function StopQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33479. 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); } }
  33480. function StopQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  33481. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  33482. * This program are made available under the terms of the Apache License, Version 2.0
  33483. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33484. /**
  33485. * @class SuperMap.StopQueryParameters
  33486. * @category iServer TrafficTransferAnalyst TransferStops
  33487. * @classdesc 站点查询参数类。
  33488. * @param {Object} options - 参数。
  33489. * @param {string} options.keyWord - 站点名称关键字。
  33490. * @param {boolean} [options.returnPosition=false] - 是否返回站点坐标信息。
  33491. */
  33492. var StopQueryParameters_StopQueryParameters = /*#__PURE__*/function () {
  33493. function StopQueryParameters(options) {
  33494. StopQueryParameters_classCallCheck(this, StopQueryParameters);
  33495. options = options || {};
  33496. /**
  33497. * @member {string} SuperMap.StopQueryParameters.prototype.keyWord
  33498. * @description 站点名称关键字。
  33499. */
  33500. this.keyWord = null;
  33501. /**
  33502. * @member {boolean} [SuperMap.StopQueryParameters.prototype.returnPosition=false]
  33503. * @description 是否返回站点坐标信息。
  33504. */
  33505. this.returnPosition = false;
  33506. Util_Util.extend(this, options);
  33507. this.CLASS_NAME = "SuperMap.StopQueryParameters";
  33508. }
  33509. /**
  33510. * @function SuperMap.StopQueryParameters.prototype.destroy
  33511. * @description 释放资源,将引用资源的属性置空。
  33512. */
  33513. StopQueryParameters_createClass(StopQueryParameters, [{
  33514. key: "destroy",
  33515. value: function destroy() {
  33516. Util_Util.reset(this);
  33517. }
  33518. }]);
  33519. return StopQueryParameters;
  33520. }();
  33521. SuperMap.StopQueryParameters = StopQueryParameters_StopQueryParameters;
  33522. // CONCATENATED MODULE: ./src/common/iServer/StopQueryService.js
  33523. 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); }
  33524. function StopQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33525. 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); } }
  33526. function StopQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryService_defineProperties(Constructor, staticProps); return Constructor; }
  33527. 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); }
  33528. function StopQueryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = StopQueryService_getPrototypeOf(object); if (object === null) break; } return object; }
  33529. 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); }
  33530. function StopQueryService_setPrototypeOf(o, p) { StopQueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return StopQueryService_setPrototypeOf(o, p); }
  33531. 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); }; }
  33532. function StopQueryService_possibleConstructorReturn(self, call) { if (call && (StopQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return StopQueryService_assertThisInitialized(self); }
  33533. function StopQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33534. 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; } }
  33535. function StopQueryService_getPrototypeOf(o) { StopQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return StopQueryService_getPrototypeOf(o); }
  33536. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  33537. * This program are made available under the terms of the Apache License, Version 2.0
  33538. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33539. /**
  33540. * @class SuperMap.StopQueryService
  33541. * @category iServer TrafficTransferAnalyst TransferStops
  33542. * @classdesc 站点查询服务类。
  33543. * 返回结果通过该类支持的事件的监听函数参数获取
  33544. * @extends {SuperMap.CommonServiceBase}
  33545. * @param {string} url - 与客户端交互的站点查询服务地址。
  33546. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  33547. * @param {Object} options - 参数。</br>
  33548. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  33549. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33550. * @param {Object} [options.headers] - 请求头。
  33551. * @example 例如:
  33552. * (start code)
  33553. * var myService = new SuperMap.StopQueryService(url, {eventListeners: {
  33554. * "processCompleted": StopQueryCompleted,
  33555. * "processFailed": StopQueryError
  33556. * }
  33557. * };
  33558. * (end)
  33559. *
  33560. *
  33561. */
  33562. var StopQueryService_StopQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  33563. StopQueryService_inherits(StopQueryService, _CommonServiceBase);
  33564. var _super = StopQueryService_createSuper(StopQueryService);
  33565. function StopQueryService(url, options) {
  33566. var _this;
  33567. StopQueryService_classCallCheck(this, StopQueryService);
  33568. _this = _super.call(this, url, options);
  33569. options = options || {};
  33570. Util_Util.extend(StopQueryService_assertThisInitialized(_this), options);
  33571. _this.CLASS_NAME = "SuperMap.StopQueryService";
  33572. return _this;
  33573. }
  33574. /**
  33575. *@override
  33576. */
  33577. StopQueryService_createClass(StopQueryService, [{
  33578. key: "destroy",
  33579. value: function destroy() {
  33580. StopQueryService_get(StopQueryService_getPrototypeOf(StopQueryService.prototype), "destroy", this).call(this);
  33581. Util_Util.reset(this);
  33582. }
  33583. /**
  33584. * @function SuperMap.StopQueryService.prototype.processAsync
  33585. * @description 负责将客户端的更新参数传递到服务端。
  33586. * @param {SuperMap.StopQueryParameters} params - 交通换乘参数。
  33587. */
  33588. }, {
  33589. key: "processAsync",
  33590. value: function processAsync(params) {
  33591. if (!(params instanceof StopQueryParameters_StopQueryParameters)) {
  33592. return;
  33593. }
  33594. var me = this;
  33595. me.url = Util_Util.urlPathAppend(me.url, 'stops/keyword/' + params.keyWord);
  33596. me.request({
  33597. method: "GET",
  33598. params: {
  33599. returnPosition: params.returnPosition
  33600. },
  33601. scope: me,
  33602. success: me.serviceProcessCompleted,
  33603. failure: me.serviceProcessFailed
  33604. });
  33605. }
  33606. }]);
  33607. return StopQueryService;
  33608. }(CommonServiceBase_CommonServiceBase);
  33609. SuperMap.StopQueryService = StopQueryService_StopQueryService;
  33610. // CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsParameter.js
  33611. function SummaryAttributesJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33612. 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); } }
  33613. function SummaryAttributesJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  33614. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  33615. * This program are made available under the terms of the Apache License, Version 2.0
  33616. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33617. /**
  33618. * @class SuperMap.SummaryAttributesJobsParameter
  33619. * @category iServer ProcessingService SummaryAttributes
  33620. * @classdesc 属性汇总分析任务参数类
  33621. * @param {Object} options - 参数。
  33622. * @param {string} options.datasetName - 数据集名。
  33623. * @param {string} options.groupField - 分组字段。
  33624. * @param {string} options.attributeField - 属性字段。
  33625. * @param {string} options.statisticModes - 统计模式。
  33626. * @param {SuperMap.OutputSetting} [options.output] -输出参数设置。
  33627. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  33628. */
  33629. var SummaryAttributesJobsParameter_SummaryAttributesJobsParameter = /*#__PURE__*/function () {
  33630. function SummaryAttributesJobsParameter(options) {
  33631. SummaryAttributesJobsParameter_classCallCheck(this, SummaryAttributesJobsParameter);
  33632. if (!options) {
  33633. return;
  33634. }
  33635. /**
  33636. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.datasetName
  33637. * @description 汇总数据集名称。
  33638. */
  33639. this.datasetName = "";
  33640. /**
  33641. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.groupField
  33642. * @description 分组字段。
  33643. */
  33644. this.groupField = "";
  33645. /**
  33646. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.attributeField
  33647. * @description 属性字段。
  33648. */
  33649. this.attributeField = "";
  33650. /**
  33651. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.statisticModes
  33652. * @description 属性汇总统计模式。
  33653. */
  33654. this.statisticModes = "";
  33655. /**
  33656. * @member {SuperMap.OutputSetting} SuperMap.SummaryAttributesJobsParameter.prototype.output
  33657. * @description 输出参数设置类。
  33658. */
  33659. this.output = null;
  33660. /**
  33661. * @member {SuperMap.MappingParameters} [SuperMap.SummaryAttributesJobsParameter.prototype.mappingParameters]
  33662. * @description 分析后结果可视化的参数类。
  33663. */
  33664. this.mappingParameters = null;
  33665. Util_Util.extend(this, options);
  33666. this.CLASS_NAME = "SuperMap.SummaryAttributesJobsParameter";
  33667. }
  33668. /**
  33669. * @function SuperMap.SummaryAttributesJobsParameter.destroy
  33670. * @override
  33671. */
  33672. SummaryAttributesJobsParameter_createClass(SummaryAttributesJobsParameter, [{
  33673. key: "destroy",
  33674. value: function destroy() {
  33675. this.datasetName = null;
  33676. this.groupField = null;
  33677. this.attributeField = null;
  33678. this.statisticModes = null;
  33679. if (this.output instanceof OutputSetting_OutputSetting) {
  33680. this.output.destroy();
  33681. this.output = null;
  33682. }
  33683. if (this.mappingParameters instanceof MappingParameters_MappingParameters) {
  33684. this.mappingParameters.destroy();
  33685. this.mappingParameters = null;
  33686. }
  33687. }
  33688. /**
  33689. * @function SuperMap.SummaryAttributesJobsParameter.toObject
  33690. * @param {Object} SummaryAttributesJobsParameter - 属性汇总任务参数。
  33691. * @param {Object} tempObj - 目标对象。
  33692. * @description 生成属性汇总分析任务对象。
  33693. */
  33694. }], [{
  33695. key: "toObject",
  33696. value: function toObject(SummaryAttributesJobsParameter, tempObj) {
  33697. for (var name in SummaryAttributesJobsParameter) {
  33698. if (name === "datasetName") {
  33699. tempObj['input'] = tempObj['input'] || {};
  33700. tempObj['input'][name] = SummaryAttributesJobsParameter[name];
  33701. continue;
  33702. }
  33703. if (name === "output") {
  33704. tempObj['output'] = tempObj['output'] || {};
  33705. tempObj['output'] = SummaryAttributesJobsParameter[name];
  33706. continue;
  33707. }
  33708. tempObj['analyst'] = tempObj['analyst'] || {};
  33709. tempObj['analyst'][name] = SummaryAttributesJobsParameter[name];
  33710. if (name === 'mappingParameters') {
  33711. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  33712. tempObj['analyst']['mappingParameters'] = SummaryAttributesJobsParameter[name];
  33713. }
  33714. }
  33715. }
  33716. }]);
  33717. return SummaryAttributesJobsParameter;
  33718. }();
  33719. SuperMap.SummaryAttributesJobsParameter = SummaryAttributesJobsParameter_SummaryAttributesJobsParameter;
  33720. // CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsService.js
  33721. 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); }
  33722. function SummaryAttributesJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33723. 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); } }
  33724. function SummaryAttributesJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  33725. 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); }
  33726. function SummaryAttributesJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryAttributesJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  33727. 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); }
  33728. function SummaryAttributesJobsService_setPrototypeOf(o, p) { SummaryAttributesJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryAttributesJobsService_setPrototypeOf(o, p); }
  33729. 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); }; }
  33730. function SummaryAttributesJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryAttributesJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryAttributesJobsService_assertThisInitialized(self); }
  33731. function SummaryAttributesJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33732. 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; } }
  33733. function SummaryAttributesJobsService_getPrototypeOf(o) { SummaryAttributesJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryAttributesJobsService_getPrototypeOf(o); }
  33734. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  33735. * This program are made available under the terms of the Apache License, Version 2.0
  33736. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33737. /**
  33738. * @class SuperMap.SummaryAttributesJobsService
  33739. * @category iServer ProcessingService SummaryAttributes
  33740. * @classdesc 属性汇总分析服务类
  33741. * @extends {SuperMap.ProcessingServiceBase}
  33742. * @param {string} url - 汇总统计分析服务地址。
  33743. * @param {Object} options - 参数。
  33744. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33745. * @param {Object} [options.headers] - 请求头。
  33746. */
  33747. var SummaryAttributesJobsService_SummaryAttributesJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  33748. SummaryAttributesJobsService_inherits(SummaryAttributesJobsService, _ProcessingServiceBas);
  33749. var _super = SummaryAttributesJobsService_createSuper(SummaryAttributesJobsService);
  33750. function SummaryAttributesJobsService(url, options) {
  33751. var _this;
  33752. SummaryAttributesJobsService_classCallCheck(this, SummaryAttributesJobsService);
  33753. _this = _super.call(this, url, options);
  33754. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/summaryattributes');
  33755. _this.CLASS_NAME = "SuperMap.SummaryAttributesJobsService";
  33756. return _this;
  33757. }
  33758. /**
  33759. *@override
  33760. */
  33761. SummaryAttributesJobsService_createClass(SummaryAttributesJobsService, [{
  33762. key: "destroy",
  33763. value: function destroy() {
  33764. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "destroy", this).call(this);
  33765. }
  33766. /**
  33767. * @function SuperMap.SummaryAttributesJobsService.protitype.getSummaryAttributesJobs
  33768. * @description 获取属性汇总分析所有任务
  33769. */
  33770. }, {
  33771. key: "getSummaryAttributesJobs",
  33772. value: function getSummaryAttributesJobs() {
  33773. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, this.url);
  33774. }
  33775. /**
  33776. * @function SuperMap.SummaryAttributesJobsService.protitype.getSummaryAttributesJob
  33777. * @description 获取指定id的属性汇总分析服务
  33778. * @param {string} id - 指定要获取数据的id
  33779. */
  33780. }, {
  33781. key: "getSummaryAttributesJob",
  33782. value: function getSummaryAttributesJob(id) {
  33783. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  33784. }
  33785. /**
  33786. * @function SuperMap.SummaryAttributesJobsService.protitype.addSummaryAttributesJob
  33787. * @description 新建属性汇总分析服务
  33788. * @param {SuperMap.SummaryAttributesJobsParameter} params - 创建一个空间分析的请求参数。
  33789. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  33790. */
  33791. }, {
  33792. key: "addSummaryAttributesJob",
  33793. value: function addSummaryAttributesJob(params, seconds) {
  33794. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryAttributesJobsParameter_SummaryAttributesJobsParameter, seconds);
  33795. }
  33796. }]);
  33797. return SummaryAttributesJobsService;
  33798. }(ProcessingServiceBase_ProcessingServiceBase);
  33799. SuperMap.SummaryAttributesJobsService = SummaryAttributesJobsService_SummaryAttributesJobsService;
  33800. // CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobParameter.js
  33801. function SummaryMeshJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33802. 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); } }
  33803. function SummaryMeshJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  33804. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  33805. * This program are made available under the terms of the Apache License, Version 2.0
  33806. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33807. /**
  33808. * @class SuperMap.SummaryMeshJobParameter
  33809. * @category iServer ProcessingService AggregatePoints
  33810. * @classdesc 点聚合分析任务参数类。
  33811. * @param {Object} options - 参数。
  33812. * @param {string} options.datasetName - 数据集名。
  33813. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  33814. * @param {number} options.fields - 权重索引。
  33815. * @param {number} [options.resolution=100] - 分辨率。
  33816. * @param {SuperMap.StatisticAnalystMode} [options.statisticModes=SuperMap.StatisticAnalystMode.AVERAGE] - 分析模式。
  33817. * @param {number} [options.meshType=0] - 分析类型。
  33818. * @param {SuperMap.SummaryType} [options.type=SuperMap.SummaryType.SUMMARYMESH] - 聚合类型。
  33819. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  33820. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  33821. */
  33822. var SummaryMeshJobParameter_SummaryMeshJobParameter = /*#__PURE__*/function () {
  33823. function SummaryMeshJobParameter(options) {
  33824. SummaryMeshJobParameter_classCallCheck(this, SummaryMeshJobParameter);
  33825. if (!options) {
  33826. return;
  33827. }
  33828. /**
  33829. * @member {string} SuperMap.SummaryMeshJobParameter.prototype.datasetName
  33830. * @description 数据集名。
  33831. */
  33832. this.datasetName = "";
  33833. /**
  33834. * @member {string} SuperMap.SummaryMeshJobParameter.prototype.regionDataset
  33835. * @description 聚合面数据集(聚合类型为多边形聚合时使用的参数)。
  33836. */
  33837. this.regionDataset = "";
  33838. /**
  33839. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.SummaryMeshJobParameter.prototype.query
  33840. * @description 分析范围(聚合类型为网格面聚合时使用的参数)。
  33841. */
  33842. this.query = "";
  33843. /**
  33844. * @member {number} [SuperMap.SummaryMeshJobParameter.prototype.resolution=100]
  33845. * @description 分辨率(聚合类型为网格面聚合时使用的参数)。
  33846. */
  33847. this.resolution = 100;
  33848. /**
  33849. * @member {number} [SuperMap.SummaryMeshJobParameter.prototype.meshType=0]
  33850. * @description 网格面类型(聚合类型为网格面聚合时使用的参数),取值:0 或 1。
  33851. */
  33852. this.meshType = 0;
  33853. /**
  33854. * @member {SuperMap.StatisticAnalystMode} [SuperMap.SummaryMeshJobParameter.prototype.statisticModes=SuperMap.StatisticAnalystMode.AVERAGE]
  33855. * @description 统计模式。
  33856. */
  33857. this.statisticModes = StatisticAnalystMode.AVERAGE;
  33858. /**
  33859. * @member {number} SuperMap.SummaryMeshJobParameter.prototype.fields
  33860. * @description 权重字段。
  33861. */
  33862. this.fields = "";
  33863. /**
  33864. * @member {SuperMap.SummaryType} [SuperMap.SummaryMeshJobParameter.prototype.type=SuperMap.SummaryType.SUMMARYMESH]
  33865. * @description 聚合类型。
  33866. */
  33867. this.type = SummaryType.SUMMARYMESH;
  33868. /**
  33869. * @member {SuperMap.OutputSetting} [SuperMap.SummaryMeshJobParameter.prototype.output]
  33870. * @description 输出参数设置类。
  33871. */
  33872. this.output = null;
  33873. /**
  33874. * @member {SuperMap.MappingParameters} [SuperMap.SummaryMeshJobParameter.prototype.mappingParameters]
  33875. * @description 分析后结果可视化的参数类。
  33876. */
  33877. this.mappingParameters = null;
  33878. Util_Util.extend(this, options);
  33879. this.CLASS_NAME = "SuperMap.SummaryMeshJobParameter";
  33880. }
  33881. /**
  33882. * @function SuperMap.SummaryMeshJobParameter.destroy
  33883. * @override
  33884. */
  33885. SummaryMeshJobParameter_createClass(SummaryMeshJobParameter, [{
  33886. key: "destroy",
  33887. value: function destroy() {
  33888. this.datasetName = null;
  33889. this.query = null;
  33890. this.resolution = null;
  33891. this.statisticModes = null;
  33892. this.meshType = null;
  33893. this.fields = null;
  33894. this.regionDataset = null;
  33895. this.type = null;
  33896. if (this.output instanceof OutputSetting_OutputSetting) {
  33897. this.output.destroy();
  33898. this.output = null;
  33899. }
  33900. if (this.mappingParameters instanceof MappingParameters_MappingParameters) {
  33901. this.mappingParameters.destroy();
  33902. this.mappingParameters = null;
  33903. }
  33904. }
  33905. /**
  33906. * @function SuperMap.SummaryMeshJobParameter.toObject
  33907. * @param {Object} summaryMeshJobParameter - 点聚合分析任务参数。
  33908. * @param {Object} tempObj - 目标对象。
  33909. * @description 生成点聚合分析任务对象。
  33910. */
  33911. }], [{
  33912. key: "toObject",
  33913. value: function toObject(summaryMeshJobParameter, tempObj) {
  33914. for (var name in summaryMeshJobParameter) {
  33915. if (name === "datasetName") {
  33916. tempObj['input'] = tempObj['input'] || {};
  33917. tempObj['input'][name] = summaryMeshJobParameter[name];
  33918. continue;
  33919. }
  33920. if (name === "type") {
  33921. tempObj['type'] = summaryMeshJobParameter[name];
  33922. continue;
  33923. }
  33924. if (name === "output") {
  33925. tempObj['output'] = tempObj['output'] || {};
  33926. tempObj['output'] = summaryMeshJobParameter[name];
  33927. continue;
  33928. }
  33929. if (summaryMeshJobParameter.type === 'SUMMARYMESH' && name !== 'regionDataset' || summaryMeshJobParameter.type === 'SUMMARYREGION' && !contains(['meshType', 'resolution', 'query'], name)) {
  33930. tempObj['analyst'] = tempObj['analyst'] || {};
  33931. if (name === 'query' && summaryMeshJobParameter[name]) {
  33932. tempObj['analyst'][name] = summaryMeshJobParameter[name].toBBOX();
  33933. } else {
  33934. tempObj['analyst'][name] = summaryMeshJobParameter[name];
  33935. }
  33936. if (name === 'mappingParameters') {
  33937. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  33938. tempObj['analyst']['mappingParameters'] = summaryMeshJobParameter[name];
  33939. }
  33940. }
  33941. }
  33942. function contains(arr, obj) {
  33943. var i = arr.length;
  33944. while (i--) {
  33945. if (arr[i] === obj) {
  33946. return true;
  33947. }
  33948. }
  33949. return false;
  33950. }
  33951. }
  33952. }]);
  33953. return SummaryMeshJobParameter;
  33954. }();
  33955. SuperMap.SummaryMeshJobParameter = SummaryMeshJobParameter_SummaryMeshJobParameter;
  33956. // CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobsService.js
  33957. 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); }
  33958. function SummaryMeshJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33959. 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); } }
  33960. function SummaryMeshJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  33961. 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); }
  33962. function SummaryMeshJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryMeshJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  33963. 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); }
  33964. function SummaryMeshJobsService_setPrototypeOf(o, p) { SummaryMeshJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryMeshJobsService_setPrototypeOf(o, p); }
  33965. 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); }; }
  33966. function SummaryMeshJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryMeshJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryMeshJobsService_assertThisInitialized(self); }
  33967. function SummaryMeshJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33968. 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; } }
  33969. function SummaryMeshJobsService_getPrototypeOf(o) { SummaryMeshJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryMeshJobsService_getPrototypeOf(o); }
  33970. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  33971. * This program are made available under the terms of the Apache License, Version 2.0
  33972. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33973. /**
  33974. * @class SuperMap.SummaryMeshJobsService
  33975. * @category iServer ProcessingService AggregatePoints
  33976. * @classdesc 点聚合分析任务类。
  33977. * @param {string} url -点聚合分析任务地址。
  33978. * @param {Object} options - 参数。
  33979. * @param {SuperMap.Events} options.events - 处理所有事件的对象。<br>
  33980. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  33981. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  33982. * @param {number} options.index - 服务访问地址在数组中的位置。<br>
  33983. * @param {number} options.length - 服务访问地址数组长度。
  33984. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33985. * @param {Object} [options.headers] - 请求头。
  33986. */
  33987. var SummaryMeshJobsService_SummaryMeshJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  33988. SummaryMeshJobsService_inherits(SummaryMeshJobsService, _ProcessingServiceBas);
  33989. var _super = SummaryMeshJobsService_createSuper(SummaryMeshJobsService);
  33990. function SummaryMeshJobsService(url, options) {
  33991. var _this;
  33992. SummaryMeshJobsService_classCallCheck(this, SummaryMeshJobsService);
  33993. _this = _super.call(this, url, options);
  33994. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/aggregatepoints');
  33995. _this.CLASS_NAME = 'SuperMap.SummaryMeshJobsService';
  33996. return _this;
  33997. }
  33998. /**
  33999. * @override
  34000. */
  34001. SummaryMeshJobsService_createClass(SummaryMeshJobsService, [{
  34002. key: "destroy",
  34003. value: function destroy() {
  34004. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "destroy", this).call(this);
  34005. }
  34006. /**
  34007. * @function SuperMap.SummaryMeshJobsService.prototype.getSummaryMeshJobs
  34008. * @description 获取点聚合分析任务
  34009. */
  34010. }, {
  34011. key: "getSummaryMeshJobs",
  34012. value: function getSummaryMeshJobs() {
  34013. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, this.url);
  34014. }
  34015. /**
  34016. * @function SuperMap.SummaryMeshJobsService.prototype.getSummaryMeshJob
  34017. * @description 获取指定ip的点聚合分析任务
  34018. * @param {string} id - 指定要获取数据的id
  34019. */
  34020. }, {
  34021. key: "getSummaryMeshJob",
  34022. value: function getSummaryMeshJob(id) {
  34023. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  34024. }
  34025. /**
  34026. * @function SuperMap.SummaryMeshJobsService.prototype.addSummaryMeshJob
  34027. * @description 新建点聚合分析服务
  34028. * @param {SuperMap.SummaryMeshJobParameter} params - 创建一个空间分析的请求参数。
  34029. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  34030. */
  34031. }, {
  34032. key: "addSummaryMeshJob",
  34033. value: function addSummaryMeshJob(params, seconds) {
  34034. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryMeshJobParameter_SummaryMeshJobParameter, seconds);
  34035. }
  34036. }]);
  34037. return SummaryMeshJobsService;
  34038. }(ProcessingServiceBase_ProcessingServiceBase);
  34039. SuperMap.SummaryMeshJobsService = SummaryMeshJobsService_SummaryMeshJobsService;
  34040. // CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobParameter.js
  34041. function SummaryRegionJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34042. 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); } }
  34043. function SummaryRegionJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  34044. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  34045. * This program are made available under the terms of the Apache License, Version 2.0
  34046. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34047. /**
  34048. * @class SuperMap.SummaryRegionJobParameter
  34049. * @category iServer ProcessingService SummaryRegion
  34050. * @classdesc 区域汇总分析任务参数类。
  34051. * @param {Object} options - 参数。
  34052. * @param {string} options.datasetName - 数据集名。
  34053. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  34054. * @param {string} [options.standardFields] - 标准属性字段名称。
  34055. * @param {string} [options.weightedFields] - 权重字段名称。
  34056. * @param {SuperMap.StatisticAnalystMode} [options.standardStatisticModes] - 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  34057. * @param {SuperMap.StatisticAnalystMode} [options.weightedStatisticModes] - 权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  34058. * @param {boolean} [options.sumShape=true] - 是否统计长度或面积。
  34059. * @param {boolean} [options.standardSummaryFields=false] - 是否以标准属字段统计。
  34060. * @param {boolean} [options.weightedSummaryFields=false] - 是否以权重字段统计。
  34061. * @param {number} [options.resolution=100] - 网格大小。
  34062. * @param {number} [options.meshType=0] - 网格面汇总类型。
  34063. * @param {SuperMap.AnalystSizeUnit} [options.meshSizeUnit=SuperMap.AnalystSizeUnit.METER] - 网格大小单位。
  34064. * @param {SuperMap.SummaryType} [options.type=SuperMap.SummaryType.SUMMARYMESH] - 汇总类型。
  34065. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  34066. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  34067. */
  34068. var SummaryRegionJobParameter_SummaryRegionJobParameter = /*#__PURE__*/function () {
  34069. function SummaryRegionJobParameter(options) {
  34070. SummaryRegionJobParameter_classCallCheck(this, SummaryRegionJobParameter);
  34071. if (!options) {
  34072. return;
  34073. }
  34074. /**
  34075. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.datasetName
  34076. * @description 数据集名。
  34077. */
  34078. this.datasetName = "";
  34079. /**
  34080. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.regionDataset
  34081. * @description 汇总数据源(多边形汇总时用到的参数)。
  34082. */
  34083. this.regionDataset = "";
  34084. /**
  34085. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.sumShape=true]
  34086. * @description 是否统计长度或面积。
  34087. */
  34088. this.sumShape = true;
  34089. /**
  34090. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.SummaryRegionJobParameter.prototype.query
  34091. * @description 分析范围。
  34092. */
  34093. this.query = "";
  34094. /**
  34095. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.standardSummaryFields=false]
  34096. * @description 是否以标准属字段统计。
  34097. */
  34098. this.standardSummaryFields = false;
  34099. /**
  34100. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.standardFields
  34101. * @description 标准属性字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。standardSummaryFields 为 true 时必填。
  34102. */
  34103. this.standardFields = "";
  34104. /**
  34105. * @member {SuperMap.StatisticAnalystMode} SuperMap.SummaryRegionJobParameter.prototype.standardStatisticModes
  34106. * @description 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  34107. */
  34108. this.standardStatisticModes = "";
  34109. /**
  34110. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.weightedSummaryFields=false]
  34111. * @description 是否以权重字段统计。
  34112. */
  34113. this.weightedSummaryFields = false;
  34114. /**
  34115. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.weightedFields
  34116. * @description 权重字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。weightedSummaryFields 为 true 时必填。
  34117. */
  34118. this.weightedFields = "";
  34119. /**
  34120. * @member {SuperMap.StatisticAnalystMode} SuperMap.SummaryRegionJobParameter.prototype.weightedStatisticModes
  34121. * @description 以权重字段统计的统计模式。权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  34122. */
  34123. this.weightedStatisticModes = "";
  34124. /**
  34125. * @member {number} [SuperMap.SummaryRegionJobParameter.prototype.meshType=0]
  34126. * @description 网格面汇总类型。
  34127. */
  34128. this.meshType = 0;
  34129. /**
  34130. * @member {number} [SuperMap.SummaryRegionJobParameter.prototype.resolution=100]
  34131. * @description 网格大小。
  34132. */
  34133. this.resolution = 100;
  34134. /**
  34135. * @member {SuperMap.AnalystSizeUnit} [SuperMap.SummaryRegionJobParameter.prototype.meshSizeUnit=SuperMap.AnalystSizeUnit.METER]
  34136. * @description 网格大小单位。
  34137. */
  34138. this.meshSizeUnit = AnalystSizeUnit.METER;
  34139. /**
  34140. * @member {SuperMap.SummaryType} [SuperMap.SummaryRegionJobParameter.prototype.type=SuperMap.SummaryType.SUMMARYMESH]
  34141. * @description 汇总类型。
  34142. */
  34143. this.type = SummaryType.SUMMARYMESH;
  34144. /**
  34145. * @member {SuperMap.OutputSetting} SuperMap.SummaryRegionJobParameter.prototype.output
  34146. * @description 输出参数设置类
  34147. */
  34148. this.output = null;
  34149. /**
  34150. * @member {SuperMap.MappingParameters} [SuperMap.SummaryRegionJobParameter.prototype.mappingParameters]
  34151. * @description 分析后结果可视化的参数类。
  34152. */
  34153. this.mappingParameters = null;
  34154. Util_Util.extend(this, options);
  34155. this.CLASS_NAME = "SuperMap.SummaryRegionJobParameter";
  34156. }
  34157. /**
  34158. * @function SuperMap.SummaryRegionJobParameter.prototype.destroy
  34159. * @description 释放资源,将引用资源的属性置空。
  34160. */
  34161. SummaryRegionJobParameter_createClass(SummaryRegionJobParameter, [{
  34162. key: "destroy",
  34163. value: function destroy() {
  34164. this.datasetName = null;
  34165. this.sumShape = null;
  34166. this.regionDataset = null;
  34167. this.query = null;
  34168. this.standardSummaryFields = null;
  34169. this.standardFields = null;
  34170. this.standardStatisticModes = null;
  34171. this.weightedSummaryFields = null;
  34172. this.weightedFields = null;
  34173. this.weightedStatisticModes = null;
  34174. this.meshType = null;
  34175. this.resolution = null;
  34176. this.meshSizeUnit = null;
  34177. this.type = null;
  34178. if (this.output instanceof OutputSetting_OutputSetting) {
  34179. this.output.destroy();
  34180. this.output = null;
  34181. }
  34182. if (this.mappingParameters instanceof MappingParameters_MappingParameters) {
  34183. this.mappingParameters.destroy();
  34184. this.mappingParameters = null;
  34185. }
  34186. }
  34187. /**
  34188. * @function SuperMap.SummaryRegionJobParameter.toObject
  34189. * @param {Object} summaryRegionJobParameter - 矢量裁剪分析任务参数。
  34190. * @param {Object} tempObj - 目标对象。
  34191. * @description 生成区域汇总分析服务对象。
  34192. */
  34193. }], [{
  34194. key: "toObject",
  34195. value: function toObject(summaryRegionJobParameter, tempObj) {
  34196. for (var name in summaryRegionJobParameter) {
  34197. if (name === "datasetName") {
  34198. tempObj['input'] = tempObj['input'] || {};
  34199. tempObj['input'][name] = summaryRegionJobParameter[name];
  34200. continue;
  34201. }
  34202. if (name === "type") {
  34203. tempObj['type'] = summaryRegionJobParameter[name];
  34204. continue;
  34205. }
  34206. if (name === "type") {
  34207. tempObj['type'] = summaryRegionJobParameter[name];
  34208. continue;
  34209. }
  34210. if (name === "output") {
  34211. tempObj['output'] = tempObj['output'] || {};
  34212. tempObj['output'] = summaryRegionJobParameter[name];
  34213. continue;
  34214. }
  34215. if (summaryRegionJobParameter.type === "SUMMARYREGION" || summaryRegionJobParameter.type === "SUMMARYMESH" && name !== "regionDataset") {
  34216. tempObj['analyst'] = tempObj['analyst'] || {};
  34217. if (name === 'query' && summaryRegionJobParameter[name]) {
  34218. tempObj['analyst'][name] = summaryRegionJobParameter[name].toBBOX();
  34219. } else {
  34220. tempObj['analyst'][name] = summaryRegionJobParameter[name];
  34221. }
  34222. if (name === 'mappingParameters') {
  34223. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  34224. tempObj['analyst']['mappingParameters'] = summaryRegionJobParameter[name];
  34225. }
  34226. }
  34227. }
  34228. }
  34229. }]);
  34230. return SummaryRegionJobParameter;
  34231. }();
  34232. SuperMap.SummaryRegionJobParameter = SummaryRegionJobParameter_SummaryRegionJobParameter;
  34233. // CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobsService.js
  34234. 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); }
  34235. function SummaryRegionJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34236. 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); } }
  34237. function SummaryRegionJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  34238. 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); }
  34239. function SummaryRegionJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryRegionJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  34240. 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); }
  34241. function SummaryRegionJobsService_setPrototypeOf(o, p) { SummaryRegionJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryRegionJobsService_setPrototypeOf(o, p); }
  34242. 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); }; }
  34243. function SummaryRegionJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryRegionJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryRegionJobsService_assertThisInitialized(self); }
  34244. function SummaryRegionJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34245. 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; } }
  34246. function SummaryRegionJobsService_getPrototypeOf(o) { SummaryRegionJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryRegionJobsService_getPrototypeOf(o); }
  34247. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  34248. * This program are made available under the terms of the Apache License, Version 2.0
  34249. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34250. /**
  34251. * @class SuperMap.SummaryRegionJobsService
  34252. * @category iServer ProcessingService SummaryRegion
  34253. * @classdesc 区域汇总分析服务类
  34254. * @extends {SuperMap.ProcessingServiceBase}
  34255. * @param {string} url - 区域汇总分析服务地址。
  34256. * @param {Object} options - 参数。
  34257. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34258. * @param {Object} [options.headers] - 请求头。
  34259. */
  34260. var SummaryRegionJobsService_SummaryRegionJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  34261. SummaryRegionJobsService_inherits(SummaryRegionJobsService, _ProcessingServiceBas);
  34262. var _super = SummaryRegionJobsService_createSuper(SummaryRegionJobsService);
  34263. function SummaryRegionJobsService(url, options) {
  34264. var _this;
  34265. SummaryRegionJobsService_classCallCheck(this, SummaryRegionJobsService);
  34266. _this = _super.call(this, url, options);
  34267. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/summaryregion');
  34268. _this.CLASS_NAME = 'SuperMap.SummaryRegionJobsService';
  34269. return _this;
  34270. }
  34271. /**
  34272. *@override
  34273. */
  34274. SummaryRegionJobsService_createClass(SummaryRegionJobsService, [{
  34275. key: "destroy",
  34276. value: function destroy() {
  34277. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "destroy", this).call(this);
  34278. }
  34279. /**
  34280. * @function SuperMap.SummaryRegionJobsService.prototype.getSummaryRegionJobs
  34281. * @description 获取区域汇总分析任务集合。
  34282. */
  34283. }, {
  34284. key: "getSummaryRegionJobs",
  34285. value: function getSummaryRegionJobs() {
  34286. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, this.url);
  34287. }
  34288. /**
  34289. * @function SuperMap.SummaryRegionJobsService.prototype.getSummaryRegionJob
  34290. * @description 获取指定id的区域汇总分析任务。
  34291. * @param {string} id -要获取区域汇总分析任务的id
  34292. */
  34293. }, {
  34294. key: "getSummaryRegionJob",
  34295. value: function getSummaryRegionJob(id) {
  34296. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  34297. }
  34298. /**
  34299. * @function SuperMap.SummaryRegionJobsService.prototype.addSummaryRegionJob
  34300. * @description 新建区域汇总任务。
  34301. * @param {SuperMap.SummaryRegionJobParameter} params - 创建一个区域汇总任务的请求参数。
  34302. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  34303. */
  34304. }, {
  34305. key: "addSummaryRegionJob",
  34306. value: function addSummaryRegionJob(params, seconds) {
  34307. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryRegionJobParameter_SummaryRegionJobParameter, seconds);
  34308. }
  34309. }]);
  34310. return SummaryRegionJobsService;
  34311. }(ProcessingServiceBase_ProcessingServiceBase);
  34312. SuperMap.SummaryRegionJobsService = SummaryRegionJobsService_SummaryRegionJobsService;
  34313. // CONCATENATED MODULE: ./src/common/iServer/SupplyCenter.js
  34314. function SupplyCenter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34315. 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); } }
  34316. function SupplyCenter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SupplyCenter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SupplyCenter_defineProperties(Constructor, staticProps); return Constructor; }
  34317. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  34318. * This program are made available under the terms of the Apache License, Version 2.0
  34319. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34320. /**
  34321. * @class SuperMap.SupplyCenter
  34322. * @category iServer NetworkAnalyst Location
  34323. * @classdesc 资源供给中心类。在资源分配和选址分区分析两个功能中使用。
  34324. * @param {Object} options - 参数。
  34325. * @param {number} options.maxWeight - 资源供给中心的最大耗费值。
  34326. * @param {number} options.nodeID - 资源供给中心点的结点 ID 号。资源供给中心必须是结点。
  34327. * @param {number} options.resourceValue - 资源供给中心能提供的最大服务量或商品数量。
  34328. * @param {SuperMap.SupplyCenterType} [options.type] - 资源供给中心点的类型常量。
  34329. */
  34330. var SupplyCenter_SupplyCenter = /*#__PURE__*/function () {
  34331. function SupplyCenter(options) {
  34332. SupplyCenter_classCallCheck(this, SupplyCenter);
  34333. /**
  34334. * @member {number} SuperMap.SupplyCenter.prototype.maxWeight
  34335. * @description 资源供给中心的最大耗费值。中心点最大阻值设置越小,表示中心点所提供的资源可影响范围越大。
  34336. * 最大阻力值是用来限制需求点到中心点的花费。
  34337. * 如果需求点(弧段或结点)到此中心的花费大于最大阻力值,则该需求点不属于该资源供给中心提供资源的范围。
  34338. */
  34339. this.maxWeight = null;
  34340. /**
  34341. * @member {number} SuperMap.SupplyCenter.prototype.nodeID
  34342. * @description 资源供给中心点的结点 ID 号,资源供给中心必须是结点。
  34343. */
  34344. this.nodeID = null;
  34345. /**
  34346. * @member {number} SuperMap.SupplyCenter.prototype.resourceValue
  34347. * @description 资源供给中心能提供的最大服务量或商品数量。例如资源中心为学校,资源中心资源量表示该学校能够接纳多少学生。
  34348. */
  34349. this.resourceValue = null;
  34350. /**
  34351. * @member {SuperMap.SupplyCenterType} [SuperMap.SupplyCenter.prototype.type]
  34352. * @description 资源供给中心点的类型常量。资源供给中心点的类型包括非中心,固定中心和可选中心。
  34353. * 固定中心用于资源分配分析;固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  34354. */
  34355. this.type = null;
  34356. if (options) {
  34357. Util_Util.extend(this, options);
  34358. }
  34359. this.CLASS_NAME = "SuperMap.SupplyCenter";
  34360. }
  34361. /**
  34362. * @function SuperMap.SupplyCenter.prototype.destroy
  34363. * @description 释放资源,将引用资源的属性置空。
  34364. */
  34365. SupplyCenter_createClass(SupplyCenter, [{
  34366. key: "destroy",
  34367. value: function destroy() {
  34368. var me = this;
  34369. me.maxWeight = null;
  34370. me.nodeID = null;
  34371. me.resourceValue = null;
  34372. me.type = null;
  34373. }
  34374. /**
  34375. * @function SuperMap.SupplyCenter.fromJson
  34376. * @description 将服务端 JSON 对象转换成当前客户端对象。
  34377. * @param {Object} jsonObject - 要转换的 JSON 对象。
  34378. * @returns {SuperMap.SupplyCenter} SupplyCenter 对象。
  34379. */
  34380. }], [{
  34381. key: "fromJson",
  34382. value: function fromJson(jsonObject) {
  34383. if (!jsonObject) {
  34384. return;
  34385. }
  34386. return new SupplyCenter({
  34387. maxWeight: jsonObject.maxWeight,
  34388. nodeID: jsonObject.nodeID,
  34389. resourceValue: jsonObject.resourceValue,
  34390. type: jsonObject.type
  34391. });
  34392. }
  34393. }]);
  34394. return SupplyCenter;
  34395. }();
  34396. SuperMap.SupplyCenter = SupplyCenter_SupplyCenter;
  34397. // CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystService.js
  34398. 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); }
  34399. function SurfaceAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34400. 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); } }
  34401. function SurfaceAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  34402. 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); }
  34403. function SurfaceAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SurfaceAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  34404. 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); }
  34405. function SurfaceAnalystService_setPrototypeOf(o, p) { SurfaceAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SurfaceAnalystService_setPrototypeOf(o, p); }
  34406. 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); }; }
  34407. function SurfaceAnalystService_possibleConstructorReturn(self, call) { if (call && (SurfaceAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return SurfaceAnalystService_assertThisInitialized(self); }
  34408. function SurfaceAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34409. 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; } }
  34410. function SurfaceAnalystService_getPrototypeOf(o) { SurfaceAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SurfaceAnalystService_getPrototypeOf(o); }
  34411. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  34412. * This program are made available under the terms of the Apache License, Version 2.0
  34413. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34414. /**
  34415. * @class SuperMap.SurfaceAnalystService
  34416. * @category iServer SpatialAnalyst SurfaceAnalyst
  34417. * @classdesc 表面分析服务类。
  34418. * 该类负责将客户设置的表面分析服务参数传递给服务端,并接收服务端返回的表面分析服务分析结果数据。
  34419. * 表面分析结果通过该类支持的事件的监听函数参数获取
  34420. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  34421. * @param {Object} options - 参数。</br>
  34422. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34423. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34424. * @param {Object} [options.headers] - 请求头。
  34425. * @extends {SuperMap.SpatialAnalystBase}
  34426. * @example 例如:
  34427. * (start code)
  34428. * var mySurfaceAnalystService = new SuperMap.SurfaceAnalystService(url, {
  34429. * eventListeners: {
  34430. * "processCompleted": surfaceAnalysCompleted,
  34431. * "processFailed": surfaceAnalysFailed
  34432. * }
  34433. * });
  34434. * (end)
  34435. *
  34436. */
  34437. var SurfaceAnalystService_SurfaceAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  34438. SurfaceAnalystService_inherits(SurfaceAnalystService, _SpatialAnalystBase);
  34439. var _super = SurfaceAnalystService_createSuper(SurfaceAnalystService);
  34440. function SurfaceAnalystService(url, options) {
  34441. var _this;
  34442. SurfaceAnalystService_classCallCheck(this, SurfaceAnalystService);
  34443. _this = _super.call(this, url, options);
  34444. _this.CLASS_NAME = "SuperMap.SurfaceAnalystService";
  34445. return _this;
  34446. }
  34447. /**
  34448. * @function SuperMap.SurfaceAnalystService.prototype.destroy
  34449. * @description 释放资源,将引用的资源属性置空。
  34450. */
  34451. SurfaceAnalystService_createClass(SurfaceAnalystService, [{
  34452. key: "destroy",
  34453. value: function destroy() {
  34454. SurfaceAnalystService_get(SurfaceAnalystService_getPrototypeOf(SurfaceAnalystService.prototype), "destroy", this).call(this);
  34455. }
  34456. /**
  34457. * @function SuperMap.SurfaceAnalystService.prototype.processAsync
  34458. * @description 负责将客户端的表面分析服务参数传递到服务端。
  34459. * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  34460. */
  34461. }, {
  34462. key: "processAsync",
  34463. value: function processAsync(params) {
  34464. if (!(params instanceof SurfaceAnalystParameters_SurfaceAnalystParameters)) {
  34465. return;
  34466. }
  34467. var me = this,
  34468. jsonParameters;
  34469. jsonParameters = me.getJsonParameters(params);
  34470. me.request({
  34471. method: "POST",
  34472. data: jsonParameters,
  34473. scope: me,
  34474. success: me.serviceProcessCompleted,
  34475. failure: me.serviceProcessFailed
  34476. });
  34477. }
  34478. /**
  34479. * @function SuperMap.SurfaceAnalystService.prototype.getJsonParameters
  34480. * @description 将参数转化为 JSON 字符串。
  34481. * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  34482. * @returns {Object} 转化后的JSON字符串。
  34483. */
  34484. }, {
  34485. key: "getJsonParameters",
  34486. value: function getJsonParameters(params) {
  34487. var jsonParameters = '';
  34488. var parameterObject = {};
  34489. var me = this;
  34490. if (params instanceof DatasetSurfaceAnalystParameters_DatasetSurfaceAnalystParameters) {
  34491. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + params.dataset + '/' + params.surfaceAnalystMethod.toLowerCase());
  34492. DatasetSurfaceAnalystParameters_DatasetSurfaceAnalystParameters.toObject(params, parameterObject);
  34493. jsonParameters = Util_Util.toJSON(parameterObject);
  34494. } else if (params instanceof GeometrySurfaceAnalystParameters_GeometrySurfaceAnalystParameters) {
  34495. me.url = Util_Util.urlPathAppend(me.url, 'geometry/' + params.surfaceAnalystMethod.toLowerCase());
  34496. jsonParameters = Util_Util.toJSON(params);
  34497. } else {
  34498. return;
  34499. }
  34500. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  34501. return jsonParameters;
  34502. }
  34503. }]);
  34504. return SurfaceAnalystService;
  34505. }(SpatialAnalystBase_SpatialAnalystBase);
  34506. SuperMap.SurfaceAnalystService = SurfaceAnalystService_SurfaceAnalystService;
  34507. // CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationParameters.js
  34508. function TerrainCurvatureCalculationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34509. 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); } }
  34510. function TerrainCurvatureCalculationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor, staticProps); return Constructor; }
  34511. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  34512. * This program are made available under the terms of the Apache License, Version 2.0
  34513. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34514. /**
  34515. * @class SuperMap.TerrainCurvatureCalculationParameters
  34516. * @category iServer SpatialAnalyst TerrainCalculation
  34517. * @classdesc 地形曲率计算参数类。
  34518. * @param {Object} options - 参数。
  34519. * @param {string} options.dataset - 要用来做地形曲率计算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  34520. * @param {string} options.averageCurvatureName - 结果数据集:平均曲率数据集的名称。
  34521. * @param {string} options.profileCurvatureName - 结果数据集:剖面曲率数据集的名称。
  34522. * @param {string} options.planCurvatureName - 结果数据集:平面曲率数据集的名称。
  34523. * @param {number} [options.zFactor=1.0] - 指定的高程缩放系数。1.0 表示不缩放。
  34524. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  34525. */
  34526. var TerrainCurvatureCalculationParameters_TerrainCurvatureCalculationParameters = /*#__PURE__*/function () {
  34527. function TerrainCurvatureCalculationParameters(options) {
  34528. TerrainCurvatureCalculationParameters_classCallCheck(this, TerrainCurvatureCalculationParameters);
  34529. if (!options) {
  34530. return;
  34531. }
  34532. /**
  34533. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.dataset
  34534. * @description 要用来做地形曲率计算数据源中数据集的名称。
  34535. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  34536. * 注:地形曲率计算必须为栅格数据集。
  34537. */
  34538. this.dataset = null;
  34539. /**
  34540. * @member {number} [SuperMap.TerrainCurvatureCalculationParameters.prototype.zFactor=1.0]
  34541. * @description 指定的高程缩放系数。1.0 表示不缩放。
  34542. * 该值是指在 DEM 栅格数据中,栅格值( Z 坐标,即高程值)相对于 X 和 Y 坐标的单位变换系数。
  34543. * 通常有 X,Y,Z 都参加的计算中,需要将高程值乘以一个高程缩放系数,使得三者单位一致。
  34544. * 例如,X、Y 方向上的单位是米,而 Z 方向的单位是英尺,由于 1 英尺等于 0.3048 米,则需要指定缩放系数为 0.3048。
  34545. */
  34546. this.zFactor = 1.0;
  34547. /**
  34548. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.averageCurvatureName
  34549. * @description 结果数据集:平均曲率数据集的名称。
  34550. */
  34551. this.averageCurvatureName = null;
  34552. /**
  34553. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.profileCurvatureName
  34554. * @description 结果数据集:剖面曲率数据集的名称。
  34555. */
  34556. this.profileCurvatureName = "";
  34557. /**
  34558. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.planCurvatureName
  34559. * @description 结果数据集:平面曲率数据集的名称。
  34560. */
  34561. this.planCurvatureName = "";
  34562. /**
  34563. * @member {boolean} [SuperMap.TerrainCurvatureCalculationParameters.prototype.deleteExistResultDataset=false]
  34564. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  34565. */
  34566. this.deleteExistResultDataset = false;
  34567. Util_Util.extend(this, options);
  34568. this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationParameters";
  34569. }
  34570. /**
  34571. * @function SuperMap.TerrainCurvatureCalculationParameters.prototype.destroy
  34572. * @description 释放资源,将引用资源的属性置空。
  34573. */
  34574. TerrainCurvatureCalculationParameters_createClass(TerrainCurvatureCalculationParameters, [{
  34575. key: "destroy",
  34576. value: function destroy() {
  34577. var me = this;
  34578. me.dataset = null;
  34579. me.zFactor = 1.0;
  34580. me.averageCurvatureName = null;
  34581. me.profileCurvatureName = null;
  34582. me.planCurvatureName = null;
  34583. me.deleteExistResultDataset = true;
  34584. }
  34585. /**
  34586. * @function SuperMap.TerrainCurvatureCalculationParameters.toObject
  34587. * @param {Object} derrainCurvatureCalculationParameters - 地形曲率计算参数。
  34588. * @param {Object} tempObj - 目标对象。
  34589. * @description 生成地形曲率计算对象。
  34590. */
  34591. }], [{
  34592. key: "toObject",
  34593. value: function toObject(derrainCurvatureCalculationParameters, tempObj) {
  34594. for (var name in derrainCurvatureCalculationParameters) {
  34595. if (name !== "dataset") {
  34596. tempObj[name] = derrainCurvatureCalculationParameters[name];
  34597. }
  34598. }
  34599. }
  34600. }]);
  34601. return TerrainCurvatureCalculationParameters;
  34602. }();
  34603. SuperMap.TerrainCurvatureCalculationParameters = TerrainCurvatureCalculationParameters_TerrainCurvatureCalculationParameters;
  34604. // CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationService.js
  34605. 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); }
  34606. function TerrainCurvatureCalculationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34607. 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); } }
  34608. function TerrainCurvatureCalculationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationService_defineProperties(Constructor, staticProps); return Constructor; }
  34609. 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); }
  34610. function TerrainCurvatureCalculationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TerrainCurvatureCalculationService_getPrototypeOf(object); if (object === null) break; } return object; }
  34611. 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); }
  34612. function TerrainCurvatureCalculationService_setPrototypeOf(o, p) { TerrainCurvatureCalculationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TerrainCurvatureCalculationService_setPrototypeOf(o, p); }
  34613. 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); }; }
  34614. function TerrainCurvatureCalculationService_possibleConstructorReturn(self, call) { if (call && (TerrainCurvatureCalculationService_typeof(call) === "object" || typeof call === "function")) { return call; } return TerrainCurvatureCalculationService_assertThisInitialized(self); }
  34615. function TerrainCurvatureCalculationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34616. 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; } }
  34617. function TerrainCurvatureCalculationService_getPrototypeOf(o) { TerrainCurvatureCalculationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TerrainCurvatureCalculationService_getPrototypeOf(o); }
  34618. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  34619. * This program are made available under the terms of the Apache License, Version 2.0
  34620. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34621. /**
  34622. * @class SuperMap.TerrainCurvatureCalculationService
  34623. * @category iServer SpatialAnalyst TerrainCalculation
  34624. * @classdesc 地形曲率计算服务类。
  34625. * @extends {SuperMap.SpatialAnalystBase}
  34626. * @param {Object} options - 参数。
  34627. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34628. * @param {string} options.url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  34629. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34630. * @param {Object} [options.headers] - 请求头。
  34631. * @example 例如:
  34632. * (start code)
  34633. * var myTerrainCurvatureCalculationService = new SuperMap.TerrainCurvatureCalculationService(url);
  34634. * myTerrainCurvatureCalculationService.on({
  34635. * "processCompleted": processCompleted,
  34636. * "processFailed": processFailed
  34637. * }
  34638. * );
  34639. * (end)
  34640. *
  34641. */
  34642. var TerrainCurvatureCalculationService_TerrainCurvatureCalculationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  34643. TerrainCurvatureCalculationService_inherits(TerrainCurvatureCalculationService, _SpatialAnalystBase);
  34644. var _super = TerrainCurvatureCalculationService_createSuper(TerrainCurvatureCalculationService);
  34645. function TerrainCurvatureCalculationService(url, options) {
  34646. var _this;
  34647. TerrainCurvatureCalculationService_classCallCheck(this, TerrainCurvatureCalculationService);
  34648. _this = _super.call(this, url, options);
  34649. _this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationService";
  34650. return _this;
  34651. }
  34652. /**
  34653. *@override
  34654. */
  34655. TerrainCurvatureCalculationService_createClass(TerrainCurvatureCalculationService, [{
  34656. key: "destroy",
  34657. value: function destroy() {
  34658. TerrainCurvatureCalculationService_get(TerrainCurvatureCalculationService_getPrototypeOf(TerrainCurvatureCalculationService.prototype), "destroy", this).call(this);
  34659. }
  34660. /**
  34661. * @function SuperMap.TerrainCurvatureCalculationService.prototype.processAsync
  34662. * @description 负责将客户端的查询参数传递到服务端。
  34663. * @param {SuperMap.TerrainCurvatureCalculationParameters} parameter - 地形曲率计算参数类。
  34664. */
  34665. }, {
  34666. key: "processAsync",
  34667. value: function processAsync(parameter) {
  34668. var me = this;
  34669. var parameterObject = {};
  34670. if (parameter instanceof TerrainCurvatureCalculationParameters_TerrainCurvatureCalculationParameters) {
  34671. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/terraincalculation/curvature');
  34672. }
  34673. TerrainCurvatureCalculationParameters_TerrainCurvatureCalculationParameters.toObject(parameter, parameterObject);
  34674. var jsonParameters = SuperMap.Util.toJSON(parameterObject);
  34675. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  34676. me.request({
  34677. method: "POST",
  34678. data: jsonParameters,
  34679. scope: me,
  34680. success: me.serviceProcessCompleted,
  34681. failure: me.serviceProcessFailed
  34682. });
  34683. }
  34684. }]);
  34685. return TerrainCurvatureCalculationService;
  34686. }(SpatialAnalystBase_SpatialAnalystBase);
  34687. SuperMap.TerrainCurvatureCalculationService = TerrainCurvatureCalculationService_TerrainCurvatureCalculationService;
  34688. // CONCATENATED MODULE: ./src/common/iServer/ThemeGridRangeItem.js
  34689. function ThemeGridRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34690. 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); } }
  34691. function ThemeGridRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRangeItem_defineProperties(Constructor, staticProps); return Constructor; }
  34692. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  34693. * This program are made available under the terms of the Apache License, Version 2.0
  34694. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34695. /**
  34696. * @class SuperMap.ThemeGridRangeItem
  34697. * @category iServer Map Theme
  34698. * @classdesc 栅格分段专题图子项类。
  34699. * @description 在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  34700. * 本类用来设置每个范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  34701. * @param {Object} options - 参数。
  34702. * @param {SuperMap.ServerColor} options.color - 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  34703. * @param {string} [options.caption] - 栅格分段专题图子项的标题。
  34704. * @param {number} [options.end=0] - 栅格分段专题图子项的终止值。
  34705. * @param {number} [options.start=0] - 栅格分段专题图子项的起始值。
  34706. * @param {boolean} [options.visible=true] - 栅格分段专题图子项是否可见。
  34707. */
  34708. var ThemeGridRangeItem_ThemeGridRangeItem = /*#__PURE__*/function () {
  34709. function ThemeGridRangeItem(options) {
  34710. ThemeGridRangeItem_classCallCheck(this, ThemeGridRangeItem);
  34711. /**
  34712. * @member {string} [SuperMap.ThemeGridRangeItem.prototype.caption]
  34713. * @description 栅格分段专题图子项的标题。
  34714. */
  34715. this.caption = null;
  34716. /**
  34717. * @member {SuperMap.ServerColor} SuperMap.ThemeGridRangeItem.prototype.color
  34718. * @description 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  34719. */
  34720. this.color = new ServerColor();
  34721. /**
  34722. * @member {number} [SuperMap.ThemeGridRangeItem.prototype.end=0]
  34723. * @description 栅格分段专题图子项的终止值,即该段专题值范围的最大值。
  34724. */
  34725. this.end = 0;
  34726. /**
  34727. * @member {number} [SuperMap.ThemeGridRangeItem.prototype.start=0]
  34728. * @description 栅格分段专题图子项的起始值,即该段专题值范围的最小值。
  34729. */
  34730. this.start = 0;
  34731. /**
  34732. * @member {boolean} [SuperMap.ThemeGridRangeItem.prototype.visible=true]
  34733. * @description 栅格分段专题图子项是否可见。
  34734. */
  34735. this.visible = true;
  34736. if (options) {
  34737. Util_Util.extend(this, options);
  34738. }
  34739. this.CLASS_NAME = "SuperMap.ThemeGridRangeItem";
  34740. }
  34741. /**
  34742. * @function SuperMap.ThemeGridRangeItem.prototype.destroy
  34743. * @description 释放资源,将引用资源的属性置空。
  34744. */
  34745. ThemeGridRangeItem_createClass(ThemeGridRangeItem, [{
  34746. key: "destroy",
  34747. value: function destroy() {
  34748. var me = this;
  34749. me.caption = null;
  34750. me.end = null;
  34751. me.start = null; //需要验证是够存在destroy方法
  34752. if (me.color) {
  34753. me.color.destroy();
  34754. me.color = null;
  34755. }
  34756. me.visible = null;
  34757. }
  34758. /**
  34759. * @function SuperMap.ThemeGridRangeItem.prototype.toServerJSONObject
  34760. * @description 转换成对应的 JSON 格式对象。
  34761. * @returns {Object} 对应的 JSON 格式对象。
  34762. */
  34763. }, {
  34764. key: "toServerJSONObject",
  34765. value: function toServerJSONObject() {
  34766. var obj = {};
  34767. obj = Util_Util.copyAttributes(obj, this);
  34768. if (obj.color) {
  34769. if (obj.color.toServerJSONObject) {
  34770. obj.color = obj.color.toServerJSONObject();
  34771. }
  34772. }
  34773. return obj;
  34774. }
  34775. /**
  34776. * @function SuperMap.ThemeGridRangeItem.fromObj
  34777. * @description 从传入对象获取栅格分段专题图子项类。
  34778. * @param {Object} obj - 传入对象。
  34779. * @returns {SuperMap.ThemeGridRangeItem} ThemeGridRangeItem 对象。
  34780. */
  34781. }], [{
  34782. key: "fromObj",
  34783. value: function fromObj(obj) {
  34784. if (!obj) {
  34785. return;
  34786. }
  34787. var res = new ThemeGridRangeItem();
  34788. Util_Util.copy(res, obj);
  34789. res.color = ServerColor.fromJson(obj.color);
  34790. return res;
  34791. }
  34792. }]);
  34793. return ThemeGridRangeItem;
  34794. }();
  34795. SuperMap.ThemeGridRangeItem = ThemeGridRangeItem_ThemeGridRangeItem;
  34796. // CONCATENATED MODULE: ./src/common/iServer/ThemeGridRange.js
  34797. 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); }
  34798. function ThemeGridRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34799. 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); } }
  34800. function ThemeGridRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRange_defineProperties(Constructor, staticProps); return Constructor; }
  34801. 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); }
  34802. function ThemeGridRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridRange_getPrototypeOf(object); if (object === null) break; } return object; }
  34803. 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); }
  34804. function ThemeGridRange_setPrototypeOf(o, p) { ThemeGridRange_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridRange_setPrototypeOf(o, p); }
  34805. 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); }; }
  34806. function ThemeGridRange_possibleConstructorReturn(self, call) { if (call && (ThemeGridRange_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGridRange_assertThisInitialized(self); }
  34807. function ThemeGridRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34808. 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; } }
  34809. function ThemeGridRange_getPrototypeOf(o) { ThemeGridRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridRange_getPrototypeOf(o); }
  34810. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  34811. * This program are made available under the terms of the Apache License, Version 2.0
  34812. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34813. /**
  34814. * @class SuperMap.ThemeGridRange
  34815. * @category iServer Map Theme
  34816. * @classdesc 栅格分段专题图。
  34817. * @description 栅格分段专题图,是将所有单元格的值按照某种分段方式分成多个范围段,值在同一个范围段中的单元格使用相同的颜色进行显示。
  34818. * 栅格分段专题图一般用来反映连续分布现象的数量或程度特征。比如某年的全国降水量分布图,将各气象站点的观测值经过内插之后生成的栅格数据进行分段显示。
  34819. * 该类类似于分段专题图类,不同点在于分段专题图的操作对象是矢量数据,而栅格分段专题图的操作对象是栅格数据。
  34820. * @extends {SuperMap.Theme}
  34821. * @param {Object} options - 参数。
  34822. * @param {Array.<SuperMap.ThemeGridRangeItem>} options.items - 栅格分段专题图子项数组。
  34823. * @param {boolean} [options.reverseColor=false] - 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  34824. * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 分段专题图的分段模式。
  34825. * @param {number} [options.rangeParameter=0] - 分段参数。
  34826. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  34827. */
  34828. var ThemeGridRange_ThemeGridRange = /*#__PURE__*/function (_Theme) {
  34829. ThemeGridRange_inherits(ThemeGridRange, _Theme);
  34830. var _super = ThemeGridRange_createSuper(ThemeGridRange);
  34831. function ThemeGridRange(options) {
  34832. var _this;
  34833. ThemeGridRange_classCallCheck(this, ThemeGridRange);
  34834. _this = _super.call(this, "GRIDRANGE", options);
  34835. /**
  34836. * @member {Array.<SuperMap.ThemeGridRangeItem>} SuperMap.ThemeGridRange.prototype.items
  34837. * @description 栅格分段专题图子项数组。<br>
  34838. * 在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  34839. * 本类用来设置每个栅格范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  34840. */
  34841. _this.items = null;
  34842. /**
  34843. * @member {SuperMap.RangeMode} [SuperMap.ThemeGridRange.prototype.rangeMode=SuperMap.RangeMode.EQUALINTERVAL]
  34844. * @description 分段专题图的分段模式。<br>
  34845. * 在栅格分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  34846. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  34847. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  34848. */
  34849. _this.rangeMode = RangeMode.EQUALINTERVAL;
  34850. /**
  34851. * @member {number} [SuperMap.ThemeGridRange.prototype.rangeParameter=0]
  34852. * @description 分段参数。<br>
  34853. * 当分段模式为等距离分段法,平方根分段,对数分段法,计数分段法其中一种模式时,该参数用于设置分段个数,必设;当分段模式为标准差分段法时,
  34854. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  34855. */
  34856. _this.rangeParameter = 0;
  34857. /**
  34858. * @member {SuperMap.ColorGradientType} [SuperMap.ThemeGridRange.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  34859. * @description 渐变颜色枚举类。
  34860. *
  34861. */
  34862. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  34863. /**
  34864. * @member {boolean} SuperMap.ThemeGridRange.prototype.reverseColor
  34865. * @description 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  34866. */
  34867. _this.reverseColor = false;
  34868. if (options) {
  34869. Util_Util.extend(ThemeGridRange_assertThisInitialized(_this), options);
  34870. }
  34871. _this.CLASS_NAME = "SuperMap.ThemeGridRange";
  34872. return _this;
  34873. }
  34874. /**
  34875. * @function SuperMap.ThemeGridRange.prototype.destroy
  34876. * @override
  34877. */
  34878. ThemeGridRange_createClass(ThemeGridRange, [{
  34879. key: "destroy",
  34880. value: function destroy() {
  34881. ThemeGridRange_get(ThemeGridRange_getPrototypeOf(ThemeGridRange.prototype), "destroy", this).call(this);
  34882. var me = this;
  34883. if (me.items) {
  34884. if (me.items.length > 0) {
  34885. for (var item in me.items) {
  34886. me.items[item].destroy();
  34887. me.items[item] = null;
  34888. }
  34889. }
  34890. me.items = null;
  34891. }
  34892. me.reverseColor = null;
  34893. me.rangeMode = null;
  34894. me.rangeParameter = null;
  34895. me.colorGradientType = null;
  34896. }
  34897. /**
  34898. * @function SuperMap.ThemeGridRange.fromObj
  34899. * @description 从传入对象获取栅格分段专题图。
  34900. * @param {Object} obj - 传入对象。
  34901. * @returns {SuperMap.ThemeGridRange} ThemeGridRange 对象。
  34902. */
  34903. }], [{
  34904. key: "fromObj",
  34905. value: function fromObj(obj) {
  34906. if (!obj) {
  34907. return;
  34908. }
  34909. var res = new ThemeGridRange();
  34910. Util_Util.copy(res, obj);
  34911. var itemsR = obj.items;
  34912. var len = itemsR ? itemsR.length : 0;
  34913. res.items = [];
  34914. for (var i = 0; i < len; i++) {
  34915. res.items.push(ThemeGridRangeItem_ThemeGridRangeItem.fromObj(itemsR[i]));
  34916. }
  34917. return res;
  34918. }
  34919. }]);
  34920. return ThemeGridRange;
  34921. }(Theme_Theme);
  34922. SuperMap.ThemeGridRange = ThemeGridRange_ThemeGridRange;
  34923. // CONCATENATED MODULE: ./src/common/iServer/ThemeGridUniqueItem.js
  34924. function ThemeGridUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34925. 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); } }
  34926. function ThemeGridUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
  34927. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  34928. * This program are made available under the terms of the Apache License, Version 2.0
  34929. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34930. /**
  34931. * @class SuperMap.ThemeGridUniqueItem
  34932. * @category iServer Map Theme
  34933. * @classdesc 栅格单值专题图子项类。
  34934. * 栅格单值专题图是将值相同的单元格归为一类,每一类是一个专题图子项。
  34935. * @param {Object} options - 参数。
  34936. * @param {string} [options.caption] - 栅格单值专题图子项的名称。
  34937. * @param {SuperMap.ServerColor} [options.color] - 栅格单值专题图子项的显示颜色。
  34938. * @param {number} options.unique - 栅格单值专题图子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  34939. * @param {boolean} [options.visible=true] - 栅格单值专题图子项是否可见。
  34940. */
  34941. var ThemeGridUniqueItem_ThemeGridUniqueItem = /*#__PURE__*/function () {
  34942. function ThemeGridUniqueItem(options) {
  34943. ThemeGridUniqueItem_classCallCheck(this, ThemeGridUniqueItem);
  34944. /**
  34945. * @member {string} [SuperMap.ThemeGridUniqueItem.prototype.caption]
  34946. * @description 栅格单值专题图子项的名称。
  34947. */
  34948. this.caption = null;
  34949. /**
  34950. * @member {SuperMap.ServerColor} [SuperMap.ThemeGridUniqueItem.prototype.color]
  34951. * @description 栅格单值专题图子项的显示颜色。
  34952. */
  34953. this.color = new ServerColor();
  34954. /**
  34955. * @member {number} SuperMap.ThemeGridUniqueItem.prototype.unique
  34956. * @description 栅格单值专题图子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  34957. */
  34958. this.unique = null;
  34959. /**
  34960. * @member {boolean} [SuperMap.ThemeGridUniqueItem.prototype.visible=true]
  34961. * @description 栅格单值专题图子项是否可见。
  34962. */
  34963. this.visible = true;
  34964. if (options) {
  34965. Util_Util.extend(this, options);
  34966. }
  34967. this.CLASS_NAME = "SuperMap.ThemeGridUniqueItem";
  34968. }
  34969. /**
  34970. * @function SuperMap.ThemeGridUniqueItem.prototype.destroy
  34971. * @description 释放资源,将引用资源的属性置空。
  34972. */
  34973. ThemeGridUniqueItem_createClass(ThemeGridUniqueItem, [{
  34974. key: "destroy",
  34975. value: function destroy() {
  34976. var me = this;
  34977. me.caption = null;
  34978. me.unique = null;
  34979. if (me.color) {
  34980. me.color.destroy();
  34981. me.color = null;
  34982. }
  34983. me.visible = null;
  34984. }
  34985. /**
  34986. * @function SuperMap.ThemeGridUniqueItem.prototype.toServerJSONObject
  34987. * @description 转换成对应的 JSON 格式对象。
  34988. * @returns {Object} 对应的 JSON 格式对象。
  34989. */
  34990. }, {
  34991. key: "toServerJSONObject",
  34992. value: function toServerJSONObject() {
  34993. var obj = {};
  34994. obj = Util_Util.copyAttributes(obj, this);
  34995. if (obj.color) {
  34996. if (obj.color.toServerJSONObject) {
  34997. obj.color = obj.color.toServerJSONObject();
  34998. }
  34999. }
  35000. return obj;
  35001. }
  35002. /**
  35003. * @function SuperMap.ThemeGridUniqueItem.fromObj
  35004. * @description 从传入对象获取栅格单值专题图子项类。
  35005. * @param {Object} obj - 传入对象。
  35006. * @returns {SuperMap.ThemeGridUniqueItem} ThemeGridUniqueItem 对象。
  35007. */
  35008. }], [{
  35009. key: "fromObj",
  35010. value: function fromObj(obj) {
  35011. var res = new ThemeGridUniqueItem();
  35012. Util_Util.copy(res, obj);
  35013. res.color = ServerColor.fromJson(obj.color);
  35014. return res;
  35015. }
  35016. }]);
  35017. return ThemeGridUniqueItem;
  35018. }();
  35019. SuperMap.ThemeGridUniqueItem = ThemeGridUniqueItem_ThemeGridUniqueItem;
  35020. // CONCATENATED MODULE: ./src/common/iServer/ThemeGridUnique.js
  35021. 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); }
  35022. function ThemeGridUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35023. 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); } }
  35024. function ThemeGridUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUnique_defineProperties(Constructor, staticProps); return Constructor; }
  35025. 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); }
  35026. function ThemeGridUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  35027. 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); }
  35028. function ThemeGridUnique_setPrototypeOf(o, p) { ThemeGridUnique_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridUnique_setPrototypeOf(o, p); }
  35029. 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); }; }
  35030. function ThemeGridUnique_possibleConstructorReturn(self, call) { if (call && (ThemeGridUnique_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGridUnique_assertThisInitialized(self); }
  35031. function ThemeGridUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35032. 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; } }
  35033. function ThemeGridUnique_getPrototypeOf(o) { ThemeGridUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridUnique_getPrototypeOf(o); }
  35034. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  35035. * This program are made available under the terms of the Apache License, Version 2.0
  35036. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35037. /**
  35038. * @class SuperMap.ThemeGridUnique
  35039. * @category iServer Map Theme
  35040. * @classdesc 栅格单值专题图类。
  35041. * @description 栅格单值专题图,是将单元格值相同的归为一类,为每一类设定一种颜色,从而用来区分不同的类别。<br>
  35042. * 栅格单值专题图适用于离散栅格数据和部分连续栅格数据,对于单元格值各不相同的那些连续栅格数据,使用栅格单值专题图不具有任何意义。
  35043. * @extends {SuperMap.Theme}
  35044. * @param {Object} options - 参数。
  35045. * @param {Array.<SuperMap.ThemeGridUniqueItem>} options.items - 栅格单值专题图子项数组。
  35046. * @param {SuperMap.ServerColor} [options.defaultcolor] - 栅格单值专题图的默认颜色。
  35047. */
  35048. var ThemeGridUnique_ThemeGridUnique = /*#__PURE__*/function (_Theme) {
  35049. ThemeGridUnique_inherits(ThemeGridUnique, _Theme);
  35050. var _super = ThemeGridUnique_createSuper(ThemeGridUnique);
  35051. function ThemeGridUnique(options) {
  35052. var _this;
  35053. ThemeGridUnique_classCallCheck(this, ThemeGridUnique);
  35054. _this = _super.call(this, "GRIDUNIQUE", options);
  35055. /**
  35056. * @member {SuperMap.ServerColor} SuperMap.ThemeGridUnique.prototype.defaultcolor
  35057. * @description 栅格单值专题图的默认颜色。
  35058. * 对于那些未在格网单值专题图子项之列的要素使用该颜色显示。
  35059. */
  35060. _this.defaultcolor = new ServerColor();
  35061. /**
  35062. * @member {Array.<SuperMap.ThemeGridUniqueItem>} SuperMap.ThemeGridUnique.prototype.items
  35063. * @description 栅格单值专题图子项数组。
  35064. * 栅格单值专题图将值相同的单元格归为一类,每一类是一个专题图子项。
  35065. */
  35066. _this.items = null;
  35067. if (options) {
  35068. Util_Util.extend(ThemeGridUnique_assertThisInitialized(_this), options);
  35069. }
  35070. _this.CLASS_NAME = "SuperMap.ThemeGridUnique";
  35071. return _this;
  35072. }
  35073. /**
  35074. * @function SuperMap.ThemeGridUnique.prototype.destroy
  35075. * @override
  35076. */
  35077. ThemeGridUnique_createClass(ThemeGridUnique, [{
  35078. key: "destroy",
  35079. value: function destroy() {
  35080. ThemeGridUnique_get(ThemeGridUnique_getPrototypeOf(ThemeGridUnique.prototype), "destroy", this).call(this);
  35081. var me = this;
  35082. if (me.items) {
  35083. if (me.items.length > 0) {
  35084. for (var item in me.items) {
  35085. me.items[item].destroy();
  35086. me.items[item] = null;
  35087. }
  35088. }
  35089. me.items = null;
  35090. }
  35091. if (me.defaultcolor) {
  35092. me.defaultcolor.destroy();
  35093. me.defaultcolor = null;
  35094. }
  35095. }
  35096. /**
  35097. * @function SuperMap.ThemeGridUnique.prototype.toServerJSONObject
  35098. * @description 转换成对应的 JSON 格式对象。
  35099. * @returns {Object} 对应的 JSON 格式对象
  35100. */
  35101. }, {
  35102. key: "toServerJSONObject",
  35103. value: function toServerJSONObject() {
  35104. var obj = {};
  35105. obj = Util_Util.copyAttributes(obj, this);
  35106. if (obj.defaultcolor) {
  35107. if (obj.defaultcolor.toServerJSONObject) {
  35108. obj.defaultcolor = obj.defaultcolor.toServerJSONObject();
  35109. }
  35110. }
  35111. if (obj.items) {
  35112. var items = [],
  35113. len = obj.items.length;
  35114. for (var i = 0; i < len; i++) {
  35115. items.push(obj.items[i].toServerJSONObject());
  35116. }
  35117. obj.items = items;
  35118. }
  35119. return obj;
  35120. }
  35121. /**
  35122. * @function SuperMap.ThemeGridUnique.fromObj
  35123. * @description 从传入对象获取栅格单值专题图类。
  35124. * @param {Object} obj - 传入对象
  35125. * @returns {SuperMap.ThemeGridUnique} ThemeGridUnique 对象
  35126. */
  35127. }], [{
  35128. key: "fromObj",
  35129. value: function fromObj(obj) {
  35130. var res = new ThemeGridUnique();
  35131. var uItems = obj.items;
  35132. var len = uItems ? uItems.length : 0;
  35133. Util_Util.extend(res, obj);
  35134. res.items = [];
  35135. res.defaultcolor = ServerColor.fromJson(obj.defaultcolor);
  35136. for (var i = 0; i < len; i++) {
  35137. res.items.push(ThemeGridUniqueItem_ThemeGridUniqueItem.fromObj(uItems[i]));
  35138. }
  35139. return res;
  35140. }
  35141. }]);
  35142. return ThemeGridUnique;
  35143. }(Theme_Theme);
  35144. SuperMap.ThemeGridUnique = ThemeGridUnique_ThemeGridUnique;
  35145. // CONCATENATED MODULE: ./src/common/iServer/ThemeLabelUniqueItem.js
  35146. function ThemeLabelUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35147. 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); } }
  35148. function ThemeLabelUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
  35149. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  35150. * This program are made available under the terms of the Apache License, Version 2.0
  35151. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35152. /**
  35153. * @class SuperMap.ThemeLabelUniqueItem
  35154. * @category iServer Map Theme
  35155. * @classdesc 单值标签专题图的子项。
  35156. * @description 标签专题图用专题值对点、线、面等对象做标注,值得注意的是,单值标签专题图允许用户通过 uniqueExpression
  35157. * 字段指定用于单值的字段,同一值的标签具有相同的显示风格,其中每一个值就是一个专题图子项,
  35158. * 每一个子项都具有其名称、风格、指定的单值、X 方向偏移量和 Y 方向偏移量。
  35159. * @param {Object} options - 参数。
  35160. * @param {string} options.unique - 单值专题图子项的值,可以为数字、字符串等。
  35161. * @param {string} [options.caption] - 专题图子项的名称。
  35162. * @param {number} [options.offsetX=0] - 标签在 X 方向偏移量。
  35163. * @param {number} [options.offsetY=0] - 标签在 Y 方向偏移量。
  35164. * @param {boolean} [options.visible=true] - 标签专题图子项是否可见。
  35165. * @param {SuperMap.ServerTextStyle} [options.style] - 标签专题图子项文本的显示风格。
  35166. */
  35167. var ThemeLabelUniqueItem_ThemeLabelUniqueItem = /*#__PURE__*/function () {
  35168. function ThemeLabelUniqueItem(options) {
  35169. ThemeLabelUniqueItem_classCallCheck(this, ThemeLabelUniqueItem);
  35170. /**
  35171. * @member {string} [SuperMap.ThemeLabelUniqueItem.prototype.caption]
  35172. * @description 标签专题子项的标题。
  35173. */
  35174. this.caption = null;
  35175. /**
  35176. * @member {string} SuperMap.ThemeLabelUniqueItem.prototype.unique
  35177. * @description 单值专题图子项的值,可以为数字、字符串等。
  35178. */
  35179. this.unique = null;
  35180. /**
  35181. * @member {number} [SuperMap.ThemeLabelUniqueItem.prototype.offsetX=0]
  35182. * @description 标签在 X 方向偏移量。
  35183. */
  35184. this.offsetX = 0;
  35185. /**
  35186. * @member {number} [SuperMap.ThemeLabelUniqueItem.prototype.offsetY=0]
  35187. * @description 标签在 Y 方向偏移量。
  35188. */
  35189. this.offsetY = 0;
  35190. /**
  35191. * @member {boolean} [SuperMap.ThemeLabelUniqueItem.prototype.visible=true]
  35192. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  35193. */
  35194. this.visible = true;
  35195. /**
  35196. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeLabelUniqueItem.prototype.style
  35197. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  35198. * uniformMixedStyle(标签文本的复合风格),SuperMap.ThemeLabelUniqueItem.style(单值子项的文本风格),uniformStyle(统一文本风格)。
  35199. */
  35200. this.style = new ServerTextStyle_ServerTextStyle();
  35201. if (options) {
  35202. Util_Util.extend(this, options);
  35203. }
  35204. this.CLASS_NAME = "SuperMap.ThemeLabelUniqueItem";
  35205. }
  35206. /**
  35207. * @function SuperMap.ThemeLabelUniqueItem.prototype.destroy
  35208. * @description 释放资源,将引用资源的属性置空。
  35209. */
  35210. ThemeLabelUniqueItem_createClass(ThemeLabelUniqueItem, [{
  35211. key: "destroy",
  35212. value: function destroy() {
  35213. var me = this;
  35214. me.unique = null;
  35215. me.caption = null;
  35216. me.offsetX = null;
  35217. me.offsetY = null;
  35218. if (me.style) {
  35219. me.style.destroy();
  35220. me.style = null;
  35221. }
  35222. me.visible = null;
  35223. }
  35224. /**
  35225. * @function SuperMap.ThemeLabelUniqueItem.fromObj
  35226. * @description 从传入对象获取单值标签专题图的子项类。
  35227. * @param {Object} obj - 传入对象。
  35228. * @returns {SuperMap.ThemeLabelUniqueItem} ThemeLabelUniqueItem 对象。
  35229. */
  35230. }], [{
  35231. key: "fromObj",
  35232. value: function fromObj(obj) {
  35233. if (!obj) {
  35234. return;
  35235. }
  35236. var t = new ThemeLabelUniqueItem();
  35237. Util_Util.copy(t, obj);
  35238. return t;
  35239. }
  35240. }]);
  35241. return ThemeLabelUniqueItem;
  35242. }();
  35243. SuperMap.ThemeLabelUniqueItem = ThemeLabelUniqueItem_ThemeLabelUniqueItem;
  35244. // CONCATENATED MODULE: ./src/common/iServer/ThemeParameters.js
  35245. function ThemeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35246. 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); } }
  35247. function ThemeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeParameters_defineProperties(Constructor, staticProps); return Constructor; }
  35248. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  35249. * This program are made available under the terms of the Apache License, Version 2.0
  35250. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35251. /**
  35252. * @class SuperMap.ThemeParameters
  35253. * @category iServer Map Theme
  35254. * @classdesc 专题图参数类。
  35255. * 该类存储了制作专题所需的参数,包括数据源、数据集名称和专题图对象。
  35256. * @param {Object} options - 参数。
  35257. * @param {Array.<string>} options.datasetNames - 要制作专题图的数据集数组。
  35258. * @param {Array.<string>} options.dataSourceNames - 要制作专题图的数据集所在的数据源数组。
  35259. * @param {Array.<SuperMap.JoinItem>} [options.joinItems] - 专题图外部表的连接信息 JoinItem 数组。
  35260. * @param {Array.<SuperMap.Theme>} options.themes - 专题图对象列表。
  35261. * @param {Array.<string>} [options.displayFilters] - 专题图属性过滤条件。
  35262. * @param {Array.<string>} [options.displayOrderBys] - 专题图对象生成符号叠加次序排序字段。
  35263. * @param {Object} [options.fieldValuesDisplayFilter] - 图层要素的显示和隐藏的过滤属性,其带有三个属性,分别是:values、fieldName、fieldValuesDisplayMode。
  35264. */
  35265. var ThemeParameters_ThemeParameters = /*#__PURE__*/function () {
  35266. function ThemeParameters(options) {
  35267. ThemeParameters_classCallCheck(this, ThemeParameters);
  35268. /**
  35269. * @member {Array.<string>} SuperMap.ThemeParameters.prototype.datasetNames
  35270. * @description 要制作专题图的数据集数组。
  35271. */
  35272. this.datasetNames = null;
  35273. /**
  35274. * @member {Array.<string>} SuperMap.ThemeParameters.prototype.dataSourceNames
  35275. * @description 要制作专题图的数据集所在的数据源数组。
  35276. */
  35277. this.dataSourceNames = null;
  35278. /**
  35279. * @member {Array.<SuperMap.JoinItem>} [SuperMap.ThemeParameters.prototype.joinItems]
  35280. * @description 设置与外部表的连接信息 JoinItem 数组。
  35281. * 使用此属性可以制作与外部表连接的专题图。
  35282. */
  35283. this.joinItems = null;
  35284. /**
  35285. * @member {Array.<SuperMap.Theme>} SuperMap.ThemeParameters.prototype.themes
  35286. * @description 专题图对象列表。
  35287. * 该参数为实例化的各类专题图对象的集合。
  35288. */
  35289. this.themes = null;
  35290. /**
  35291. * @member {Array.<string>} [SuperMap.ThemeParameters.prototype.displayFilters]
  35292. * @description 专题图属性过滤条件。
  35293. */
  35294. this.displayFilters = null;
  35295. /**
  35296. * @member {Array.<string>} [SuperMap.ThemeParameters.prototype.displayOrderBys]
  35297. * @description 专题图对象生成符号叠加次序排序字段。
  35298. */
  35299. this.displayOrderBys = null;
  35300. /**
  35301. * @member {Object} [SuperMap.ThemeParameters.prototype.fieldValuesDisplayFilter]
  35302. * @property {Array.<number>} values - 需要过滤的值。
  35303. * @property {string} fieldName - 要过滤的字段名称只支持数字类型的字段。
  35304. * @property {string} fieldValuesDisplayMode - 目前为 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  35305. */
  35306. this.fieldValuesDisplayFilter = null;
  35307. if (options) {
  35308. Util_Util.extend(this, options);
  35309. }
  35310. this.CLASS_NAME = "SuperMap.ThemeParameters";
  35311. }
  35312. /**
  35313. * @function SuperMap.ThemeParameters.prototype.destroy
  35314. * @description 释放资源,将引用资源的属性置空。
  35315. */
  35316. ThemeParameters_createClass(ThemeParameters, [{
  35317. key: "destroy",
  35318. value: function destroy() {
  35319. var me = this;
  35320. me.datasetNames = null;
  35321. me.dataSourceNames = null;
  35322. if (me.joinItems) {
  35323. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  35324. joinItems[i].destroy();
  35325. }
  35326. me.joinItems = null;
  35327. }
  35328. if (me.themes) {
  35329. for (var _i = 0, themes = me.themes, _len = themes.length; _i < _len; _i++) {
  35330. themes[_i].destroy();
  35331. }
  35332. me.themes = null;
  35333. }
  35334. }
  35335. }]);
  35336. return ThemeParameters;
  35337. }();
  35338. SuperMap.ThemeParameters = ThemeParameters_ThemeParameters;
  35339. // CONCATENATED MODULE: ./src/common/iServer/ThemeService.js
  35340. 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); }
  35341. function ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35342. 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); } }
  35343. function ThemeService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeService_defineProperties(Constructor, staticProps); return Constructor; }
  35344. 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); }
  35345. function ThemeService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeService_getPrototypeOf(object); if (object === null) break; } return object; }
  35346. 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); }
  35347. function ThemeService_setPrototypeOf(o, p) { ThemeService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeService_setPrototypeOf(o, p); }
  35348. 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); }; }
  35349. function ThemeService_possibleConstructorReturn(self, call) { if (call && (ThemeService_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeService_assertThisInitialized(self); }
  35350. function ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35351. 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; } }
  35352. function ThemeService_getPrototypeOf(o) { ThemeService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeService_getPrototypeOf(o); }
  35353. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  35354. * This program are made available under the terms of the Apache License, Version 2.0
  35355. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35356. /**
  35357. * @class SuperMap.ThemeService
  35358. * @category iServer Map Theme
  35359. * @classdesc 专题图服务类。
  35360. * @extends {SuperMap.CommonServiceBase}
  35361. * @example
  35362. * var myThemeService = new SuperMap.ThemeService(url, {
  35363. * eventListeners: {
  35364. * "processCompleted": themeCompleted,
  35365. * "processFailed": themeFailed
  35366. * }
  35367. * });
  35368. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  35369. * @param {Object} options - 参数。
  35370. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35371. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35372. * @param {Object} [options.headers] - 请求头。
  35373. */
  35374. var ThemeService_ThemeService = /*#__PURE__*/function (_CommonServiceBase) {
  35375. ThemeService_inherits(ThemeService, _CommonServiceBase);
  35376. var _super = ThemeService_createSuper(ThemeService);
  35377. function ThemeService(url, options) {
  35378. var _this;
  35379. ThemeService_classCallCheck(this, ThemeService);
  35380. _this = _super.call(this, url, options);
  35381. if (options) {
  35382. SuperMap.Util.extend(ThemeService_assertThisInitialized(_this), options);
  35383. }
  35384. _this.url = Util_Util.urlPathAppend(_this.url, 'tempLayersSet');
  35385. _this.CLASS_NAME = 'SuperMap.ThemeService';
  35386. return _this;
  35387. }
  35388. /**
  35389. * @override
  35390. */
  35391. ThemeService_createClass(ThemeService, [{
  35392. key: "destroy",
  35393. value: function destroy() {
  35394. ThemeService_get(ThemeService_getPrototypeOf(ThemeService.prototype), "destroy", this).call(this);
  35395. }
  35396. /**
  35397. * @function SuperMap.ThemeService.prototype.processAsync
  35398. * @description 负责将客户端的专题图参数传递到服务端。
  35399. * @param {SuperMap.ThemeParameters} params - 专题图参数类。
  35400. */
  35401. }, {
  35402. key: "processAsync",
  35403. value: function processAsync(params) {
  35404. if (!(params instanceof ThemeParameters_ThemeParameters)) {
  35405. return;
  35406. }
  35407. var me = this,
  35408. jsonParameters = null;
  35409. jsonParameters = me.getJsonParameters(params);
  35410. me.request({
  35411. method: "POST",
  35412. data: jsonParameters,
  35413. scope: me,
  35414. success: me.serviceProcessCompleted,
  35415. failure: me.serviceProcessFailed
  35416. });
  35417. }
  35418. /**
  35419. * @function SuperMap.ThemeService.prototype.getJsonParameters
  35420. * @description 将专题图参数参数转化为 JSON 字符串。
  35421. * @param {SuperMap.ThemeParameters} parameter - 专题图参数类。
  35422. * @returns {Object} 转化后的JSON字符串。
  35423. */
  35424. }, {
  35425. key: "getJsonParameters",
  35426. value: function getJsonParameters(parameter) {
  35427. var jsonParameters = "",
  35428. themeObj = null,
  35429. filters = null,
  35430. orderBys = null,
  35431. fieldValuesDisplayFilter;
  35432. jsonParameters += "[{'type': 'UGC','subLayers': {'layers': [";
  35433. for (var i = 0; i < parameter.themes.length; i++) {
  35434. themeObj = parameter.themes[i];
  35435. var jsonTheme = Util_Util.toJSON(themeObj);
  35436. jsonTheme = jsonTheme.slice(0, -1);
  35437. jsonParameters += "{'theme': " + jsonTheme + "},'type': 'UGC','ugcLayerType': 'THEME',";
  35438. filters = parameter.displayFilters;
  35439. if (filters && filters.length > 0) {
  35440. if (filters.length === 1) {
  35441. jsonParameters += "'displayFilter':\"" + filters[0] + "\",";
  35442. } else {
  35443. jsonParameters += "'displayFilter':\"" + filters[i] + "\",";
  35444. }
  35445. }
  35446. orderBys = parameter.displayOrderBy;
  35447. if (orderBys && orderBys.length > 0) {
  35448. if (orderBys.length === 1) {
  35449. jsonParameters += "'displayOrderBy':'" + orderBys[0] + "',";
  35450. } else {
  35451. jsonParameters += "'displayOrderBy':'" + orderBys[i] + "',";
  35452. }
  35453. }
  35454. fieldValuesDisplayFilter = parameter.fieldValuesDisplayFilter;
  35455. if (fieldValuesDisplayFilter) {
  35456. jsonParameters += "'fieldValuesDisplayFilter':" + Util_Util.toJSON(fieldValuesDisplayFilter) + ",";
  35457. }
  35458. if (parameter.joinItems && parameter.joinItems.length > 0 && parameter.joinItems[i]) {
  35459. jsonParameters += "'joinItems':[" + Util_Util.toJSON(parameter.joinItems[i]) + "],";
  35460. }
  35461. if (parameter.datasetNames && parameter.dataSourceNames) {
  35462. var datasetID = parameter.datasetNames[i] ? i : parameter.datasetNames.length - 1;
  35463. var dataSourceID = parameter.dataSourceNames[i] ? i : parameter.dataSourceNames.length - 1;
  35464. jsonParameters += "'datasetInfo': {'name': '" + parameter.datasetNames[datasetID] + "','dataSourceName': '" + parameter.dataSourceNames[dataSourceID] + "'}},";
  35465. } else {
  35466. jsonParameters += "},";
  35467. }
  35468. } //去除多余的逗号
  35469. if (parameter.themes && parameter.themes.length > 0) {
  35470. jsonParameters = jsonParameters.substring(0, jsonParameters.length - 1);
  35471. }
  35472. jsonParameters += "]},";
  35473. var urlArray = this.url.split("/");
  35474. var jsonMapName = urlArray[urlArray.length - 2];
  35475. jsonParameters += "'name': '" + jsonMapName + "'}]";
  35476. return jsonParameters;
  35477. }
  35478. }]);
  35479. return ThemeService;
  35480. }(CommonServiceBase_CommonServiceBase);
  35481. SuperMap.ThemeService = ThemeService_ThemeService;
  35482. // CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystService.js
  35483. 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); }
  35484. function ThiessenAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35485. 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); } }
  35486. function ThiessenAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  35487. 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); }
  35488. function ThiessenAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThiessenAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  35489. 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); }
  35490. function ThiessenAnalystService_setPrototypeOf(o, p) { ThiessenAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThiessenAnalystService_setPrototypeOf(o, p); }
  35491. 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); }; }
  35492. function ThiessenAnalystService_possibleConstructorReturn(self, call) { if (call && (ThiessenAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return ThiessenAnalystService_assertThisInitialized(self); }
  35493. function ThiessenAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35494. 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; } }
  35495. function ThiessenAnalystService_getPrototypeOf(o) { ThiessenAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThiessenAnalystService_getPrototypeOf(o); }
  35496. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  35497. * This program are made available under the terms of the Apache License, Version 2.0
  35498. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35499. /**
  35500. * @class SuperMap.ThiessenAnalystService
  35501. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  35502. * @classdesc
  35503. * 泰森多边形分析服务类
  35504. * 该类负责将客户设置的泰森多边形分析参数传递给服务端,并接收服务端返回的分析结果数据。
  35505. * 泰森多边形分析结果通过该类支持的事件的监听函数参数获取
  35506. * 泰森多边形分析的参数支持两种,当参数为 {SuperMap.DatasetThiessenAnalystParameters} 类型
  35507. * 时,执行数据集泰森多边形分析,当参数为 {SuperMap.GeometryThiessenAnalystParameters} 类型时,
  35508. * 执行几何对象泰森多边形分析。
  35509. * @param url - {string} 服务的访问地址。
  35510. * 如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  35511. * @param {Object} options - 参数。</br>
  35512. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35513. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35514. * @param {Object} [options.headers] - 请求头。
  35515. * @extends {SuperMap.SpatialAnalystBase}
  35516. * @example 例如:
  35517. * (start code)
  35518. * var myThiessenAnalystService = new SuperMap.ThiessenAnalystService(url, {
  35519. * eventListeners: {
  35520. * "processCompleted": bufferCompleted,
  35521. * "processFailed": bufferFailed
  35522. * }
  35523. * });
  35524. * (end)
  35525. *
  35526. */
  35527. var ThiessenAnalystService_ThiessenAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  35528. ThiessenAnalystService_inherits(ThiessenAnalystService, _SpatialAnalystBase);
  35529. var _super = ThiessenAnalystService_createSuper(ThiessenAnalystService);
  35530. function ThiessenAnalystService(url, options) {
  35531. var _this;
  35532. ThiessenAnalystService_classCallCheck(this, ThiessenAnalystService);
  35533. _this = _super.call(this, url, options);
  35534. /**
  35535. * @member {string} SuperMap.ThiessenAnalystService.prototype.mode
  35536. * @description 缓冲区分析类型
  35537. */
  35538. _this.mode = null;
  35539. if (options) {
  35540. Util_Util.extend(ThiessenAnalystService_assertThisInitialized(_this), options);
  35541. }
  35542. _this.CLASS_NAME = "SuperMap.ThiessenAnalystService";
  35543. return _this;
  35544. }
  35545. /**
  35546. * @override
  35547. */
  35548. ThiessenAnalystService_createClass(ThiessenAnalystService, [{
  35549. key: "destroy",
  35550. value: function destroy() {
  35551. ThiessenAnalystService_get(ThiessenAnalystService_getPrototypeOf(ThiessenAnalystService.prototype), "destroy", this).call(this);
  35552. this.mode = null;
  35553. }
  35554. /**
  35555. * @function SuperMap.ThiessenAnalystService.prototype.processAsync
  35556. * @description 负责将客户端的查询参数传递到服务端。
  35557. * @param {(SuperMap.DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters)} parameter - 泰森多边形分析参数基类。
  35558. */
  35559. }, {
  35560. key: "processAsync",
  35561. value: function processAsync(parameter) {
  35562. var parameterObject = {};
  35563. var me = this;
  35564. if (parameter instanceof DatasetThiessenAnalystParameters_DatasetThiessenAnalystParameters) {
  35565. me.mode = "datasets";
  35566. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/thiessenpolygon');
  35567. DatasetThiessenAnalystParameters_DatasetThiessenAnalystParameters.toObject(parameter, parameterObject);
  35568. } else if (parameter instanceof GeometryThiessenAnalystParameters_GeometryThiessenAnalystParameters) {
  35569. me.mode = "geometry";
  35570. me.url = Util_Util.urlPathAppend(me.url, 'geometry/thiessenpolygon');
  35571. GeometryThiessenAnalystParameters_GeometryThiessenAnalystParameters.toObject(parameter, parameterObject);
  35572. }
  35573. var jsonParameters = Util_Util.toJSON(parameterObject);
  35574. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  35575. me.request({
  35576. method: "POST",
  35577. data: jsonParameters,
  35578. scope: me,
  35579. success: me.serviceProcessCompleted,
  35580. failure: me.serviceProcessFailed
  35581. });
  35582. }
  35583. }]);
  35584. return ThiessenAnalystService;
  35585. }(SpatialAnalystBase_SpatialAnalystBase);
  35586. SuperMap.ThiessenAnalystService = ThiessenAnalystService_ThiessenAnalystService;
  35587. // CONCATENATED MODULE: ./src/common/iServer/GeometryBatchAnalystService.js
  35588. 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); }
  35589. function GeometryBatchAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35590. 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); } }
  35591. function GeometryBatchAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBatchAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBatchAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  35592. 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); }
  35593. function GeometryBatchAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBatchAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  35594. 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); }
  35595. function GeometryBatchAnalystService_setPrototypeOf(o, p) { GeometryBatchAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBatchAnalystService_setPrototypeOf(o, p); }
  35596. 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); }; }
  35597. function GeometryBatchAnalystService_possibleConstructorReturn(self, call) { if (call && (GeometryBatchAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryBatchAnalystService_assertThisInitialized(self); }
  35598. function GeometryBatchAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35599. 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; } }
  35600. function GeometryBatchAnalystService_getPrototypeOf(o) { GeometryBatchAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBatchAnalystService_getPrototypeOf(o); }
  35601. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  35602. * This program are made available under the terms of the Apache License, Version 2.0
  35603. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35604. /**
  35605. * @class SuperMap.GeometryBatchAnalystService
  35606. * @category iServer SpatialAnalyst BatchAnalyst
  35607. * @classdesc 批量空间分析服务类
  35608. * @description 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  35609. * 叠加分析结果通过该类支持的事件的监听函数参数获取,参数类型为 {<SuperMap.REST.OverlayAnalystEventArgs>}; 获取的结果数据包括 originResult 、result 两种,
  35610. * 其中,originResult 为服务端返回的用 JSON 对象表示的量算结果数据,result 为服务端返回的量算结果数据。
  35611. * @extends {SuperMap.SpatialAnalystBase}
  35612. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  35613. * @param {Object} options - 参数。
  35614. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35615. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35616. * @param {Object} [options.headers] - 请求头。
  35617. * @example
  35618. * var myOverlayAnalystService = new SuperMap.REST.GeometryBatchAnalystService(url, {
  35619. * eventListeners: {
  35620. * "processCompleted": OverlayCompleted,
  35621. * "processFailed": OverlayFailed
  35622. * }
  35623. * });
  35624. */
  35625. var GeometryBatchAnalystService_GeometryBatchAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  35626. GeometryBatchAnalystService_inherits(GeometryBatchAnalystService, _SpatialAnalystBase);
  35627. var _super = GeometryBatchAnalystService_createSuper(GeometryBatchAnalystService);
  35628. function GeometryBatchAnalystService(url, options) {
  35629. var _this;
  35630. GeometryBatchAnalystService_classCallCheck(this, GeometryBatchAnalystService);
  35631. _this = _super.call(this, url, options);
  35632. if (options) {
  35633. Util_Util.extend(GeometryBatchAnalystService_assertThisInitialized(_this), options);
  35634. }
  35635. _this.CLASS_NAME = "SuperMap.GeometryBatchAnalystService";
  35636. return _this;
  35637. }
  35638. /**
  35639. * @function SuperMap.GeometryBatchAnalystService.prototype.processAsync
  35640. * @description 负责将客户端的查询参数传递到服务端。
  35641. * @param {SuperMap.GeometryBatchOverlayAnalystParameters} parameter - 批量几何对象叠加分析参数类
  35642. *
  35643. */
  35644. GeometryBatchAnalystService_createClass(GeometryBatchAnalystService, [{
  35645. key: "processAsync",
  35646. value: function processAsync(parameters) {
  35647. var me = this;
  35648. me.url = Util_Util.urlPathAppend(me.url, 'geometry/batchanalyst');
  35649. me.url = Util_Util.urlAppend(me.url, 'returnContent=true&ignoreAnalystParam=true');
  35650. var parameterObjects = me._processParams(parameters);
  35651. var jsonParameters = Util_Util.toJSON(parameterObjects);
  35652. me.request({
  35653. method: "POST",
  35654. data: jsonParameters,
  35655. scope: me,
  35656. success: me.serviceProcessCompleted,
  35657. failure: me.serviceProcessFailed
  35658. });
  35659. }
  35660. }, {
  35661. key: "_processParams",
  35662. value: function _processParams(parameters) {
  35663. var me = this;
  35664. if (!Util_Util.isArray(parameters)) {
  35665. return;
  35666. }
  35667. var processParams = [];
  35668. parameters.map(function (item) {
  35669. processParams.push(me._toJSON(item));
  35670. return item;
  35671. });
  35672. return processParams;
  35673. }
  35674. }, {
  35675. key: "_toJSON",
  35676. value: function _toJSON(parameter) {
  35677. var tempObj = {};
  35678. if (parameter.analystName === "buffer") {
  35679. tempObj.analystName = "buffer";
  35680. tempObj.param = {}; //几何对象的批量空间分析,
  35681. GeometryBufferAnalystParameters_GeometryBufferAnalystParameters.toObject(parameter.param, tempObj.param);
  35682. } else if (parameter.analystName === "overlay") {
  35683. tempObj.analystName = "overlay";
  35684. tempObj.param = {};
  35685. GeometryOverlayAnalystParameters_GeometryOverlayAnalystParameters.toObject(parameter.param, tempObj.param);
  35686. } else if (parameter.analystName === "interpolationDensity") {
  35687. tempObj.analystName = "interpolationDensity";
  35688. tempObj.param = {};
  35689. InterpolationAnalystParameters_InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  35690. } else if (parameter.analystName === "interpolationidw") {
  35691. tempObj.analystName = "interpolationidw";
  35692. tempObj.param = {};
  35693. InterpolationAnalystParameters_InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  35694. } else if (parameter.analystName === "interpolationRBF") {
  35695. tempObj.analystName = "interpolationRBF";
  35696. tempObj.param = {};
  35697. InterpolationAnalystParameters_InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  35698. } else if (parameter.analystName === "interpolationKriging") {
  35699. tempObj.analystName = "interpolationKriging";
  35700. tempObj.param = {};
  35701. InterpolationAnalystParameters_InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  35702. } else if (parameter.analystName === "thiessenpolygon") {
  35703. tempObj.analystName = "thiessenpolygon";
  35704. tempObj.param = {};
  35705. GeometryThiessenAnalystParameters_GeometryThiessenAnalystParameters.toObject(parameter.param, tempObj.param);
  35706. } else {
  35707. //isoline; isoregion; calculatemeasure; routelocator 四种分析不需要再处理参数
  35708. return parameter;
  35709. }
  35710. return tempObj;
  35711. }
  35712. /**
  35713. * @override
  35714. */
  35715. }, {
  35716. key: "destroy",
  35717. value: function destroy() {
  35718. GeometryBatchAnalystService_get(GeometryBatchAnalystService_getPrototypeOf(GeometryBatchAnalystService.prototype), "destroy", this).call(this);
  35719. }
  35720. }]);
  35721. return GeometryBatchAnalystService;
  35722. }(SpatialAnalystBase_SpatialAnalystBase);
  35723. SuperMap.GeometryBatchAnalystService = GeometryBatchAnalystService_GeometryBatchAnalystService;
  35724. // CONCATENATED MODULE: ./src/common/iServer/TilesetsService.js
  35725. 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); }
  35726. function TilesetsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35727. 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); } }
  35728. function TilesetsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TilesetsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TilesetsService_defineProperties(Constructor, staticProps); return Constructor; }
  35729. 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); }
  35730. function TilesetsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TilesetsService_getPrototypeOf(object); if (object === null) break; } return object; }
  35731. 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); }
  35732. function TilesetsService_setPrototypeOf(o, p) { TilesetsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TilesetsService_setPrototypeOf(o, p); }
  35733. 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); }; }
  35734. function TilesetsService_possibleConstructorReturn(self, call) { if (call && (TilesetsService_typeof(call) === "object" || typeof call === "function")) { return call; } return TilesetsService_assertThisInitialized(self); }
  35735. function TilesetsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35736. 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; } }
  35737. function TilesetsService_getPrototypeOf(o) { TilesetsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TilesetsService_getPrototypeOf(o); }
  35738. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  35739. * This program are made available under the terms of the Apache License, Version 2.0
  35740. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35741. /**
  35742. * @class SuperMap.TilesetsService
  35743. * @category iServer Map Tilesets
  35744. * @classdesc 切片列表信息查询服务类;即查询切片地图服务的切片列表,返回切片集名称、地图切片元数据信息、切片版本集信息。
  35745. * @extends {SuperMap.CommonServiceBase}
  35746. * @param {string} url - 地图服务地址。URL 应为:
  35747. * http://{服务器地址}:{服务端口号}/iserver/services/{服务名}/rest/maps/map;
  35748. * 例如: "http://localhost:8090/iserver/services/test/rest/maps/tianlocal"。
  35749. * @param {Object} options - 参数。
  35750. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  35751. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  35752. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  35753. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35754. * @param {Object} [options.headers] - 请求头。
  35755. */
  35756. var TilesetsService_TilesetsService = /*#__PURE__*/function (_CommonServiceBase) {
  35757. TilesetsService_inherits(TilesetsService, _CommonServiceBase);
  35758. var _super = TilesetsService_createSuper(TilesetsService);
  35759. function TilesetsService(url, options) {
  35760. var _this;
  35761. TilesetsService_classCallCheck(this, TilesetsService);
  35762. _this = _super.call(this, url, options);
  35763. _this.CLASS_NAME = "SuperMap.TilesetsService";
  35764. return _this;
  35765. }
  35766. /**
  35767. * @override
  35768. */
  35769. TilesetsService_createClass(TilesetsService, [{
  35770. key: "destroy",
  35771. value: function destroy() {
  35772. TilesetsService_get(TilesetsService_getPrototypeOf(TilesetsService.prototype), "destroy", this).call(this);
  35773. }
  35774. /**
  35775. * @function SuperMap.TilesetsService.prototype.processAsync
  35776. * @description 负责将客户端的查询参数传递到服务端。
  35777. */
  35778. }, {
  35779. key: "processAsync",
  35780. value: function processAsync() {
  35781. if (!this.url) {
  35782. return;
  35783. }
  35784. var me = this;
  35785. me.url = Util_Util.urlPathAppend(me.url, 'tilesets');
  35786. me.request({
  35787. method: "GET",
  35788. scope: me,
  35789. success: me.serviceProcessCompleted,
  35790. failure: me.serviceProcessFailed
  35791. });
  35792. }
  35793. }]);
  35794. return TilesetsService;
  35795. }(CommonServiceBase_CommonServiceBase);
  35796. SuperMap.TilesetsService = TilesetsService_TilesetsService;
  35797. // CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsParameter.js
  35798. function TopologyValidatorJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35799. 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); } }
  35800. function TopologyValidatorJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  35801. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  35802. * This program are made available under the terms of the Apache License, Version 2.0
  35803. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35804. /**
  35805. * @class SuperMap.TopologyValidatorJobsParameter
  35806. * @category iServer ProcessingService TopologyValidator
  35807. * @classdesc 拓扑检查分析任务参数类。
  35808. * @param {Object} options - 必填参数。
  35809. * @param {string} options.datasetName - 数据集名。
  35810. * @param {string} options.datasetTopology -检查对象所在的数据集名称。
  35811. * @param {SuperMap.TopologyValidatorRule} [options.rule=SuperMap.TopologyValidatorRule.REGIONNOOVERLAP] - 拓扑检查规则。
  35812. * @param {string} [options.tolerance] - 容限。
  35813. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  35814. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  35815. */
  35816. var TopologyValidatorJobsParameter_TopologyValidatorJobsParameter = /*#__PURE__*/function () {
  35817. function TopologyValidatorJobsParameter(options) {
  35818. TopologyValidatorJobsParameter_classCallCheck(this, TopologyValidatorJobsParameter);
  35819. if (!options) {
  35820. return;
  35821. }
  35822. /**
  35823. * @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetName
  35824. * @description 数据集名。
  35825. */
  35826. this.datasetName = "";
  35827. /**
  35828. * @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetTopology
  35829. * @description 拓扑检查对象所在的数据集名称。
  35830. */
  35831. this.datasetTopology = "";
  35832. /**
  35833. * @member {string} [SuperMap.TopologyValidatorJobsParameter.prototype.tolerance]
  35834. * @description 容限,指定的拓扑错误检查时使用的容限。
  35835. */
  35836. this.tolerance = "";
  35837. /**
  35838. * @member {SuperMap.TopologyValidatorRule} [SuperMap.TopologyValidatorJobsParameter.prototype.rule=SuperMap.TopologyValidatorRule.REGIONNOOVERLAP]
  35839. * @description 拓扑检查模式。
  35840. */
  35841. this.rule = TopologyValidatorRule.REGIONNOOVERLAP;
  35842. /**
  35843. * @member {SuperMap.OutputSetting} [SuperMap.TopologyValidatorJobsParameter.prototype.output]
  35844. * @description 输出参数设置类。
  35845. */
  35846. this.output = null;
  35847. /**
  35848. * @member {SuperMap.MappingParameters} [SuperMap.TopologyValidatorJobsParameter.prototype.mappingParameters]
  35849. * @description 分析后结果可视化的参数类。
  35850. */
  35851. this.mappingParameters = null;
  35852. Util_Util.extend(this, options);
  35853. this.CLASS_NAME = "SuperMap.TopologyValidatorJobsParameter";
  35854. }
  35855. /**
  35856. * @function SuperMap.TopologyValidatorJobsParameter.prototype.destroy
  35857. * @description 释放资源,将引用资源的属性置空。
  35858. */
  35859. TopologyValidatorJobsParameter_createClass(TopologyValidatorJobsParameter, [{
  35860. key: "destroy",
  35861. value: function destroy() {
  35862. this.datasetName = null;
  35863. this.datasetTopology = null;
  35864. this.tolerance = null;
  35865. this.rule = null;
  35866. if (this.output instanceof OutputSetting_OutputSetting) {
  35867. this.output.destroy();
  35868. this.output = null;
  35869. }
  35870. if (this.mappingParameters instanceof MappingParameters_MappingParameters) {
  35871. this.mappingParameters.destroy();
  35872. this.mappingParameters = null;
  35873. }
  35874. }
  35875. /**
  35876. * @function SuperMap.TopologyValidatorJobsParameter.toObject
  35877. * @param {Object} TopologyValidatorJobsParameter -拓扑检查分析任务参数。
  35878. * @param {Object} tempObj - 目标对象。
  35879. * @description 生成拓扑检查分析任务对象。
  35880. */
  35881. }], [{
  35882. key: "toObject",
  35883. value: function toObject(TopologyValidatorJobsParameter, tempObj) {
  35884. for (var name in TopologyValidatorJobsParameter) {
  35885. if (name === "datasetName") {
  35886. tempObj['input'] = tempObj['input'] || {};
  35887. tempObj['input'][name] = TopologyValidatorJobsParameter[name];
  35888. continue;
  35889. }
  35890. if (name === "output") {
  35891. tempObj['output'] = tempObj['output'] || {};
  35892. tempObj['output'] = TopologyValidatorJobsParameter[name];
  35893. continue;
  35894. }
  35895. tempObj['analyst'] = tempObj['analyst'] || {};
  35896. tempObj['analyst'][name] = TopologyValidatorJobsParameter[name];
  35897. if (name === 'mappingParameters') {
  35898. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  35899. tempObj['analyst']['mappingParameters'] = TopologyValidatorJobsParameter[name];
  35900. }
  35901. }
  35902. }
  35903. }]);
  35904. return TopologyValidatorJobsParameter;
  35905. }();
  35906. SuperMap.TopologyValidatorJobsParameter = TopologyValidatorJobsParameter_TopologyValidatorJobsParameter;
  35907. // CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsService.js
  35908. 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); }
  35909. function TopologyValidatorJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35910. 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); } }
  35911. function TopologyValidatorJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  35912. 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); }
  35913. function TopologyValidatorJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TopologyValidatorJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  35914. 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); }
  35915. function TopologyValidatorJobsService_setPrototypeOf(o, p) { TopologyValidatorJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TopologyValidatorJobsService_setPrototypeOf(o, p); }
  35916. 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); }; }
  35917. function TopologyValidatorJobsService_possibleConstructorReturn(self, call) { if (call && (TopologyValidatorJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return TopologyValidatorJobsService_assertThisInitialized(self); }
  35918. function TopologyValidatorJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35919. 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; } }
  35920. function TopologyValidatorJobsService_getPrototypeOf(o) { TopologyValidatorJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TopologyValidatorJobsService_getPrototypeOf(o); }
  35921. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  35922. * This program are made available under the terms of the Apache License, Version 2.0
  35923. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35924. /**
  35925. * @class SuperMap.TopologyValidatorJobsService
  35926. * @category iServer ProcessingService TopologyValidator
  35927. * @classdesc 拓扑检查分析服务类
  35928. * @extends {SuperMap.ProcessingServiceBase}
  35929. * @param {string} url - 拓扑检查分析服务地址。
  35930. * @param {Object} options - 参数。
  35931. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35932. * @param {Object} [options.headers] - 请求头。
  35933. */
  35934. var TopologyValidatorJobsService_TopologyValidatorJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  35935. TopologyValidatorJobsService_inherits(TopologyValidatorJobsService, _ProcessingServiceBas);
  35936. var _super = TopologyValidatorJobsService_createSuper(TopologyValidatorJobsService);
  35937. function TopologyValidatorJobsService(url, options) {
  35938. var _this;
  35939. TopologyValidatorJobsService_classCallCheck(this, TopologyValidatorJobsService);
  35940. _this = _super.call(this, url, options);
  35941. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/topologyvalidator');
  35942. _this.CLASS_NAME = "SuperMap.TopologyValidatorJobsService";
  35943. return _this;
  35944. }
  35945. /**
  35946. *@override
  35947. */
  35948. TopologyValidatorJobsService_createClass(TopologyValidatorJobsService, [{
  35949. key: "destroy",
  35950. value: function destroy() {
  35951. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "destroy", this).call(this);
  35952. }
  35953. /**
  35954. * @function SuperMap.TopologyValidatorJobsService.protitype.getTopologyValidatorJobs
  35955. * @description 获取拓扑检查分析所有任务
  35956. */
  35957. }, {
  35958. key: "getTopologyValidatorJobs",
  35959. value: function getTopologyValidatorJobs() {
  35960. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, this.url);
  35961. }
  35962. /**
  35963. * @function SuperMap.TopologyValidatorJobsService.protitype.getTopologyValidatorJob
  35964. * @description 获取指定id的拓扑检查分析服务
  35965. * @param {string} id - 指定要获取数据的id
  35966. */
  35967. }, {
  35968. key: "getTopologyValidatorJob",
  35969. value: function getTopologyValidatorJob(id) {
  35970. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  35971. }
  35972. /**
  35973. * @function SuperMap.TopologyValidatorJobsService.protitype.addTopologyValidatorJob
  35974. * @description 新建拓扑检查分析服务
  35975. * @param {SuperMap.TopologyValidatorJobsParameter} params - 创建一个空间分析的请求参数。
  35976. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  35977. */
  35978. }, {
  35979. key: "addTopologyValidatorJob",
  35980. value: function addTopologyValidatorJob(params, seconds) {
  35981. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "addJob", this).call(this, this.url, params, TopologyValidatorJobsParameter_TopologyValidatorJobsParameter, seconds);
  35982. }
  35983. }]);
  35984. return TopologyValidatorJobsService;
  35985. }(ProcessingServiceBase_ProcessingServiceBase);
  35986. SuperMap.TopologyValidatorJobsService = TopologyValidatorJobsService_TopologyValidatorJobsService;
  35987. // CONCATENATED MODULE: ./src/common/iServer/TransferLine.js
  35988. function TransferLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35989. 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); } }
  35990. function TransferLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferLine_defineProperties(Constructor, staticProps); return Constructor; }
  35991. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  35992. * This program are made available under the terms of the Apache License, Version 2.0
  35993. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35994. /**
  35995. * @class SuperMap.TransferLine
  35996. * @category iServer TrafficTransferAnalyst TransferPath
  35997. * @classdesc 换乘路线信息类。
  35998. * @param {Object} options - 参数。
  35999. * @param {number} options.lineID - 乘车路线 ID。
  36000. * @param {string} options.lineName - 乘车路线名称。
  36001. * @param {string} options.lineAliasName - 乘车路线别名。
  36002. * @param {number} options.startStopIndex - 上车站点在本公交路线中的索引。
  36003. * @param {string} options.startStopName - 上车站点名称。
  36004. * @param {string} options.startStopAliasName - 上车站点别名。
  36005. * @param {number} options.endStopIndex - 下车站点在本公交路线中的索引。
  36006. * @param {string} options.endStopName - 下车站点名称。
  36007. * @param {string} options.endStopAliasName - 下车站点别名。
  36008. */
  36009. var TransferLine_TransferLine = /*#__PURE__*/function () {
  36010. function TransferLine(options) {
  36011. TransferLine_classCallCheck(this, TransferLine);
  36012. options = options || {};
  36013. /**
  36014. * @member {number} SuperMap.TransferLine.prototype.lineID
  36015. * @description 乘车路线 ID。
  36016. */
  36017. this.lineID = null;
  36018. /**
  36019. * @member {string} SuperMap.TransferLine.prototype.lineName
  36020. * @description 乘车路线名称。
  36021. */
  36022. this.lineName = null;
  36023. /**
  36024. * @member {string} SuperMap.TransferLine.prototype.lineAliasName
  36025. * @description 乘车路线别名。
  36026. */
  36027. this.lineAliasName = null;
  36028. /**
  36029. * @member {number} SuperMap.TransferLine.prototype.startStopIndex
  36030. * @description 上车站点在本公交路线中的索引。
  36031. */
  36032. this.startStopIndex = null;
  36033. /**
  36034. * @member {string} SuperMap.TransferLine.prototype.startStopName
  36035. * @description 上车站点名称。
  36036. */
  36037. this.startStopName = null;
  36038. /**
  36039. * @member {string} SuperMap.TransferLine.prototype.startStopAliasName
  36040. * @description 上车站点别名。
  36041. */
  36042. this.startStopAliasName = null;
  36043. /**
  36044. * @member {number} SuperMap.TransferLine.prototype.endStopIndex
  36045. * @description 下车站点在本公交路线中的索引。
  36046. */
  36047. this.endStopIndex = null;
  36048. /**
  36049. * @member {string} SuperMap.TransferLine.prototype.endStopName
  36050. * @description 下车站点名称。
  36051. */
  36052. this.endStopName = null;
  36053. /**
  36054. * @member {string} SuperMap.TransferLine.prototype.endStopAliasName
  36055. * @description 下车站点别名。
  36056. */
  36057. this.endStopAliasName = null;
  36058. Util_Util.extend(this, options);
  36059. this.CLASS_NAME = "SuperMap.TransferLine";
  36060. }
  36061. /**
  36062. * @function SuperMap.TransferLine.prototype.destroy
  36063. * @description 释放资源,将引用资源的属性置空。
  36064. */
  36065. TransferLine_createClass(TransferLine, [{
  36066. key: "destroy",
  36067. value: function destroy() {
  36068. Util_Util.reset(this);
  36069. }
  36070. /**
  36071. * @function SuperMap.TransferLine.fromJson
  36072. * @description 将返回结果转化为 {@link SuperMap.TransferLine} 对象。
  36073. * @param {Object} jsonObject - 新的返回结果。
  36074. * @returns {SuperMap.TransferLine} 转化后的 {@link SuperMap.TransferLine} 对象。
  36075. */
  36076. }], [{
  36077. key: "fromJson",
  36078. value: function fromJson(jsonObject) {
  36079. if (!jsonObject) {
  36080. return;
  36081. }
  36082. return new TransferLine({
  36083. lineID: jsonObject['lineID'],
  36084. lineName: jsonObject['lineName'],
  36085. lineAliasName: jsonObject['lineAliasName'],
  36086. startStopIndex: jsonObject['startStopIndex'],
  36087. startStopName: jsonObject['startStopName'],
  36088. startStopAliasName: jsonObject['startStopAliasName'],
  36089. endStopIndex: jsonObject['endStopIndex'],
  36090. endStopName: jsonObject['endStopName'],
  36091. endStopAliasName: jsonObject['endStopAliasName']
  36092. });
  36093. }
  36094. }]);
  36095. return TransferLine;
  36096. }();
  36097. SuperMap.TransferLine = TransferLine_TransferLine;
  36098. // CONCATENATED MODULE: ./src/common/iServer/TransferPathParameters.js
  36099. function TransferPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36100. 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); } }
  36101. function TransferPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathParameters_defineProperties(Constructor, staticProps); return Constructor; }
  36102. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  36103. * This program are made available under the terms of the Apache License, Version 2.0
  36104. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36105. /**
  36106. * @class SuperMap.TransferPathParameters
  36107. * @category iServer TrafficTransferAnalyst TransferPaths
  36108. * @classdesc 交通换乘线路查询参数类。
  36109. * @param {Object} options - 参数。
  36110. * @param {Array.<SuperMap.TransferLine>} options.transferLines - 本换乘分段内可乘车的路线集合。
  36111. * @param {Array.<(string|SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} options.points - 两种查询方式:按照公交站点的起止 ID 进行查询和按照起止点的坐标进行查询。
  36112. *
  36113. */
  36114. var TransferPathParameters_TransferPathParameters = /*#__PURE__*/function () {
  36115. function TransferPathParameters(options) {
  36116. TransferPathParameters_classCallCheck(this, TransferPathParameters);
  36117. options = options || {};
  36118. /**
  36119. * @member {Array.<SuperMap.TransferLine>} SuperMap.TransferPathParameters.prototype.transferLines
  36120. * @description 本换乘分段内可乘车的路线集合,通过交通换乘方案查询得到。
  36121. */
  36122. this.transferLines = null;
  36123. /**
  36124. * @member {Array.<(string|SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.TransferPathParameters.prototype.points
  36125. * @description 两种查询方式:<br>
  36126. * 1. 按照公交站点的起止ID进行查询,则 points 参数的类型为 int[],形如:[起点ID、终点ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  36127. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  36128. */
  36129. this.points = null;
  36130. Util_Util.extend(this, options);
  36131. this.CLASS_NAME = "SuperMap.TransferPathParameters";
  36132. }
  36133. /**
  36134. * @function SuperMap.TransferPathParameters.prototype.destroy
  36135. * @description 释放资源,将引用资源的属性置空。
  36136. */
  36137. TransferPathParameters_createClass(TransferPathParameters, [{
  36138. key: "destroy",
  36139. value: function destroy() {
  36140. Util_Util.reset(this);
  36141. }
  36142. /**
  36143. * @function SuperMap.TransferPathParameters.toJson
  36144. * @description 将 {@link SuperMap.TransferPathParameters} 对象参数转换为 JSON 字符串。
  36145. * @param {SuperMap.TransferPathParameters} params - 交通换乘参数。
  36146. * @returns {string} 转化后的 JSON 字符串。
  36147. */
  36148. }], [{
  36149. key: "toJson",
  36150. value: function toJson(params) {
  36151. if (params) {
  36152. return Util_Util.toJSON(params);
  36153. }
  36154. }
  36155. }]);
  36156. return TransferPathParameters;
  36157. }();
  36158. SuperMap.TransferPathParameters = TransferPathParameters_TransferPathParameters;
  36159. // CONCATENATED MODULE: ./src/common/iServer/TransferPathService.js
  36160. 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); }
  36161. function TransferPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36162. 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); } }
  36163. function TransferPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathService_defineProperties(Constructor, staticProps); return Constructor; }
  36164. 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); }
  36165. function TransferPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  36166. 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); }
  36167. function TransferPathService_setPrototypeOf(o, p) { TransferPathService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferPathService_setPrototypeOf(o, p); }
  36168. 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); }; }
  36169. function TransferPathService_possibleConstructorReturn(self, call) { if (call && (TransferPathService_typeof(call) === "object" || typeof call === "function")) { return call; } return TransferPathService_assertThisInitialized(self); }
  36170. function TransferPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36171. 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; } }
  36172. function TransferPathService_getPrototypeOf(o) { TransferPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferPathService_getPrototypeOf(o); }
  36173. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  36174. * This program are made available under the terms of the Apache License, Version 2.0
  36175. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36176. /**
  36177. * @class SuperMap.TransferPathService
  36178. * @category iServer TrafficTransferAnalyst TransferPath
  36179. * @classdesc 交通换乘线路查询服务类,根据交通换乘分析结果(TransferSolutionResult),获取某一条乘车路线的详细信息。
  36180. * 返回结果通过该类支持的事件的监听函数参数获取
  36181. * @extends {SuperMap.CommonServiceBase}
  36182. * @example 例如:
  36183. * var myService = new SuperMap.TransferPathService(url, {eventListeners: {
  36184. * "processCompleted": TrafficTransferCompleted,
  36185. * "processFailed": TrafficTransferError
  36186. * }
  36187. * };
  36188. * @param {string} url - 与客户端交互的交通换乘线路查询服务地址。
  36189. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  36190. * @param {Object} options - 参数。</br>
  36191. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36192. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36193. * @param {Object} [options.headers] - 请求头。
  36194. */
  36195. var TransferPathService_TransferPathService = /*#__PURE__*/function (_CommonServiceBase) {
  36196. TransferPathService_inherits(TransferPathService, _CommonServiceBase);
  36197. var _super = TransferPathService_createSuper(TransferPathService);
  36198. function TransferPathService(url, options) {
  36199. var _this;
  36200. TransferPathService_classCallCheck(this, TransferPathService);
  36201. _this = _super.call(this, url, options);
  36202. _this.CLASS_NAME = "SuperMap.TransferPathService";
  36203. return _this;
  36204. }
  36205. /**
  36206. * @override
  36207. */
  36208. TransferPathService_createClass(TransferPathService, [{
  36209. key: "destroy",
  36210. value: function destroy() {
  36211. TransferPathService_get(TransferPathService_getPrototypeOf(TransferPathService.prototype), "destroy", this).call(this);
  36212. }
  36213. /**
  36214. * @function SuperMap.TransferPathService.prototype.processAsync
  36215. * @description 负责将客户端的更新参数传递到服务端。
  36216. * @param {SuperMap.TransferPathParameters} params - 交通换乘参数。
  36217. */
  36218. }, {
  36219. key: "processAsync",
  36220. value: function processAsync(params) {
  36221. if (!(params instanceof TransferPathParameters_TransferPathParameters)) {
  36222. return;
  36223. }
  36224. var me = this,
  36225. method = "GET",
  36226. jsonParameters;
  36227. me.url = Util_Util.urlPathAppend(me.url, 'path');
  36228. jsonParameters = {
  36229. points: Util_Util.toJSON(params.points),
  36230. transferLines: Util_Util.toJSON(params['transferLines'])
  36231. };
  36232. me.request({
  36233. method: method,
  36234. params: jsonParameters,
  36235. scope: me,
  36236. success: me.serviceProcessCompleted,
  36237. failure: me.serviceProcessFailed
  36238. });
  36239. }
  36240. }]);
  36241. return TransferPathService;
  36242. }(CommonServiceBase_CommonServiceBase);
  36243. SuperMap.TransferPathService = TransferPathService_TransferPathService;
  36244. // CONCATENATED MODULE: ./src/common/iServer/TransferSolutionParameters.js
  36245. function TransferSolutionParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36246. 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); } }
  36247. function TransferSolutionParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionParameters_defineProperties(Constructor, staticProps); return Constructor; }
  36248. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  36249. * This program are made available under the terms of the Apache License, Version 2.0
  36250. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36251. /**
  36252. * @class SuperMap.TransferSolutionParameters
  36253. * @category iServer TrafficTransferAnalyst TransferSolutions
  36254. * @classdesc 交通换乘方案查询参数类。
  36255. * @param {Object} options - 参数。
  36256. * @param {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|number)>} options.points - 两种查询方式:按照公交站点的起止ID进行查询和按照起止点的坐标进行查询。
  36257. * @param {number} [options.solutionCount=6] - 乘车方案的数量。
  36258. * @param {SuperMap.TransferTactic} [options.transferTactic=SuperMap.TransferTactic.LESS_TIME] - 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  36259. * @param {SuperMap.TransferPreference} [options.transferPreference=SuperMap.TransferPreference.NONE] - 乘车偏好枚举。
  36260. * @param {number} [options.walkingRatio=10] - 步行与公交的消耗权重比。
  36261. * @param {Array.<number>} [options.evadeLines] - 避让路线的 ID。
  36262. * @param {Array.<number>} [options.evadeStops] - 避让站点的 ID。
  36263. * @param {Array.<number>} [options.priorLines] - 优先路线的 ID。
  36264. * @param {Array.<number>} [options.priorStops] - 优先站点的 ID。
  36265. * @param {string} [options.travelTime] - 出行的时间。
  36266. */
  36267. var TransferSolutionParameters_TransferSolutionParameters = /*#__PURE__*/function () {
  36268. function TransferSolutionParameters(options) {
  36269. TransferSolutionParameters_classCallCheck(this, TransferSolutionParameters);
  36270. options = options || {};
  36271. /**
  36272. * @member {number} [SuperMap.TransferSolutionParameters.prototype.solutionCount=6]
  36273. * @description 乘车方案的数量。
  36274. */
  36275. this.solutionCount = 6;
  36276. /**
  36277. * @member {SuperMap.TransferPreference} [SuperMap.TransferSolutionParameters.prototype.transferPreference=SuperMap.TransferPreference.NONE]
  36278. * @description 乘车偏好枚举。
  36279. */
  36280. this.transferPreference = TransferPreference.NONE;
  36281. /**
  36282. * @member {SuperMap.TransferTactic} [SuperMap.TransferSolutionParameters.prototype.transferTactic=TransferTactic|SuperMap.TransferTactic.LESS_TIME]
  36283. * @description 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  36284. */
  36285. this.transferTactic = TransferTactic.LESS_TIME;
  36286. /**
  36287. * @member {number} [SuperMap.TransferSolutionParameters.prototype.walkingRatio=10]
  36288. * @description 步行与公交的消耗权重比。此值越大,则步行因素对于方案选择的影响越大。例如:</br>
  36289. * 例如现在有两种换乘方案(在仅考虑消耗因素的情况下):</br>
  36290. * 方案1:坐车 10 公里,走路 1 公里;</br>
  36291. * 方案2:坐车 15 公里,走路 0.5 公里;</br>
  36292. * 1. 假设权重比为 15:</br>
  36293. * •方案 1 的总消耗为:10 + 1*15 = 25</br>
  36294. * •方案 2 的总消耗为:15 + 0.5*15 = 22.5</br>
  36295. * 此时方案 2 消耗更低。</br>
  36296. * 2. 假设权重比为2:</br>
  36297. * •方案 1 的总消耗为:10+1*2 = 12</br>
  36298. * •方案 2 的总消耗为:15+0.5*2 = 17</br>
  36299. * 此时方案 1 消耗更低。</br>
  36300. */
  36301. this.walkingRatio = null;
  36302. /**
  36303. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|string)>} SuperMap.TransferSolutionParameters.prototype.points
  36304. * @description 两种查询方式:</br>
  36305. * 1. 按照公交站点的起止 ID 进行查询,则 points 参数的类型为 int[],形如:[起点 ID、终点 ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  36306. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  36307. */
  36308. this.points = false;
  36309. /**
  36310. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.evadeLinesnull]
  36311. * @description 避让路线 ID。
  36312. * */
  36313. this.evadeLines = null;
  36314. /**
  36315. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.evadeStops=TransferLine]
  36316. * @description 避让站点 ID。
  36317. * */
  36318. this.evadeStops = null;
  36319. /**
  36320. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.priorLines]
  36321. * @description 优先路线 ID。
  36322. * */
  36323. this.priorLines = null;
  36324. /**
  36325. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.priorStops]
  36326. * @description 优先站点 ID。
  36327. * */
  36328. this.priorStops = null;
  36329. /**
  36330. * @member {string} SuperMap.TransferSolutionParameters.prototype.travelTime
  36331. * @description 出行的时间; 格式是:"小时:分钟",如:"08:30"。如果设置了该参数,在分析时,则会考虑线路的首末班车时间的限制,即在返回的结果中会提示公交的首末班发车时间。
  36332. */
  36333. this.travelTime = null;
  36334. Util_Util.extend(this, options);
  36335. this.CLASS_NAME = "SuperMap.TransferSolutionParameters";
  36336. }
  36337. /**
  36338. * @function SuperMap.TransferSolutionParameters.prototype.destroy
  36339. * @description 释放资源,将引用资源的属性置空。
  36340. */
  36341. TransferSolutionParameters_createClass(TransferSolutionParameters, [{
  36342. key: "destroy",
  36343. value: function destroy() {
  36344. Util_Util.reset(this);
  36345. }
  36346. /**
  36347. * @function SuperMap.TransferSolutionParameters.toJsonParameters
  36348. * @description 将 {@link SuperMap.TransferSolutionParameters} 对象参数转换为 JSON 字符串。
  36349. * @param {SuperMap.TransferSolutionParameters} params - 交通换乘参数。
  36350. * @returns {string} 转化后的 JSON 字符串。
  36351. */
  36352. }], [{
  36353. key: "toJson",
  36354. value: function toJson(params) {
  36355. if (params) {
  36356. return Util_Util.toJSON(params);
  36357. }
  36358. }
  36359. }]);
  36360. return TransferSolutionParameters;
  36361. }();
  36362. SuperMap.TransferSolutionParameters = TransferSolutionParameters_TransferSolutionParameters;
  36363. // CONCATENATED MODULE: ./src/common/iServer/TransferSolutionService.js
  36364. 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); }
  36365. function TransferSolutionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36366. 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); } }
  36367. function TransferSolutionService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionService_defineProperties(Constructor, staticProps); return Constructor; }
  36368. 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); }
  36369. function TransferSolutionService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferSolutionService_getPrototypeOf(object); if (object === null) break; } return object; }
  36370. 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); }
  36371. function TransferSolutionService_setPrototypeOf(o, p) { TransferSolutionService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferSolutionService_setPrototypeOf(o, p); }
  36372. 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); }; }
  36373. function TransferSolutionService_possibleConstructorReturn(self, call) { if (call && (TransferSolutionService_typeof(call) === "object" || typeof call === "function")) { return call; } return TransferSolutionService_assertThisInitialized(self); }
  36374. function TransferSolutionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36375. 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; } }
  36376. function TransferSolutionService_getPrototypeOf(o) { TransferSolutionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferSolutionService_getPrototypeOf(o); }
  36377. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  36378. * This program are made available under the terms of the Apache License, Version 2.0
  36379. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36380. /**
  36381. * @class SuperMap.TransferSolutionService
  36382. * @category iServer TrafficTransferAnalyst TransferSolutions
  36383. * @classdesc 交通换乘方案查询服务类。
  36384. * 返回结果通过该类支持的事件的监听函数参数获取。
  36385. * @param {string} url - 与客户端交互的交通换乘方案查询服务地址。
  36386. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  36387. * @param {Object} options - 参数。</br>
  36388. * @param {Object} options.eventListeners - 需要被注册的监听器对象。</br>
  36389. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36390. * @param {Object} [options.headers] - 请求头。
  36391. * @extends {SuperMap.CommonServiceBase}
  36392. * @example 例如:
  36393. * (start code)
  36394. * var myService = new SuperMap.TransferSolutionService(url, {eventListeners: {
  36395. * "processCompleted": trafficTransferCompleted,
  36396. * "processFailed": trafficTransferError
  36397. * }
  36398. * };
  36399. * (end)
  36400. *
  36401. */
  36402. var TransferSolutionService_TransferSolutionService = /*#__PURE__*/function (_CommonServiceBase) {
  36403. TransferSolutionService_inherits(TransferSolutionService, _CommonServiceBase);
  36404. var _super = TransferSolutionService_createSuper(TransferSolutionService);
  36405. function TransferSolutionService(url, options) {
  36406. var _this;
  36407. TransferSolutionService_classCallCheck(this, TransferSolutionService);
  36408. _this = _super.call(this, url, options);
  36409. _this.CLASS_NAME = "SuperMap.TransferSolutionService";
  36410. return _this;
  36411. }
  36412. /**
  36413. * @override
  36414. */
  36415. TransferSolutionService_createClass(TransferSolutionService, [{
  36416. key: "destroy",
  36417. value: function destroy() {
  36418. TransferSolutionService_get(TransferSolutionService_getPrototypeOf(TransferSolutionService.prototype), "destroy", this).call(this);
  36419. }
  36420. /**
  36421. * @function SuperMap.TransferSolutionService.prototype.processAsync
  36422. * @description 负责将客户端的更新参数传递到服务端。
  36423. * @param {SuperMap.TransferSolutionParameters} params - 交通换乘参数。
  36424. */
  36425. }, {
  36426. key: "processAsync",
  36427. value: function processAsync(params) {
  36428. if (!(params instanceof TransferSolutionParameters_TransferSolutionParameters)) {
  36429. return;
  36430. }
  36431. var me = this,
  36432. method = "GET",
  36433. jsonParameters;
  36434. me.url = Util_Util.urlPathAppend(me.url, 'solutions');
  36435. jsonParameters = {
  36436. points: Util_Util.toJSON(params.points),
  36437. walkingRatio: params['walkingRatio'],
  36438. transferTactic: params['transferTactic'],
  36439. solutionCount: params['solutionCount'],
  36440. transferPreference: params["transferPreference"]
  36441. };
  36442. if (params.evadeLines) {
  36443. jsonParameters["evadeLines"] = Util_Util.toJSON(params.evadeLines);
  36444. }
  36445. if (params.evadeStops) {
  36446. jsonParameters["evadeStops"] = Util_Util.toJSON(params.evadeStops);
  36447. }
  36448. if (params.priorLines) {
  36449. jsonParameters["priorLines"] = Util_Util.toJSON(params.priorLines);
  36450. }
  36451. if (params.priorStops) {
  36452. jsonParameters["priorStops"] = Util_Util.toJSON(params.priorStops);
  36453. }
  36454. if (params.travelTime) {
  36455. jsonParameters["travelTime"] = params.travelTime;
  36456. }
  36457. me.request({
  36458. method: method,
  36459. params: jsonParameters,
  36460. scope: me,
  36461. success: me.serviceProcessCompleted,
  36462. failure: me.serviceProcessFailed
  36463. });
  36464. }
  36465. }]);
  36466. return TransferSolutionService;
  36467. }(CommonServiceBase_CommonServiceBase);
  36468. SuperMap.TransferSolutionService = TransferSolutionService_TransferSolutionService;
  36469. // CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightParameters.js
  36470. function UpdateEdgeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36471. 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); } }
  36472. function UpdateEdgeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightParameters_defineProperties(Constructor, staticProps); return Constructor; }
  36473. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  36474. * This program are made available under the terms of the Apache License, Version 2.0
  36475. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36476. /**
  36477. * @class SuperMap.UpdateEdgeWeightParameters
  36478. * @category iServer NetworkAnalyst EdgeWeight
  36479. * @classdesc 边的耗费权重更新服务参数类。
  36480. * @param {Object} options - 参数。
  36481. * @param {string} options.edgeId - 所在边的 ID。
  36482. * @param {string} options.fromNodeId - 起始转向点的 ID。
  36483. * @param {string} options.toNodeId - 终止转向点的 ID。
  36484. * @param {string} options.weightField - 边的耗费字段。
  36485. * @param {string} options.edgeWeight - 耗费权重。
  36486. */
  36487. var UpdateEdgeWeightParameters_UpdateEdgeWeightParameters = /*#__PURE__*/function () {
  36488. function UpdateEdgeWeightParameters(options) {
  36489. UpdateEdgeWeightParameters_classCallCheck(this, UpdateEdgeWeightParameters);
  36490. if (!options) {
  36491. return;
  36492. }
  36493. /**
  36494. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.edgeId
  36495. * @description 所在边的 ID。
  36496. */
  36497. this.edgeId = "";
  36498. /**
  36499. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.fromNodeId
  36500. * @description 起始转向点的 ID。
  36501. */
  36502. this.fromNodeId = "";
  36503. /**
  36504. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.toNodeId
  36505. * @description 终止转向点的 ID。
  36506. */
  36507. this.toNodeId = "";
  36508. /**
  36509. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.weightField
  36510. * @description 边的耗费字段。
  36511. */
  36512. this.weightField = "";
  36513. /**
  36514. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.edgeWeight
  36515. * @description 耗费权重。
  36516. */
  36517. this.edgeWeight = "";
  36518. Util_Util.extend(this, options);
  36519. this.CLASS_NAME = "SuperMap.UpdateEdgeWeightParameters";
  36520. }
  36521. /**
  36522. * @function SuperMap.UpdateEdgeWeightParameters.prototype.destroy
  36523. * @description 释放资源,将引用资源的属性置空。
  36524. */
  36525. UpdateEdgeWeightParameters_createClass(UpdateEdgeWeightParameters, [{
  36526. key: "destroy",
  36527. value: function destroy() {
  36528. this.edgeId = null;
  36529. this.fromNodeId = null;
  36530. this.toNodeId = null;
  36531. this.weightField = null;
  36532. this.edgeWeight = null;
  36533. }
  36534. }]);
  36535. return UpdateEdgeWeightParameters;
  36536. }();
  36537. SuperMap.UpdateEdgeWeightParameters = UpdateEdgeWeightParameters_UpdateEdgeWeightParameters;
  36538. // CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightService.js
  36539. 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); }
  36540. function UpdateEdgeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36541. 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); } }
  36542. function UpdateEdgeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightService_defineProperties(Constructor, staticProps); return Constructor; }
  36543. 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); }
  36544. function UpdateEdgeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateEdgeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  36545. 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); }
  36546. function UpdateEdgeWeightService_setPrototypeOf(o, p) { UpdateEdgeWeightService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateEdgeWeightService_setPrototypeOf(o, p); }
  36547. 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); }; }
  36548. function UpdateEdgeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateEdgeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } return UpdateEdgeWeightService_assertThisInitialized(self); }
  36549. function UpdateEdgeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36550. 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; } }
  36551. function UpdateEdgeWeightService_getPrototypeOf(o) { UpdateEdgeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateEdgeWeightService_getPrototypeOf(o); }
  36552. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  36553. * This program are made available under the terms of the Apache License, Version 2.0
  36554. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36555. /**
  36556. * @class SuperMap.UpdateEdgeWeightService
  36557. * @category iServer NetworkAnalyst EdgeWeight
  36558. * @classdesc 更新边的边的耗费权重服务
  36559. * @extends {SuperMap.NetworkAnalystServiceBase}
  36560. * @example
  36561. *(start code)
  36562. * var updateEdgeWeightService = new SuperMap.UpdateEdgeWeightService(url, {
  36563. * eventListeners: {
  36564. * "processCompleted": UpdateEdgeWeightCompleted, //参数为SuperMap.UpdateEdgeWeightEventArgs
  36565. * "processFailed": UpdateEdgeWeightError //参数为SuperMap.ServiceFailedEventArgs
  36566. * }
  36567. * });
  36568. * (end)
  36569. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  36570. * @param {Object} options - 参数。
  36571. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36572. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36573. * @param {Object} [options.headers] - 请求头。
  36574. */
  36575. var UpdateEdgeWeightService_UpdateEdgeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  36576. UpdateEdgeWeightService_inherits(UpdateEdgeWeightService, _NetworkAnalystServic);
  36577. var _super = UpdateEdgeWeightService_createSuper(UpdateEdgeWeightService);
  36578. function UpdateEdgeWeightService(url, options) {
  36579. var _this;
  36580. UpdateEdgeWeightService_classCallCheck(this, UpdateEdgeWeightService);
  36581. _this = _super.call(this, url, options);
  36582. _this.CLASS_NAME = "SuperMap.UpdateEdgeWeightService";
  36583. return _this;
  36584. }
  36585. /**
  36586. * @override
  36587. */
  36588. UpdateEdgeWeightService_createClass(UpdateEdgeWeightService, [{
  36589. key: "destroy",
  36590. value: function destroy() {
  36591. UpdateEdgeWeightService_get(UpdateEdgeWeightService_getPrototypeOf(UpdateEdgeWeightService.prototype), "destroy", this).call(this);
  36592. }
  36593. /**
  36594. * @function SuperMap.UpdateEdgeWeightService.prototype.processAsync
  36595. * @description 开始异步执行边的边的耗费权重的更新
  36596. * @param {SuperMap.UpdateEdgeWeightParameters} params - 边的耗费权重更新服务参数类
  36597. * @example
  36598. * (code)
  36599. * var updateEdgeWeightParam=new SuperMapUpdateEdgeWeightParameters({
  36600. * edgeId:"20",
  36601. * fromNodeId:"26",
  36602. * toNodeId:"109",
  36603. * weightField:"time",
  36604. * edgeWeight:"25"
  36605. * });
  36606. * updateEdgeWeightService.processAsync(updateEdgeWeightParam);
  36607. * (end)
  36608. */
  36609. }, {
  36610. key: "processAsync",
  36611. value: function processAsync(params) {
  36612. if (!(params instanceof UpdateEdgeWeightParameters_UpdateEdgeWeightParameters)) {
  36613. return;
  36614. }
  36615. var me = this;
  36616. var paramStr = me.parse(params);
  36617. me.url = Util_Util.urlPathAppend(me.url, paramStr);
  36618. var data = params.edgeWeight ? params.edgeWeight : null;
  36619. me.request({
  36620. method: "PUT",
  36621. scope: me,
  36622. data: data,
  36623. success: me.serviceProcessCompleted,
  36624. failure: me.serviceProcessFailed
  36625. });
  36626. }
  36627. /**
  36628. * @function SuperMap.UpdateEdgeWeightService.prototype.parse
  36629. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  36630. */
  36631. }, {
  36632. key: "parse",
  36633. value: function parse(params) {
  36634. if (!params) {
  36635. return;
  36636. }
  36637. var paramStr = "";
  36638. for (var attr in params) {
  36639. if (params[attr] === "" || params[attr] === "edgeWeight") {
  36640. continue;
  36641. }
  36642. switch (attr) {
  36643. case "edgeId":
  36644. paramStr += "/edgeweight/" + params[attr];
  36645. break;
  36646. case "fromNodeId":
  36647. paramStr += "/fromnode/" + params[attr];
  36648. break;
  36649. case "toNodeId":
  36650. paramStr += "/tonode/" + params[attr];
  36651. break;
  36652. case "weightField":
  36653. paramStr += "/weightfield/" + params[attr];
  36654. break;
  36655. default:
  36656. break;
  36657. }
  36658. }
  36659. return paramStr;
  36660. }
  36661. }]);
  36662. return UpdateEdgeWeightService;
  36663. }(NetworkAnalystServiceBase_NetworkAnalystServiceBase);
  36664. SuperMap.UpdateEdgeWeightService = UpdateEdgeWeightService_UpdateEdgeWeightService;
  36665. // CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightParameters.js
  36666. function UpdateTurnNodeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36667. 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); } }
  36668. function UpdateTurnNodeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor, staticProps); return Constructor; }
  36669. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  36670. * This program are made available under the terms of the Apache License, Version 2.0
  36671. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36672. /**
  36673. * @class SuperMap.UpdateTurnNodeWeightParameters
  36674. * @category iServer NetworkAnalyst TurnNodeWeight
  36675. * @classdesc 转向耗费权重更新服务参数类。
  36676. * @param {Object} options - 参数。
  36677. * @param {string} options.nodeId - 转向结点的 ID。
  36678. * @param {string} options.fromEdgeId - 起始边的 ID。
  36679. * @param {string} options.toEdgeId - 终止边的 ID。
  36680. * @param {string} options.weightField - 转向结点的耗费字段。
  36681. * @param {string} options.turnNodeWeight - 耗费权重。
  36682. */
  36683. var UpdateTurnNodeWeightParameters_UpdateTurnNodeWeightParameters = /*#__PURE__*/function () {
  36684. function UpdateTurnNodeWeightParameters(options) {
  36685. UpdateTurnNodeWeightParameters_classCallCheck(this, UpdateTurnNodeWeightParameters);
  36686. if (!options) {
  36687. return;
  36688. }
  36689. /**
  36690. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.nodeId
  36691. * @description 转向结点的 ID。
  36692. */
  36693. this.nodeId = "";
  36694. /**
  36695. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.fromEdgeId
  36696. * @description 起始边的 ID。
  36697. */
  36698. this.fromEdgeId = "";
  36699. /**
  36700. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.toEdgeId
  36701. * @description 终止边的 ID。
  36702. */
  36703. this.toEdgeId = "";
  36704. /**
  36705. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.weightField
  36706. * @description 转向结点的耗费字段。
  36707. */
  36708. this.weightField = "";
  36709. /**
  36710. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.turnNodeWeight
  36711. * @description 耗费权重。
  36712. */
  36713. this.turnNodeWeight = "";
  36714. Util_Util.extend(this, options);
  36715. this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightParameters";
  36716. }
  36717. /**
  36718. * @function SuperMap.UpdateTurnNodeWeightParameters.prototype.destroy
  36719. * @description 释放资源,将引用资源的属性置空。
  36720. */
  36721. UpdateTurnNodeWeightParameters_createClass(UpdateTurnNodeWeightParameters, [{
  36722. key: "destroy",
  36723. value: function destroy() {
  36724. this.nodeId = null;
  36725. this.fromEdgeId = null;
  36726. this.toEdgeId = null;
  36727. this.weightField = null;
  36728. this.turnNodeWeight = null;
  36729. }
  36730. }]);
  36731. return UpdateTurnNodeWeightParameters;
  36732. }();
  36733. SuperMap.UpdateTurnNodeWeightParameters = UpdateTurnNodeWeightParameters_UpdateTurnNodeWeightParameters;
  36734. // CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightService.js
  36735. 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); }
  36736. function UpdateTurnNodeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36737. 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); } }
  36738. function UpdateTurnNodeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightService_defineProperties(Constructor, staticProps); return Constructor; }
  36739. 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); }
  36740. function UpdateTurnNodeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateTurnNodeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  36741. 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); }
  36742. function UpdateTurnNodeWeightService_setPrototypeOf(o, p) { UpdateTurnNodeWeightService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateTurnNodeWeightService_setPrototypeOf(o, p); }
  36743. 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); }; }
  36744. function UpdateTurnNodeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateTurnNodeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } return UpdateTurnNodeWeightService_assertThisInitialized(self); }
  36745. function UpdateTurnNodeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36746. 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; } }
  36747. function UpdateTurnNodeWeightService_getPrototypeOf(o) { UpdateTurnNodeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateTurnNodeWeightService_getPrototypeOf(o); }
  36748. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  36749. * This program are made available under the terms of the Apache License, Version 2.0
  36750. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36751. /**
  36752. * @class SuperMap.UpdateTurnNodeWeightService
  36753. * @category iServer NetworkAnalyst TurnNodeWeight
  36754. * @classdesc 转向耗费权重更新服务类
  36755. * @extends {SuperMap.NetworkAnalystServiceBase}
  36756. * @example
  36757. * var UpdateTurnNodeWeightService = new SuperMap.UpdateTurnNodeWeightService(url, {
  36758. * eventListeners: {
  36759. * "processCompleted": UpdateTurnNodeWeightCompleted, //参数为SuperMap.UpdateTurnNodeWeightEventArgs
  36760. * "processFailed": UpdateTurnNodeWeightError //参数为SuperMap.ServiceFailedEventArgs
  36761. * }
  36762. * });
  36763. * @param {string} url - 服务的访问地址。如:
  36764. * http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  36765. * @param {Object} options - 参数。
  36766. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36767. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36768. * @param {Object} [options.headers] - 请求头。
  36769. */
  36770. var UpdateTurnNodeWeightService_UpdateTurnNodeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  36771. UpdateTurnNodeWeightService_inherits(UpdateTurnNodeWeightService, _NetworkAnalystServic);
  36772. var _super = UpdateTurnNodeWeightService_createSuper(UpdateTurnNodeWeightService);
  36773. function UpdateTurnNodeWeightService(url, options) {
  36774. var _this;
  36775. UpdateTurnNodeWeightService_classCallCheck(this, UpdateTurnNodeWeightService);
  36776. _this = _super.call(this, url, options);
  36777. _this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightService";
  36778. return _this;
  36779. }
  36780. /**
  36781. * @override
  36782. */
  36783. UpdateTurnNodeWeightService_createClass(UpdateTurnNodeWeightService, [{
  36784. key: "destroy",
  36785. value: function destroy() {
  36786. UpdateTurnNodeWeightService_get(UpdateTurnNodeWeightService_getPrototypeOf(UpdateTurnNodeWeightService.prototype), "destroy", this).call(this);
  36787. }
  36788. /**
  36789. * @function SuperMap.UpdateTurnNodeWeightService.prototype.processAsync
  36790. * @description 开始异步执行转向耗费权重的更新
  36791. * @param {SuperMap.UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类
  36792. * @example
  36793. * (code)
  36794. * var updateTurnNodeWeightParam=new SuperMap.UpdateTurnNodeWeightParameters({
  36795. * nodeId:"106",
  36796. * fromEdgeId:"6508",
  36797. * toEdgeId:"6504",
  36798. * weightField:"TurnCost",
  36799. * turnNodeWeight:"50"
  36800. * });
  36801. * updateTurnNodeWeightService.processAsync(updateTurnNodeWeightParam);
  36802. * (end)
  36803. **/
  36804. }, {
  36805. key: "processAsync",
  36806. value: function processAsync(params) {
  36807. if (!(params instanceof UpdateTurnNodeWeightParameters_UpdateTurnNodeWeightParameters)) {
  36808. return;
  36809. }
  36810. var me = this;
  36811. var paramStr = me.parse(params);
  36812. me.url = Util_Util.urlPathAppend(me.url, paramStr);
  36813. var data = params.turnNodeWeight ? params.turnNodeWeight : null;
  36814. me.request({
  36815. method: "PUT",
  36816. scope: me,
  36817. data: data,
  36818. success: me.serviceProcessCompleted,
  36819. failure: me.serviceProcessFailed
  36820. });
  36821. }
  36822. /**
  36823. * @function SuperMap.UpdateTurnNodeWeightService.prototype.parse
  36824. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  36825. */
  36826. }, {
  36827. key: "parse",
  36828. value: function parse(params) {
  36829. if (!params) {
  36830. return;
  36831. }
  36832. var paramStr = "";
  36833. for (var attr in params) {
  36834. if (params[attr] === "" || params[attr] === "turnNodeWeight") {
  36835. continue;
  36836. }
  36837. switch (attr) {
  36838. case "nodeId":
  36839. paramStr += "/turnnodeweight/" + params[attr];
  36840. break;
  36841. case "fromEdgeId":
  36842. paramStr += "/fromedge/" + params[attr];
  36843. break;
  36844. case "toEdgeId":
  36845. paramStr += "/toedge/" + params[attr];
  36846. break;
  36847. case "weightField":
  36848. paramStr += "/weightfield/" + params[attr];
  36849. break;
  36850. default:
  36851. break;
  36852. }
  36853. }
  36854. return paramStr;
  36855. }
  36856. }]);
  36857. return UpdateTurnNodeWeightService;
  36858. }(NetworkAnalystServiceBase_NetworkAnalystServiceBase);
  36859. SuperMap.UpdateTurnNodeWeightService = UpdateTurnNodeWeightService_UpdateTurnNodeWeightService;
  36860. // CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsParameter.js
  36861. function VectorClipJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36862. 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); } }
  36863. function VectorClipJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  36864. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  36865. * This program are made available under the terms of the Apache License, Version 2.0
  36866. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36867. /**
  36868. * @class SuperMap.VectorClipJobsParameter
  36869. * @category iServer ProcessingService VectorClip
  36870. * @classdesc 矢量裁剪分析任务参数类。
  36871. * @param {Object} options - 参数。
  36872. * @param {string} options.datasetName - 数据集名。
  36873. * @param {string} options.datasetOverlay - 裁剪对象数据集。
  36874. * @param {SuperMap.ClipAnalystMode} [options.mode=SuperMap.ClipAnalystMode.CLIP] - 裁剪分析模式。
  36875. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  36876. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  36877. */
  36878. var VectorClipJobsParameter_VectorClipJobsParameter = /*#__PURE__*/function () {
  36879. function VectorClipJobsParameter(options) {
  36880. VectorClipJobsParameter_classCallCheck(this, VectorClipJobsParameter);
  36881. options = options || {};
  36882. /**
  36883. * @member {string} SuperMap.VectorClipJobsParameter.prototype.datasetName
  36884. * @description 数据集名。
  36885. */
  36886. this.datasetName = "";
  36887. /**
  36888. * @member {string} SuperMap.VectorClipJobsParameter.prototype.datasetOverlay
  36889. * @description 裁剪对象数据集。
  36890. */
  36891. this.datasetVectorClip = "";
  36892. /**
  36893. * @member {string} SuperMap.VectorClipJobsParameter.prototype.geometryClip
  36894. * @description 裁剪几何对象。
  36895. */
  36896. this.geometryClip = "";
  36897. /**
  36898. * @member {SuperMap.ClipAnalystMode} [SuperMap.VectorClipJobsParameter.prototype.mode=ClipAnalystMode.CLIP]
  36899. * @description 裁剪分析模式 。
  36900. */
  36901. this.mode = ClipAnalystMode.CLIP;
  36902. /**
  36903. * @member {SuperMap.OutputSetting} SuperMap.VectorClipJobsParameter.prototype.output
  36904. * @description 输出参数设置类。
  36905. */
  36906. this.output = null;
  36907. /**
  36908. * @member {SuperMap.MappingParameters} [SuperMap.VectorClipJobsParameter.prototype.mappingParameters]
  36909. * @description 分析后结果可视化的参数类。
  36910. */
  36911. this.mappingParameters = null;
  36912. Util_Util.extend(this, options);
  36913. this.CLASS_NAME = "SuperMap.VectorClipJobsParameter";
  36914. }
  36915. /**
  36916. * @function SuperMap.VectorClipJobsParameter.prototype.destroy
  36917. * @description 释放资源,将引用资源的属性置空。
  36918. */
  36919. VectorClipJobsParameter_createClass(VectorClipJobsParameter, [{
  36920. key: "destroy",
  36921. value: function destroy() {
  36922. this.datasetName = null;
  36923. this.datasetVectorClip = null;
  36924. this.geometryClip = null;
  36925. this.mode = null;
  36926. if (this.output instanceof OutputSetting_OutputSetting) {
  36927. this.output.destroy();
  36928. this.output = null;
  36929. }
  36930. if (this.mappingParameters instanceof MappingParameters_MappingParameters) {
  36931. this.mappingParameters.destroy();
  36932. this.mappingParameters = null;
  36933. }
  36934. }
  36935. /**
  36936. * @function SuperMap.VectorClipJobsParameter.toObject
  36937. * @param {Object} vectorClipJobsParameter - 区域汇总分析服务参数。
  36938. * @param {Object} tempObj - 目标对象。
  36939. * @description 矢量裁剪分析任务对象。
  36940. */
  36941. }], [{
  36942. key: "toObject",
  36943. value: function toObject(vectorClipJobsParameter, tempObj) {
  36944. for (var name in vectorClipJobsParameter) {
  36945. if (name === "datasetName") {
  36946. tempObj['input'] = tempObj['input'] || {};
  36947. tempObj['input'][name] = vectorClipJobsParameter[name];
  36948. continue;
  36949. }
  36950. if (name === "output") {
  36951. tempObj['output'] = tempObj['output'] || {};
  36952. tempObj['output'] = vectorClipJobsParameter[name];
  36953. continue;
  36954. }
  36955. tempObj['analyst'] = tempObj['analyst'] || {};
  36956. tempObj['analyst'][name] = vectorClipJobsParameter[name];
  36957. if (name === 'mappingParameters') {
  36958. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  36959. tempObj['analyst']['mappingParameters'] = vectorClipJobsParameter[name];
  36960. }
  36961. }
  36962. }
  36963. }]);
  36964. return VectorClipJobsParameter;
  36965. }();
  36966. SuperMap.VectorClipJobsParameter = VectorClipJobsParameter_VectorClipJobsParameter;
  36967. // CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsService.js
  36968. 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); }
  36969. function VectorClipJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36970. 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); } }
  36971. function VectorClipJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  36972. 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); }
  36973. function VectorClipJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = VectorClipJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  36974. 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); }
  36975. function VectorClipJobsService_setPrototypeOf(o, p) { VectorClipJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return VectorClipJobsService_setPrototypeOf(o, p); }
  36976. 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); }; }
  36977. function VectorClipJobsService_possibleConstructorReturn(self, call) { if (call && (VectorClipJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return VectorClipJobsService_assertThisInitialized(self); }
  36978. function VectorClipJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36979. 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; } }
  36980. function VectorClipJobsService_getPrototypeOf(o) { VectorClipJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorClipJobsService_getPrototypeOf(o); }
  36981. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  36982. * This program are made available under the terms of the Apache License, Version 2.0
  36983. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36984. /**
  36985. * @class SuperMap.VectorClipJobsService
  36986. * @category iServer ProcessingService VectorClip
  36987. * @classdesc 矢量裁剪分析服务类
  36988. * @extends {SuperMap.ProcessingServiceBase}
  36989. * @param {string} url -矢量裁剪分析服务地址。
  36990. * @param {Object} options - 交互服务时所需可选参数。
  36991. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36992. * @param {Object} [options.headers] - 请求头。
  36993. */
  36994. var VectorClipJobsService_VectorClipJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  36995. VectorClipJobsService_inherits(VectorClipJobsService, _ProcessingServiceBas);
  36996. var _super = VectorClipJobsService_createSuper(VectorClipJobsService);
  36997. function VectorClipJobsService(url, options) {
  36998. var _this;
  36999. VectorClipJobsService_classCallCheck(this, VectorClipJobsService);
  37000. _this = _super.call(this, url, options);
  37001. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/vectorclip');
  37002. _this.CLASS_NAME = 'SuperMap.VectorClipJobsService';
  37003. return _this;
  37004. }
  37005. /**
  37006. *@override
  37007. */
  37008. VectorClipJobsService_createClass(VectorClipJobsService, [{
  37009. key: "destroy",
  37010. value: function destroy() {
  37011. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "destroy", this).call(this);
  37012. }
  37013. /**
  37014. * @function SuperMap.VectorClipJobsService.protitype.getVectorClipJobs
  37015. * @description 获取矢量裁剪分析所有任务
  37016. */
  37017. }, {
  37018. key: "getVectorClipJobs",
  37019. value: function getVectorClipJobs() {
  37020. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, this.url);
  37021. }
  37022. /**
  37023. * @function SuperMap.KernelDensityJobsService.protitype.getVectorClipJob
  37024. * @description 获取指定id的矢量裁剪分析服务
  37025. * @param {string} id - 指定要获取数据的id
  37026. */
  37027. }, {
  37028. key: "getVectorClipJob",
  37029. value: function getVectorClipJob(id) {
  37030. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  37031. }
  37032. /**
  37033. * @function SuperMap.VectorClipJobsService.protitype.addVectorClipJob
  37034. * @description 新建矢量裁剪分析服务
  37035. * @param {SuperMap.VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  37036. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  37037. */
  37038. }, {
  37039. key: "addVectorClipJob",
  37040. value: function addVectorClipJob(params, seconds) {
  37041. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "addJob", this).call(this, this.url, params, VectorClipJobsParameter_VectorClipJobsParameter, seconds);
  37042. }
  37043. }]);
  37044. return VectorClipJobsService;
  37045. }(ProcessingServiceBase_ProcessingServiceBase);
  37046. SuperMap.VectorClipJobsService = VectorClipJobsService_VectorClipJobsService;
  37047. // CONCATENATED MODULE: ./src/common/iServer/RasterFunctionParameter.js
  37048. function RasterFunctionParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37049. 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); } }
  37050. function RasterFunctionParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) RasterFunctionParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) RasterFunctionParameter_defineProperties(Constructor, staticProps); return Constructor; }
  37051. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  37052. * This program are made available under the terms of the Apache License, Version 2.0
  37053. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37054. /**
  37055. * @class SuperMap.RasterFunctionParameter
  37056. * @category iServer Map
  37057. * @classdesc iServer 地图服务栅格分析参数基类
  37058. * @param {Object} options - 参数。
  37059. * @param {SuperMap.RasterFunctionType} options.type - 栅格分析方法。
  37060. */
  37061. var RasterFunctionParameter_RasterFunctionParameter = /*#__PURE__*/function () {
  37062. function RasterFunctionParameter(options) {
  37063. RasterFunctionParameter_classCallCheck(this, RasterFunctionParameter);
  37064. options = options || {};
  37065. /**
  37066. * @member {SuperMap.RasterFunctionType} [SuperMap.RasterFunctionParameter.prototype.type]
  37067. * @description 栅格分析方法。
  37068. */
  37069. this.type = null;
  37070. Util_Util.extend(this, options);
  37071. this.CLASS_NAME = 'SuperMap.RasterFunctionParameter';
  37072. }
  37073. /**
  37074. * @function SuperMap.RasterFunctionParameter.prototype.destroy
  37075. * @description 释放资源,将资源的属性置空。
  37076. */
  37077. RasterFunctionParameter_createClass(RasterFunctionParameter, [{
  37078. key: "destroy",
  37079. value: function destroy() {
  37080. this.type = null;
  37081. }
  37082. }]);
  37083. return RasterFunctionParameter;
  37084. }();
  37085. SuperMap.RasterFunctionParameter = RasterFunctionParameter_RasterFunctionParameter;
  37086. // CONCATENATED MODULE: ./src/common/iServer/NDVIParameter.js
  37087. 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); }
  37088. function NDVIParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37089. 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); } }
  37090. function NDVIParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) NDVIParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) NDVIParameter_defineProperties(Constructor, staticProps); return Constructor; }
  37091. 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); }
  37092. function NDVIParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NDVIParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  37093. 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); }
  37094. function NDVIParameter_setPrototypeOf(o, p) { NDVIParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NDVIParameter_setPrototypeOf(o, p); }
  37095. 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); }; }
  37096. function NDVIParameter_possibleConstructorReturn(self, call) { if (call && (NDVIParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return NDVIParameter_assertThisInitialized(self); }
  37097. function NDVIParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37098. 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; } }
  37099. function NDVIParameter_getPrototypeOf(o) { NDVIParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NDVIParameter_getPrototypeOf(o); }
  37100. /* Copyright© 2000 - 2020 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.NDVIParameter
  37105. * @category iServer Map
  37106. * @classdesc 归一化植被指数参数类
  37107. * @param {Object} options - 参数。
  37108. * @param {number} [options.redIndex=0] - 红光谱波段索引。
  37109. * @param {number} [options.nirIndex=1] - 近红外光谱波段索引。
  37110. * @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。仅单波段数据时设定。
  37111. * @extends {SuperMap.RasterFunctionParameter}
  37112. */
  37113. var NDVIParameter_NDVIParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  37114. NDVIParameter_inherits(NDVIParameter, _RasterFunctionParame);
  37115. var _super = NDVIParameter_createSuper(NDVIParameter);
  37116. function NDVIParameter(options) {
  37117. var _this;
  37118. NDVIParameter_classCallCheck(this, NDVIParameter);
  37119. _this = _super.call(this, options);
  37120. /**
  37121. * @member {number} [SuperMap.NDVIParameter.prototype.redIndex=0]
  37122. * @description 红光谱波段索引。
  37123. */
  37124. _this.redIndex = 0;
  37125. /**
  37126. * @member {number} [SuperMap.NDVIParameter.prototype.nirIndex=1]
  37127. * @description 近红外光谱波段索引。
  37128. */
  37129. _this.nirIndex = 1;
  37130. /**
  37131. * @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"]
  37132. * @description 颜色表。由栅格的中断值和颜色停止之间的映射组成的,如0.3->d9f0a3ff 指的是[0,0.3)显示d9f0a3ff。仅单波段数据时设定。
  37133. */
  37134. _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';
  37135. /**
  37136. * @member {SuperMap.RasterFunctionType} [SuperMap.RasterFunctionParameter.prototype.type]
  37137. * @description 栅格分析方法。
  37138. */
  37139. _this.type = RasterFunctionType.NDVI;
  37140. Util_Util.extend(NDVIParameter_assertThisInitialized(_this), options);
  37141. _this.CLASS_NAME = 'SuperMap.NDVIParameter';
  37142. return _this;
  37143. }
  37144. /**
  37145. * @function SuperMap.NDVIParameter.prototype.destroy
  37146. * @override
  37147. */
  37148. NDVIParameter_createClass(NDVIParameter, [{
  37149. key: "destroy",
  37150. value: function destroy() {
  37151. NDVIParameter_get(NDVIParameter_getPrototypeOf(NDVIParameter.prototype), "destroy", this).call(this);
  37152. this.redIndex = null;
  37153. this.nirIndex = null;
  37154. this.colorMap = null;
  37155. }
  37156. /**
  37157. * @function SuperMap.NDVIParameter.prototype.toJSON
  37158. * @description 将 NDVIParameter 对象转化为 JSON 字符串。
  37159. * @returns {string} 返回转换后的 JSON 字符串。
  37160. */
  37161. }, {
  37162. key: "toJSON",
  37163. value: function toJSON() {
  37164. return {
  37165. redIndex: this.redIndex,
  37166. nirIndex: this.nirIndex,
  37167. colorMap: this.colorMap,
  37168. type: this.type
  37169. };
  37170. }
  37171. }]);
  37172. return NDVIParameter;
  37173. }(RasterFunctionParameter_RasterFunctionParameter);
  37174. SuperMap.NDVIParameter = NDVIParameter_NDVIParameter;
  37175. // CONCATENATED MODULE: ./src/common/iServer/HillshadeParameter.js
  37176. 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); }
  37177. function HillshadeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37178. 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); } }
  37179. function HillshadeParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) HillshadeParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) HillshadeParameter_defineProperties(Constructor, staticProps); return Constructor; }
  37180. 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); }
  37181. function HillshadeParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = HillshadeParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  37182. 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); }
  37183. function HillshadeParameter_setPrototypeOf(o, p) { HillshadeParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HillshadeParameter_setPrototypeOf(o, p); }
  37184. 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); }; }
  37185. function HillshadeParameter_possibleConstructorReturn(self, call) { if (call && (HillshadeParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return HillshadeParameter_assertThisInitialized(self); }
  37186. function HillshadeParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37187. 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; } }
  37188. function HillshadeParameter_getPrototypeOf(o) { HillshadeParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HillshadeParameter_getPrototypeOf(o); }
  37189. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  37190. * This program are made available under the terms of the Apache License, Version 2.0
  37191. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37192. /**
  37193. * @class SuperMap.HillshadeParameter
  37194. * @category iServer Map
  37195. * @classdesc 阴影面分析参数类
  37196. * @param {Object} options - 参数。
  37197. * @param {number} [options.altitude=45] - 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  37198. * @param {number} [options.azimuth=315] - 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  37199. * @param {number} [options.zFactor=1] - 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  37200. * z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  37201. * 如果 x,y 单位和 z 单位采用相同的测量单位,则 z 因子为 1。这是默认设置。
  37202. * 如果 x,y 单位和 z 单位采用不同的测量单位,则必须将 z 因子设置为适当的因子,否则会得到错误的结果。例如,如果 z 单位是英尺而 x,y 单位是米,则应使用 z 因子 0.3048 将 z 单位从英尺转换为米(1 英尺 = 0.3048 米)。
  37203. * 如果输入栅格位于球面坐标系中(如十进制度球面坐标系),则生成的山体阴影可能看起来很独特。这是因为水平地面单位与高程 z 单位之间的测量值存在差异。由于经度的长度随着纬度而变化,因此需要为该纬度指定一个适当的 z 因子。如果 x,y 单位是十进制度而 Z 单位是米,特定纬度的一些合适的 Z 因子为:
  37204. * Latitude Z-factor
  37205. * 0 0.00000898
  37206. * 10 0.00000912
  37207. * 20 0.00000956
  37208. * 30 0.00001036
  37209. * 40 0.00001171
  37210. * 50 0.00001395
  37211. * 60 0.00001792
  37212. * 70 0.00002619
  37213. * 80 0.00005156
  37214. * @extends {SuperMap.RasterFunctionParameter}
  37215. */
  37216. var HillshadeParameter_HillshadeParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  37217. HillshadeParameter_inherits(HillshadeParameter, _RasterFunctionParame);
  37218. var _super = HillshadeParameter_createSuper(HillshadeParameter);
  37219. function HillshadeParameter(options) {
  37220. var _this;
  37221. HillshadeParameter_classCallCheck(this, HillshadeParameter);
  37222. _this = _super.call(this, options);
  37223. /**
  37224. * @member {number} [SuperMap.HillshadeParameter.prototype.altitude = 45]
  37225. * @description 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  37226. */
  37227. _this.altitude = 45;
  37228. /**
  37229. * @member {number} [SuperMap.HillshadeParameter.prototype.azimuth = 315]
  37230. * @description 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  37231. */
  37232. _this.azimuth = 315;
  37233. /**
  37234. * @member {number} [SuperMap.HillshadeParameter.prototype.zFactor = 1]
  37235. * @description 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  37236. */
  37237. _this.zFactor = 1;
  37238. /**
  37239. * @member {SuperMap.RasterFunctionType} SuperMap.RasterFunctionParameter.prototype.type
  37240. * @description 栅格分析方法。
  37241. */
  37242. _this.type = RasterFunctionType.HILLSHADE;
  37243. Util_Util.extend(HillshadeParameter_assertThisInitialized(_this), options);
  37244. _this.CLASS_NAME = 'SuperMap.HillshadeParameter';
  37245. return _this;
  37246. }
  37247. /**
  37248. * @function SuperMap.HillshadeParameter.prototype.destroy
  37249. * @override
  37250. */
  37251. HillshadeParameter_createClass(HillshadeParameter, [{
  37252. key: "destroy",
  37253. value: function destroy() {
  37254. HillshadeParameter_get(HillshadeParameter_getPrototypeOf(HillshadeParameter.prototype), "destroy", this).call(this);
  37255. this.altitude = null;
  37256. this.azimuth = null;
  37257. this.zFactor = null;
  37258. }
  37259. /**
  37260. * @function SuperMap.HillshadeParameter.prototype.toJSON
  37261. * @description 将 HillshadeParameter 对象转化为 JSON 字符串。
  37262. * @returns {string} 返回转换后的 JSON 字符串。
  37263. */
  37264. }, {
  37265. key: "toJSON",
  37266. value: function toJSON() {
  37267. return {
  37268. altitude: this.altitude,
  37269. azimuth: this.azimuth,
  37270. zFactor: this.zFactor,
  37271. type: this.type
  37272. };
  37273. }
  37274. }]);
  37275. return HillshadeParameter;
  37276. }(RasterFunctionParameter_RasterFunctionParameter);
  37277. SuperMap.HillshadeParameter = HillshadeParameter_HillshadeParameter;
  37278. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobCustomItems.js
  37279. function WebPrintingJobCustomItems_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37280. 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); } }
  37281. function WebPrintingJobCustomItems_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobCustomItems_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobCustomItems_defineProperties(Constructor, staticProps); return Constructor; }
  37282. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  37283. * This program are made available under the terms of the Apache License, Version 2.0
  37284. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37285. /**
  37286. * @class SuperMap.WebPrintingJobCustomItems
  37287. * @classdesc Web 打印图例元素参数类。
  37288. * @version 10.1.0
  37289. * @category iServer WebPrintingJob
  37290. * @param {Object} option - 初始化参数。
  37291. * @param {string} option.name - 图例元素的名称。
  37292. * @param {string} [option.picAsUrl] - 图例元素 Base64 格式图片。
  37293. * @param {string} [option.picAsBase64] - 图例元素图片的获取地址。
  37294. */
  37295. var WebPrintingJobCustomItems_WebPrintingJobCustomItems = /*#__PURE__*/function () {
  37296. function WebPrintingJobCustomItems(option) {
  37297. WebPrintingJobCustomItems_classCallCheck(this, WebPrintingJobCustomItems);
  37298. /**
  37299. * @member {string} SuperMap.WebPrintingJobCustomItems.prototype.name
  37300. * @description 图例元素的名称。
  37301. */
  37302. this.name = null;
  37303. /**
  37304. * @member {string} [SuperMap.WebPrintingJobCustomItems.prototype.picAsUrl]
  37305. * @description 图例元素 Base64 格式图片。
  37306. */
  37307. this.picAsUrl = null;
  37308. /**
  37309. * @member {string} [SuperMap.WebPrintingJobCustomItems.prototype.picAsBase64]
  37310. * @description 图例元素图片的获取地址。
  37311. */
  37312. this.picAsBase64 = null;
  37313. this.CLASS_NAME = 'SuperMap.WebPrintingJobCustomItems';
  37314. Util_Util.extend(this, option);
  37315. }
  37316. /**
  37317. * @function SuperMap.WebPrintingJobCustomItems.prototype.destroy
  37318. * @description 释放资源,将引用资源的属性置空。
  37319. */
  37320. WebPrintingJobCustomItems_createClass(WebPrintingJobCustomItems, [{
  37321. key: "destroy",
  37322. value: function destroy() {
  37323. var me = this;
  37324. me.name = null;
  37325. me.picAsUrl = null;
  37326. me.picAsBase64 = null;
  37327. }
  37328. /**
  37329. * @function SuperMap.WebPrintingJobCustomItems.prototype.toJSON
  37330. * @description 将 SuperMap.WebPrintingJobCustomItems 对象转化为 JSON 字符串。
  37331. * @returns {string} 返回转换后的 JSON 字符串。
  37332. */
  37333. }, {
  37334. key: "toJSON",
  37335. value: function toJSON() {
  37336. var params = {
  37337. name: this.name
  37338. };
  37339. if (this.title) {
  37340. params.title = this.title;
  37341. }
  37342. if (this.picAsUrl) {
  37343. params.picAsUrl = this.picAsUrl;
  37344. } else if (this.picAsBase64) {
  37345. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  37346. }
  37347. return Util_Util.toJSON(params);
  37348. }
  37349. }]);
  37350. return WebPrintingJobCustomItems;
  37351. }();
  37352. SuperMap.WebPrintingJobCustomItems = WebPrintingJobCustomItems_WebPrintingJobCustomItems;
  37353. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobImage.js
  37354. function WebPrintingJobImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37355. 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); } }
  37356. function WebPrintingJobImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobImage_defineProperties(Constructor, staticProps); return Constructor; }
  37357. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  37358. * This program are made available under the terms of the Apache License, Version 2.0
  37359. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37360. /**
  37361. * @class SuperMap.WebPrintingJobImage
  37362. * @classdesc 表达小地图的静态图片参数类。
  37363. * @version 10.1.0
  37364. * @category iServer WebPrintingJob
  37365. * @param {Object} option - 初始化参数。
  37366. * @param {string} [option.picAsUrl] - 小地图的图片 url 地址。
  37367. * @param {string} [option.picAsBase64] - 小地图的base64位图片信息。
  37368. */
  37369. var WebPrintingJobImage_WebPrintingJobImage = /*#__PURE__*/function () {
  37370. function WebPrintingJobImage(option) {
  37371. WebPrintingJobImage_classCallCheck(this, WebPrintingJobImage);
  37372. /**
  37373. * @member {string} [SuperMap.WebPrintingJobImage.prototype.picAsUrl]
  37374. * @description 小地图的图片 url 地址。
  37375. */
  37376. this.picAsUrl = null;
  37377. /**
  37378. * @member {string} [SuperMap.WebPrintingJobImage.prototype.picAsBase64]
  37379. * @description 小地图的base64位图片信息。
  37380. */
  37381. this.picAsBase64 = null;
  37382. this.CLASS_NAME = 'SuperMap.WebPrintingJobImage';
  37383. Util_Util.extend(this, option);
  37384. }
  37385. /**
  37386. * @function SuperMap.WebPrintingJobImage.prototype.destroy
  37387. * @description 释放资源,将引用资源的属性置空。
  37388. */
  37389. WebPrintingJobImage_createClass(WebPrintingJobImage, [{
  37390. key: "destroy",
  37391. value: function destroy() {
  37392. this.picAsUrl = null;
  37393. this.picAsBase64 = null;
  37394. }
  37395. /**
  37396. * @function SuperMap.WebPrintingJobImage.prototype.toJSON
  37397. * @description 将 SuperMap.WebPrintingJobImage 对象转化为 JSON 字符串。
  37398. * @returns {string} 返回转换后的 JSON 字符串。
  37399. */
  37400. }, {
  37401. key: "toJSON",
  37402. value: function toJSON() {
  37403. var params = {};
  37404. if (this.picAsUrl) {
  37405. params.picAsUrl = this.picAsUrl;
  37406. }
  37407. if (this.picAsBase64) {
  37408. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  37409. }
  37410. return Util_Util.toJSON(params);
  37411. }
  37412. }]);
  37413. return WebPrintingJobImage;
  37414. }();
  37415. SuperMap.WebPrintingJobImage = WebPrintingJobImage_WebPrintingJobImage;
  37416. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayers.js
  37417. function WebPrintingJobLayers_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37418. 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); } }
  37419. function WebPrintingJobLayers_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayers_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayers_defineProperties(Constructor, staticProps); return Constructor; }
  37420. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  37421. * This program are made available under the terms of the Apache License, Version 2.0
  37422. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37423. /**
  37424. * @class SuperMap.WebPrintingJobLayers
  37425. * @classdesc 将图例添加到布局的业务图层参数类。
  37426. * @version 10.1.0
  37427. * @category iServer WebPrintingJob
  37428. * @param {Object} option - 初始化参数。
  37429. * @param {string} [option.name] - 表示图层 name 的字符串。此 name 必须唯一,并且必须与定义业务图层的 LegendOptions_layers 元素中的图层 name 匹配。
  37430. */
  37431. var WebPrintingJobLayers_WebPrintingJobLayers = /*#__PURE__*/function () {
  37432. function WebPrintingJobLayers(option) {
  37433. WebPrintingJobLayers_classCallCheck(this, WebPrintingJobLayers);
  37434. /**
  37435. * @member {string} SuperMap.WebPrintingJobLayers.prototype.name
  37436. * @description 图层 name。
  37437. */
  37438. this.name = null;
  37439. /**
  37440. * @member {string} SuperMap.WebPrintingJobLayers.prototype.layerType
  37441. * @description 图层 type。
  37442. */
  37443. this.layerType = null;
  37444. /**
  37445. * @member {string} SuperMap.WebPrintingJobLayers.prototype.url
  37446. * @description 图层 url。
  37447. */
  37448. this.url = null;
  37449. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayers';
  37450. Util_Util.extend(this, option);
  37451. }
  37452. /**
  37453. * @function SuperMap.WebPrintingJobLayers.prototype.destroy
  37454. * @description 释放资源,将引用资源的属性置空。
  37455. */
  37456. WebPrintingJobLayers_createClass(WebPrintingJobLayers, [{
  37457. key: "destroy",
  37458. value: function destroy() {
  37459. this.name = null;
  37460. this.layerType = null;
  37461. this.url = null;
  37462. }
  37463. }]);
  37464. return WebPrintingJobLayers;
  37465. }();
  37466. SuperMap.WebPrintingJobLayers = WebPrintingJobLayers_WebPrintingJobLayers;
  37467. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLegendOptions.js
  37468. function WebPrintingJobLegendOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37469. 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); } }
  37470. function WebPrintingJobLegendOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLegendOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLegendOptions_defineProperties(Constructor, staticProps); return Constructor; }
  37471. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  37472. * This program are made available under the terms of the Apache License, Version 2.0
  37473. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37474. /**
  37475. * @class SuperMap.WebPrintingJobLegendOptions
  37476. * @classdesc Web 打印图例参数类。
  37477. * @version 10.1.0
  37478. * @category iServer WebPrintingJob
  37479. * @param {Object} option - 初始化参数。
  37480. * @param {string} [option.title] - 图例名称。
  37481. * @param {string} [option.picAsUrl] - 图例的图片 url 地址。
  37482. * @param {string} [option.picAsBase64] - 图例的 base64 位图片信息。
  37483. * @param {SuperMap.WebPrintingJobLayers} [option.layers] - 图例的布局业务图层参数类。
  37484. * @param {SuperMap.WebPrintingJobCustomItems} [option.customItems] - 自定义图例元素参数类。
  37485. */
  37486. var WebPrintingJobLegendOptions_WebPrintingJobLegendOptions = /*#__PURE__*/function () {
  37487. function WebPrintingJobLegendOptions(option) {
  37488. WebPrintingJobLegendOptions_classCallCheck(this, WebPrintingJobLegendOptions);
  37489. /**
  37490. * @member {string} SuperMap.WebPrintingJobLegendOptions.prototype.title
  37491. * @description 图例名称。
  37492. */
  37493. this.title = null;
  37494. /**
  37495. * @member {string} [SuperMap.WebPrintingJobLegendOptions.prototype.picAsUrl]
  37496. * @description 图例的图片 url 地址。
  37497. */
  37498. this.picAsUrl = null;
  37499. /**
  37500. * @member {string} [SuperMap.WebPrintingJobLegendOptions.prototype.picAsBase64]
  37501. * @description 图例的 base64 位图片信息。
  37502. */
  37503. this.picAsBase64 = null;
  37504. /**
  37505. * @member {SuperMap.WebPrintingJobLayers} [SuperMap.WebPrintingJobLegendOptions.prototype.layers]
  37506. * @description 图例的布局业务图层参数类。
  37507. */
  37508. this.layers = null;
  37509. /**
  37510. * @member {SuperMap.WebPrintingJobCustomItems} [SuperMap.WebPrintingJobLegendOptions.prototype.customItems]
  37511. * @description 自定义图例元素参数类。
  37512. */
  37513. this.customItems = null;
  37514. this.CLASS_NAME = 'SuperMap.WebPrintingJobLegendOptions';
  37515. Util_Util.extend(this, option);
  37516. }
  37517. /**
  37518. * @function SuperMap.WebPrintingJobLegendOptions.prototype.destroy
  37519. * @description 释放资源,将引用资源的属性置空。
  37520. */
  37521. WebPrintingJobLegendOptions_createClass(WebPrintingJobLegendOptions, [{
  37522. key: "destroy",
  37523. value: function destroy() {
  37524. this.title = null;
  37525. this.picAsUrl = null;
  37526. this.picAsBase64 = null;
  37527. if (this.layers instanceof WebPrintingJobLayers_WebPrintingJobLayers) {
  37528. this.layers.destroy();
  37529. this.layers = null;
  37530. }
  37531. if (this.customItems instanceof WebPrintingJobCustomItems_WebPrintingJobCustomItems) {
  37532. this.customItems.destroy();
  37533. this.customItems = null;
  37534. }
  37535. }
  37536. /**
  37537. * @function SuperMap.WebPrintingJobLegendOptions.prototype.toJSON
  37538. * @description 将 SuperMap.WebPrintingJobLegendOptions 对象转化为 JSON 字符串。
  37539. * @returns {string} 返回转换后的 JSON 字符串。
  37540. */
  37541. }, {
  37542. key: "toJSON",
  37543. value: function toJSON() {
  37544. var params = {
  37545. title: this.title || ""
  37546. };
  37547. if (this.picAsUrl) {
  37548. params.picAsUrl = this.picAsUrl;
  37549. } else if (this.picAsBase64) {
  37550. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  37551. } else if (this.customItems) {
  37552. params.customItems = this.customItems;
  37553. }
  37554. return Util_Util.toJSON(params);
  37555. }
  37556. }]);
  37557. return WebPrintingJobLegendOptions;
  37558. }();
  37559. SuperMap.WebPrintingJobLegendOptions = WebPrintingJobLegendOptions_WebPrintingJobLegendOptions;
  37560. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLittleMapOptions.js
  37561. function WebPrintingJobLittleMapOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37562. 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); } }
  37563. function WebPrintingJobLittleMapOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor, staticProps); return Constructor; }
  37564. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  37565. * This program are made available under the terms of the Apache License, Version 2.0
  37566. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37567. /**
  37568. * @class SuperMap.WebPrintingJobLittleMapOptions
  37569. * @classdesc Web 打印小地图参数类。
  37570. * @version 10.1.0
  37571. * @category iServer WebPrintingJob
  37572. * @param {Object} option - 初始化参数。
  37573. * @param {SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} option.center - 小地图的中心点。
  37574. * @param {number} [option.scale] - 小地图的比例尺。
  37575. * @param {Array.<string>} [option.layerNames] - 指定 WebMap中图层名称的列表,用于渲染小地图。
  37576. * @param {SuperMap.WebPrintingJobImage} [option.image] - 表达小地图的静态图类。
  37577. * @param {SuperMap.WebPrintingJobLayers} [option.layers] - 指定 WebMap 中的 layers 图层类。
  37578. */
  37579. var WebPrintingJobLittleMapOptions_WebPrintingJobLittleMapOptions = /*#__PURE__*/function () {
  37580. function WebPrintingJobLittleMapOptions(option) {
  37581. WebPrintingJobLittleMapOptions_classCallCheck(this, WebPrintingJobLittleMapOptions);
  37582. /**
  37583. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.WebPrintingJobLittleMapOptions.prototype.center
  37584. * @description 小地图的中心点。
  37585. */
  37586. this.center = null;
  37587. /**
  37588. * @member {number} [SuperMap.WebPrintingJobLittleMapOptions.prototype.scale]
  37589. * @description 小地图的比例尺。
  37590. */
  37591. this.scale = null;
  37592. /**
  37593. * @member {Array.<string>} SuperMap.WebPrintingJobLittleMapOptions.prototype.layerNames
  37594. * @description 指定 WebMap中图层名称的列表,用于渲染小地图。
  37595. */
  37596. this.layerNames = null;
  37597. /**
  37598. * @member {SuperMap.WebPrintingJobImage} [SuperMap.WebPrintingJobLittleMapOptions.prototype.image]
  37599. * @description 表达小地图的静态图类。暂不支持
  37600. */
  37601. this.image = null;
  37602. /**
  37603. * @member {SuperMap.WebPrintingJobLayers} [SuperMap.WebPrintingJobLittleMapOptions.prototype.layers]
  37604. * @description 指定 WebMap 中的 layers 图层类。
  37605. */
  37606. this.layers = null;
  37607. this.CLASS_NAME = 'SuperMap.WebPrintingJobLittleMapOptions';
  37608. Util_Util.extend(this, option);
  37609. }
  37610. /**
  37611. * @function SuperMap.WebPrintingJobLittleMapOptions.prototype.destroy
  37612. * @description 释放资源,将引用资源的属性置空。
  37613. */
  37614. WebPrintingJobLittleMapOptions_createClass(WebPrintingJobLittleMapOptions, [{
  37615. key: "destroy",
  37616. value: function destroy() {
  37617. this.center = null;
  37618. this.scale = null;
  37619. this.layerNames = null;
  37620. if (this.image instanceof WebPrintingJobImage_WebPrintingJobImage) {
  37621. this.image.destroy();
  37622. this.image = null;
  37623. }
  37624. if (this.layers instanceof WebPrintingJobLayers_WebPrintingJobLayers) {
  37625. this.layers.destroy();
  37626. this.layers = null;
  37627. }
  37628. }
  37629. /**
  37630. * @function SuperMap.WebPrintingJobLittleMapOptions.prototype.toJSON
  37631. * @description 将 SuperMap.WebPrintingJobLittleMapOptions 对象转化为 JSON 字符串。
  37632. * @returns {string} 返回转换后的 JSON 字符串。
  37633. */
  37634. }, {
  37635. key: "toJSON",
  37636. value: function toJSON() {
  37637. var params = {
  37638. scale: this.scale,
  37639. center: this.center
  37640. };
  37641. if (this.layerNames) {
  37642. params.layerNames = this.layerNames;
  37643. } else if (this.layers) {
  37644. params.layers = this.layers;
  37645. }
  37646. if (this.image) {
  37647. params.image = this.image;
  37648. }
  37649. return Util_Util.toJSON(params);
  37650. }
  37651. }]);
  37652. return WebPrintingJobLittleMapOptions;
  37653. }();
  37654. SuperMap.WebPrintingJobLittleMapOptions = WebPrintingJobLittleMapOptions_WebPrintingJobLittleMapOptions;
  37655. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobNorthArrowOptions.js
  37656. function WebPrintingJobNorthArrowOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37657. 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); } }
  37658. function WebPrintingJobNorthArrowOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor, staticProps); return Constructor; }
  37659. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  37660. * This program are made available under the terms of the Apache License, Version 2.0
  37661. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37662. /**
  37663. * @class SuperMap.WebPrintingJobNorthArrowOptions
  37664. * @classdesc Web 打印地图指北针参数类。
  37665. * @version 10.1.0
  37666. * @category iServer WebPrintingJob
  37667. * @param {Object} option - 初始化参数。
  37668. * @param {string} option.picAsUrl - 指北针的图片 url 地址。
  37669. * @param {string} [option.picAsBase64] - 指北针的base64位图片信息。
  37670. */
  37671. var WebPrintingJobNorthArrowOptions_WebPrintingJobNorthArrowOptions = /*#__PURE__*/function () {
  37672. function WebPrintingJobNorthArrowOptions(option) {
  37673. WebPrintingJobNorthArrowOptions_classCallCheck(this, WebPrintingJobNorthArrowOptions);
  37674. /**
  37675. * @member {string} SuperMap.WebPrintingJobNorthArrowOptions.prototype.picAsUrl
  37676. * @description 指北针的图片 url 地址。
  37677. */
  37678. this.picAsUrl = null;
  37679. /**
  37680. * @member {string} [SuperMap.WebPrintingJobNorthArrowOptions.prototype.picAsBase64]
  37681. * @description 指北针的base64位图片信息。
  37682. */
  37683. this.picAsBase64 = null;
  37684. this.CLASS_NAME = 'SuperMap.WebPrintingJobNorthArrowOptions';
  37685. Util_Util.extend(this, option);
  37686. }
  37687. /**
  37688. * @function SuperMap.WebPrintingJobNorthArrowOptions.prototype.destroy
  37689. * @description 释放资源,将引用资源的属性置空。
  37690. */
  37691. WebPrintingJobNorthArrowOptions_createClass(WebPrintingJobNorthArrowOptions, [{
  37692. key: "destroy",
  37693. value: function destroy() {
  37694. this.picAsUrl = null;
  37695. this.picAsBase64 = null;
  37696. }
  37697. /**
  37698. * @function SuperMap.WebPrintingJobNorthArrowOptions.prototype.toJSON
  37699. * @description 将 SuperMap.WebPrintingJobNorthArrowOptions 对象转化为 JSON 字符串。
  37700. * @returns {string} 返回转换后的 JSON 字符串。
  37701. */
  37702. }, {
  37703. key: "toJSON",
  37704. value: function toJSON() {
  37705. var params = {};
  37706. if (this.picAsUrl) {
  37707. params.picAsUrl = this.picAsUrl;
  37708. } else if (this.picAsBase64) {
  37709. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  37710. }
  37711. return Util_Util.toJSON(params);
  37712. }
  37713. }]);
  37714. return WebPrintingJobNorthArrowOptions;
  37715. }();
  37716. SuperMap.WebPrintingJobNorthArrowOptions = WebPrintingJobNorthArrowOptions_WebPrintingJobNorthArrowOptions;
  37717. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobScaleBarOptions.js
  37718. function WebPrintingJobScaleBarOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37719. 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); } }
  37720. function WebPrintingJobScaleBarOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor, staticProps); return Constructor; }
  37721. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  37722. * This program are made available under the terms of the Apache License, Version 2.0
  37723. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37724. /**
  37725. * @class SuperMap.WebPrintingJobScaleBarOptions
  37726. * @classdesc Web 打印比例尺参数类。
  37727. * @category iServer WebPrintingJob
  37728. * @version 10.1.0
  37729. * @param {Object} option - 初始化参数。
  37730. * @param {string} [option.scaleText] - 比例尺文本信息。例如:1:1000000
  37731. * @param {SuperMap.WebScaleOrientationType} [option.orientation] - 比例尺的方位样式。
  37732. * @param {SuperMap.WebScaleType} [option.type] - 比例尺的样式。
  37733. * @param {number} [option.intervals] - 比例尺条的段数。
  37734. * @param {SuperMap.WebScaleUnit} [option.unit] - 比例尺的单位制。
  37735. */
  37736. var WebPrintingJobScaleBarOptions_WebPrintingJobScaleBarOptions = /*#__PURE__*/function () {
  37737. function WebPrintingJobScaleBarOptions(option) {
  37738. WebPrintingJobScaleBarOptions_classCallCheck(this, WebPrintingJobScaleBarOptions);
  37739. /**
  37740. * @member {string} SuperMap.WebPrintingJobScaleBarOptions.prototype.scaleText
  37741. * @description 比例尺文本信息。
  37742. */
  37743. this.scaleText = null;
  37744. /**
  37745. * @member {SuperMap.WebScaleOrientationType} [SuperMap.WebPrintingJobScaleBarOptions.prototype.orientation]
  37746. * @description 比例尺的方位样式。
  37747. */
  37748. this.orientation = null;
  37749. /**
  37750. * @member {SuperMap.WebScaleType} [SuperMap.WebPrintingJobScaleBarOptions.prototype.type]
  37751. * @description 比例尺的样式。
  37752. */
  37753. this.type = null;
  37754. /**
  37755. * @member {object} [SuperMap.WebPrintingJobScaleBarOptions.prototype.intervals]
  37756. * @description 比例尺条的段数。
  37757. */
  37758. this.intervals = null;
  37759. /**
  37760. * @member {SuperMap.WebScaleUnit} [SuperMap.WebPrintingJobScaleBarOptions.prototype.unit]
  37761. * @description 比例尺的单位制。
  37762. */
  37763. this.unit = null;
  37764. this.CLASS_NAME = 'SuperMap.WebPrintingJobScaleBarOptions';
  37765. Util_Util.extend(this, option);
  37766. }
  37767. /**
  37768. * @function SuperMap.WebPrintingJobScaleBarOptions.prototype.destroy
  37769. * @description 释放资源,将引用资源的属性置空。
  37770. */
  37771. WebPrintingJobScaleBarOptions_createClass(WebPrintingJobScaleBarOptions, [{
  37772. key: "destroy",
  37773. value: function destroy() {
  37774. this.scaleText = null;
  37775. this.orientation = null;
  37776. this.type = null;
  37777. this.intervals = null;
  37778. this.unit = null;
  37779. }
  37780. /**
  37781. * @function SuperMap.WebPrintingJobScaleBarOptions.prototype.toJSON
  37782. * @description 将 SuperMap.WebPrintingJobScaleBarOptions 对象转化为 JSON 字符串。
  37783. * @returns {string} 返回转换后的 JSON 字符串。
  37784. */
  37785. }, {
  37786. key: "toJSON",
  37787. value: function toJSON() {
  37788. var params = {
  37789. scaleText: this.scaleText || "",
  37790. type: this.type || "BAR",
  37791. intervals: this.intervals || "",
  37792. unit: this.unit || "METER"
  37793. };
  37794. if (this.orientation) {
  37795. params.orientation = this.orientation;
  37796. }
  37797. return Util_Util.toJSON(params);
  37798. }
  37799. }]);
  37800. return WebPrintingJobScaleBarOptions;
  37801. }();
  37802. SuperMap.WebPrintingJobScaleBarOptions = WebPrintingJobScaleBarOptions_WebPrintingJobScaleBarOptions;
  37803. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobContent.js
  37804. function WebPrintingJobContent_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37805. 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); } }
  37806. function WebPrintingJobContent_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobContent_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobContent_defineProperties(Constructor, staticProps); return Constructor; }
  37807. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  37808. * This program are made available under the terms of the Apache License, Version 2.0
  37809. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37810. /**
  37811. * @class SuperMap.WebPrintingJobContent
  37812. * @classdesc Web 打印内容参数类。
  37813. * @version 10.1.0
  37814. * @category iServer WebPrintingJob
  37815. * @param {Object} option - 初始化参数。
  37816. * @param {string} option.type - Web 打印内容支持的类型。目前支持的类型:WEBMAP
  37817. * @param {string} [option.url] - 待打印的 SuperMap iPortal WebMap 的 url 地址。例如:http://supermapiportal:8190/iportal/web/maps/{mapid}/map.rjson
  37818. * @param {string} [option.token] - 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  37819. * @param {WebMapSummaryObject} [option.value] - 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 json 表达。如果已填了 url 参数,此参数可不传
  37820. */
  37821. var WebPrintingJobContent_WebPrintingJobContent = /*#__PURE__*/function () {
  37822. function WebPrintingJobContent(option) {
  37823. WebPrintingJobContent_classCallCheck(this, WebPrintingJobContent);
  37824. /**
  37825. * @member {string} SuperMap.WebPrintingJobContent.prototype.type
  37826. * @description Web 打印内容支持的类型。
  37827. */
  37828. this.type = null;
  37829. /**
  37830. * @member {string} [SuperMap.WebPrintingJobContent.prototype.url]
  37831. * @description 待打印的 SuperMap iPortal WebMap 的 url 地址。
  37832. */
  37833. this.url = null;
  37834. /**
  37835. * @member {string} [SuperMap.WebPrintingJobContent.prototype.token]
  37836. * @description 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  37837. */
  37838. this.token = null;
  37839. /**
  37840. * @member {WebMapSummaryObject} [SuperMap.WebPrintingJobContent.prototype.value]
  37841. * @description 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 json 表达。
  37842. */
  37843. this.value = null;
  37844. this.CLASS_NAME = 'SuperMap.WebPrintingJobContent';
  37845. Util_Util.extend(this, option);
  37846. }
  37847. /**
  37848. * @function SuperMap.WebPrintingJobContent.prototype.destroy
  37849. * @description 释放资源,将引用资源的属性置空。
  37850. */
  37851. WebPrintingJobContent_createClass(WebPrintingJobContent, [{
  37852. key: "destroy",
  37853. value: function destroy() {
  37854. this.type = false || "WEBMAP";
  37855. this.url = null;
  37856. this.token = null;
  37857. this.value = null;
  37858. }
  37859. /**
  37860. * @function SuperMap.WebPrintingJobContent.prototype.toJSON
  37861. * @description 将 SuperMap.WebPrintingJobContent 对象转化为 JSON 字符串。
  37862. * @returns {string} 返回转换后的 JSON 字符串。
  37863. */
  37864. }, {
  37865. key: "toJSON",
  37866. value: function toJSON() {
  37867. var params = {
  37868. type: this.type
  37869. };
  37870. if (this.token) {
  37871. params.token = this.token;
  37872. }
  37873. if (this.url) {
  37874. params.url = this.url;
  37875. } else if (this.value) {
  37876. params.value = this.value;
  37877. }
  37878. return Util_Util.toJSON(params);
  37879. }
  37880. }]);
  37881. return WebPrintingJobContent;
  37882. }();
  37883. SuperMap.WebPrintingJobContent = WebPrintingJobContent_WebPrintingJobContent;
  37884. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayoutOptions.js
  37885. function WebPrintingJobLayoutOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37886. 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); } }
  37887. function WebPrintingJobLayoutOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayoutOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayoutOptions_defineProperties(Constructor, staticProps); return Constructor; }
  37888. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  37889. * This program are made available under the terms of the Apache License, Version 2.0
  37890. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37891. /**
  37892. * @class SuperMap.WebPrintingJobLayoutOptions
  37893. * @classdesc Web 打印的布局参数类。
  37894. * @version 10.1.0
  37895. * @category iServer WebPrintingJob
  37896. * @param {Object} option - 初始化参数。
  37897. * @param {string} option.templateName - 布局模板的名称。
  37898. * @param {string} option.title - 地图主标题名称。
  37899. * @param {string} option.subTitle - 地图副标题名称。
  37900. * @param {string} option.author - 地图作者名称。
  37901. * @param {string} option.copyright - 地图版权信息。
  37902. * @param {SuperMap.WebPrintingJobLittleMapOptions} option.littleMapOptions - 小地图参数类。
  37903. * @param {SuperMap.WebPrintingJobLegendOptions} option.legendOptions - 图例参数类。
  37904. * @param {SuperMap.WebPrintingJobScaleBarOptions} [option.scaleBarOptions] - 地图比例尺参数类。
  37905. * @param {SuperMap.WebPrintingJobNorthArrowOptions} [option.northArrowOptions] - 地图指北针参数类。
  37906. */
  37907. var WebPrintingJobLayoutOptions_WebPrintingJobLayoutOptions = /*#__PURE__*/function () {
  37908. function WebPrintingJobLayoutOptions(option) {
  37909. WebPrintingJobLayoutOptions_classCallCheck(this, WebPrintingJobLayoutOptions);
  37910. /**
  37911. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.templateName
  37912. * @description 布局模板的名称。
  37913. */
  37914. this.templateName = null;
  37915. /**
  37916. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.title
  37917. * @description 地图主标题名称。
  37918. */
  37919. this.title = null;
  37920. /**
  37921. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.subTitle
  37922. * @description 地图副标题名称。
  37923. */
  37924. this.subTitle = null;
  37925. /**
  37926. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.author
  37927. * @description 地图作者名称。
  37928. */
  37929. this.author = null;
  37930. /**
  37931. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.copyright
  37932. * @description 地图版权信息。
  37933. */
  37934. this.copyright = null;
  37935. /**
  37936. * @member {SuperMap.WebPrintingJobScaleBarOptions} [SuperMap.WebPrintingJobLayoutOptions.prototype.scaleBarOptions]
  37937. * @description 地图比例尺参数类。
  37938. */
  37939. this.scaleBarOptions = null;
  37940. /**
  37941. * @member {SuperMap.WebPrintingJobNorthArrowOptions} [SuperMap.WebPrintingJobLayoutOptions.prototype.northArrowOptions]
  37942. * @description 地图指北针参数类。
  37943. */
  37944. this.northArrowOptions = null;
  37945. /**
  37946. * @member {SuperMap.WebPrintingJobLittleMapOptions} SuperMap.WebPrintingJobLayoutOptions.prototype.littleMapOptions
  37947. * @description 小地图参数类。
  37948. */
  37949. this.littleMapOptions = null;
  37950. /**
  37951. * @member {SuperMap.WebPrintingJobLegendOptions} SuperMap.WebPrintingJobLayoutOptions.prototype.legendOptions
  37952. * @description 图例参数类。
  37953. */
  37954. this.legendOptions = null;
  37955. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayoutOptions';
  37956. Util_Util.extend(this, option);
  37957. }
  37958. /**
  37959. * @function SuperMap.WebPrintingJobLayoutOptions.prototype.destroy
  37960. * @description 释放资源,将引用资源的属性置空。
  37961. */
  37962. WebPrintingJobLayoutOptions_createClass(WebPrintingJobLayoutOptions, [{
  37963. key: "destroy",
  37964. value: function destroy() {
  37965. this.templateName = null;
  37966. this.title = null;
  37967. this.subTitle = null;
  37968. this.author = null;
  37969. this.copyright = null;
  37970. if (this.scaleBarOptions instanceof WebPrintingJobScaleBarOptions_WebPrintingJobScaleBarOptions) {
  37971. this.scaleBarOptions.destroy();
  37972. this.scaleBarOptions = null;
  37973. }
  37974. if (this.northArrowOptions instanceof WebPrintingJobNorthArrowOptions_WebPrintingJobNorthArrowOptions) {
  37975. this.northArrowOptions.destroy();
  37976. this.northArrowOptions = null;
  37977. }
  37978. if (this.littleMapOptions instanceof WebPrintingJobLittleMapOptions_WebPrintingJobLittleMapOptions) {
  37979. this.littleMapOptions.destroy();
  37980. this.littleMapOptions = null;
  37981. }
  37982. if (this.legendOptions instanceof WebPrintingJobLegendOptions_WebPrintingJobLegendOptions) {
  37983. this.legendOptions.destroy();
  37984. this.legendOptions = null;
  37985. }
  37986. }
  37987. /**
  37988. * @function SuperMap.WebPrintingJobLayoutOptions.prototype.toJSON
  37989. * @description 将 SuperMap.WebPrintingJobLayoutOptions 对象转化为 JSON 字符串。
  37990. * @returns {string} 返回转换后的 JSON 字符串。
  37991. */
  37992. }, {
  37993. key: "toJSON",
  37994. value: function toJSON() {
  37995. var params = {
  37996. templateName: this.templateName,
  37997. title: this.title,
  37998. subTitle: this.subTitle,
  37999. author: this.author,
  38000. copyright: this.copyright
  38001. };
  38002. if (this.scaleBarOptions) {
  38003. params.scaleBarOptions = this.scaleBarOptions;
  38004. }
  38005. if (this.northArrowOptions) {
  38006. params.northArrowOptions = this.northArrowOptions;
  38007. }
  38008. if (this.littleMapOptions) {
  38009. params.littleMapOptions = this.littleMapOptions;
  38010. }
  38011. if (this.legendOptions) {
  38012. params.legendOptions = this.legendOptions;
  38013. }
  38014. return Util_Util.toJSON(params);
  38015. }
  38016. }]);
  38017. return WebPrintingJobLayoutOptions;
  38018. }();
  38019. SuperMap.WebPrintingJobLayoutOptions = WebPrintingJobLayoutOptions_WebPrintingJobLayoutOptions;
  38020. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobExportOptions.js
  38021. function WebPrintingJobExportOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38022. 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); } }
  38023. function WebPrintingJobExportOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobExportOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobExportOptions_defineProperties(Constructor, staticProps); return Constructor; }
  38024. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38025. * This program are made available under the terms of the Apache License, Version 2.0
  38026. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38027. /**
  38028. * @class SuperMap.WebPrintingJobExportOptions
  38029. * @classdesc Web 打印的输出参数类。
  38030. * @version 10.1.0
  38031. * @category iServer WebPrintingJob
  38032. * @param {Object} option - 初始化参数。
  38033. * @param {SuperMap.WebExportFormatType} option.format - Web 打印输出的格式,目前支持:PNG、PDF。
  38034. * @param {number} [option.dpi=96] - Web 打印输出的分辨率,单位为每英寸点数。默认值为 96 dpi。
  38035. * @param {number} [option.scale] - Web 打印输出的地图比例尺。
  38036. * @param {number} [option.rotation] - Web 打印输出的地图角度。
  38037. * @param {SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} [option.center] - Web 打印输出的地图中心点。
  38038. */
  38039. var WebPrintingJobExportOptions_WebPrintingJobExportOptions = /*#__PURE__*/function () {
  38040. function WebPrintingJobExportOptions(option) {
  38041. WebPrintingJobExportOptions_classCallCheck(this, WebPrintingJobExportOptions);
  38042. /**
  38043. * @member {SuperMap.WebExportFormatType} SuperMap.WebPrintingJobExportOptions.prototype.format
  38044. * @description Web 打印输出的格式。
  38045. */
  38046. this.format = null;
  38047. /**
  38048. * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.dpi=96]
  38049. * @description Web 打印输出的分辨率,单位为每英寸点数。
  38050. */
  38051. this.dpi = 96;
  38052. /**
  38053. * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.scale]
  38054. * @description Web 打印输出的地图比例尺。
  38055. */
  38056. this.scale = null;
  38057. /**
  38058. * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.rotation]
  38059. * @description Web 打印输出的地图角度。
  38060. */
  38061. this.rotation = null;
  38062. /**
  38063. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} [SuperMap.WebPrintingJobExportOptions.prototype.center]
  38064. * @description Web 打印输出的地图中心点。
  38065. */
  38066. this.center = null;
  38067. this.CLASS_NAME = 'SuperMap.WebPrintingJobExportOptions';
  38068. Util_Util.extend(this, option);
  38069. }
  38070. /**
  38071. * @function SuperMap.WebPrintingJobExportOptions.prototype.destroy
  38072. * @description 释放资源,将引用资源的属性置空。
  38073. */
  38074. WebPrintingJobExportOptions_createClass(WebPrintingJobExportOptions, [{
  38075. key: "destroy",
  38076. value: function destroy() {
  38077. this.format = null;
  38078. this.dpi = null;
  38079. this.scale = null;
  38080. this.rotation = null;
  38081. this.center = null;
  38082. this.outputSize = null;
  38083. }
  38084. /**
  38085. * @function SuperMap.WebPrintingJobExportOptions.prototype.toJSON
  38086. * @description 将 SuperMap.WebPrintingJobExportOptions 对象转化为 JSON 字符串。
  38087. * @returns {string} 返回转换后的 JSON 字符串。
  38088. */
  38089. }, {
  38090. key: "toJSON",
  38091. value: function toJSON() {
  38092. var params = {
  38093. format: this.format || "PDF",
  38094. dpi: this.dpi,
  38095. scale: this.scale,
  38096. center: this.center
  38097. };
  38098. if (this.rotation) {
  38099. params.rotation = this.rotation;
  38100. }
  38101. if (this.outputSize) {
  38102. params.outputSize = this.outputSize;
  38103. }
  38104. return Util_Util.toJSON(params);
  38105. }
  38106. }]);
  38107. return WebPrintingJobExportOptions;
  38108. }();
  38109. SuperMap.WebPrintingJobExportOptions = WebPrintingJobExportOptions_WebPrintingJobExportOptions;
  38110. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobParameters.js
  38111. function WebPrintingJobParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38112. 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); } }
  38113. function WebPrintingJobParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobParameters_defineProperties(Constructor, staticProps); return Constructor; }
  38114. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38115. * This program are made available under the terms of the Apache License, Version 2.0
  38116. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38117. /**
  38118. * @class SuperMap.WebPrintingJobParameters
  38119. * @category iServer WebPrintingJob
  38120. * @version 10.1.0
  38121. * @classdesc Web 打印参数类
  38122. * @param {Object} options - 初始化参数。
  38123. * @param {SuperMap.WebPrintingJobContent} options.content - Web 打印的内容类。
  38124. * @param {SuperMap.WebPrintingJobLayoutOptions} options.layoutOptions - Web 打印的布局类,包含各种布局元素的设置。
  38125. * @param {SuperMap.WebPrintingJobExportOptions} options.exportOptions - Web 打印的输出类,包含 DPI、页面大小等。
  38126. */
  38127. var WebPrintingJobParameters_WebPrintingJobParameters = /*#__PURE__*/function () {
  38128. function WebPrintingJobParameters(options) {
  38129. WebPrintingJobParameters_classCallCheck(this, WebPrintingJobParameters);
  38130. if (!options) {
  38131. return;
  38132. }
  38133. /**
  38134. * @member {SuperMap.WebPrintingJobContent} SuperMap.WebPrintingJobParameters.prototype.content
  38135. * @description Web 打印的内容类。
  38136. */
  38137. this.content = null;
  38138. /**
  38139. * @member {SuperMap.WebPrintingJobLayoutOptions} SuperMap.WebPrintingJobParameters.prototype.layoutOptions
  38140. * @description Web 打印的布局类,包含各种布局元素的设置。
  38141. */
  38142. this.layoutOptions = null;
  38143. /**
  38144. * @member {SuperMap.WebPrintingJobExportOptions} SuperMap.WebPrintingJobParameters.prototype.exportOptions
  38145. * @description Web 打印的输出类,包含 DPI、页面大小等。
  38146. */
  38147. this.exportOptions = null;
  38148. Util_Util.extend(this, options);
  38149. this.CLASS_NAME = 'SuperMap.WebPrintingJobParameters';
  38150. }
  38151. /**
  38152. * @function SuperMap.WebPrintingJobParameters.prototype.destroy
  38153. * @description 释放资源,将引用资源的属性置空。
  38154. */
  38155. WebPrintingJobParameters_createClass(WebPrintingJobParameters, [{
  38156. key: "destroy",
  38157. value: function destroy() {
  38158. if (this.content instanceof WebPrintingJobContent_WebPrintingJobContent) {
  38159. this.content.destroy();
  38160. this.content = null;
  38161. }
  38162. if (this.layoutOptions instanceof WebPrintingJobLayoutOptions_WebPrintingJobLayoutOptions) {
  38163. this.layoutOptions.destroy();
  38164. this.layoutOptions = null;
  38165. }
  38166. if (this.exportOptions instanceof WebPrintingJobExportOptions_WebPrintingJobExportOptions) {
  38167. this.exportOptions.destroy();
  38168. this.exportOptions = null;
  38169. }
  38170. }
  38171. }]);
  38172. return WebPrintingJobParameters;
  38173. }();
  38174. SuperMap.WebPrintingJobParameters = WebPrintingJobParameters_WebPrintingJobParameters;
  38175. // CONCATENATED MODULE: ./src/common/iServer/WebPrintingService.js
  38176. 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); }
  38177. function WebPrintingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38178. 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); } }
  38179. function WebPrintingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingService_defineProperties(Constructor, staticProps); return Constructor; }
  38180. 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); }
  38181. function WebPrintingService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = WebPrintingService_getPrototypeOf(object); if (object === null) break; } return object; }
  38182. 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); }
  38183. function WebPrintingService_setPrototypeOf(o, p) { WebPrintingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebPrintingService_setPrototypeOf(o, p); }
  38184. 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); }; }
  38185. function WebPrintingService_possibleConstructorReturn(self, call) { if (call && (WebPrintingService_typeof(call) === "object" || typeof call === "function")) { return call; } return WebPrintingService_assertThisInitialized(self); }
  38186. function WebPrintingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38187. 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; } }
  38188. function WebPrintingService_getPrototypeOf(o) { WebPrintingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingService_getPrototypeOf(o); }
  38189. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38190. * This program are made available under the terms of the Apache License, Version 2.0
  38191. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38192. /**
  38193. * @class SuperMap.WebPrintingService
  38194. * @category iServer WebPrintingJob
  38195. * @version 10.1.0
  38196. * @classdesc 打印地图服务基类。
  38197. * @extends {SuperMap.CommonServiceBase}
  38198. * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  38199. * @param {Object} options - 参数。
  38200. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  38201. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38202. * @param {Object} [options.headers] - 请求头。
  38203. */
  38204. var WebPrintingService_WebPrintingService = /*#__PURE__*/function (_CommonServiceBase) {
  38205. WebPrintingService_inherits(WebPrintingService, _CommonServiceBase);
  38206. var _super = WebPrintingService_createSuper(WebPrintingService);
  38207. /**
  38208. * @function SuperMap.WebPrintingService.prototype.constructor
  38209. * @description 打印地图服务基类。
  38210. * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  38211. * @param {Object} options -参数。
  38212. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  38213. */
  38214. function WebPrintingService(url, options) {
  38215. var _this;
  38216. WebPrintingService_classCallCheck(this, WebPrintingService);
  38217. _this = _super.call(this, url, options);
  38218. if (options) {
  38219. Util_Util.extend(WebPrintingService_assertThisInitialized(_this), options);
  38220. }
  38221. _this.CLASS_NAME = 'SuperMap.WebPrintingService';
  38222. if (!_this.url) {
  38223. return WebPrintingService_possibleConstructorReturn(_this);
  38224. }
  38225. return _this;
  38226. }
  38227. /**
  38228. * @function SuperMap.WebPrintingService.prototype.destroy
  38229. * @description 释放资源,将引用资源的属性置空。
  38230. */
  38231. WebPrintingService_createClass(WebPrintingService, [{
  38232. key: "destroy",
  38233. value: function destroy() {
  38234. WebPrintingService_get(WebPrintingService_getPrototypeOf(WebPrintingService.prototype), "destroy", this).call(this);
  38235. }
  38236. /**
  38237. * @function SuperMap.WebPrintingService.prototype.createWebPrintingJob
  38238. * @description 创建 Web 打印任务。
  38239. * @param {SuperMap.WebPrintingJobParameters} params - Web 打印的请求参数。
  38240. */
  38241. }, {
  38242. key: "createWebPrintingJob",
  38243. value: function createWebPrintingJob(params) {
  38244. if (!params) {
  38245. return;
  38246. }
  38247. if (params.layoutOptions) {
  38248. if (params.layoutOptions.legendOptions) {
  38249. !params.layoutOptions.legendOptions.title && (params.layoutOptions.legendOptions.title = '');
  38250. params.layoutOptions.legendOptions.picAsBase64 = params.layoutOptions.legendOptions.picAsBase64 && params.layoutOptions.legendOptions.picAsBase64.replace(/^data:.+;base64,/, '');
  38251. if (params.layoutOptions.legendOptions.customItems && params.layoutOptions.legendOptions.customItems.hasOwnProperty('picAsBase64')) {
  38252. params.layoutOptions.legendOptions.customItems.picAsBase64 = params.layoutOptions.legendOptions.customItems.picAsBase64.replace(/^data:.+;base64,/, '');
  38253. }
  38254. }
  38255. }
  38256. var me = this;
  38257. me.request({
  38258. url: me._processUrl('jobs'),
  38259. method: 'POST',
  38260. data: Util_Util.toJSON(params),
  38261. scope: me,
  38262. success: me.serviceProcessCompleted,
  38263. failure: me.serviceProcessFailed
  38264. });
  38265. }
  38266. /**
  38267. * @function SuperMap.WebPrintingService.prototype.getPrintingJob
  38268. * @description 获取 Web 打印输出文档任务。
  38269. * @param {String} jobId - Web 打印任务 ID
  38270. */
  38271. }, {
  38272. key: "getPrintingJob",
  38273. value: function getPrintingJob(jobId) {
  38274. var me = this;
  38275. var url = me._processUrl("jobs/".concat(jobId));
  38276. me.request({
  38277. url: url,
  38278. method: 'GET',
  38279. scope: me,
  38280. success: function success(result) {
  38281. me.rollingProcess(result, url);
  38282. },
  38283. failure: me.serviceProcessFailed
  38284. });
  38285. }
  38286. /**
  38287. * @function SuperMap.WebPrintingService.prototype.getPrintingJobResult
  38288. * @description 获取 Web 打印任务的输出文档。
  38289. * @param {String} jobId - Web 打印输入文档任务 ID。
  38290. */
  38291. }, {
  38292. key: "getPrintingJobResult",
  38293. value: function getPrintingJobResult(jobId) {
  38294. var me = this;
  38295. me.request({
  38296. url: me._processUrl("jobs/".concat(jobId, "/result")),
  38297. method: 'GET',
  38298. scope: me,
  38299. success: me.serviceProcessCompleted,
  38300. failure: me.serviceProcessFailed
  38301. });
  38302. }
  38303. /**
  38304. * @function SuperMap.WebPrintingService.prototype.getLayoutTemplates
  38305. * @description 查询 Web 打印服务所有可用的模板信息。
  38306. */
  38307. }, {
  38308. key: "getLayoutTemplates",
  38309. value: function getLayoutTemplates() {
  38310. var me = this;
  38311. me.request({
  38312. url: me._processUrl('layouts'),
  38313. method: 'GET',
  38314. scope: me,
  38315. success: me.serviceProcessCompleted,
  38316. failure: me.serviceProcessFailed
  38317. });
  38318. }
  38319. /**
  38320. * @function SuperMap.WebPrintingService.prototype.rollingProcess
  38321. * @description 轮询查询 Web 打印任务。
  38322. * @param {Object} result - 服务器返回的结果对象。
  38323. */
  38324. }, {
  38325. key: "rollingProcess",
  38326. value: function rollingProcess(result, url) {
  38327. var me = this;
  38328. if (!result) {
  38329. return;
  38330. }
  38331. var id = setInterval(function () {
  38332. me.request({
  38333. url: url,
  38334. method: 'GET',
  38335. scope: me,
  38336. success: function success(result) {
  38337. switch (result.status) {
  38338. case 'FINISHED':
  38339. clearInterval(id);
  38340. me.serviceProcessCompleted(result);
  38341. break;
  38342. case 'ERROR':
  38343. clearInterval(id);
  38344. me.serviceProcessFailed(result);
  38345. break;
  38346. case 'RUNNING':
  38347. me.events.triggerEvent('processRunning', result);
  38348. break;
  38349. }
  38350. },
  38351. failure: me.serviceProcessFailed
  38352. });
  38353. }, 1000);
  38354. }
  38355. }, {
  38356. key: "_processUrl",
  38357. value: function _processUrl(appendContent) {
  38358. if (appendContent) {
  38359. return Util_Util.urlPathAppend(this.url, appendContent);
  38360. }
  38361. return this.url;
  38362. }
  38363. }]);
  38364. return WebPrintingService;
  38365. }(CommonServiceBase_CommonServiceBase);
  38366. SuperMap.WebPrintingService = WebPrintingService_WebPrintingService;
  38367. // CONCATENATED MODULE: ./src/common/iServer/index.js
  38368. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38369. * This program are made available under the terms of the Apache License, Version 2.0
  38370. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38371. // CONCATENATED MODULE: ./src/common/online/OnlineResources.js
  38372. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38373. * This program are made available under the terms of the Apache License, Version 2.0
  38374. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38375. /**
  38376. * @enum ServiceStatus
  38377. * @memberOf SuperMap
  38378. * @category iPortal/Online
  38379. * @description 服务发布状态。
  38380. */
  38381. var ServiceStatus = SuperMap.ServiceStatus = {
  38382. /** 不涉及,不可发布。 */
  38383. DOES_NOT_INVOLVE: "DOES_NOT_INVOLVE",
  38384. /** 发布失败。 */
  38385. PUBLISH_FAILED: "PUBLISH_FAILED",
  38386. /** 已发布。 */
  38387. PUBLISHED: "PUBLISHED",
  38388. /** 正在发布。 */
  38389. PUBLISHING: "PUBLISHING",
  38390. /** 未发布。 */
  38391. UNPUBLISHED: "UNPUBLISHED",
  38392. /** 取消服务失败。 */
  38393. UNPUBLISHED_FAILED: "UNPUBLISHED_FAILED"
  38394. };
  38395. /**
  38396. *
  38397. * @enum DataItemType
  38398. * @memberOf SuperMap
  38399. * @category iPortal/Online
  38400. * @description 数据项类型。
  38401. */
  38402. var OnlineResources_DataItemType = SuperMap.DataItemType = {
  38403. /** AUDIO */
  38404. AUDIO: "AUDIO",
  38405. /** COLOR */
  38406. COLOR: "COLOR",
  38407. /** COLORSCHEME */
  38408. COLORSCHEME: "COLORSCHEME",
  38409. /** CSV */
  38410. CSV: "CSV",
  38411. /** EXCEL */
  38412. EXCEL: "EXCEL",
  38413. /** FILLSYMBOL */
  38414. FILLSYMBOL: "FILLSYMBOL",
  38415. /** IMAGE */
  38416. IMAGE: "IMAGE",
  38417. /** LAYERTEMPLATE */
  38418. LAYERTEMPLATE: "LAYERTEMPLATE",
  38419. /** LAYOUTTEMPLATE */
  38420. LAYOUTTEMPLATE: "LAYOUTTEMPLATE",
  38421. /** LINESYMBOL */
  38422. LINESYMBOL: "LINESYMBOL",
  38423. /** MAPTEMPLATE */
  38424. MAPTEMPLATE: "MAPTEMPLATE",
  38425. /** MARKERSYMBOL */
  38426. MARKERSYMBOL: "MARKERSYMBOL",
  38427. /** MBTILES */
  38428. MBTILES: "MBTILES",
  38429. /** PHOTOS */
  38430. PHOTOS: "PHOTOS",
  38431. /** SHP */
  38432. SHP: "SHP",
  38433. /** SMTILES */
  38434. SMTILES: "SMTILES",
  38435. /** SVTILES */
  38436. SVTILES: "SVTILES",
  38437. /** THEMETEMPLATE */
  38438. THEMETEMPLATE: "THEMETEMPLATE",
  38439. /** TPK */
  38440. TPK: "TPK",
  38441. /** UDB */
  38442. UDB: "UDB",
  38443. /** UGCV5 */
  38444. UGCV5: "UGCV5",
  38445. /** UNKNOWN */
  38446. UNKNOWN: "UNKNOWN",
  38447. /** VIDEO */
  38448. VIDEO: "VIDEO",
  38449. /** WORKENVIRONMENT */
  38450. WORKENVIRONMENT: "WORKENVIRONMENT",
  38451. /** WORKSPACE */
  38452. WORKSPACE: "WORKSPACE"
  38453. };
  38454. /**
  38455. * @enum DataItemOrderBy
  38456. * @memberOf SuperMap
  38457. * @category iPortal/Online
  38458. * @description 数据排序字段。
  38459. */
  38460. var DataItemOrderBy = SuperMap.DataItemOrderBy = {
  38461. /** FILENAME */
  38462. FILENAME: "FILENAME",
  38463. /** ID */
  38464. ID: "ID",
  38465. /** LASTMODIFIEDTIME */
  38466. LASTMODIFIEDTIME: "LASTMODIFIEDTIME",
  38467. /** NICKNAME */
  38468. NICKNAME: "NICKNAME",
  38469. /** SERVICESTATUS */
  38470. SERVICESTATUS: "SERVICESTATUS",
  38471. /** SIZE */
  38472. SIZE: "SIZE",
  38473. /** STATUS */
  38474. STATUS: "STATUS",
  38475. /** TYPE */
  38476. TYPE: "TYPE",
  38477. /** UPDATETIME */
  38478. UPDATETIME: "UPDATETIME",
  38479. /** USERNAME */
  38480. USERNAME: "USERNAME"
  38481. };
  38482. /**
  38483. * @enum FilterField
  38484. * @memberOf SuperMap
  38485. * @category iPortal/Online
  38486. * @description 关键字查询时的过滤字段。
  38487. */
  38488. var FilterField = SuperMap.FilterField = {
  38489. /** LINKPAGE */
  38490. LINKPAGE: "LINKPAGE",
  38491. /** LINKPAGE */
  38492. MAPTITLE: "MAPTITLE",
  38493. /** LINKPAGE */
  38494. NICKNAME: "NICKNAME",
  38495. /** LINKPAGE */
  38496. RESTITLE: "RESTITLE",
  38497. /** LINKPAGE */
  38498. USERNAME: "USERNAME"
  38499. };
  38500. // CONCATENATED MODULE: ./src/common/online/OnlineServiceBase.js
  38501. function OnlineServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38502. 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); } }
  38503. function OnlineServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  38504. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38505. * This program are made available under the terms of the Apache License, Version 2.0
  38506. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38507. // import {SecurityManager} from '../security/SecurityManager';
  38508. /**
  38509. * @class SuperMap.OnlineServiceBase
  38510. * @classdesc Online 服务基类(使用 key 作为权限限制的类需要实现此类)。
  38511. * @category iPortal/Online
  38512. * @param {Object} options - 服务参数。
  38513. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38514. * @param {Object} [options.headers] - 请求头。
  38515. */
  38516. var OnlineServiceBase_OnlineServiceBase = /*#__PURE__*/function () {
  38517. function OnlineServiceBase(options) {
  38518. OnlineServiceBase_classCallCheck(this, OnlineServiceBase);
  38519. options = options || {};
  38520. Util_Util.extend(this, options);
  38521. this.serverType = ServerType.ONLINE;
  38522. this.CLASS_NAME = "SuperMap.OnlineServiceBase";
  38523. }
  38524. /**
  38525. * @function SuperMap.OnlineServiceBase.prototype.request
  38526. * @description 请求 online 服务
  38527. * @param {string} [method='GET'] - 请求方式, 'GET', 'PUT', 'POST', 'DELETE'。
  38528. * @param {string} url - 服务地址。
  38529. * @param {Object} param - URL 查询参数。
  38530. * @param {Object} [requestOptions] - http 请求参数, 比如请求头,超时时间等。
  38531. * @returns {Promise} 返回包含请求结果的 Promise 对象。
  38532. */
  38533. OnlineServiceBase_createClass(OnlineServiceBase, [{
  38534. key: "request",
  38535. value: function request(method, url, param) {
  38536. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  38537. url = this.createCredentialUrl(url);
  38538. requestOptions['crossOrigin'] = this.options.crossOrigin;
  38539. requestOptions['headers'] = this.options.headers;
  38540. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  38541. return response.json();
  38542. });
  38543. }
  38544. /**
  38545. * @function SuperMap.OnlineServiceBase.prototype.createCredentialUrl
  38546. * @description 追加授权信息。
  38547. * @param {string} url - 对接的 online 服务地址。
  38548. */
  38549. }, {
  38550. key: "createCredentialUrl",
  38551. value: function createCredentialUrl(url) {
  38552. var newUrl = url,
  38553. key = this.getCredential();
  38554. if (key) {
  38555. var paramStr = "key=" + key;
  38556. var endStr = newUrl.substring(newUrl.length - 1, newUrl.length);
  38557. if (newUrl.indexOf("?") > -1 && endStr === "?") {
  38558. newUrl += paramStr;
  38559. } else if (newUrl.indexOf("?") > -1 && endStr !== "?") {
  38560. newUrl += "&" + paramStr;
  38561. } else {
  38562. newUrl += "?" + paramStr;
  38563. }
  38564. }
  38565. return newUrl;
  38566. } //其子类需要重写该方法,修改其中获取key的字段
  38567. //存储key可能是服务id字段,可能是url,或者是WebAPI类型
  38568. }, {
  38569. key: "getCredential",
  38570. value: function getCredential() {//return SecurityManager.getKey(this.id);
  38571. //或
  38572. //return SecurityManager.getKey(this.serviceUrl);
  38573. }
  38574. }]);
  38575. return OnlineServiceBase;
  38576. }();
  38577. SuperMap.OnlineServiceBase = OnlineServiceBase_OnlineServiceBase;
  38578. // CONCATENATED MODULE: ./src/common/online/OnlineData.js
  38579. 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); }
  38580. function OnlineData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38581. 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); } }
  38582. function OnlineData_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineData_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineData_defineProperties(Constructor, staticProps); return Constructor; }
  38583. 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); }
  38584. function OnlineData_setPrototypeOf(o, p) { OnlineData_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OnlineData_setPrototypeOf(o, p); }
  38585. 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); }; }
  38586. function OnlineData_possibleConstructorReturn(self, call) { if (call && (OnlineData_typeof(call) === "object" || typeof call === "function")) { return call; } return OnlineData_assertThisInitialized(self); }
  38587. function OnlineData_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38588. 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; } }
  38589. function OnlineData_getPrototypeOf(o) { OnlineData_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OnlineData_getPrototypeOf(o); }
  38590. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38591. * This program are made available under the terms of the Apache License, Version 2.0
  38592. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38593. /**
  38594. * @class SuperMap.OnlineData
  38595. * @classdesc Online myData 服务。
  38596. * @category iPortal/Online
  38597. * @param {string} serviceRootUrl - 服务根地址。
  38598. * @param {Object} options - 服务相关参数。
  38599. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38600. * @param {Object} [options.headers] - 请求头。
  38601. */
  38602. var OnlineData_OnlineData = /*#__PURE__*/function (_OnlineServiceBase) {
  38603. OnlineData_inherits(OnlineData, _OnlineServiceBase);
  38604. var _super = OnlineData_createSuper(OnlineData);
  38605. //TODO 目前并没有对接服务支持的所有操作,日后需要补充完整
  38606. function OnlineData(serviceRootUrl, options) {
  38607. var _this;
  38608. OnlineData_classCallCheck(this, OnlineData);
  38609. _this = _super.call(this, serviceRootUrl);
  38610. options = options || {}; //MD5
  38611. _this.MD5 = null; //文件类型。
  38612. _this.type = null; //数据上传者名称。
  38613. _this.userName = null; //文件名称。
  38614. _this.fileName = null; //文件大小,单位为 B 。
  38615. _this.size = null; //服务发布状态。
  38616. _this.serviceStatus = null; //服务 id 。
  38617. _this.serviceId = null; //数据项 id 。
  38618. _this.id = null; //最后修改时间。
  38619. _this.lastModfiedTime = null; //文件状态。
  38620. _this.status = null; //数据文件存储 id 。
  38621. _this.storageId = null; //数据的发布信息。
  38622. _this.publishInfo = null; //数据的权限信息。
  38623. _this.authorizeSetting = null; //用户的昵称。
  38624. _this.nickname = null; //数据的标签。
  38625. _this.tags = []; //数据的描述信息。
  38626. _this.description = null; //数据发布的服务信息集合。
  38627. _this.dataItemServices = null; //数据坐标类型。
  38628. _this.coordType = null; //数据审核信息
  38629. _this.dataCheckResult = null; //数据元数据信息
  38630. _this.dataMetaInfo = null; //数据的缩略图路径。
  38631. _this.thumbnail = null;
  38632. Util_Util.extend(OnlineData_assertThisInitialized(_this), options);
  38633. if (_this.id) {
  38634. _this.serviceUrl = serviceRootUrl + "/" + _this.id;
  38635. }
  38636. _this.CLASS_NAME = "SuperMap.OnlineData";
  38637. return _this;
  38638. }
  38639. /**
  38640. * @function SuperMap.OnlineData.prototype.load
  38641. * @description 通过 URL 请求获取该服务完整信息。
  38642. * @returns {Promise} 返回不包含请求结果的 Promise 对象,请求返回结果自动填充到该类属性中。
  38643. */
  38644. OnlineData_createClass(OnlineData, [{
  38645. key: "load",
  38646. value: function load() {
  38647. if (!this.serviceUrl) {
  38648. return;
  38649. }
  38650. var me = this;
  38651. return me.request("GET", this.serviceUrl).then(function (result) {
  38652. Util_Util.extend(me, result);
  38653. });
  38654. }
  38655. /**
  38656. * @function SuperMap.OnlineData.prototype.getPublishedServices
  38657. * @description 获取数据发布的所有服务。
  38658. * @returns {Object} 数据发布的所有服务。
  38659. */
  38660. }, {
  38661. key: "getPublishedServices",
  38662. value: function getPublishedServices() {
  38663. return this.dataItemServices;
  38664. }
  38665. /**
  38666. * @function SuperMap.OnlineData.prototype.getAuthorizeSetting
  38667. * @description 获取数据的权限信息。
  38668. * @returns {Object} 权限信息。
  38669. */
  38670. }, {
  38671. key: "getAuthorizeSetting",
  38672. value: function getAuthorizeSetting() {
  38673. return this.authorizeSetting;
  38674. }
  38675. }]);
  38676. return OnlineData;
  38677. }(OnlineServiceBase_OnlineServiceBase);
  38678. SuperMap.OnlineData = OnlineData_OnlineData;
  38679. // CONCATENATED MODULE: ./src/common/online/Online.js
  38680. function Online_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38681. 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); } }
  38682. function Online_createClass(Constructor, protoProps, staticProps) { if (protoProps) Online_defineProperties(Constructor.prototype, protoProps); if (staticProps) Online_defineProperties(Constructor, staticProps); return Constructor; }
  38683. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38684. * This program are made available under the terms of the Apache License, Version 2.0
  38685. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38686. /**
  38687. * @class SuperMap.Online
  38688. * @classdesc 对接 SuperMap Online 所有基础服务。
  38689. * @category iPortal/Online
  38690. * @example
  38691. * var online=new SuperMap.Online();
  38692. * var services = online.queryDatas(param);
  38693. * service.then(function(services){
  38694. * var service= services[0];
  38695. * service.updateDataInfo();
  38696. * })
  38697. */
  38698. var Online_Online = /*#__PURE__*/function () {
  38699. //TODO 目前并没有对接Online的所有操作,需要补充完整
  38700. //所有查询返回的是一个Promise,在外部使用的时候通过Promise的then方法获取异步结果
  38701. function Online() {
  38702. Online_classCallCheck(this, Online);
  38703. this.rootUrl = "https://www.supermapol.com";
  38704. this.webUrl = this.rootUrl + "/web";
  38705. var mContentUrl = this.webUrl + "/mycontent";
  38706. this.mDatasUrl = mContentUrl + "/datas";
  38707. this.CLASS_NAME = "SuperMap.Online";
  38708. }
  38709. /**
  38710. * @function SuperMap.Online.prototype.load
  38711. * @description 加载 online,验证 online 是否可用。
  38712. * @returns {Promise} 返回包含网络请求结果的 Promise 对象。
  38713. */
  38714. Online_createClass(Online, [{
  38715. key: "load",
  38716. value: function load() {
  38717. return FetchRequest.get(this.rootUrl).then(function (response) {
  38718. return response;
  38719. });
  38720. }
  38721. /**
  38722. * @function SuperMap.Online.prototype.login
  38723. * @description 登录Online
  38724. */
  38725. }, {
  38726. key: "login",
  38727. value: function login() {
  38728. SecurityManager_SecurityManager.loginOnline(this.rootUrl, true);
  38729. }
  38730. /**
  38731. * @function SuperMap.Online.prototype.queryDatas
  38732. * @description 查询 Online “我的内容” 下 “我的数据” 服务(需要登录状态获取),并返回可操作的服务对象。
  38733. * @param {SuperMap.OnlineQueryDatasParameter} parameter - myDatas 服务资源查询参数。
  38734. * @returns {Promise} 返回包含所有数据服务信息的 Promise 对象。
  38735. */
  38736. }, {
  38737. key: "queryDatas",
  38738. value: function queryDatas(parameter) {
  38739. var me = this,
  38740. url = me.mDatasUrl;
  38741. if (parameter) {
  38742. parameter = parameter.toJSON();
  38743. }
  38744. return FetchRequest.get(url, parameter).then(function (json) {
  38745. if (!json || !json.content || json.content.length < 1) {
  38746. return;
  38747. }
  38748. var services = [],
  38749. contents = json.content,
  38750. len = contents.length;
  38751. for (var i = 0; i < len; i++) {
  38752. var content = contents[i];
  38753. var service = new OnlineData_OnlineData(me.mDatasUrl, content);
  38754. services.push(service);
  38755. }
  38756. return services;
  38757. });
  38758. }
  38759. }]);
  38760. return Online;
  38761. }();
  38762. SuperMap.Online = Online_Online;
  38763. // CONCATENATED MODULE: ./src/common/online/OnlineQueryDatasParameter.js
  38764. function OnlineQueryDatasParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38765. 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); } }
  38766. function OnlineQueryDatasParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineQueryDatasParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineQueryDatasParameter_defineProperties(Constructor, staticProps); return Constructor; }
  38767. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38768. * This program are made available under the terms of the Apache License, Version 2.0
  38769. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38770. /**
  38771. * @class SuperMap.OnlineQueryDatasParameter
  38772. * @classdesc myDatas 服务资源查询参数。
  38773. * @category iPortal/Online
  38774. * @param {Object} options - 查询参数。
  38775. */
  38776. var OnlineQueryDatasParameter_OnlineQueryDatasParameter = /*#__PURE__*/function () {
  38777. function OnlineQueryDatasParameter(options) {
  38778. OnlineQueryDatasParameter_classCallCheck(this, OnlineQueryDatasParameter);
  38779. options = options || {};
  38780. /**
  38781. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.userNames
  38782. * @description 数据作者名。可以根据数据作者名查询,默认查询全部。
  38783. */
  38784. this.userNames = null;
  38785. /**
  38786. * @member {Array.<Object>} SuperMap.OnlineQueryDatasParameter.prototype.types
  38787. * @description 数据类型。
  38788. */
  38789. this.types = null;
  38790. /**
  38791. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.fileName
  38792. * @description 文件名称。
  38793. */
  38794. this.fileName = null;
  38795. /**
  38796. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.serviceStatuses
  38797. * @description 服务发布状态。
  38798. */
  38799. this.serviceStatuses = null;
  38800. /**
  38801. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.serviceId
  38802. * @description 服务 ID。
  38803. */
  38804. this.serviceId = null;
  38805. /**
  38806. * @member {Array.<integer>} SuperMap.OnlineQueryDatasParameter.prototype.ids
  38807. * @description 由数据项 ID 组成的整型数组。
  38808. */
  38809. this.ids = null;
  38810. /**
  38811. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.keywords
  38812. * @description 关键字。
  38813. */
  38814. this.keywords = null;
  38815. /**
  38816. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.orderBy
  38817. * @description 排序字段。
  38818. */
  38819. this.orderBy = null;
  38820. /**
  38821. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.tags
  38822. * @description 数据的标签。
  38823. */
  38824. this.tags = null;
  38825. /**
  38826. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.filterFields
  38827. * @description 用于关键字查询时的过滤字段。
  38828. */
  38829. this.filterFields = null;
  38830. Util_Util.extend(this, options);
  38831. this.CLASS_NAME = "SuperMap.OnlineQueryDatasParameter";
  38832. }
  38833. /**
  38834. * @function SuperMap.OnlineQueryDatasParameter.prototype.toJSON
  38835. * @description 返回对应的 JSON 对象。
  38836. * @returns {Object} 对应的 JSON 对象。
  38837. */
  38838. OnlineQueryDatasParameter_createClass(OnlineQueryDatasParameter, [{
  38839. key: "toJSON",
  38840. value: function toJSON() {
  38841. var me = this;
  38842. var jsonObj = {
  38843. "types": me.types,
  38844. "fileName": me.fileName,
  38845. "serviceStatuses": me.serviceStatuses,
  38846. "serviceId": me.serviceId,
  38847. "ids": me.ids,
  38848. "keywords": me.keywords,
  38849. "orderBy": me.orderBy,
  38850. "tags": me.tags,
  38851. "filterFields": me.filterFields
  38852. };
  38853. for (var key in jsonObj) {
  38854. if (jsonObj[key] == null) {
  38855. delete jsonObj[key];
  38856. }
  38857. }
  38858. return jsonObj;
  38859. }
  38860. }]);
  38861. return OnlineQueryDatasParameter;
  38862. }();
  38863. SuperMap.OnlineQueryDatasParameter = OnlineQueryDatasParameter_OnlineQueryDatasParameter;
  38864. // CONCATENATED MODULE: ./src/common/online/index.js
  38865. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38866. * This program are made available under the terms of the Apache License, Version 2.0
  38867. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38868. // CONCATENATED MODULE: ./src/common/security/KeyServiceParameter.js
  38869. function KeyServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38870. 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); } }
  38871. function KeyServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KeyServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KeyServiceParameter_defineProperties(Constructor, staticProps); return Constructor; }
  38872. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38873. * This program are made available under the terms of the Apache License, Version 2.0
  38874. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38875. /**
  38876. * @class SuperMap.KeyServiceParameter
  38877. * @classdesc key申请参数
  38878. * @category Security
  38879. * @param {Object} options - 参数。
  38880. * @param {string} options.name - 申请服务名称。
  38881. * @param {number} options.serviceIds - 服务 ID。
  38882. * @param {SuperMap.ClientType} [options.clientType=SuperMap.ClientType.SERVER] - 服务端类型。
  38883. * @param {number} options.limitation - 有效期
  38884. */
  38885. var KeyServiceParameter_KeyServiceParameter = /*#__PURE__*/function () {
  38886. function KeyServiceParameter(options) {
  38887. KeyServiceParameter_classCallCheck(this, KeyServiceParameter);
  38888. this.name = null;
  38889. this.serviceIds = null;
  38890. this.clientType = ClientType.SERVER;
  38891. this.limitation = null;
  38892. Util_Util.extend(this, options);
  38893. this.CLASS_NAME = "SuperMap.KeyServiceParameter";
  38894. }
  38895. /**
  38896. * @function SuperMap.KeyServiceParameter.prototype.toJSON
  38897. * @description 转换成 JSON 对象
  38898. * @returns {Object} 参数的 JSON 对象
  38899. */
  38900. KeyServiceParameter_createClass(KeyServiceParameter, [{
  38901. key: "toJSON",
  38902. value: function toJSON() {
  38903. return {
  38904. name: this.name,
  38905. serviceIds: this.serviceIds,
  38906. clientType: this.clientType,
  38907. limitation: this.limitation
  38908. };
  38909. }
  38910. }]);
  38911. return KeyServiceParameter;
  38912. }();
  38913. SuperMap.KeyServiceParameter = KeyServiceParameter_KeyServiceParameter;
  38914. // CONCATENATED MODULE: ./src/common/security/ServerInfo.js
  38915. function ServerInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38916. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38917. * This program are made available under the terms of the Apache License, Version 2.0
  38918. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38919. /**
  38920. * @class SuperMap.ServerInfo
  38921. * @classdesc 服务器信息(安全相关),包含服务器类型,服务地址,token服务地址等
  38922. * @category Security
  38923. * @param {string} type - 服务器类型
  38924. * @param {Object} options - 服务器信息相关可选参数。
  38925. * @param {string} options.server - 服务器地址,如:http://supermapiserver:8090/iserver
  38926. * @param {string} [options.tokenServiceUrl] - 如:http://supermapiserver:8090/iserver/services/security/tokens.json
  38927. * @param {string} [options.keyServiceUrl] - 如:http://supermapiserver:8092/web/mycontent/keys/register.json
  38928. */
  38929. var ServerInfo_ServerInfo = function ServerInfo(type, options) {
  38930. ServerInfo_classCallCheck(this, ServerInfo);
  38931. /**
  38932. * @member {SuperMap.ServerType} SuperMap.ServerInfo.prototype.type
  38933. * @description 服务器类型
  38934. */
  38935. this.type = type;
  38936. /**
  38937. * @member {string} SuperMap.ServerInfo.prototype.server
  38938. * @description 服务器地址
  38939. */
  38940. this.server = null;
  38941. /**
  38942. * @member {string} [SuperMap.ServerInfo.prototype.tokenServiceUrl]
  38943. * @description 如:http://supermapiserver:8090/iserver/services/security/tokens.json
  38944. */
  38945. this.tokenServiceUrl = null;
  38946. /**
  38947. * @member {string} [SuperMap.ServerInfo.prototype.keyServiceUrl]
  38948. * @description 如:http://supermapiserver:8092/web/mycontent/keys/register.json
  38949. */
  38950. this.keyServiceUrl = null;
  38951. Util_Util.extend(this, options);
  38952. this.CLASS_NAME = "SuperMap.ServerInfo";
  38953. this.type = this.type || ServerType.ISERVER;
  38954. if (!this.server) {
  38955. console.error('server url require is not undefined');
  38956. } // var patten = /http:\/\/([^\/]+)/i;
  38957. //this.server = this.server.match(patten)[0];
  38958. var tokenServiceSuffix = "/services/security/tokens";
  38959. if (this.type === ServerType.ISERVER && this.server.indexOf("iserver") < 0) {
  38960. tokenServiceSuffix = "/iserver" + tokenServiceSuffix;
  38961. }
  38962. if (!this.tokenServiceUrl) {
  38963. this.tokenServiceUrl = Util_Util.urlPathAppend(this.server, tokenServiceSuffix);
  38964. }
  38965. if (!this.keyServiceUrl) {
  38966. if (this.type === ServerType.IPORTAL) {
  38967. this.keyServiceUrl = Util_Util.urlPathAppend(this.server, "/web/mycontent/keys/register");
  38968. } else if (this.type === ServerType.ONLINE) {
  38969. this.keyServiceUrl = Util_Util.urlPathAppend(this.server, "/web/mycontent/keys");
  38970. }
  38971. }
  38972. };
  38973. SuperMap.ServerInfo = ServerInfo_ServerInfo;
  38974. // CONCATENATED MODULE: ./src/common/security/TokenServiceParameter.js
  38975. function TokenServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38976. 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); } }
  38977. function TokenServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TokenServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TokenServiceParameter_defineProperties(Constructor, staticProps); return Constructor; }
  38978. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  38979. * This program are made available under the terms of the Apache License, Version 2.0
  38980. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38981. /**
  38982. * @class SuperMap.TokenServiceParameter
  38983. * @classdesc token 申请参数。
  38984. * @category Security
  38985. * @param {Object} options - token 申请参数。
  38986. * @param {string} options.username - 用户名。
  38987. * @param {string} options.password - 密码。
  38988. * @param {SuperMap.ClientType} [options.clientType='SuperMap.ClientType.NONE'] - token 申请的客户端标识类型。
  38989. * @param {string} [options.ip] - clientType=IP 时,必选。
  38990. * @param {string} [options.referer] -clientType=Referer 时,必选。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  38991. * @param {number} [options.expiration=60] - 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  38992. *
  38993. *
  38994. */
  38995. var TokenServiceParameter_TokenServiceParameter = /*#__PURE__*/function () {
  38996. function TokenServiceParameter(options) {
  38997. TokenServiceParameter_classCallCheck(this, TokenServiceParameter);
  38998. /**
  38999. * @member {string} SuperMap.TokenServiceParameter.prototype.userName
  39000. * @description 用户名。
  39001. */
  39002. this.userName = null;
  39003. /**
  39004. * @member {string} SuperMap.TokenServiceParameter.prototype.password
  39005. * @description 密码。
  39006. */
  39007. this.password = null;
  39008. /**
  39009. * @member {SuperMap.ClientType} SuperMap.TokenServiceParameter.prototype.clientType
  39010. * @description token 申请的客户端标识类型。
  39011. */
  39012. this.clientType = ClientType.NONE;
  39013. /**
  39014. * @member {string} [SuperMap.TokenServiceParameter.prototype.ip]
  39015. * @description clientType=IP 时,必选。
  39016. */
  39017. this.ip = null;
  39018. /**
  39019. * @member {string} [SuperMap.TokenServiceParameter.prototype.referer]
  39020. * @description clientType=Referer 时,必选。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  39021. */
  39022. this.referer = null;
  39023. /**
  39024. * @member {number} SuperMap.TokenServiceParameter.prototype.expiration
  39025. * @description 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  39026. */
  39027. this.expiration = 60;
  39028. Util_Util.extend(this, options);
  39029. this.CLASS_NAME = "SuperMap.TokenServiceParameter";
  39030. }
  39031. /**
  39032. * @function SuperMap.TokenServiceParameter.prototype.toJSON
  39033. * @description 将所有信息转成 JSON 字符串
  39034. * @returns {string} 参数的 JSON 字符串
  39035. */
  39036. TokenServiceParameter_createClass(TokenServiceParameter, [{
  39037. key: "toJSON",
  39038. value: function toJSON() {
  39039. return {
  39040. userName: this.userName,
  39041. password: this.password,
  39042. clientType: this.clientType,
  39043. ip: this.ip,
  39044. referer: this.referer,
  39045. expiration: this.expiration
  39046. };
  39047. }
  39048. }]);
  39049. return TokenServiceParameter;
  39050. }();
  39051. SuperMap.TokenServiceParameter = TokenServiceParameter_TokenServiceParameter;
  39052. // CONCATENATED MODULE: ./src/common/security/index.js
  39053. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  39054. * This program are made available under the terms of the Apache License, Version 2.0
  39055. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39056. // EXTERNAL MODULE: external "function(){try{return elasticsearch}catch(e){return {}}}()"
  39057. var external_function_try_return_elasticsearch_catch_e_return_ = __webpack_require__(7);
  39058. var external_function_try_return_elasticsearch_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_elasticsearch_catch_e_return_);
  39059. // CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/ElasticSearch.js
  39060. function ElasticSearch_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39061. 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); } }
  39062. function ElasticSearch_createClass(Constructor, protoProps, staticProps) { if (protoProps) ElasticSearch_defineProperties(Constructor.prototype, protoProps); if (staticProps) ElasticSearch_defineProperties(Constructor, staticProps); return Constructor; }
  39063. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  39064. * This program are made available under the terms of the Apache License, Version 2.0
  39065. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39066. /**
  39067. * @class SuperMap.ElasticSearch
  39068. * @classdesc ElasticSearch服务类。
  39069. * @category ElasticSearch
  39070. * @param {string} url - ElasticSearch服务地址。
  39071. * @param {Object} options - 参数。
  39072. * @param {function} [options.change] - 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  39073. * @param {boolean} [options.openGeoFence=false] - 是否开启地理围栏验证,默认为不开启。
  39074. * @param {function} [options.outOfGeoFence] - 数据超出地理围栏后执行的函数。
  39075. * @param {Object} [options.geoFence] - 地理围栏。
  39076. */
  39077. var ElasticSearch_ElasticSearch = /*#__PURE__*/function () {
  39078. function ElasticSearch(url, options) {
  39079. ElasticSearch_classCallCheck(this, ElasticSearch);
  39080. options = options || {};
  39081. /**
  39082. * @member {string} SuperMap.ElasticSearch.prototype.url
  39083. * @description ElasticSearch服务地址
  39084. */
  39085. this.url = url;
  39086. /**
  39087. * @member {Object} SuperMap.ElasticSearch.prototype.client
  39088. * @description client ES客户端
  39089. */
  39090. this.client = new external_function_try_return_elasticsearch_catch_e_return_default.a.Client({
  39091. host: this.url
  39092. });
  39093. /**
  39094. * @deprecated
  39095. * @member {function} [SuperMap.ElasticSearch.prototype.change]
  39096. * @description 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  39097. */
  39098. this.change = null;
  39099. /**
  39100. * @member {boolean} [SuperMap.ElasticSearch.prototype.openGeoFence=false]
  39101. * @description 是否开启地理围栏验证,默认为不开启。
  39102. */
  39103. this.openGeoFence = false;
  39104. /**
  39105. * @member {function} [SuperMap.ElasticSearch.prototype.outOfGeoFence]
  39106. * @description 数据超出地理围栏后执行的函数
  39107. */
  39108. this.outOfGeoFence = null;
  39109. /**
  39110. * @member {Object} [SuperMap.ElasticSearch.prototype.geoFence]
  39111. * @description 地理围栏
  39112. * @example {
  39113. * radius: 1000,//单位是m
  39114. * center: [104.40, 30.43],
  39115. * unit: 'meter|degree'
  39116. * }
  39117. */
  39118. this.geoFence = null;
  39119. /*
  39120. * Constant: EVENT_TYPES
  39121. * {Array.<String>}
  39122. * 此类支持的事件类型。
  39123. *
  39124. */
  39125. this.EVENT_TYPES = ['change', 'error', 'outOfGeoFence'];
  39126. /**
  39127. * @member {SuperMap.Events} SuperMap.ElasticSearch.prototype.events
  39128. * @description 事件
  39129. */
  39130. this.events = new Events_Events(this, null, this.EVENT_TYPES);
  39131. /**
  39132. * @member {Object} SuperMap.ElasticSearch.prototype.eventListeners
  39133. * @description 听器对象,在构造函数中设置此参数(可选),对 MapService 支持的两个事件 processCompleted 、processFailed 进行监听,
  39134. * 相当于调用 SuperMap.Events.on(eventListeners)。
  39135. */
  39136. this.eventListeners = null;
  39137. Util_Util.extend(this, options);
  39138. if (this.eventListeners instanceof Object) {
  39139. this.events.on(this.eventListeners);
  39140. }
  39141. }
  39142. /**
  39143. * @function SuperMap.ElasticSearch.prototype.setGeoFence
  39144. * @description 设置地理围栏,openGeoFence参数为true的时候,设置的地理围栏才生效。
  39145. * @param {SuperMap.Geometry} geoFence - 地理围栏。
  39146. */
  39147. ElasticSearch_createClass(ElasticSearch, [{
  39148. key: "setGeoFence",
  39149. value: function setGeoFence(geoFence) {
  39150. this.geoFence = geoFence;
  39151. }
  39152. /**
  39153. * @function SuperMap.ElasticSearch.prototype.bulk
  39154. * @description 批量操作API,允许执行多个索引/删除操作。
  39155. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk}</br>
  39156. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html}</br>
  39157. * @param {Object} params - 参数。
  39158. * @param {function} callback - 回调函数。
  39159. */
  39160. }, {
  39161. key: "bulk",
  39162. value: function bulk(params, callback) {
  39163. return this.client.bulk(params, callback);
  39164. }
  39165. /**
  39166. * @function SuperMap.ElasticSearch.prototype.clearScroll
  39167. * @description 通过指定scroll参数进行查询来清除已经创建的scroll请求。
  39168. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-clearscroll}</br>
  39169. *更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  39170. * @param {Object} params - 参数。
  39171. * @param {function} callback - 回调函数。
  39172. */
  39173. }, {
  39174. key: "clearScroll",
  39175. value: function clearScroll(params, callback) {
  39176. return this.client.clearScroll(params, callback);
  39177. }
  39178. /**
  39179. * @function SuperMap.ElasticSearch.prototype.count
  39180. * @description 获取集群、索引、类型或查询的文档个数。
  39181. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-count}</br>
  39182. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html}</br>
  39183. * @param {Object} params - 参数。
  39184. * @param {function} callback - 回调函数。
  39185. */
  39186. }, {
  39187. key: "count",
  39188. value: function count(params, callback) {
  39189. return this.client.count(params, callback);
  39190. }
  39191. /**
  39192. * @function SuperMap.ElasticSearch.prototype.count
  39193. * @description 在特定索引中添加一个类型化的JSON文档,使其可搜索。如果具有相同index,type且id已经存在的文档将发生错误。</br>
  39194. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-create}
  39195. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}
  39196. * @param {Object} params - 参数。
  39197. * @param {function} callback - 回调函数。
  39198. */
  39199. }, {
  39200. key: "create",
  39201. value: function create(params, callback) {
  39202. return this.client.create(params, callback);
  39203. }
  39204. /**
  39205. * @function SuperMap.ElasticSearch.prototype.delete
  39206. * @description 根据其ID从特定索引中删除键入的JSON文档。
  39207. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-delete}</br>
  39208. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html}</br>
  39209. * @param {Object} params - 参数。
  39210. * @param {function} callback - 回调函数。
  39211. */
  39212. }, {
  39213. key: "delete",
  39214. value: function _delete(params, callback) {
  39215. return this.client["delete"](params, callback);
  39216. }
  39217. /**
  39218. * @function SuperMap.ElasticSearch.prototype.delete
  39219. * @description 根据其ID从特定索引中删除键入的JSON文档。
  39220. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletebyquery}</br>
  39221. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html}</br>
  39222. * @param {Object} params - 参数。
  39223. * @param {function} callback - 回调函数。
  39224. */
  39225. }, {
  39226. key: "deleteByQuery",
  39227. value: function deleteByQuery(params, callback) {
  39228. return this.client.deleteByQuery(params, callback);
  39229. }
  39230. /**
  39231. * @function SuperMap.ElasticSearch.prototype.delete
  39232. * @description 根据其ID删除脚本。</br>
  39233. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletescript}</br>
  39234. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  39235. * @param {Object} params - 参数。
  39236. * @param {function} callback - 回调函数。
  39237. */
  39238. }, {
  39239. key: "deleteScript",
  39240. value: function deleteScript(params, callback) {
  39241. return this.client.deleteScript(params, callback);
  39242. }
  39243. /**
  39244. * @function SuperMap.ElasticSearch.prototype.deleteTemplate
  39245. * @description 根据其ID删除模板。</br>
  39246. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletetemplate}</br>
  39247. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  39248. * @param {Object} params - 参数。
  39249. * @param {function} callback - 回调函数。
  39250. */
  39251. }, {
  39252. key: "deleteTemplate",
  39253. value: function deleteTemplate(params, callback) {
  39254. return this.client.deleteTemplate(params, callback);
  39255. }
  39256. /**
  39257. * @function SuperMap.ElasticSearch.prototype.exists
  39258. * @description 检查给定文档是否存在。</br>
  39259. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-exists}</br>
  39260. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  39261. * @param {Object} params - 参数。
  39262. * @param {function} callback - 回调函数。
  39263. */
  39264. }, {
  39265. key: "exists",
  39266. value: function exists(params, callback) {
  39267. return this.client.exists(params, callback);
  39268. }
  39269. /**
  39270. * @function SuperMap.ElasticSearch.prototype.existsSource
  39271. * @description 检查资源是否存在。</br>
  39272. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-existssource}</br>
  39273. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  39274. * @param {Object} params - 参数。
  39275. * @param {function} callback - 回调函数。
  39276. */
  39277. }, {
  39278. key: "existsSource",
  39279. value: function existsSource(params, callback) {
  39280. return this.client.existsSource(params, callback);
  39281. }
  39282. /**
  39283. * @function SuperMap.ElasticSearch.prototype.explain
  39284. * @description 提供与特定查询相关的特定文档分数的详细信息。它还会告诉您文档是否与指定的查询匹配。</br>
  39285. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-explain}</br>
  39286. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html}</br>
  39287. * @param {Object} params - 参数。
  39288. * @param {function} callback - 回调函数。
  39289. */
  39290. }, {
  39291. key: "explain",
  39292. value: function explain(params, callback) {
  39293. return this.client.explain(params, callback);
  39294. }
  39295. /**
  39296. * @function SuperMap.ElasticSearch.prototype.fieldCaps
  39297. * @description 允许检索多个索引之间的字段的功能。(实验性API,可能会在未来版本中删除)</br>
  39298. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-fieldcaps}</br>
  39299. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html}</br>
  39300. * @param {Object} params - 参数。
  39301. * @param {function} callback - 回调函数。
  39302. */
  39303. }, {
  39304. key: "fieldCaps",
  39305. value: function fieldCaps(params, callback) {
  39306. return this.client.fieldCaps(params, callback);
  39307. }
  39308. /**
  39309. * @function SuperMap.ElasticSearch.prototype.get
  39310. * @description 从索引获取一个基于其id的类型的JSON文档。</br>
  39311. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-get}</br>
  39312. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  39313. * @param {Object} params - 参数。
  39314. * @param {function} callback - 回调函数。
  39315. */
  39316. }, {
  39317. key: "get",
  39318. value: function get(params, callback) {
  39319. return this.client.get(params, callback);
  39320. }
  39321. /**
  39322. * @function SuperMap.ElasticSearch.prototype.getScript
  39323. * @description 获取脚本。</br>
  39324. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getscript}</br>
  39325. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  39326. * @param {Object} params - 参数。
  39327. * @param {function} callback - 回调函数。
  39328. */
  39329. }, {
  39330. key: "getScript",
  39331. value: function getScript(params, callback) {
  39332. return this.client.getScript(params, callback);
  39333. }
  39334. /**
  39335. * @function SuperMap.ElasticSearch.prototype.getSource
  39336. * @description 通过索引,类型和ID获取文档的源。</br>
  39337. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getsource}</br>
  39338. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  39339. * @param {Object} params - 参数。
  39340. * @param {function} callback - 回调函数。
  39341. */
  39342. }, {
  39343. key: "getSource",
  39344. value: function getSource(params, callback) {
  39345. return this.client.getSource(params, callback);
  39346. }
  39347. /**
  39348. * @function SuperMap.ElasticSearch.prototype.getTemplate
  39349. * @description 获取模板。</br>
  39350. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-gettemplate}</br>
  39351. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  39352. * @param {Object} params - 参数。
  39353. * @param {function} callback - 回调函数。
  39354. */
  39355. }, {
  39356. key: "getTemplate",
  39357. value: function getTemplate(params, callback) {
  39358. return this.client.getTemplate(params, callback);
  39359. }
  39360. /**
  39361. * @function SuperMap.ElasticSearch.prototype.index
  39362. * @description 在索引中存储一个键入的JSON文档,使其可搜索。</br>
  39363. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-index}</br>
  39364. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}</br>
  39365. * @param {Object} params - 参数。
  39366. * @param {function} callback - 回调函数。
  39367. */
  39368. }, {
  39369. key: "index",
  39370. value: function index(params, callback) {
  39371. return this.client.index(params, callback);
  39372. }
  39373. /**
  39374. * @function SuperMap.ElasticSearch.prototype.info
  39375. * @description 从当前集群获取基本信息。</br>
  39376. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-info}</br>
  39377. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  39378. * @param {Object} params - 参数。
  39379. * @param {function} callback - 回调函数。
  39380. */
  39381. }, {
  39382. key: "info",
  39383. value: function info(params, callback) {
  39384. return this.client.info(params, callback);
  39385. }
  39386. /**
  39387. * @function SuperMap.ElasticSearch.prototype.mget
  39388. * @description 根据索引,类型(可选)和ids来获取多个文档。mget所需的主体可以采用两种形式:文档位置数组或文档ID数组。</br>
  39389. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mget}</br>
  39390. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html}</br>
  39391. * @param {Object} params - 参数。
  39392. * @param {function} callback - 回调函数。
  39393. */
  39394. }, {
  39395. key: "mget",
  39396. value: function mget(params, callback) {
  39397. return this.client.mget(params, callback);
  39398. }
  39399. /**
  39400. * @function SuperMap.ElasticSearch.prototype.msearch
  39401. * @description 在同一请求中执行多个搜索请求。</br>
  39402. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch}</br>
  39403. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html}</br>
  39404. * @param {Object} params - 参数。
  39405. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  39406. * 回调参数:error,response。结果存储在response.responses中
  39407. */
  39408. }, {
  39409. key: "msearch",
  39410. value: function msearch(params, callback) {
  39411. var me = this;
  39412. return me.client.msearch(params).then(function (resp) {
  39413. me._update(resp.responses, callback);
  39414. return resp;
  39415. }, function (err) {
  39416. callback(err);
  39417. me.events.triggerEvent('error', {
  39418. error: err
  39419. });
  39420. return err;
  39421. });
  39422. }
  39423. /**
  39424. * @function SuperMap.ElasticSearch.prototype.msearchTemplate
  39425. * @description 在同一请求中执行多个搜索模板请求。</br>
  39426. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearchtemplate}</br>
  39427. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  39428. * @param {Object} params - 参数。
  39429. * @param {function} callback - 回调函数。
  39430. */
  39431. }, {
  39432. key: "msearchTemplate",
  39433. value: function msearchTemplate(params, callback) {
  39434. return this.client.msearchTemplate(params, callback);
  39435. }
  39436. /**
  39437. * @function SuperMap.ElasticSearch.prototype.mtermvectors
  39438. * @description 多termvectors API允许一次获得多个termvectors。</br>
  39439. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mtermvectors}</br>
  39440. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html}</br>
  39441. * @param {Object} params - 参数。
  39442. * @param {function} callback - 回调函数。
  39443. */
  39444. }, {
  39445. key: "mtermvectors",
  39446. value: function mtermvectors(params, callback) {
  39447. return this.client.mtermvectors(params, callback);
  39448. }
  39449. /**
  39450. * @function SuperMap.ElasticSearch.prototype.ping
  39451. * @description 测试连接。</br>
  39452. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-ping}</br>
  39453. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  39454. * @param {Object} params - 参数。
  39455. * @param {function} callback - 回调函数。
  39456. */
  39457. }, {
  39458. key: "ping",
  39459. value: function ping(params, callback) {
  39460. return this.client.ping(params, callback);
  39461. }
  39462. /**
  39463. * @function SuperMap.ElasticSearch.prototype.putScript
  39464. * @description 添加脚本。</br>
  39465. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-putscript}</br>
  39466. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  39467. * @param {Object} params - 参数。
  39468. * @param {function} callback - 回调函数。
  39469. */
  39470. }, {
  39471. key: "putScript",
  39472. value: function putScript(params, callback) {
  39473. return this.client.putScript(params, callback);
  39474. }
  39475. /**
  39476. * @function SuperMap.ElasticSearch.prototype.putTemplate
  39477. * @description 添加模板。</br>
  39478. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-puttemplate}</br>
  39479. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  39480. * @param {Object} params - 参数。
  39481. * @param {function} callback - 回调函数。
  39482. */
  39483. }, {
  39484. key: "putTemplate",
  39485. value: function putTemplate(params, callback) {
  39486. return this.client.putTemplate(params, callback);
  39487. }
  39488. /**
  39489. * @function SuperMap.ElasticSearch.prototype.reindex
  39490. * @description 重新索引。</br>
  39491. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindex}</br>
  39492. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  39493. * @param {Object} params - 参数。
  39494. * @param {function} callback - 回调函数。
  39495. */
  39496. }, {
  39497. key: "reindex",
  39498. value: function reindex(params, callback) {
  39499. return this.client.reindex(params, callback);
  39500. }
  39501. /**
  39502. * @function SuperMap.ElasticSearch.prototype.reindexRessrottle
  39503. * @description 重新索引。</br>
  39504. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindexrethrottle}</br>
  39505. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  39506. * @param {Object} params - 参数。
  39507. * @param {function} callback - 回调函数。
  39508. */
  39509. }, {
  39510. key: "reindexRessrottle",
  39511. value: function reindexRessrottle(params, callback) {
  39512. return this.client.reindexRessrottle(params, callback);
  39513. }
  39514. /**
  39515. * @function SuperMap.ElasticSearch.prototype.renderSearchTemplate
  39516. * @description 搜索模板。</br>
  39517. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-rendersearchtemplate}</br>
  39518. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  39519. * @param {Object} params - 参数。
  39520. * @param {function} callback - 回调函数。
  39521. */
  39522. }, {
  39523. key: "renderSearchTemplate",
  39524. value: function renderSearchTemplate(params, callback) {
  39525. return this.client.renderSearchTemplate(params, callback);
  39526. }
  39527. /**
  39528. * @function SuperMap.ElasticSearch.prototype.scroll
  39529. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。</br>
  39530. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-scroll}</br>
  39531. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  39532. * @param {Object} params - 参数。
  39533. * @param {function} callback - 回调函数。
  39534. */
  39535. }, {
  39536. key: "scroll",
  39537. value: function scroll(params, callback) {
  39538. return this.client.scroll(params, callback);
  39539. }
  39540. /**
  39541. * @function SuperMap.ElasticSearch.prototype.search
  39542. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。
  39543. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search}</br>
  39544. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html}</br>
  39545. * @param {Object} params - 参数。
  39546. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  39547. * 回调参数:error,response,结果存储在response.responses中
  39548. */
  39549. }, {
  39550. key: "search",
  39551. value: function search(params, callback) {
  39552. var me = this;
  39553. return me.client.search(params).then(function (resp) {
  39554. me._update(resp.responses, callback);
  39555. return resp;
  39556. }, function (err) {
  39557. callback(err);
  39558. me.events.triggerEvent('error', {
  39559. error: err
  39560. });
  39561. return err;
  39562. });
  39563. }
  39564. /**
  39565. * @function SuperMap.ElasticSearch.prototype.searchShards
  39566. * @description 返回要执行搜索请求的索引和分片。
  39567. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchshards}</br>
  39568. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shards.html}</br>
  39569. * @param {Object} params - 参数。
  39570. * @param {function} callback - 回调函数。
  39571. */
  39572. }, {
  39573. key: "searchShards",
  39574. value: function searchShards(params, callback) {
  39575. return this.client.searchShards(params, callback);
  39576. }
  39577. /**
  39578. * @function SuperMap.ElasticSearch.prototype.searchTemplate
  39579. * @description 搜索模板。
  39580. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchtemplate}</br>
  39581. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  39582. * @param {Object} params - 参数。
  39583. * @param {function} callback - 回调函数。
  39584. */
  39585. }, {
  39586. key: "searchTemplate",
  39587. value: function searchTemplate(params, callback) {
  39588. return this.client.searchTemplate(params, callback);
  39589. }
  39590. /**
  39591. * @function SuperMap.ElasticSearch.prototype.suggest
  39592. * @description 该建议功能通过使用特定的建议者,基于所提供的文本来建议类似的术语。
  39593. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-suggest}</br>
  39594. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  39595. * @param {Object} params - 参数。
  39596. * @param {function} callback - 回调函数。
  39597. */
  39598. }, {
  39599. key: "suggest",
  39600. value: function suggest(params, callback) {
  39601. return this.client.suggest(params, callback);
  39602. }
  39603. /**
  39604. * @function SuperMap.ElasticSearch.prototype.termvectors
  39605. * @description 返回有关特定文档字段中的术语的信息和统计信息。
  39606. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-termvectors}</br>
  39607. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html}</br>
  39608. * @param {Object} params - 参数。
  39609. * @param {function} callback - 回调函数。
  39610. */
  39611. }, {
  39612. key: "termvectors",
  39613. value: function termvectors(params, callback) {
  39614. return this.client.termvectors(params, callback);
  39615. }
  39616. /**
  39617. * @function SuperMap.ElasticSearch.prototype.update
  39618. * @description 更新文档的部分。
  39619. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-update}</br>
  39620. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html}</br>
  39621. * @param {Object} params - 参数。
  39622. * @param {function} callback - 回调函数。
  39623. */
  39624. }, {
  39625. key: "update",
  39626. value: function update(params, callback) {
  39627. return this.client.update(params, callback);
  39628. }
  39629. /**
  39630. * @function SuperMap.ElasticSearch.prototype.update
  39631. * @description 通过查询API来更新文档。
  39632. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-updatebyquery}</br>
  39633. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html}</br>
  39634. * @param {Object} params - 参数。
  39635. * @param {function} callback - 回调函数。
  39636. */
  39637. }, {
  39638. key: "updateByQuery",
  39639. value: function updateByQuery(params, callback) {
  39640. return this.client.updateByQuery(params, callback);
  39641. }
  39642. }, {
  39643. key: "_update",
  39644. value: function _update(data, callback) {
  39645. var me = this;
  39646. if (!data) {
  39647. return;
  39648. }
  39649. me.data = data;
  39650. if (me.openGeoFence && me.geoFence) {
  39651. me._validateDatas(data);
  39652. }
  39653. me.events.triggerEvent('change', {
  39654. data: me.data
  39655. }); //change方法已废弃,不建议使用。建议使用search方法的第二个参数传入请求成功的回调
  39656. if (me.change) {
  39657. me.change && me.change(data);
  39658. } else {
  39659. //加responses是为了保持跟原来es自身的数据结构一致
  39660. callback && callback(undefined, {
  39661. responses: data
  39662. });
  39663. }
  39664. }
  39665. }, {
  39666. key: "_validateDatas",
  39667. value: function _validateDatas(datas) {
  39668. if (!datas) {
  39669. return;
  39670. }
  39671. if (!(datas instanceof Array)) {
  39672. datas = [datas];
  39673. }
  39674. var i,
  39675. len = datas.length;
  39676. for (i = 0; i < len; i++) {
  39677. this._validateData(datas[i]);
  39678. }
  39679. }
  39680. }, {
  39681. key: "_validateData",
  39682. value: function _validateData(data) {
  39683. var me = this;
  39684. data.hits.hits.map(function (source) {
  39685. var content = source._source;
  39686. var meterUnit = me._getMeterPerMapUnit(me.geoFence.unit);
  39687. var geoFenceCX = me.geoFence.center[0] * meterUnit;
  39688. var geoFenceCY = me.geoFence.center[1] * meterUnit;
  39689. var contentX = content.x * meterUnit;
  39690. var contentY = content.y * meterUnit;
  39691. var distance = me._distance(contentX, contentY, geoFenceCX, geoFenceCY);
  39692. var radius = me.geoFence.radius;
  39693. if (distance > radius) {
  39694. me.outOfGeoFence && me.outOfGeoFence(data);
  39695. me.events.triggerEvent('outOfGeoFence', {
  39696. data: data
  39697. });
  39698. }
  39699. return source;
  39700. });
  39701. }
  39702. }, {
  39703. key: "_distance",
  39704. value: function _distance(x1, y1, x2, y2) {
  39705. return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
  39706. }
  39707. }, {
  39708. key: "_getMeterPerMapUnit",
  39709. value: function _getMeterPerMapUnit(mapUnit) {
  39710. var earchRadiusInMeters = 6378137;
  39711. var meterPerMapUnit;
  39712. if (mapUnit === 'meter') {
  39713. meterPerMapUnit = 1;
  39714. } else if (mapUnit === 'degree') {
  39715. // 每度表示多少米。
  39716. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  39717. }
  39718. return meterPerMapUnit;
  39719. }
  39720. }]);
  39721. return ElasticSearch;
  39722. }();
  39723. SuperMap.ElasticSearch = ElasticSearch_ElasticSearch;
  39724. // CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/index.js
  39725. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  39726. * This program are made available under the terms of the Apache License, Version 2.0
  39727. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39728. // CONCATENATED MODULE: ./src/common/thirdparty/index.js
  39729. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  39730. * This program are made available under the terms of the Apache License, Version 2.0
  39731. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39732. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Util.js
  39733. 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); }
  39734. function Util_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39735. 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); } }
  39736. function Util_createClass(Constructor, protoProps, staticProps) { if (protoProps) Util_defineProperties(Constructor.prototype, protoProps); if (staticProps) Util_defineProperties(Constructor, staticProps); return Constructor; }
  39737. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  39738. * This program are made available under the terms of the Apache License, Version 2.0
  39739. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39740. /**
  39741. * @private
  39742. * @class SuperMap.LevelRenderer.Tool.Util
  39743. * @category Visualization Theme
  39744. * LevelRenderer 基础工具类
  39745. *
  39746. */
  39747. var levelRenderer_Util_Util = /*#__PURE__*/function () {
  39748. /**
  39749. * @function SuperMap.LevelRenderer.Tool.Util.constructor
  39750. * @description 构造函数。
  39751. *
  39752. */
  39753. function Util() {
  39754. Util_classCallCheck(this, Util);
  39755. /**
  39756. * @member {Object} SuperMap.LevelRenderer.Tool.Util.prototype.BUILTIN_OBJECT
  39757. * @description 用于处理merge时无法遍历Date等对象的问题
  39758. */
  39759. this.BUILTIN_OBJECT = {
  39760. '[object Function]': 1,
  39761. '[object RegExp]': 1,
  39762. '[object Date]': 1,
  39763. '[object Error]': 1,
  39764. '[object CanvasGradient]': 1
  39765. };
  39766. /**
  39767. * @member {Object} SuperMap.LevelRenderer.Tool.Util.prototype._ctx
  39768. */
  39769. this._ctx = null;
  39770. /**
  39771. * Property: _canvas
  39772. * {Object}
  39773. */
  39774. this._canvas = null;
  39775. /**
  39776. * Property: _pixelCtx
  39777. * {Object}
  39778. */
  39779. this._pixelCtx = null;
  39780. /**
  39781. * Property: _width
  39782. * {Object}
  39783. */
  39784. this._width = null;
  39785. /**
  39786. * Property: _height
  39787. * {Object}
  39788. */
  39789. this._height = null;
  39790. /**
  39791. * Property: _offsetX
  39792. * {Object}
  39793. */
  39794. this._offsetX = 0;
  39795. /**
  39796. * Property: _offsetY
  39797. * {Object}
  39798. */
  39799. this._offsetY = 0;
  39800. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Util";
  39801. }
  39802. /**
  39803. * @function SuperMap.LevelRenderer.Tool.Util.prototype.clone
  39804. * @description 对一个object进行深度拷贝。
  39805. *
  39806. * @param {Object} source - 需要进行拷贝的对象。
  39807. * @return {Object} 拷贝后的新对象。
  39808. */
  39809. Util_createClass(Util, [{
  39810. key: "clone",
  39811. value: function clone(source) {
  39812. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  39813. if (Util_typeof(source) == 'object' && source !== null) {
  39814. var result = source;
  39815. if (source instanceof Array) {
  39816. result = [];
  39817. for (var i = 0, len = source.length; i < len; i++) {
  39818. result[i] = this.clone(source[i]);
  39819. }
  39820. } else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) {
  39821. result = {};
  39822. for (var key in source) {
  39823. if (source.hasOwnProperty(key)) {
  39824. result[key] = this.clone(source[key]);
  39825. }
  39826. }
  39827. }
  39828. return result;
  39829. }
  39830. return source;
  39831. }
  39832. /**
  39833. * @function SuperMap.LevelRenderer.Tool.Util.prototype.mergeItem
  39834. * @description 合并源对象的单个属性到目标对象。
  39835. *
  39836. * @param {Object} target - 目标对象。
  39837. * @param {Object} source - 源对象。
  39838. * @param {string} key - 键。
  39839. * @param {boolean} overwrite - 是否覆盖。
  39840. * @return {Object} 目标对象
  39841. */
  39842. }, {
  39843. key: "mergeItem",
  39844. value: function mergeItem(target, source, key, overwrite) {
  39845. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  39846. if (source.hasOwnProperty(key)) {
  39847. if (Util_typeof(target[key]) == 'object' && !BUILTIN_OBJECT[Object.prototype.toString.call(target[key])]) {
  39848. // 如果需要递归覆盖,就递归调用merge
  39849. this.merge(target[key], source[key], overwrite);
  39850. } else if (overwrite || !(key in target)) {
  39851. // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况
  39852. target[key] = source[key];
  39853. }
  39854. }
  39855. }
  39856. /**
  39857. * @function SuperMap.LevelRenderer.Tool.Util.prototype.merge
  39858. * @description 合并源对象的属性到目标对象。
  39859. *
  39860. * @param {Object} target - 目标对象。
  39861. * @param {Object} source - 源对象。
  39862. * @param {boolean} overwrite - 是否覆盖。
  39863. * @return {Object} 目标对象。
  39864. */
  39865. }, {
  39866. key: "merge",
  39867. value: function merge(target, source, overwrite) {
  39868. for (var i in source) {
  39869. this.mergeItem(target, source, i, overwrite);
  39870. }
  39871. return target;
  39872. }
  39873. /**
  39874. * @function SuperMap.LevelRenderer.Tool.Util.prototype.getContext
  39875. * @description 获取 Canvas 上下文。
  39876. * @return {Object} 上下文。
  39877. */
  39878. }, {
  39879. key: "getContext",
  39880. value: function getContext() {
  39881. if (!this._ctx) {
  39882. this._ctx = document.createElement('canvas').getContext('2d');
  39883. }
  39884. return this._ctx;
  39885. }
  39886. /**
  39887. * @function SuperMap.LevelRenderer.Tool.Util.prototype.getPixelContext
  39888. * @description 获取像素拾取专用的上下文。
  39889. * @return {Object} 像素拾取专用的上下文。
  39890. */
  39891. }, {
  39892. key: "getPixelContext",
  39893. value: function getPixelContext() {
  39894. if (!this._pixelCtx) {
  39895. this._canvas = document.createElement('canvas');
  39896. this._width = this._canvas.width;
  39897. this._height = this._canvas.height;
  39898. this._pixelCtx = this._canvas.getContext('2d');
  39899. }
  39900. return this._pixelCtx;
  39901. }
  39902. /**
  39903. * @function SuperMap.LevelRenderer.Tool.Util.prototype.adjustCanvasSize
  39904. * @description 如果坐标处在_canvas外部,改变_canvas的大小,修改canvas的大小 需要重新设置translate
  39905. *
  39906. * @param {number} x - 横坐标。
  39907. * @param {number} y - 纵坐标。
  39908. *
  39909. */
  39910. }, {
  39911. key: "adjustCanvasSize",
  39912. value: function adjustCanvasSize(x, y) {
  39913. var _canvas = this._canvas;
  39914. var _pixelCtx = this._pixelCtx;
  39915. var _width = this._width;
  39916. var _height = this._height;
  39917. var _offsetX = this._offsetX;
  39918. var _offsetY = this._offsetY; // 每次加的长度
  39919. var _v = 100;
  39920. var _flag;
  39921. if (x + _offsetX > _width) {
  39922. _width = x + _offsetX + _v;
  39923. _canvas.width = _width;
  39924. _flag = true;
  39925. }
  39926. if (y + _offsetY > _height) {
  39927. _height = y + _offsetY + _v;
  39928. _canvas.height = _height;
  39929. _flag = true;
  39930. }
  39931. if (x < -_offsetX) {
  39932. _offsetX = Math.ceil(-x / _v) * _v;
  39933. _width += _offsetX;
  39934. _canvas.width = _width;
  39935. _flag = true;
  39936. }
  39937. if (y < -_offsetY) {
  39938. _offsetY = Math.ceil(-y / _v) * _v;
  39939. _height += _offsetY;
  39940. _canvas.height = _height;
  39941. _flag = true;
  39942. }
  39943. if (_flag) {
  39944. _pixelCtx.translate(_offsetX, _offsetY);
  39945. }
  39946. }
  39947. /**
  39948. * @function SuperMap.LevelRenderer.Tool.Util.prototype.getPixelOffset
  39949. * @description 获取像素canvas的偏移量。
  39950. * @return {Object} 偏移量。
  39951. */
  39952. }, {
  39953. key: "getPixelOffset",
  39954. value: function getPixelOffset() {
  39955. return {
  39956. x: this._offsetX,
  39957. y: this._offsetY
  39958. };
  39959. }
  39960. /**
  39961. * @function SuperMap.LevelRenderer.Tool.Util.prototype.indexOf
  39962. * @description 查询数组中元素的index
  39963. * @return {Object} 偏移量。
  39964. */
  39965. }, {
  39966. key: "indexOf",
  39967. value: function indexOf(array, value) {
  39968. if (array.indexOf) {
  39969. return array.indexOf(value);
  39970. }
  39971. for (var i = 0, len = array.length; i < len; i++) {
  39972. if (array[i] === value) {
  39973. return i;
  39974. }
  39975. }
  39976. return -1;
  39977. }
  39978. /**
  39979. * @function SuperMap.LevelRenderer.Tool.Util.prototype.inherits
  39980. * @description 构造类继承关系
  39981. *
  39982. * @param {Function} clazz - 源类。
  39983. * @param {Function} baseClazz - 基类。
  39984. * @return {Object} 偏移量。
  39985. */
  39986. }, {
  39987. key: "inherits",
  39988. value: function inherits(clazz, baseClazz) {
  39989. var clazzPrototype = clazz.prototype;
  39990. function F() {}
  39991. F.prototype = baseClazz.prototype;
  39992. clazz.prototype = new F();
  39993. for (var prop in clazzPrototype) {
  39994. clazz.prototype[prop] = clazzPrototype[prop];
  39995. }
  39996. clazz.constructor = clazz;
  39997. }
  39998. }]);
  39999. return Util;
  40000. }();
  40001. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Color.js
  40002. function Color_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40003. 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); } }
  40004. function Color_createClass(Constructor, protoProps, staticProps) { if (protoProps) Color_defineProperties(Constructor.prototype, protoProps); if (staticProps) Color_defineProperties(Constructor, staticProps); return Constructor; }
  40005. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  40006. * This program are made available under the terms of the Apache License, Version 2.0
  40007. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40008. /**
  40009. * @class SuperMap.LevelRenderer.Tool.Color
  40010. * @category Visualization Theme
  40011. * @classdesc LevelRenderer 工具-颜色辅助类
  40012. * @private
  40013. */
  40014. var Color_Color = /*#__PURE__*/function () {
  40015. function Color() {
  40016. Color_classCallCheck(this, Color);
  40017. /**
  40018. * @member {SuperMap.LevelRenderer.Tool.Util} SuperMap.LevelRenderer.Tool.Color.prototype.util
  40019. * @description LevelRenderer 基础工具对象。
  40020. */
  40021. this.util = new levelRenderer_Util_Util();
  40022. /**
  40023. * @member {Object} SuperMap.LevelRenderer.Tool.Color.prototype._ctx
  40024. * @description _ctx。
  40025. */
  40026. this._ctx = null;
  40027. /**
  40028. * @member {Array} SuperMap.LevelRenderer.Tool.Color.prototype.palette
  40029. * @description 默认色板。色板是一个包含图表默认颜色系列的数组,当色板中所有颜色被使用过后,又将从新回到色板中的第一个颜色。
  40030. */
  40031. 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'];
  40032. /**
  40033. * @member {Array} SuperMap.LevelRenderer.Tool.Color.prototype._palette
  40034. * @description 复位色板,用于复位 palette
  40035. */
  40036. this._palette = this.palette;
  40037. /**
  40038. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype.highlightColor
  40039. * @description 高亮色
  40040. */
  40041. this.highlightColor = 'rgba(0,0,255,1)';
  40042. /**
  40043. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype._highlightColor
  40044. * @description 复位高亮色
  40045. */
  40046. this._highlightColor = this.highlightColor;
  40047. /**
  40048. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype.colorRegExp
  40049. * @description 颜色格式,正则表达式。
  40050. */
  40051. 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;
  40052. /**
  40053. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype._nameColors
  40054. * @description 颜色名。
  40055. */
  40056. this._nameColors = {
  40057. aliceblue: '#f0f8ff',
  40058. antiquewhite: '#faebd7',
  40059. aqua: '#0ff',
  40060. aquamarine: '#7fffd4',
  40061. azure: '#f0ffff',
  40062. beige: '#f5f5dc',
  40063. bisque: '#ffe4c4',
  40064. black: '#000',
  40065. blanchedalmond: '#ffebcd',
  40066. blue: '#00f',
  40067. blueviolet: '#8a2be2',
  40068. brown: '#a52a2a',
  40069. burlywood: '#deb887',
  40070. cadetblue: '#5f9ea0',
  40071. chartreuse: '#7fff00',
  40072. chocolate: '#d2691e',
  40073. coral: '#ff7f50',
  40074. cornflowerblue: '#6495ed',
  40075. cornsilk: '#fff8dc',
  40076. crimson: '#dc143c',
  40077. cyan: '#0ff',
  40078. darkblue: '#00008b',
  40079. darkcyan: '#008b8b',
  40080. darkgoldenrod: '#b8860b',
  40081. darkgray: '#a9a9a9',
  40082. darkgrey: '#a9a9a9',
  40083. darkgreen: '#006400',
  40084. darkkhaki: '#bdb76b',
  40085. darkmagenta: '#8b008b',
  40086. darkolivegreen: '#556b2f',
  40087. darkorange: '#ff8c00',
  40088. darkorchid: '#9932cc',
  40089. darkred: '#8b0000',
  40090. darksalmon: '#e9967a',
  40091. darkseagreen: '#8fbc8f',
  40092. darkslateblue: '#483d8b',
  40093. darkslategray: '#2f4f4f',
  40094. darkslategrey: '#2f4f4f',
  40095. darkturquoise: '#00ced1',
  40096. darkviolet: '#9400d3',
  40097. deeppink: '#ff1493',
  40098. deepskyblue: '#00bfff',
  40099. dimgray: '#696969',
  40100. dimgrey: '#696969',
  40101. dodgerblue: '#1e90ff',
  40102. firebrick: '#b22222',
  40103. floralwhite: '#fffaf0',
  40104. forestgreen: '#228b22',
  40105. fuchsia: '#f0f',
  40106. gainsboro: '#dcdcdc',
  40107. ghostwhite: '#f8f8ff',
  40108. gold: '#ffd700',
  40109. goldenrod: '#daa520',
  40110. gray: '#808080',
  40111. grey: '#808080',
  40112. green: '#008000',
  40113. greenyellow: '#adff2f',
  40114. honeydew: '#f0fff0',
  40115. hotpink: '#ff69b4',
  40116. indianred: '#cd5c5c',
  40117. indigo: '#4b0082',
  40118. ivory: '#fffff0',
  40119. khaki: '#f0e68c',
  40120. lavender: '#e6e6fa',
  40121. lavenderblush: '#fff0f5',
  40122. lawngreen: '#7cfc00',
  40123. lemonchiffon: '#fffacd',
  40124. lightblue: '#add8e6',
  40125. lightcoral: '#f08080',
  40126. lightcyan: '#e0ffff',
  40127. lightgoldenrodyellow: '#fafad2',
  40128. lightgray: '#d3d3d3',
  40129. lightgrey: '#d3d3d3',
  40130. lightgreen: '#90ee90',
  40131. lightpink: '#ffb6c1',
  40132. lightsalmon: '#ffa07a',
  40133. lightseagreen: '#20b2aa',
  40134. lightskyblue: '#87cefa',
  40135. lightslategray: '#789',
  40136. lightslategrey: '#789',
  40137. lightsteelblue: '#b0c4de',
  40138. lightyellow: '#ffffe0',
  40139. lime: '#0f0',
  40140. limegreen: '#32cd32',
  40141. linen: '#faf0e6',
  40142. magenta: '#f0f',
  40143. maroon: '#800000',
  40144. mediumaquamarine: '#66cdaa',
  40145. mediumblue: '#0000cd',
  40146. mediumorchid: '#ba55d3',
  40147. mediumpurple: '#9370d8',
  40148. mediumseagreen: '#3cb371',
  40149. mediumslateblue: '#7b68ee',
  40150. mediumspringgreen: '#00fa9a',
  40151. mediumturquoise: '#48d1cc',
  40152. mediumvioletred: '#c71585',
  40153. midnightblue: '#191970',
  40154. mintcream: '#f5fffa',
  40155. mistyrose: '#ffe4e1',
  40156. moccasin: '#ffe4b5',
  40157. navajowhite: '#ffdead',
  40158. navy: '#000080',
  40159. oldlace: '#fdf5e6',
  40160. olive: '#808000',
  40161. olivedrab: '#6b8e23',
  40162. orange: '#ffa500',
  40163. orangered: '#ff4500',
  40164. orchid: '#da70d6',
  40165. palegoldenrod: '#eee8aa',
  40166. palegreen: '#98fb98',
  40167. paleturquoise: '#afeeee',
  40168. palevioletred: '#d87093',
  40169. papayawhip: '#ffefd5',
  40170. peachpuff: '#ffdab9',
  40171. peru: '#cd853f',
  40172. pink: '#ffc0cb',
  40173. plum: '#dda0dd',
  40174. powderblue: '#b0e0e6',
  40175. purple: '#800080',
  40176. red: '#f00',
  40177. rosybrown: '#bc8f8f',
  40178. royalblue: '#4169e1',
  40179. saddlebrown: '#8b4513',
  40180. salmon: '#fa8072',
  40181. sandybrown: '#f4a460',
  40182. seagreen: '#2e8b57',
  40183. seashell: '#fff5ee',
  40184. sienna: '#a0522d',
  40185. silver: '#c0c0c0',
  40186. skyblue: '#87ceeb',
  40187. slateblue: '#6a5acd',
  40188. slategray: '#708090',
  40189. slategrey: '#708090',
  40190. snow: '#fffafa',
  40191. springgreen: '#00ff7f',
  40192. steelblue: '#4682b4',
  40193. tan: '#d2b48c',
  40194. teal: '#008080',
  40195. thistle: '#d8bfd8',
  40196. tomato: '#ff6347',
  40197. turquoise: '#40e0d0',
  40198. violet: '#ee82ee',
  40199. wheat: '#f5deb3',
  40200. white: '#fff',
  40201. whitesmoke: '#f5f5f5',
  40202. yellow: '#ff0',
  40203. yellowgreen: '#9acd32'
  40204. };
  40205. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Color";
  40206. }
  40207. /**
  40208. * @function SuperMap.LevelRenderer.Tool.Color.prototype.customPalette
  40209. * @description 自定义调色板。
  40210. * @param {Array} userPalete - 颜色板。
  40211. */
  40212. Color_createClass(Color, [{
  40213. key: "customPalette",
  40214. value: function customPalette(userPalete) {
  40215. this.palette = userPalete;
  40216. }
  40217. /**
  40218. * @function SuperMap.LevelRenderer.Tool.Color.prototype.resetPalette
  40219. * @description 复位默认色板。
  40220. */
  40221. }, {
  40222. key: "resetPalette",
  40223. value: function resetPalette() {
  40224. this.palette = this._palette;
  40225. }
  40226. /**
  40227. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getColor
  40228. * @description 获取色板颜色。
  40229. * @param {number} idx - 色板位置。
  40230. * @param {Array} userPalete - 色板。
  40231. * @returns {string} 颜色值。
  40232. */
  40233. }, {
  40234. key: "getColor",
  40235. value: function getColor(idx, userPalete) {
  40236. idx = idx | 0;
  40237. userPalete = userPalete || this.palette;
  40238. return userPalete[idx % userPalete.length];
  40239. }
  40240. /**
  40241. * @function SuperMap.LevelRenderer.Tool.Color.prototype.customHighlight
  40242. * @description 自定义默认高亮颜色。
  40243. * @param {string} userHighlightColor - 自定义高亮色。
  40244. */
  40245. }, {
  40246. key: "customHighlight",
  40247. value: function customHighlight(userHighlightColor) {
  40248. this.highlightColor = userHighlightColor;
  40249. }
  40250. /**
  40251. * @function SuperMap.LevelRenderer.Tool.Color.prototype.resetHighlight
  40252. * @description 重置默认高亮颜色。将当前的高亮色作为默认高亮颜色
  40253. */
  40254. }, {
  40255. key: "resetHighlight",
  40256. value: function resetHighlight() {
  40257. this.highlightColor = this._highlightColor;
  40258. }
  40259. /**
  40260. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getHighlightColor
  40261. * @description 获取默认高亮颜色
  40262. * @returns {string} 颜色值。
  40263. */
  40264. }, {
  40265. key: "getHighlightColor",
  40266. value: function getHighlightColor() {
  40267. return this.highlightColor;
  40268. }
  40269. /**
  40270. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getRadialGradient
  40271. * @description 径向渐变。
  40272. * @param {number} x0 - 渐变起点横坐标。
  40273. * @param {number} y0 - 渐变起点纵坐标。
  40274. * @param {number} r0 - 半径
  40275. * @param {number} x1 - 渐变终点横坐标。
  40276. * @param {number} y1 - 渐变终点纵坐标。
  40277. * @param {number} r1 - 半径
  40278. * @param {Array} colorList - 颜色列表。
  40279. * @returns {CanvasGradient} Cavans 渐变颜色。
  40280. */
  40281. }, {
  40282. key: "getRadialGradient",
  40283. value: function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) {
  40284. var util = this.util;
  40285. if (!this._ctx) {
  40286. this._ctx = util.getContext();
  40287. }
  40288. var gradient = this._ctx.createRadialGradient(x0, y0, r0, x1, y1, r1);
  40289. for (var i = 0, l = colorList.length; i < l; i++) {
  40290. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  40291. }
  40292. gradient.__nonRecursion = true;
  40293. return gradient;
  40294. }
  40295. /**
  40296. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getLinearGradient
  40297. * @description 线性渐变。
  40298. * @param {number} x0 - 渐变起点横坐标。
  40299. * @param {number} y0 - 渐变起点纵坐标。
  40300. * @param {number} x1 - 渐变终点横坐标。
  40301. * @param {number} y1 - 渐变终点纵坐标。
  40302. * @param {Array} colorList - 颜色列表。
  40303. * @returns {CanvasGradient} Cavans 渐变颜色。
  40304. */
  40305. }, {
  40306. key: "getLinearGradient",
  40307. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  40308. var util = this.util;
  40309. if (!this._ctx) {
  40310. this._ctx = util.getContext();
  40311. }
  40312. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  40313. for (var i = 0, l = colorList.length; i < l; i++) {
  40314. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  40315. }
  40316. gradient.__nonRecursion = true;
  40317. return gradient;
  40318. }
  40319. /**
  40320. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getStepColors
  40321. * @description 获取两种颜色之间渐变颜色数组。
  40322. * @param {Object} start - 起始颜色对象。
  40323. * @param {Object} end - 结束颜色对象。
  40324. * @param {number} step - 渐变级数。
  40325. * @returns {Array} 颜色数组。
  40326. */
  40327. }, {
  40328. key: "getStepColors",
  40329. value: function getStepColors(start, end, step) {
  40330. start = this.toRGBA(start);
  40331. end = this.toRGBA(end);
  40332. start = this.getData(start);
  40333. end = this.getData(end);
  40334. var colors = [];
  40335. var stepR = (end[0] - start[0]) / step;
  40336. var stepG = (end[1] - start[1]) / step;
  40337. var stepB = (end[2] - start[2]) / step;
  40338. var stepA = (end[3] - start[3]) / step; // 生成颜色集合
  40339. // fix by linfeng 颜色堆积
  40340. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  40341. 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');
  40342. r += stepR;
  40343. g += stepG;
  40344. b += stepB;
  40345. a += stepA;
  40346. }
  40347. r = end[0];
  40348. g = end[1];
  40349. b = end[2];
  40350. a = end[3];
  40351. colors[i] = this.toColor([r, g, b, a], 'rgba');
  40352. return colors;
  40353. }
  40354. /**
  40355. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getGradientColors
  40356. * @description 获取指定级数的渐变颜色数组。
  40357. * @param {Array.<string>} colors - 颜色数组。
  40358. * @param {number} [step=20] - 渐变级数。
  40359. * @returns {Array.<string>} 颜色数组。
  40360. */
  40361. }, {
  40362. key: "getGradientColors",
  40363. value: function getGradientColors(colors, step) {
  40364. var ret = [];
  40365. var len = colors.length;
  40366. if (step === undefined) {
  40367. step = 20;
  40368. }
  40369. if (len === 1) {
  40370. ret = this.getStepColors(colors[0], colors[0], step);
  40371. } else if (len > 1) {
  40372. for (var i = 0, n = len - 1; i < n; i++) {
  40373. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  40374. if (i < n - 1) {
  40375. steps.pop();
  40376. }
  40377. ret = ret.concat(steps);
  40378. }
  40379. }
  40380. return ret;
  40381. }
  40382. /**
  40383. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toColor
  40384. * @description 颜色值数组转为指定格式颜色。
  40385. * @param {Array} data - 颜色值数组。
  40386. * @param {string} format - 格式,默认'rgb'
  40387. * @returns {string} 颜色。
  40388. */
  40389. }, {
  40390. key: "toColor",
  40391. value: function toColor(data, format) {
  40392. format = format || 'rgb';
  40393. if (data && (data.length === 3 || data.length === 4)) {
  40394. data = this.map(data, function (c) {
  40395. return c > 1 ? Math.ceil(c) : c;
  40396. });
  40397. if (format.indexOf('hex') > -1) {
  40398. return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + +data[2]).toString(16).slice(1);
  40399. } else if (format.indexOf('hs') > -1) {
  40400. var sx = this.map(data.slice(1, 3), function (c) {
  40401. return c + '%';
  40402. });
  40403. data[1] = sx[0];
  40404. data[2] = sx[1];
  40405. }
  40406. if (format.indexOf('a') > -1) {
  40407. if (data.length === 3) {
  40408. data.push(1);
  40409. }
  40410. data[3] = this.adjust(data[3], [0, 1]);
  40411. return format + '(' + data.slice(0, 4).join(',') + ')';
  40412. }
  40413. return format + '(' + data.slice(0, 3).join(',') + ')';
  40414. }
  40415. }
  40416. /**
  40417. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toArray
  40418. * @description 颜色字符串转换为rgba数组。
  40419. * @param {string} color - 颜色。
  40420. * @returns {Array.<number>} 颜色值数组。
  40421. */
  40422. }, {
  40423. key: "toArray",
  40424. value: function toArray(color) {
  40425. color = this.trim(color);
  40426. if (color.indexOf('rgba') < 0) {
  40427. color = this.toRGBA(color);
  40428. }
  40429. var data = [];
  40430. var i = 0;
  40431. color.replace(/[\d.]+/g, function (n) {
  40432. if (i < 3) {
  40433. n = n | 0;
  40434. } else {
  40435. // Alpha
  40436. n = +n;
  40437. }
  40438. data[i++] = n;
  40439. });
  40440. return data;
  40441. }
  40442. /**
  40443. * @function SuperMap.LevelRenderer.Tool.Color.prototype.convert
  40444. * @description 颜色格式转化。
  40445. * @param {Array} data - 颜色值数组。
  40446. * @param {string} format - 格式,默认'rgb'
  40447. * @returns {string} 颜色。
  40448. */
  40449. }, {
  40450. key: "convert",
  40451. value: function convert(color, format) {
  40452. if (!this.isCalculableColor(color)) {
  40453. return color;
  40454. }
  40455. var data = this.getData(color);
  40456. var alpha = data[3];
  40457. if (typeof alpha === 'undefined') {
  40458. alpha = 1;
  40459. }
  40460. if (color.indexOf('hsb') > -1) {
  40461. data = this._HSV_2_RGB(data);
  40462. } else if (color.indexOf('hsl') > -1) {
  40463. data = this._HSL_2_RGB(data);
  40464. }
  40465. if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) {
  40466. data = this._RGB_2_HSB(data);
  40467. } else if (format.indexOf('hsl') > -1) {
  40468. data = this._RGB_2_HSL(data);
  40469. }
  40470. data[3] = alpha;
  40471. return this.toColor(data, format);
  40472. }
  40473. /**
  40474. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toRGBA
  40475. * @description 转换为rgba格式的颜色。
  40476. * @param {string} color - 颜色。
  40477. * @returns {string} 颜色。
  40478. */
  40479. }, {
  40480. key: "toRGBA",
  40481. value: function toRGBA(color) {
  40482. return this.convert(color, 'rgba');
  40483. }
  40484. /**
  40485. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toRGB
  40486. * @description 转换为rgb数字格式的颜色。
  40487. * @param {string} color - 颜色。
  40488. * @returns {string} 颜色。
  40489. */
  40490. }, {
  40491. key: "toRGB",
  40492. value: function toRGB(color) {
  40493. return this.convert(color, 'rgb');
  40494. }
  40495. /**
  40496. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHex
  40497. * @description 转换为16进制颜色。
  40498. * @param {string} color - 颜色。
  40499. * @returns {string} 16进制颜色,#rrggbb格式
  40500. */
  40501. }, {
  40502. key: "toHex",
  40503. value: function toHex(color) {
  40504. return this.convert(color, 'hex');
  40505. }
  40506. /**
  40507. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSVA
  40508. * @description 转换为HSV颜色。
  40509. * @param {string} color - 颜色。
  40510. * @returns {string} HSVA颜色,hsva(h,s,v,a)
  40511. */
  40512. }, {
  40513. key: "toHSVA",
  40514. value: function toHSVA(color) {
  40515. return this.convert(color, 'hsva');
  40516. }
  40517. /**
  40518. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSV
  40519. * @description 转换为HSV颜色。
  40520. * @param {string} color - 颜色。
  40521. * @returns {string} HSV颜色,hsv(h,s,v)
  40522. */
  40523. }, {
  40524. key: "toHSV",
  40525. value: function toHSV(color) {
  40526. return this.convert(color, 'hsv');
  40527. }
  40528. /**
  40529. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSBA
  40530. * @description 转换为HSBA颜色。
  40531. * @param {string} color - 颜色。
  40532. * @returns {string} HSBA颜色,hsba(h,s,b,a)
  40533. */
  40534. }, {
  40535. key: "toHSBA",
  40536. value: function toHSBA(color) {
  40537. return this.convert(color, 'hsba');
  40538. }
  40539. /**
  40540. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSB
  40541. * @description 转换为HSB颜色。
  40542. * @param {string} color - 颜色。
  40543. * @returns {string} HSB颜色,hsb(h,s,b)
  40544. */
  40545. }, {
  40546. key: "toHSB",
  40547. value: function toHSB(color) {
  40548. return this.convert(color, 'hsb');
  40549. }
  40550. /**
  40551. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSLA
  40552. * @description 转换为HSLA颜色。
  40553. * @param {string} color - 颜色。
  40554. * @returns {string} HSLA颜色,hsla(h,s,l,a)
  40555. */
  40556. }, {
  40557. key: "toHSLA",
  40558. value: function toHSLA(color) {
  40559. return this.convert(color, 'hsla');
  40560. }
  40561. /**
  40562. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSL
  40563. * @description 转换为HSL颜色。
  40564. * @param {string} color - 颜色。
  40565. * @returns {string} HSL颜色,hsl(h,s,l)
  40566. */
  40567. }, {
  40568. key: "toHSL",
  40569. value: function toHSL(color) {
  40570. return this.convert(color, 'hsl');
  40571. }
  40572. /**
  40573. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toName
  40574. * @description 转换颜色名。
  40575. * @param {string} color - 颜色。
  40576. * @returns {string} 颜色名
  40577. */
  40578. }, {
  40579. key: "toName",
  40580. value: function toName(color) {
  40581. for (var key in this._nameColors) {
  40582. if (this.toHex(this._nameColors[key]) === this.toHex(color)) {
  40583. return key;
  40584. }
  40585. }
  40586. return null;
  40587. }
  40588. /**
  40589. * @function SuperMap.LevelRenderer.Tool.Color.prototype.trim
  40590. * @description 移除颜色中多余空格。
  40591. * @param {string} color - 颜色。
  40592. * @returns {string} 无空格颜色
  40593. */
  40594. }, {
  40595. key: "trim",
  40596. value: function trim(color) {
  40597. return String(color).replace(/\s+/g, '');
  40598. }
  40599. /**
  40600. * @function SuperMap.LevelRenderer.Tool.Color.prototype.normalize
  40601. * @description 颜色规范化。
  40602. * @param {string} color - 颜色。
  40603. * @returns {string} 规范化后的颜色
  40604. */
  40605. }, {
  40606. key: "normalize",
  40607. value: function normalize(color) {
  40608. // 颜色名
  40609. if (this._nameColors[color]) {
  40610. color = this._nameColors[color];
  40611. } // 去掉空格
  40612. color = this.trim(color); // hsv与hsb等价
  40613. color = color.replace(/hsv/i, 'hsb'); // rgb转为rrggbb
  40614. if (/^#[\da-f]{3}$/i.test(color)) {
  40615. color = parseInt(color.slice(1), 16);
  40616. var r = (color & 0xf00) << 8;
  40617. var g = (color & 0xf0) << 4;
  40618. var b = color & 0xf;
  40619. color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1);
  40620. } // 或者使用以下正则替换,不过 chrome 下性能相对差点
  40621. // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3');
  40622. return color;
  40623. }
  40624. /**
  40625. * @function SuperMap.LevelRenderer.Tool.Color.prototype.lift
  40626. * @description 颜色加深或减淡,当level>0加深,当level<0减淡。
  40627. * @param {string} color - 颜色。
  40628. * @param {number} level - 升降程度,取值区间[-1,1]。
  40629. * @returns {string} 加深或减淡后颜色值
  40630. */
  40631. }, {
  40632. key: "lift",
  40633. value: function lift(color, level) {
  40634. if (!this.isCalculableColor(color)) {
  40635. return color;
  40636. }
  40637. var direct = level > 0 ? 1 : -1;
  40638. if (typeof level === 'undefined') {
  40639. level = 0;
  40640. }
  40641. level = Math.abs(level) > 1 ? 1 : Math.abs(level);
  40642. color = this.toRGB(color);
  40643. var data = this.getData(color);
  40644. for (var i = 0; i < 3; i++) {
  40645. if (direct === 1) {
  40646. data[i] = data[i] * (1 - level) | 0;
  40647. } else {
  40648. data[i] = (255 - data[i]) * level + data[i] | 0;
  40649. }
  40650. }
  40651. return 'rgb(' + data.join(',') + ')';
  40652. }
  40653. /**
  40654. * @function SuperMap.LevelRenderer.Tool.Color.prototype.reverse
  40655. * @description 颜色翻转。[255-r,255-g,255-b,1-a]
  40656. * @param {string} color - 颜色。
  40657. * @returns {string} 翻转颜色
  40658. */
  40659. }, {
  40660. key: "reverse",
  40661. value: function reverse(color) {
  40662. if (!this.isCalculableColor(color)) {
  40663. return color;
  40664. }
  40665. var data = this.getData(this.toRGBA(color));
  40666. data = this.map(data, function (c) {
  40667. return 255 - c;
  40668. });
  40669. return this.toColor(data, 'rgb');
  40670. }
  40671. /**
  40672. * @function SuperMap.LevelRenderer.Tool.Color.prototype.mix
  40673. * @description 简单两种颜色混合
  40674. * @param {string} color1 - 第一种颜色。
  40675. * @param {string} color2 - 第二种颜色。
  40676. * @param {number} weight - 混合权重[0-1]。
  40677. * @returns {string} 结果色。rgb(r,g,b)或rgba(r,g,b,a)
  40678. */
  40679. }, {
  40680. key: "mix",
  40681. value: function mix(color1, color2, weight) {
  40682. if (!this.isCalculableColor(color1) || !this.isCalculableColor(color2)) {
  40683. return color1;
  40684. }
  40685. if (typeof weight === 'undefined') {
  40686. weight = 0.5;
  40687. }
  40688. weight = 1 - this.adjust(weight, [0, 1]);
  40689. var w = weight * 2 - 1;
  40690. var data1 = this.getData(this.toRGBA(color1));
  40691. var data2 = this.getData(this.toRGBA(color2));
  40692. var d = data1[3] - data2[3];
  40693. var weight1 = ((w * d === -1 ? w : (w + d) / (1 + w * d)) + 1) / 2;
  40694. var weight2 = 1 - weight1;
  40695. var data = [];
  40696. for (var i = 0; i < 3; i++) {
  40697. data[i] = data1[i] * weight1 + data2[i] * weight2;
  40698. }
  40699. var alpha = data1[3] * weight + data2[3] * (1 - weight);
  40700. alpha = Math.max(0, Math.min(1, alpha));
  40701. if (data1[3] === 1 && data2[3] === 1) {
  40702. // 不考虑透明度
  40703. return this.toColor(data, 'rgb');
  40704. }
  40705. data[3] = alpha;
  40706. return this.toColor(data, 'rgba');
  40707. }
  40708. /**
  40709. * @function SuperMap.LevelRenderer.Tool.Color.prototype.random
  40710. * @description 随机颜色
  40711. * @returns {string} 颜色值,#rrggbb格式
  40712. */
  40713. }, {
  40714. key: "random",
  40715. value: function random() {
  40716. return '#' + Math.random().toString(16).slice(2, 8);
  40717. }
  40718. /**
  40719. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getData
  40720. * @description 获取颜色值数组,返回值范围。
  40721. * RGB 范围[0-255]
  40722. * HSL/HSV/HSB 范围[0-1]
  40723. * A透明度范围[0-1]
  40724. * 支持格式:
  40725. * #rgb
  40726. * #rrggbb
  40727. * rgb(r,g,b)
  40728. * rgb(r%,g%,b%)
  40729. * rgba(r,g,b,a)
  40730. * hsb(h,s,b) // hsv与hsb等价
  40731. * hsb(h%,s%,b%)
  40732. * hsba(h,s,b,a)
  40733. * hsl(h,s,l)
  40734. * hsl(h%,s%,l%)
  40735. * hsla(h,s,l,a)
  40736. * @param {string} color - 颜色。
  40737. * @returns {Array.<number>} 颜色值数组或null
  40738. */
  40739. }, {
  40740. key: "getData",
  40741. value: function getData(color) {
  40742. color = this.normalize(color);
  40743. var r = color.match(this.colorRegExp);
  40744. if (r === null) {
  40745. throw new Error('The color format error'); // 颜色格式错误
  40746. }
  40747. var d;
  40748. var a;
  40749. var data = [];
  40750. var rgb;
  40751. if (r[2]) {
  40752. // #rrggbb
  40753. d = r[2].replace('#', '').split('');
  40754. rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]];
  40755. data = this.map(rgb, function (c) {
  40756. return Color.prototype.adjust.call(this, parseInt(c, 16), [0, 255]);
  40757. });
  40758. } else if (r[4]) {
  40759. // rgb rgba
  40760. var rgba = r[4].split(',');
  40761. a = rgba[3];
  40762. rgb = rgba.slice(0, 3);
  40763. data = this.map(rgb, function (c) {
  40764. c = Math.floor(c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c);
  40765. return Color.prototype.adjust.call(this, c, [0, 255]);
  40766. });
  40767. if (typeof a !== 'undefined') {
  40768. data.push(this.adjust(parseFloat(a), [0, 1]));
  40769. }
  40770. } else if (r[5] || r[6]) {
  40771. // hsb hsba hsl hsla
  40772. var hsxa = (r[5] || r[6]).split(',');
  40773. var h = parseInt(hsxa[0], 0) / 360;
  40774. var s = hsxa[1];
  40775. var x = hsxa[2];
  40776. a = hsxa[3];
  40777. data = this.map([s, x], function (c) {
  40778. return Color.prototype.adjust.call(this, parseFloat(c) / 100, [0, 1]);
  40779. });
  40780. data.unshift(h);
  40781. if (typeof a !== 'undefined') {
  40782. data.push(this.adjust(parseFloat(a), [0, 1]));
  40783. }
  40784. }
  40785. return data;
  40786. }
  40787. /**
  40788. * @function SuperMap.LevelRenderer.Tool.Color.prototype.alpha
  40789. * @description 设置颜色透明度
  40790. * @param {string} color - 颜色。
  40791. * @param {number} a - 透明度,区间[0,1]。
  40792. * @returns {string} rgba颜色值
  40793. */
  40794. }, {
  40795. key: "alpha",
  40796. value: function alpha(color, a) {
  40797. if (!this.isCalculableColor(color)) {
  40798. return color;
  40799. }
  40800. if (a === null) {
  40801. a = 1;
  40802. }
  40803. var data = this.getData(this.toRGBA(color));
  40804. data[3] = this.adjust(Number(a).toFixed(4), [0, 1]);
  40805. return this.toColor(data, 'rgba');
  40806. }
  40807. /**
  40808. * @function SuperMap.LevelRenderer.Tool.Color.prototype.map
  40809. * @description 数组映射
  40810. * @param {Array} array - 数组。
  40811. * @param {function} fun - 函数。
  40812. * @returns {string} 数组映射结果
  40813. */
  40814. }, {
  40815. key: "map",
  40816. value: function map(array, fun) {
  40817. if (typeof fun !== 'function') {
  40818. throw new TypeError();
  40819. }
  40820. var len = array ? array.length : 0;
  40821. for (var i = 0; i < len; i++) {
  40822. array[i] = fun(array[i]);
  40823. }
  40824. return array;
  40825. }
  40826. /**
  40827. * @function SuperMap.LevelRenderer.Tool.Color.prototype.adjust
  40828. * @description 调整值区间
  40829. * @param {Array.<number>} value - 数组。
  40830. * @param {Array.<number>} region - 区间。
  40831. * @returns {number} 调整后的值
  40832. */
  40833. }, {
  40834. key: "adjust",
  40835. value: function adjust(value, region) {
  40836. // < to <= & > to >=
  40837. // modify by linzhifeng 2014-05-25 because -0 == 0
  40838. if (value <= region[0]) {
  40839. value = region[0];
  40840. } else if (value >= region[1]) {
  40841. value = region[1];
  40842. }
  40843. return value;
  40844. }
  40845. /**
  40846. * @function SuperMap.LevelRenderer.Tool.Color.prototype.isCalculableColor
  40847. * @description 判断是否是可计算的颜色
  40848. * @param {string} color - 颜色。
  40849. * @returns {boolean} 是否是可计算的颜色
  40850. */
  40851. }, {
  40852. key: "isCalculableColor",
  40853. value: function isCalculableColor(color) {
  40854. return color instanceof Array || typeof color === 'string';
  40855. }
  40856. /**
  40857. * @function SuperMap.LevelRenderer.Tool.Color.prototype._HSV_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  40858. */
  40859. }, {
  40860. key: "_HSV_2_RGB",
  40861. value: function _HSV_2_RGB(data) {
  40862. var H = data[0];
  40863. var S = data[1];
  40864. var V = data[2]; // HSV from 0 to 1
  40865. var R;
  40866. var G;
  40867. var B;
  40868. if (S === 0) {
  40869. R = V * 255;
  40870. G = V * 255;
  40871. B = V * 255;
  40872. } else {
  40873. var h = H * 6;
  40874. if (h === 6) {
  40875. h = 0;
  40876. }
  40877. var i = h | 0;
  40878. var v1 = V * (1 - S);
  40879. var v2 = V * (1 - S * (h - i));
  40880. var v3 = V * (1 - S * (1 - (h - i)));
  40881. var r = 0;
  40882. var g = 0;
  40883. var b = 0;
  40884. if (i === 0) {
  40885. r = V;
  40886. g = v3;
  40887. b = v1;
  40888. } else if (i === 1) {
  40889. r = v2;
  40890. g = V;
  40891. b = v1;
  40892. } else if (i === 2) {
  40893. r = v1;
  40894. g = V;
  40895. b = v3;
  40896. } else if (i === 3) {
  40897. r = v1;
  40898. g = v2;
  40899. b = V;
  40900. } else if (i === 4) {
  40901. r = v3;
  40902. g = v1;
  40903. b = V;
  40904. } else {
  40905. r = V;
  40906. g = v1;
  40907. b = v2;
  40908. } // RGB results from 0 to 255
  40909. R = r * 255;
  40910. G = g * 255;
  40911. B = b * 255;
  40912. }
  40913. return [R, G, B];
  40914. }
  40915. /**
  40916. * @function SuperMap.LevelRenderer.Tool.Color.prototype._HSL_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  40917. */
  40918. }, {
  40919. key: "_HSL_2_RGB",
  40920. value: function _HSL_2_RGB(data) {
  40921. var H = data[0];
  40922. var S = data[1];
  40923. var L = data[2]; // HSL from 0 to 1
  40924. var R;
  40925. var G;
  40926. var B;
  40927. if (S === 0) {
  40928. R = L * 255;
  40929. G = L * 255;
  40930. B = L * 255;
  40931. } else {
  40932. var v2;
  40933. if (L < 0.5) {
  40934. v2 = L * (1 + S);
  40935. } else {
  40936. v2 = L + S - S * L;
  40937. }
  40938. var v1 = 2 * L - v2;
  40939. R = 255 * this._HUE_2_RGB(v1, v2, H + 1 / 3);
  40940. G = 255 * this._HUE_2_RGB(v1, v2, H);
  40941. B = 255 * this._HUE_2_RGB(v1, v2, H - 1 / 3);
  40942. }
  40943. return [R, G, B];
  40944. }
  40945. /**
  40946. * @function SuperMap.LevelRenderer.Tool.Color.prototype._HUE_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  40947. */
  40948. }, {
  40949. key: "_HUE_2_RGB",
  40950. value: function _HUE_2_RGB(v1, v2, vH) {
  40951. if (vH < 0) {
  40952. vH += 1;
  40953. }
  40954. if (vH > 1) {
  40955. vH -= 1;
  40956. }
  40957. if (6 * vH < 1) {
  40958. return v1 + (v2 - v1) * 6 * vH;
  40959. }
  40960. if (2 * vH < 1) {
  40961. return v2;
  40962. }
  40963. if (3 * vH < 2) {
  40964. return v1 + (v2 - v1) * (2 / 3 - vH) * 6;
  40965. }
  40966. return v1;
  40967. }
  40968. /**
  40969. * @function SuperMap.LevelRenderer.Tool.Color.prototype._RGB_2_HSB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  40970. */
  40971. }, {
  40972. key: "_RGB_2_HSB",
  40973. value: function _RGB_2_HSB(data) {
  40974. // RGB from 0 to 255
  40975. var R = data[0] / 255;
  40976. var G = data[1] / 255;
  40977. var B = data[2] / 255;
  40978. var vMin = Math.min(R, G, B); // Min. value of RGB
  40979. var vMax = Math.max(R, G, B); // Max. value of RGB
  40980. var delta = vMax - vMin; // Delta RGB value
  40981. var V = vMax;
  40982. var H;
  40983. var S; // HSV results from 0 to 1
  40984. if (delta === 0) {
  40985. H = 0;
  40986. S = 0;
  40987. } else {
  40988. S = delta / vMax;
  40989. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  40990. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  40991. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  40992. if (R === vMax) {
  40993. H = deltaB - deltaG;
  40994. } else if (G === vMax) {
  40995. H = 1 / 3 + deltaR - deltaB;
  40996. } else if (B === vMax) {
  40997. H = 2 / 3 + deltaG - deltaR;
  40998. }
  40999. if (H < 0) {
  41000. H += 1;
  41001. }
  41002. if (H > 1) {
  41003. H -= 1;
  41004. }
  41005. }
  41006. H = H * 360;
  41007. S = S * 100;
  41008. V = V * 100;
  41009. return [H, S, V];
  41010. }
  41011. /**
  41012. * @function SuperMap.LevelRenderer.Tool.Color.prototype._RGB_2_HSL。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  41013. */
  41014. }, {
  41015. key: "_RGB_2_HSL",
  41016. value: function _RGB_2_HSL(data) {
  41017. // RGB from 0 to 255
  41018. var R = data[0] / 255;
  41019. var G = data[1] / 255;
  41020. var B = data[2] / 255;
  41021. var vMin = Math.min(R, G, B); // Min. value of RGB
  41022. var vMax = Math.max(R, G, B); // Max. value of RGB
  41023. var delta = vMax - vMin; // Delta RGB value
  41024. var L = (vMax + vMin) / 2;
  41025. var H;
  41026. var S; // HSL results from 0 to 1
  41027. if (delta === 0) {
  41028. H = 0;
  41029. S = 0;
  41030. } else {
  41031. if (L < 0.5) {
  41032. S = delta / (vMax + vMin);
  41033. } else {
  41034. S = delta / (2 - vMax - vMin);
  41035. }
  41036. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  41037. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  41038. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  41039. if (R === vMax) {
  41040. H = deltaB - deltaG;
  41041. } else if (G === vMax) {
  41042. H = 1 / 3 + deltaR - deltaB;
  41043. } else if (B === vMax) {
  41044. H = 2 / 3 + deltaG - deltaR;
  41045. }
  41046. if (H < 0) {
  41047. H += 1;
  41048. }
  41049. if (H > 1) {
  41050. H -= 1;
  41051. }
  41052. }
  41053. H = H * 360;
  41054. S = S * 100;
  41055. L = L * 100;
  41056. return [H, S, L];
  41057. }
  41058. }]);
  41059. return Color;
  41060. }();
  41061. // CONCATENATED MODULE: ./src/common/util/ColorsPickerUtil.js
  41062. function ColorsPickerUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41063. 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); } }
  41064. function ColorsPickerUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorsPickerUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorsPickerUtil_defineProperties(Constructor, staticProps); return Constructor; }
  41065. var ColorRender = new Color_Color(); // let "http://www.qzu.zj.cn": "#bd10e0"
  41066. // "www.qzct.net": "#7ed321" = new SuperMap.LevelRenderer.Tool.Color();
  41067. /**
  41068. * Created by yzy on 2016/11/9.
  41069. * 色带选择器工具类 用于1、创建canvas对象,2、从几种颜色中获取一定数量的渐变色
  41070. *
  41071. */
  41072. var ColorsPickerUtil = /*#__PURE__*/function () {
  41073. function ColorsPickerUtil() {
  41074. ColorsPickerUtil_classCallCheck(this, ColorsPickerUtil);
  41075. }
  41076. ColorsPickerUtil_createClass(ColorsPickerUtil, null, [{
  41077. key: "createCanvas",
  41078. /**
  41079. * 创建DOM canvas
  41080. * @param height canvas 高度
  41081. * @param width canvas 宽度
  41082. *
  41083. */
  41084. value: function createCanvas(height, width) {
  41085. var canvas = document.createElement("canvas");
  41086. canvas.height = height;
  41087. canvas.width = width;
  41088. return canvas.getContext("2d");
  41089. }
  41090. /**
  41091. * 线性渐变。
  41092. * Parameters:
  41093. * x0 - {Number} 渐变起点。
  41094. * y0 - {Number}
  41095. * x1 - {Number} 渐变终点。
  41096. * y1 - {Number}
  41097. * colorList - {Array} 颜色列表。
  41098. *
  41099. * Returns:
  41100. * {CanvasGradient} Cavans 渐变颜色。
  41101. */
  41102. }, {
  41103. key: "getLinearGradient",
  41104. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  41105. if (!this._ctx) {
  41106. this._ctx = this.getContext();
  41107. }
  41108. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  41109. var leng = colorList.length;
  41110. var add = 1 / (leng - 1);
  41111. var offset = 0;
  41112. for (var i = 0; i < leng; i++) {
  41113. gradient.addColorStop(offset, colorList[i]);
  41114. offset += add;
  41115. }
  41116. gradient.__nonRecursion = true;
  41117. return gradient;
  41118. }
  41119. /**
  41120. * 获取 Cavans 上下文
  41121. *
  41122. * Returns:
  41123. * {Object} Cavans 上下文。
  41124. */
  41125. }, {
  41126. key: "getContext",
  41127. value: function getContext() {
  41128. if (!this._ctx) {
  41129. this._ctx = document.createElement('canvas').getContext('2d');
  41130. }
  41131. return this._ctx;
  41132. }
  41133. /**
  41134. * 获取两种颜色之间渐变颜色数组。
  41135. *
  41136. * Parameters:
  41137. * start - {color} 起始颜色。
  41138. * end - {color} 结束颜色。
  41139. * step - {Number} 渐变级数。
  41140. * colorList - {Array} 颜色列表。
  41141. *
  41142. * Returns:
  41143. * {Array} 颜色数组。
  41144. */
  41145. }, {
  41146. key: "getStepColors",
  41147. value: function getStepColors(start, end, step) {
  41148. start = ColorRender.toRGBA(start);
  41149. end = ColorRender.toRGBA(end);
  41150. start = ColorRender.getData(start);
  41151. end = ColorRender.getData(end);
  41152. var colors = [];
  41153. var stepR = (end[0] - start[0]) / step;
  41154. var stepG = (end[1] - start[1]) / step;
  41155. var stepB = (end[2] - start[2]) / step;
  41156. var stepA = (end[3] - start[3]) / step; // 生成颜色集合
  41157. // fix by linfeng 颜色堆积
  41158. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  41159. 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');
  41160. r += stepR;
  41161. g += stepG;
  41162. b += stepB;
  41163. a += stepA;
  41164. }
  41165. r = end[0];
  41166. g = end[1];
  41167. b = end[2];
  41168. a = end[3];
  41169. colors[i] = ColorRender.toColor([r, g, b, a], 'hex');
  41170. return colors;
  41171. }
  41172. /**
  41173. * APIMethod: getGradientColors
  41174. * 获取指定级数的渐变颜色数组。
  41175. *
  41176. * Parameters:
  41177. * colors - {Array{String}} 颜色组。
  41178. * total - {Number} 颜色总数。
  41179. * total - {String} 专题类型
  41180. *
  41181. * Returns:
  41182. * {Array{String}} 颜色数组。
  41183. */
  41184. }, {
  41185. key: "getGradientColors",
  41186. value: function getGradientColors(colors, total, themeType) {
  41187. var ret = [],
  41188. step;
  41189. var i,
  41190. n,
  41191. len = colors.length;
  41192. if (total === undefined) {
  41193. return;
  41194. }
  41195. if (len >= total) {
  41196. if (themeType === 'RANGE') {
  41197. for (i = 0; i < total; i++) {
  41198. ret.push(colors[i]);
  41199. }
  41200. } else {
  41201. //1/2前后取色
  41202. for (i = 0; i < total; i++) {
  41203. var ii = Math.floor(i / 2);
  41204. if (i % 2 === 0) {
  41205. ret.push(colors[ii]);
  41206. } else {
  41207. var _index = colors.length - 1 - ii;
  41208. ret.push(colors[_index]);
  41209. }
  41210. }
  41211. }
  41212. } else {
  41213. step = Math.ceil(total / (len - 1));
  41214. for (i = 0, n = len - 1; i < n; i++) {
  41215. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  41216. if (i < n - 1) {
  41217. steps.pop();
  41218. }
  41219. ret = ret.concat(steps);
  41220. } //删除多余元素
  41221. var nouse = ret.length - total;
  41222. for (var j = 0, index = 0; j < nouse; j++) {
  41223. ret.splice(index + 2, 1);
  41224. }
  41225. }
  41226. return ret;
  41227. }
  41228. }]);
  41229. return ColorsPickerUtil;
  41230. }();
  41231. SuperMap.ColorsPickerUtil = ColorsPickerUtil;
  41232. // CONCATENATED MODULE: ./src/common/util/ArrayStatistic.js
  41233. function ArrayStatistic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41234. 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); } }
  41235. function ArrayStatistic_createClass(Constructor, protoProps, staticProps) { if (protoProps) ArrayStatistic_defineProperties(Constructor.prototype, protoProps); if (staticProps) ArrayStatistic_defineProperties(Constructor, staticProps); return Constructor; }
  41236. var ArrayStatistic = /*#__PURE__*/function () {
  41237. function ArrayStatistic() {
  41238. ArrayStatistic_classCallCheck(this, ArrayStatistic);
  41239. }
  41240. ArrayStatistic_createClass(ArrayStatistic, null, [{
  41241. key: "newInstance",
  41242. // geostatsInstance: null,
  41243. /**
  41244. * 初始化插件实例
  41245. */
  41246. value: function newInstance() {
  41247. // if(!this.geostatsInstance) {
  41248. // // this.geostatsInstance = new geostats();
  41249. // // }
  41250. // window.dataList = [];
  41251. if (!this.geostatsInstance) {
  41252. this.geostatsInstance = new window.geostats();
  41253. }
  41254. return this.geostatsInstance;
  41255. }
  41256. /**
  41257. * 设置需要被处理的数组
  41258. *
  41259. * @param array
  41260. */
  41261. }, {
  41262. key: "getInstance",
  41263. value: function getInstance(array) {
  41264. var instance = this.newInstance();
  41265. instance.setSerie(array);
  41266. return instance;
  41267. }
  41268. /**
  41269. * 获取数组统计的值
  41270. *
  41271. * @param array 需要统计的数组
  41272. * @param type 统计方法
  41273. */
  41274. }, {
  41275. key: "getArrayStatistic",
  41276. value: function getArrayStatistic(array, type) {
  41277. if (!array.length) {
  41278. return 0;
  41279. }
  41280. if (type === "Sum" || type === "求和") {
  41281. return this.getSum(array);
  41282. } else if (type === "Maximum" || type === "最大值") {
  41283. return this.getMax(array);
  41284. } else if (type === "Minimum" || type === "最小值") {
  41285. return this.getMin(array);
  41286. } else if (type === "Average" || type === "平均值") {
  41287. return this.getMean(array);
  41288. } else if (type === "Median" || type === "中位数") {
  41289. return this.getMedian(array);
  41290. } else if (type === "times" || type === "计数") {
  41291. return this.getTimes(array);
  41292. }
  41293. }
  41294. /**
  41295. * 获取数组分段后的数值
  41296. *
  41297. * @param array 需要分段的数组
  41298. * @param type 分段方法
  41299. * @param segNum 分段个数
  41300. */
  41301. }, {
  41302. key: "getArraySegments",
  41303. value: function getArraySegments(array, type, segNum) {
  41304. if (type === "offset") {
  41305. return this.getEqInterval(array, segNum);
  41306. } else if (type === "jenks") {
  41307. return this.getJenks(array, segNum);
  41308. } else if (type === "square") {
  41309. // 数据都必须 >= 0
  41310. var minValue = this.getMin(array);
  41311. if (minValue >= 0) {
  41312. return this.getSqrtInterval(array, segNum);
  41313. } else {
  41314. //console.log('数据都必须 >= 0');
  41315. // Util.showMessage(Language.hasNegValue + Language.noSupportRange, 'ERROR');
  41316. return false;
  41317. }
  41318. } else if (type === "logarithm") {
  41319. // 数据都必须 > 0
  41320. var _minValue = this.getMin(array);
  41321. if (_minValue > 0) {
  41322. return this.getGeometricProgression(array, segNum);
  41323. } else {
  41324. //console.log('数据都必须 > 0');
  41325. // Util.showMessage(Language.hasZeroNegValue + Language.noSupportRange, 'ERROR');
  41326. return false;
  41327. }
  41328. }
  41329. }
  41330. /**
  41331. * 求和
  41332. * @param array
  41333. * @returns {number}
  41334. */
  41335. }, {
  41336. key: "getSum",
  41337. value: function getSum(array) {
  41338. return this.getInstance(array).sum();
  41339. }
  41340. /**
  41341. * 最小值
  41342. * @param array
  41343. * @returns {*}
  41344. */
  41345. }, {
  41346. key: "getMax",
  41347. value: function getMax(array) {
  41348. return this.getInstance(array).max();
  41349. }
  41350. /**
  41351. * 最大值
  41352. * @param array
  41353. * @returns {*}
  41354. */
  41355. }, {
  41356. key: "getMin",
  41357. value: function getMin(array) {
  41358. return this.getInstance(array).min();
  41359. }
  41360. /**
  41361. * 求平均
  41362. * @param array
  41363. * @returns {number}
  41364. */
  41365. }, {
  41366. key: "getMean",
  41367. value: function getMean(array) {
  41368. return this.getInstance(array).mean();
  41369. }
  41370. /**
  41371. * 求中位数
  41372. *
  41373. * @param array
  41374. * @returns {number}
  41375. */
  41376. }, {
  41377. key: "getMedian",
  41378. value: function getMedian(array) {
  41379. return this.getInstance(array).median();
  41380. }
  41381. /**
  41382. * 计数
  41383. *
  41384. * @param array
  41385. * @returns {number}
  41386. */
  41387. }, {
  41388. key: "getTimes",
  41389. value: function getTimes(array) {
  41390. return array.length;
  41391. }
  41392. /**
  41393. * 等距分段法
  41394. *
  41395. * @param array
  41396. * @param segNum
  41397. */
  41398. }, {
  41399. key: "getEqInterval",
  41400. value: function getEqInterval(array, segNum) {
  41401. return this.getInstance(array).getClassEqInterval(segNum);
  41402. }
  41403. /**
  41404. * 自然断裂法
  41405. *
  41406. * @param array
  41407. * @param segNum
  41408. */
  41409. }, {
  41410. key: "getJenks",
  41411. value: function getJenks(array, segNum) {
  41412. return this.getInstance(array).getClassJenks(segNum);
  41413. }
  41414. /**
  41415. * 平方根分段法
  41416. *
  41417. * @param array
  41418. * @param segNum
  41419. */
  41420. }, {
  41421. key: "getSqrtInterval",
  41422. value: function getSqrtInterval(array, segNum) {
  41423. array = array.map(function (value) {
  41424. return Math.sqrt(value);
  41425. });
  41426. var breaks = this.getInstance(array).getClassEqInterval(segNum);
  41427. return breaks.map(function (value) {
  41428. return value * value;
  41429. });
  41430. }
  41431. /**
  41432. * 对数分段法
  41433. *
  41434. * @param array
  41435. * @param segNum
  41436. */
  41437. }, {
  41438. key: "getGeometricProgression",
  41439. value: function getGeometricProgression(array, segNum) {
  41440. return this.getInstance(array).getClassGeometricProgression(segNum);
  41441. }
  41442. }]);
  41443. return ArrayStatistic;
  41444. }();
  41445. SuperMap.ArrayStatistic = ArrayStatistic;
  41446. // CONCATENATED MODULE: ./src/common/util/MapCalculateUtil.js
  41447. var MapCalculateUtil_getMeterPerMapUnit = function getMeterPerMapUnit(mapUnit) {
  41448. var earchRadiusInMeters = 6378137;
  41449. var meterPerMapUnit;
  41450. if (mapUnit === Unit.METER) {
  41451. meterPerMapUnit = 1;
  41452. } else if (mapUnit === Unit.DEGREE) {
  41453. // 每度表示多少米。
  41454. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  41455. } else if (mapUnit === Unit.KILOMETER) {
  41456. meterPerMapUnit = 1.0e-3;
  41457. } else if (mapUnit === Unit.INCH) {
  41458. meterPerMapUnit = 1 / 2.5399999918e-2;
  41459. } else if (mapUnit === Unit.FOOT) {
  41460. meterPerMapUnit = 0.3048;
  41461. } else {
  41462. return meterPerMapUnit;
  41463. }
  41464. return meterPerMapUnit;
  41465. };
  41466. // CONCATENATED MODULE: ./src/common/util/index.js
  41467. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  41468. * This program are made available under the terms of the Apache License, Version 2.0
  41469. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41470. // EXTERNAL MODULE: ./node_modules/lodash.topairs/index.js
  41471. var lodash_topairs = __webpack_require__(8);
  41472. var lodash_topairs_default = /*#__PURE__*/__webpack_require__.n(lodash_topairs);
  41473. // CONCATENATED MODULE: ./src/common/style/CartoCSS.js
  41474. 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); }
  41475. function CartoCSS_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41476. 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); } }
  41477. function CartoCSS_createClass(Constructor, protoProps, staticProps) { if (protoProps) CartoCSS_defineProperties(Constructor.prototype, protoProps); if (staticProps) CartoCSS_defineProperties(Constructor, staticProps); return Constructor; }
  41478. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  41479. * This program are made available under the terms of the Apache License, Version 2.0
  41480. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41481. /**
  41482. * @class SuperMap.CartoCSS
  41483. * @classdesc CartoCSS 解析类,其主要功能为将 CartoCSS 字符串解析为 CartoCSS 的 shader 属性风格对象。
  41484. * @category BaseTypes Style
  41485. * @param {string} cartoStr - CartoCSS 样式表字符串
  41486. * @example
  41487. * var cartocss = "@provinceLineColor:#ddd;
  41488. * #China_Provinces_L___China400{
  41489. * line-dasharray:10,10;
  41490. * line-color:@provinceLineColor;
  41491. * line-width:1;
  41492. * }";
  41493. * new SuperMap.CartoCSS(cartocss);
  41494. */
  41495. /*eslint no-useless-escape: "off"*/
  41496. var CartoCSS_CartoCSS = /*#__PURE__*/function () {
  41497. function CartoCSS(cartoStr) {
  41498. CartoCSS_classCallCheck(this, CartoCSS);
  41499. this.env = null;
  41500. /**
  41501. * @member SuperMap.CartoCSS.prototype.parser
  41502. * @description 解析器
  41503. */
  41504. this.parser = null;
  41505. /**
  41506. * @member SuperMap.CartoCSS.prototype.ruleSet
  41507. * @description CartoCSS 规则对象
  41508. */
  41509. this.ruleSet = null;
  41510. /**
  41511. * @member SuperMap.CartoCSS.prototype.cartoStr
  41512. * @description CartoCSS 样式表字符串
  41513. */
  41514. this.cartoStr = "";
  41515. /**
  41516. * @member SuperMap.CartoCSS.prototype.shaders
  41517. * @description Carto 着色器集
  41518. */
  41519. this.shaders = null;
  41520. if (typeof cartoStr === "string") {
  41521. this.cartoStr = cartoStr;
  41522. this.env = {
  41523. frames: [],
  41524. errors: [],
  41525. error: function error(obj) {
  41526. this.errors.push(obj);
  41527. }
  41528. };
  41529. this.parser = this.getParser(this.env);
  41530. this.parse(cartoStr);
  41531. this.shaders = this.toShaders();
  41532. }
  41533. }
  41534. /**
  41535. * @function SuperMap.CartoCSS.prototype.getParser
  41536. * @description 获取 CartoCSS 解析器
  41537. */
  41538. CartoCSS_createClass(CartoCSS, [{
  41539. key: "getParser",
  41540. value: function getParser(env) {
  41541. var input, // LeSS input string
  41542. i, // current index in `input`
  41543. j, // current chunk
  41544. temp, // temporarily holds a chunk's state, for backtracking
  41545. memo, // temporarily holds `i`, when backtracking
  41546. furthest, // furthest index the parser has gone to
  41547. chunks, // chunkified input
  41548. current, // index of current chunk, in `input`
  41549. parser;
  41550. var that = this; // This function is called after all files
  41551. // have been imported through `@import`.
  41552. var finish = function finish() {//NOSONAR
  41553. //所有文件导入完成之后调用
  41554. };
  41555. function save() {
  41556. temp = chunks[j];
  41557. memo = i;
  41558. current = i;
  41559. }
  41560. function restore() {
  41561. chunks[j] = temp;
  41562. i = memo;
  41563. current = i;
  41564. }
  41565. function sync() {
  41566. if (i > current) {
  41567. chunks[j] = chunks[j].slice(i - current);
  41568. current = i;
  41569. }
  41570. } //
  41571. // Parse from a token, regexp or string, and move forward if match
  41572. //
  41573. function _match(tok) {
  41574. var match, length, c, endIndex; // Non-terminal
  41575. if (tok instanceof Function) {
  41576. return tok.call(parser.parsers); // Terminal
  41577. // Either match a single character in the input,
  41578. // or match a regexp in the current chunk (chunk[j]).
  41579. } else if (typeof tok === 'string') {
  41580. match = input.charAt(i) === tok ? tok : null;
  41581. length = 1;
  41582. sync();
  41583. } else {
  41584. sync();
  41585. match = tok.exec(chunks[j]);
  41586. if (match) {
  41587. length = match[0].length;
  41588. } else {
  41589. return null;
  41590. }
  41591. } // The match is confirmed, add the match length to `i`,
  41592. // and consume any extra white-space characters (' ' || '\n')
  41593. // which come after that. The reason for this is that LeSS's
  41594. // grammar is mostly white-space insensitive.
  41595. if (match) {
  41596. var mem = i += length;
  41597. endIndex = i + chunks[j].length - length;
  41598. while (i < endIndex) {
  41599. c = input.charCodeAt(i);
  41600. if (!(c === 32 || c === 10 || c === 9)) {
  41601. break;
  41602. }
  41603. i++;
  41604. }
  41605. chunks[j] = chunks[j].slice(length + (i - mem));
  41606. current = i;
  41607. if (chunks[j].length === 0 && j < chunks.length - 1) {
  41608. j++;
  41609. }
  41610. if (typeof match === 'string') {
  41611. return match;
  41612. } else {
  41613. return match.length === 1 ? match[0] : match;
  41614. }
  41615. }
  41616. } // Same as _match(), but don't change the state of the parser,
  41617. // just return the match.
  41618. function peek(tok) {
  41619. if (typeof tok === 'string') {
  41620. return input.charAt(i) === tok;
  41621. } else {
  41622. return !!tok.test(chunks[j]);
  41623. }
  41624. } // Make an error object from a passed set of properties.
  41625. // Accepted properties:
  41626. // - `message`: Text of the error message.
  41627. // - `filename`: Filename where the error occurred.
  41628. // - `index`: Char. index where the error occurred.
  41629. function makeError(err) {
  41630. var einput;
  41631. var defautls = {
  41632. index: furthest,
  41633. filename: env.filename,
  41634. message: 'Parse error.',
  41635. line: 0,
  41636. column: -1
  41637. };
  41638. for (var prop in defautls) {
  41639. if (err[prop] === 0) {
  41640. err[prop] = defautls[prop];
  41641. }
  41642. }
  41643. if (err.filename && that.env.inputs && that.env.inputs[err.filename]) {
  41644. einput = that.env.inputs[err.filename];
  41645. } else {
  41646. einput = input;
  41647. }
  41648. err.line = (einput.slice(0, err.index).match(/\n/g) || '').length + 1;
  41649. for (var n = err.index; n >= 0 && einput.charAt(n) !== '\n'; n--) {
  41650. err.column++;
  41651. }
  41652. return new Error([err.filename, err.line, err.column, err.message].join(";"));
  41653. }
  41654. this.env = env = env || {};
  41655. this.env.filename = this.env.filename || null;
  41656. this.env.inputs = this.env.inputs || {}; // The Parser
  41657. parser = {
  41658. // Parse an input string into an abstract syntax tree.
  41659. // Throws an error on parse errors.
  41660. parse: function parse(str) {
  41661. var root,
  41662. error = null;
  41663. i = j = current = furthest = 0;
  41664. chunks = [];
  41665. input = str.replace(/\r\n/g, '\n');
  41666. if (env.filename) {
  41667. that.env.inputs[env.filename] = input;
  41668. } // Split the input into chunks.
  41669. chunks = function (chunks) {
  41670. var j = 0,
  41671. skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
  41672. comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
  41673. string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
  41674. level = 0,
  41675. match,
  41676. chunk = chunks[0],
  41677. inParam;
  41678. for (var i = 0, c, cc; i < input.length;) {
  41679. skip.lastIndex = i;
  41680. if (match = skip.exec(input)) {
  41681. if (match.index === i) {
  41682. i += match[0].length;
  41683. chunk.push(match[0]);
  41684. }
  41685. }
  41686. c = input.charAt(i);
  41687. comment.lastIndex = string.lastIndex = i;
  41688. if (match = string.exec(input)) {
  41689. if (match.index === i) {
  41690. i += match[0].length;
  41691. chunk.push(match[0]);
  41692. continue;
  41693. }
  41694. }
  41695. if (!inParam && c === '/') {
  41696. cc = input.charAt(i + 1);
  41697. if (cc === '/' || cc === '*') {
  41698. if (match = comment.exec(input)) {
  41699. if (match.index === i) {
  41700. i += match[0].length;
  41701. chunk.push(match[0]);
  41702. continue;
  41703. }
  41704. }
  41705. }
  41706. }
  41707. switch (c) {
  41708. case '{':
  41709. //NOSONAR
  41710. if (!inParam) {
  41711. level++;
  41712. chunk.push(c);
  41713. break;
  41714. }
  41715. case '}':
  41716. //NOSONAR
  41717. if (!inParam) {
  41718. level--;
  41719. chunk.push(c);
  41720. chunks[++j] = chunk = [];
  41721. break;
  41722. }
  41723. case '(':
  41724. //NOSONAR
  41725. if (!inParam) {
  41726. inParam = true;
  41727. chunk.push(c);
  41728. break;
  41729. }
  41730. case ')':
  41731. //NOSONAR
  41732. if (inParam) {
  41733. inParam = false;
  41734. chunk.push(c);
  41735. break;
  41736. }
  41737. default:
  41738. chunk.push(c);
  41739. break;
  41740. }
  41741. i++;
  41742. }
  41743. if (level !== 0) {
  41744. error = {
  41745. index: i - 1,
  41746. type: 'Parse',
  41747. message: level > 0 ? "missing closing `}`" : "missing opening `{`"
  41748. };
  41749. }
  41750. return chunks.map(function (c) {
  41751. return c.join('');
  41752. });
  41753. }([[]]);
  41754. if (error) {
  41755. throw makeError(error);
  41756. } // Sort rules by specificity: this function expects selectors to be
  41757. // split already.
  41758. //
  41759. // Written to be used as a .sort(Function);
  41760. // argument.
  41761. //
  41762. // [1, 0, 0, 467] > [0, 0, 1, 520]
  41763. var specificitySort = function specificitySort(a, b) {
  41764. var as = a.specificity;
  41765. var bs = b.specificity;
  41766. if (as[0] != bs[0]) {
  41767. return bs[0] - as[0];
  41768. }
  41769. if (as[1] != bs[1]) {
  41770. return bs[1] - as[1];
  41771. }
  41772. if (as[2] != bs[2]) {
  41773. return bs[2] - as[2];
  41774. }
  41775. return bs[3] - as[3];
  41776. }; // Start with the primary rule.
  41777. // The whole syntax tree is held under a Ruleset node,
  41778. // with the `root` property set to true, so no `{}` are
  41779. // output.
  41780. root = new SuperMap.CartoCSS.Tree.Ruleset([], _match(this.parsers.primary));
  41781. root.root = true; // Get an array of Ruleset objects, flattened
  41782. // and sorted according to specificitySort
  41783. root.toList = function () {
  41784. return function (env) {
  41785. env.error = function (e) {
  41786. if (!env.errors) {
  41787. env.errors = new Error('');
  41788. }
  41789. if (env.errors.message) {
  41790. env.errors.message += '\n' + makeError(e).message;
  41791. } else {
  41792. env.errors.message = makeError(e).message;
  41793. }
  41794. };
  41795. env.frames = env.frames || []; // call populates Invalid-caused errors
  41796. var definitions = this.flatten([], [], env);
  41797. definitions.sort(specificitySort);
  41798. return definitions;
  41799. };
  41800. }();
  41801. return root;
  41802. },
  41803. // Here in, the parsing rules/functions
  41804. //
  41805. // The basic structure of the syntax tree generated is as follows:
  41806. //
  41807. // Ruleset -> Rule -> Value -> Expression -> Entity
  41808. //
  41809. // In general, most rules will try to parse a token with the `_match()` function, and if the return
  41810. // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
  41811. // first, before parsing, that's when we use `peek()`.
  41812. parsers: {
  41813. // The `primary` rule is the *entry* and *exit* point of the parser.
  41814. // The rules here can appear at any level of the parse tree.
  41815. //
  41816. // The recursive nature of the grammar is an interplay between the `block`
  41817. // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
  41818. // as represented by this simplified grammar:
  41819. //
  41820. // primary → (ruleset | rule)+
  41821. // ruleset → selector+ block
  41822. // block → '{' primary '}'
  41823. //
  41824. // Only at one point is the primary rule not called from the
  41825. // block rule: at the root level.
  41826. primary: function primary() {
  41827. var node,
  41828. root = [];
  41829. while ((node = _match(this.rule) || _match(this.ruleset) || _match(this.comment)) || _match(/^[\s\n]+/) || (node = _match(this.invalid))) {
  41830. if (node) {
  41831. root.push(node);
  41832. }
  41833. }
  41834. return root;
  41835. },
  41836. invalid: function invalid() {
  41837. var chunk = _match(/^[^;\n]*[;\n]/); // To fail gracefully, match everything until a semicolon or linebreak.
  41838. if (chunk) {
  41839. return new SuperMap.CartoCSS.Tree.Invalid(chunk, memo);
  41840. }
  41841. },
  41842. // We create a Comment node for CSS comments `/* */`,
  41843. // but keep the LeSS comments `//` silent, by just skipping
  41844. // over them.
  41845. comment: function comment() {
  41846. var comment;
  41847. if (input.charAt(i) !== '/') {
  41848. return;
  41849. }
  41850. if (input.charAt(i + 1) === '/') {
  41851. return new SuperMap.CartoCSS.Tree.Comment(_match(/^\/\/.*/), true);
  41852. } else if (comment = _match(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
  41853. return new SuperMap.CartoCSS.Tree.Comment(comment);
  41854. }
  41855. },
  41856. // Entities are tokens which can be found inside an Expression
  41857. entities: {
  41858. // A string, which supports escaping " and ' "milky way" 'he\'s the one!'
  41859. quoted: function quoted() {
  41860. if (input.charAt(i) !== '"' && input.charAt(i) !== "'") {
  41861. return;
  41862. }
  41863. var str = _match(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);
  41864. if (str) {
  41865. return new SuperMap.CartoCSS.Tree.Quoted(str[1] || str[2]);
  41866. }
  41867. },
  41868. // A reference to a Mapnik field, like [NAME]
  41869. // Behind the scenes, this has the same representation, but Carto
  41870. // needs to be careful to warn when unsupported operations are used.
  41871. field: function field() {
  41872. var l = '[',
  41873. r = ']';
  41874. if (!_match(l)) {
  41875. return;
  41876. }
  41877. var field_name = _match(/(^[^\]]+)/);
  41878. if (!_match(r)) {
  41879. return;
  41880. }
  41881. if (field_name) {
  41882. return new SuperMap.CartoCSS.Tree.Field(field_name[1]);
  41883. }
  41884. },
  41885. // This is a comparison operator
  41886. comparison: function comparison() {
  41887. var str = _match(/^=~|=|!=|<=|>=|<|>/);
  41888. if (str) {
  41889. return str;
  41890. }
  41891. },
  41892. // A catch-all word, such as: hard-light
  41893. // These can start with either a letter or a dash (-),
  41894. // and then contain numbers, underscores, and letters.
  41895. keyword: function keyword() {
  41896. var k = _match(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);
  41897. if (k) {
  41898. return new SuperMap.CartoCSS.Tree.Keyword(k);
  41899. }
  41900. },
  41901. // A function call like rgb(255, 0, 255)
  41902. // The arguments are parsed with the `entities.arguments` parser.
  41903. call: function call() {
  41904. var name, args;
  41905. if (!(name = /^([\w\-]+|%)\(/.exec(chunks[j]))) {
  41906. return;
  41907. }
  41908. name = name[1];
  41909. if (name === 'url') {
  41910. // url() is handled by the url parser instead
  41911. return null;
  41912. } else {
  41913. i += name.length;
  41914. }
  41915. var l = '(',
  41916. r = ')';
  41917. _match(l); // Parse the '(' and consume whitespace.
  41918. args = _match(this.entities['arguments']);
  41919. if (!_match(r)) {
  41920. return;
  41921. }
  41922. if (name) {
  41923. return new SuperMap.CartoCSS.Tree.Call(name, args, i);
  41924. }
  41925. },
  41926. // Arguments are comma-separated expressions
  41927. 'arguments': function _arguments() {
  41928. var args = [],
  41929. arg;
  41930. while (arg = _match(this.expression)) {
  41931. args.push(arg);
  41932. var q = ',';
  41933. if (!_match(q)) {
  41934. break;
  41935. }
  41936. }
  41937. return args;
  41938. },
  41939. literal: function literal() {
  41940. return _match(this.entities.dimension) || _match(this.entities.keywordcolor) || _match(this.entities.hexcolor) || _match(this.entities.quoted);
  41941. },
  41942. // Parse url() tokens
  41943. //
  41944. // We use a specific rule for urls, because they don't really behave like
  41945. // standard function calls. The difference is that the argument doesn't have
  41946. // to be enclosed within a string, so it can't be parsed as an Expression.
  41947. url: function url() {
  41948. var value;
  41949. if (input.charAt(i) !== 'u' || !_match(/^url\(/)) {
  41950. return;
  41951. }
  41952. value = _match(this.entities.quoted) || _match(this.entities.variable) || _match(/^[\-\w%@_match\/.&=:;#+?~]+/) || '';
  41953. var r = ')';
  41954. if (!_match(r)) {
  41955. return new SuperMap.CartoCSS.Tree.Invalid(value, memo, 'Missing closing ) in URL.');
  41956. } else {
  41957. return new SuperMap.CartoCSS.Tree.URL(typeof value.value !== 'undefined' || value instanceof SuperMap.CartoCSS.Tree.Variable ? value : new SuperMap.CartoCSS.Tree.Quoted(value));
  41958. }
  41959. },
  41960. // A Variable entity, such as `@fink`, in
  41961. //
  41962. // width: @fink + 2px
  41963. //
  41964. // We use a different parser for variable definitions,
  41965. // see `parsers.variable`.
  41966. variable: function variable() {
  41967. var name,
  41968. index = i;
  41969. if (input.charAt(i) === '@' && (name = _match(/^@[\w-]+/))) {
  41970. return new SuperMap.CartoCSS.Tree.Variable(name, index, env.filename);
  41971. }
  41972. },
  41973. hexcolor: function hexcolor() {
  41974. var rgb;
  41975. if (input.charAt(i) === '#' && (rgb = _match(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
  41976. return new SuperMap.CartoCSS.Tree.Color(rgb[1]);
  41977. }
  41978. },
  41979. keywordcolor: function keywordcolor() {
  41980. var rgb = chunks[j].match(/^[a-z]+/);
  41981. if (rgb && rgb[0] in SuperMap.CartoCSS.Tree.Reference.data.colors) {
  41982. return new SuperMap.CartoCSS.Tree.Color(SuperMap.CartoCSS.Tree.Reference.data.colors[_match(/^[a-z]+/)]);
  41983. }
  41984. },
  41985. // A Dimension, that is, a number and a unit. The only
  41986. // unit that has an effect is %
  41987. dimension: function dimension() {
  41988. var c = input.charCodeAt(i);
  41989. if (c > 57 || c < 45 || c === 47) {
  41990. return;
  41991. }
  41992. var value = _match(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);
  41993. if (value) {
  41994. return new SuperMap.CartoCSS.Tree.Dimension(value[1], value[2], memo);
  41995. }
  41996. }
  41997. },
  41998. // The variable part of a variable definition.
  41999. // Used in the `rule` parser. Like @fink:
  42000. variable: function variable() {
  42001. var name;
  42002. if (input.charAt(i) === '@' && (name = _match(/^(@[\w-]+)\s*:/))) {
  42003. return name[1];
  42004. }
  42005. },
  42006. // Entities are the smallest recognized token,
  42007. // and can be found inside a rule's value.
  42008. entity: function entity() {
  42009. var property1 = _match(this.entities.call) || _match(this.entities.literal);
  42010. var property2 = _match(this.entities.field) || _match(this.entities.variable);
  42011. var property3 = _match(this.entities.url) || _match(this.entities.keyword);
  42012. return property1 || property2 || property3;
  42013. },
  42014. // A Rule terminator. Note that we use `peek()` to check for '}',
  42015. // because the `block` rule will be expecting it, but we still need to make sure
  42016. // it's there, if ';' was ommitted.
  42017. end: function end() {
  42018. var q = ';';
  42019. return _match(q) || peek('}');
  42020. },
  42021. // Elements are the building blocks for Selectors. They consist of
  42022. // an element name, such as a tag a class, or `*`.
  42023. //增加对中文的支持,[\u4e00-\u9fa5]
  42024. element: function element() {
  42025. var e = _match(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);
  42026. if (e) {
  42027. return new SuperMap.CartoCSS.Tree.Element(e);
  42028. }
  42029. },
  42030. // Attachments allow adding multiple lines, polygons etc. to an
  42031. // object. There can only be one attachment per selector.
  42032. attachment: function attachment() {
  42033. var s = _match(/^::([\w\-]+(?:\/[\w\-]+)*)/);
  42034. if (s) {
  42035. return s[1];
  42036. }
  42037. },
  42038. // Selectors are made out of one or more Elements, see above.
  42039. selector: function selector() {
  42040. var a,
  42041. attachment,
  42042. e,
  42043. elements = [],
  42044. f,
  42045. filters = new SuperMap.CartoCSS.Tree.Filterset(),
  42046. z,
  42047. zooms = [],
  42048. segments = 0,
  42049. conditions = 0;
  42050. while ((e = _match(this.element)) || (z = _match(this.zoom)) || (f = _match(this.filter)) || (a = _match(this.attachment))) {
  42051. segments++;
  42052. if (e) {
  42053. elements.push(e);
  42054. } else if (z) {
  42055. zooms.push(z);
  42056. conditions++;
  42057. } else if (f) {
  42058. var err = filters.add(f);
  42059. if (err) {
  42060. throw makeError({
  42061. message: err,
  42062. index: i - 1
  42063. });
  42064. }
  42065. conditions++;
  42066. } else if (attachment) {
  42067. throw makeError({
  42068. message: 'Encountered second attachment name.',
  42069. index: i - 1
  42070. });
  42071. } else {
  42072. attachment = a;
  42073. }
  42074. var c = input.charAt(i);
  42075. if (c === '{' || c === '}' || c === ';' || c === ',') {
  42076. break;
  42077. }
  42078. }
  42079. if (segments) {
  42080. return new SuperMap.CartoCSS.Tree.Selector(filters, zooms, elements, attachment, conditions, memo);
  42081. }
  42082. },
  42083. filter: function filter() {
  42084. save();
  42085. var key,
  42086. op,
  42087. val,
  42088. l = '[',
  42089. r = ']';
  42090. if (!_match(l)) {
  42091. return;
  42092. }
  42093. if (key = _match(/^[a-zA-Z0-9\-_]+/) || _match(this.entities.quoted) || _match(this.entities.variable) || _match(this.entities.keyword) || _match(this.entities.field)) {
  42094. if (key instanceof SuperMap.CartoCSS.Tree.Quoted) {
  42095. key = new SuperMap.CartoCSS.Tree.Field(key.toString());
  42096. }
  42097. 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))) {
  42098. if (!_match(r)) {
  42099. throw makeError({
  42100. message: 'Missing closing ] of filter.',
  42101. index: memo - 1
  42102. });
  42103. }
  42104. if (!key.is) {
  42105. key = new SuperMap.CartoCSS.Tree.Field(key);
  42106. }
  42107. return new SuperMap.CartoCSS.Tree.Filter(key, op, val, memo, env.filename);
  42108. }
  42109. }
  42110. },
  42111. zoom: function zoom() {
  42112. save();
  42113. var op,
  42114. val,
  42115. r = ']';
  42116. if (_match(/^\[\s*zoom/g) && (op = _match(this.entities.comparison)) && (val = _match(this.entities.variable) || _match(this.entities.dimension)) && _match(r)) {
  42117. return new SuperMap.CartoCSS.Tree.Zoom(op, val, memo);
  42118. } else {
  42119. // backtrack
  42120. restore();
  42121. }
  42122. },
  42123. // The `block` rule is used by `ruleset`
  42124. // It's a wrapper around the `primary` rule, with added `{}`.
  42125. block: function block() {
  42126. var content,
  42127. l = '{',
  42128. r = '}';
  42129. if (_match(l) && (content = _match(this.primary)) && _match(r)) {
  42130. return content;
  42131. }
  42132. },
  42133. // div, .class, body > p {...}
  42134. ruleset: function ruleset() {
  42135. var selectors = [],
  42136. s,
  42137. rules,
  42138. q = ',';
  42139. save();
  42140. while (s = _match(this.selector)) {
  42141. selectors.push(s);
  42142. while (_match(this.comment)) {//NOSONAR
  42143. }
  42144. if (!_match(q)) {
  42145. break;
  42146. }
  42147. while (_match(this.comment)) {//NOSONAR
  42148. }
  42149. }
  42150. if (s) {
  42151. while (_match(this.comment)) {//NOSONAR
  42152. }
  42153. }
  42154. if (selectors.length > 0 && (rules = _match(this.block))) {
  42155. if (selectors.length === 1 && selectors[0].elements.length && selectors[0].elements[0].value === 'Map') {
  42156. var rs = new SuperMap.CartoCSS.Tree.Ruleset(selectors, rules);
  42157. rs.isMap = true;
  42158. return rs;
  42159. }
  42160. return new SuperMap.CartoCSS.Tree.Ruleset(selectors, rules);
  42161. } else {
  42162. // Backtrack
  42163. restore();
  42164. }
  42165. },
  42166. rule: function rule() {
  42167. var name,
  42168. value,
  42169. c = input.charAt(i);
  42170. save();
  42171. if (c === '.' || c === '#') {
  42172. return;
  42173. }
  42174. if (name = _match(this.variable) || _match(this.property)) {
  42175. value = _match(this.value);
  42176. if (value && _match(this.end)) {
  42177. return new SuperMap.CartoCSS.Tree.Rule(name, value, memo, env.filename);
  42178. } else {
  42179. furthest = i;
  42180. restore();
  42181. }
  42182. }
  42183. },
  42184. font: function font() {
  42185. var value = [],
  42186. expression = [],
  42187. e,
  42188. q = ',';
  42189. while (e = _match(this.entity)) {
  42190. expression.push(e);
  42191. }
  42192. value.push(new SuperMap.CartoCSS.Tree.Expression(expression));
  42193. if (_match(q)) {
  42194. while (e = _match(this.expression)) {
  42195. value.push(e);
  42196. if (!_match(q)) {
  42197. break;
  42198. }
  42199. }
  42200. }
  42201. return new SuperMap.CartoCSS.Tree.Value(value);
  42202. },
  42203. // A Value is a comma-delimited list of Expressions
  42204. // In a Rule, a Value represents everything after the `:`,
  42205. // and before the `;`.
  42206. value: function value() {
  42207. var e,
  42208. expressions = [],
  42209. q = ',';
  42210. while (e = _match(this.expression)) {
  42211. expressions.push(e);
  42212. if (!_match(q)) {
  42213. break;
  42214. }
  42215. }
  42216. if (expressions.length > 1) {
  42217. return new SuperMap.CartoCSS.Tree.Value(expressions.map(function (e) {
  42218. return e.value[0];
  42219. }));
  42220. } else if (expressions.length === 1) {
  42221. return new SuperMap.CartoCSS.Tree.Value(expressions);
  42222. }
  42223. },
  42224. // A sub-expression, contained by parenthensis
  42225. sub: function sub() {
  42226. var e,
  42227. l = '(',
  42228. r = ")";
  42229. if (_match(l) && (e = _match(this.expression)) && _match(r)) {
  42230. return e;
  42231. }
  42232. },
  42233. // This is a misnomer because it actually handles multiplication
  42234. // and division.
  42235. multiplication: function multiplication() {
  42236. var m,
  42237. a,
  42238. op,
  42239. operation,
  42240. q = '/';
  42241. if (m = _match(this.operand)) {
  42242. while ((op = _match(q) || _match('*') || _match('%')) && (a = _match(this.operand))) {
  42243. operation = new SuperMap.CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  42244. }
  42245. return operation || m;
  42246. }
  42247. },
  42248. addition: function addition() {
  42249. var m,
  42250. a,
  42251. op,
  42252. operation,
  42253. plus = '+';
  42254. if (m = _match(this.multiplication)) {
  42255. while ((op = _match(/^[-+]\s+/) || input.charAt(i - 1) != ' ' && (_match(plus) || _match('-'))) && (a = _match(this.multiplication))) {
  42256. operation = new SuperMap.CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  42257. }
  42258. return operation || m;
  42259. }
  42260. },
  42261. // An operand is anything that can be part of an operation,
  42262. // such as a Color, or a Variable
  42263. operand: function operand() {
  42264. return _match(this.sub) || _match(this.entity);
  42265. },
  42266. // Expressions either represent mathematical operations,
  42267. // or white-space delimited Entities. @var * 2
  42268. expression: function expression() {
  42269. var e,
  42270. entities = [];
  42271. while (e = _match(this.addition) || _match(this.entity)) {
  42272. entities.push(e);
  42273. }
  42274. if (entities.length > 0) {
  42275. return new SuperMap.CartoCSS.Tree.Expression(entities);
  42276. }
  42277. },
  42278. property: function property() {
  42279. var name = _match(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);
  42280. if (name) {
  42281. return name[1];
  42282. }
  42283. }
  42284. }
  42285. };
  42286. return parser;
  42287. }
  42288. /**
  42289. * @function SuperMap.CartoCSS.prototype.parse
  42290. * @description 利用CartoCSS解析器里面的parse方法,将CartoCSS样式表字符串转化为CartoCSS规则集
  42291. * @returns {Object} CartoCSS规则集
  42292. */
  42293. }, {
  42294. key: "parse",
  42295. value: function parse(str) {
  42296. var parser = this.parser;
  42297. var ruleSet = this.ruleSet = parser.parse(str);
  42298. return ruleSet;
  42299. }
  42300. /**
  42301. * @function SuperMap.CartoCSS.prototype.toShaders
  42302. * @description 将CartoCSS规则集转化为着色器
  42303. * @returns {Array} CartoCSS着色器集
  42304. */
  42305. }, {
  42306. key: "toShaders",
  42307. value: function toShaders() {
  42308. if (this.ruleSet) {
  42309. var ruleset = this.ruleSet;
  42310. if (ruleset) {
  42311. var defs = ruleset.toList(this.env);
  42312. defs.reverse();
  42313. var shaders = {};
  42314. var keys = [];
  42315. this._toShaders(shaders, keys, defs);
  42316. var ordered_shaders = [];
  42317. var done = {};
  42318. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  42319. var def = defs[i];
  42320. var k = def.attachment;
  42321. var shader = shaders[keys[i]];
  42322. var shaderArray = [];
  42323. if (!done[k]) {
  42324. var j = 0;
  42325. for (var prop in shader) {
  42326. if (prop !== 'zoom' && prop !== 'frames' && prop !== "attachment" && prop != "elements") {
  42327. //对layer-index作特殊处理以实现图层的控制
  42328. if (prop === "layer-index") {
  42329. /*var getLayerIndex = Function("attributes", "zoom", "var _value = null;" + shader[prop].join('\n') + "; return _value; ");*/
  42330. var getLayerIndex = function getLayerIndex(attributes, zoom) {
  42331. //NOSONAR
  42332. var _value = null;
  42333. shader[prop].join('\n');
  42334. return _value;
  42335. };
  42336. var layerIndex = getLayerIndex();
  42337. Object.defineProperty(shaderArray, "layerIndex", {
  42338. configurable: true,
  42339. enumerable: false,
  42340. value: layerIndex
  42341. });
  42342. } else {
  42343. shaderArray[j++] = function (ops, shaderArray) {
  42344. //NOSONAR
  42345. if (!Array.isArray(ops)) {
  42346. return ops;
  42347. }
  42348. var body = ops.join('\n');
  42349. var myKeyword = 'attributes["FEATUREID"]&&attributes["FEATUREID"]';
  42350. var index = body.indexOf(myKeyword);
  42351. if (index >= 0) {
  42352. //对featureID作一些特殊处理,以将featureID提取出来
  42353. if (!shaderArray.featureFilter) {
  42354. var featureFilterStart = index + myKeyword.length;
  42355. var featureFilterEnd = body.indexOf(")", featureFilterStart + 1);
  42356. var featureFilterStr = "featureId&&(featureId" + body.substring(featureFilterStart, featureFilterEnd) + ")";
  42357. /*var featureFilter = Function("featureId", "if(" + featureFilterStr + "){return true;}return false;");*/
  42358. var featureFilter = function featureFilter(featureId) {
  42359. if (featureFilterStr) {
  42360. return true;
  42361. }
  42362. return false;
  42363. };
  42364. Object.defineProperty(shaderArray, "featureFilter", {
  42365. configurable: true,
  42366. enumerable: false,
  42367. value: featureFilter
  42368. });
  42369. }
  42370. return {
  42371. "property": prop,
  42372. "getValue": Function("attributes", "zoom", "seftFilter", "var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){" + body + ";} return _value; ") //NOSONAR
  42373. };
  42374. } else {
  42375. return {
  42376. "property": prop,
  42377. "getValue": Function("attributes", "zoom", "var _value = null;" + body + "; return _value; ") //NOSONAR
  42378. };
  42379. }
  42380. }(shader[prop], shaderArray);
  42381. }
  42382. }
  42383. }
  42384. Object.defineProperty(shaderArray, "attachment", {
  42385. configurable: true,
  42386. enumerable: false,
  42387. value: k
  42388. });
  42389. Object.defineProperty(shaderArray, "elements", {
  42390. configurable: true,
  42391. enumerable: false,
  42392. value: def.elements
  42393. });
  42394. ordered_shaders.push(shaderArray);
  42395. done[keys[i]] = true;
  42396. }
  42397. Object.defineProperty(shaderArray, "zoom", {
  42398. configurable: true,
  42399. enumerable: false,
  42400. value: def.zoom
  42401. }); //shader.frames.push(def.frame_offset);
  42402. }
  42403. return ordered_shaders;
  42404. }
  42405. }
  42406. return null;
  42407. }
  42408. }, {
  42409. key: "_toShaders",
  42410. value: function _toShaders(shaders, keys, defs) {
  42411. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  42412. var def = defs[i];
  42413. var element_str = [];
  42414. for (var j = 0, len1 = def.elements.length; j < len1; j++) {
  42415. element_str.push(def.elements[j]);
  42416. }
  42417. var filters = def.filters.filters;
  42418. var filterStr = [];
  42419. for (var attr in filters) {
  42420. filterStr.push(filters[attr].id);
  42421. }
  42422. var key = element_str.join("/") + "::" + def.attachment + "_" + filterStr.join("_");
  42423. keys.push(key);
  42424. var shader = shaders[key] = shaders[key] || {}; //shader.frames = [];
  42425. shader.zoom = SuperMap.CartoCSS.Tree.Zoom.all;
  42426. var props = def.toJS(this.env);
  42427. for (var v in props) {
  42428. (shader[v] = shader[v] || []).push(props[v].join('\n'));
  42429. }
  42430. }
  42431. }
  42432. /**
  42433. * @function SuperMap.CartoCSS.prototype.getShaders
  42434. * @description 获取CartoCSS着色器
  42435. * @returns {Array} 着色器集
  42436. * @example
  42437. * //shaders的结构大概如下:
  42438. * var shaders=[
  42439. * {
  42440. * attachment:"one",
  42441. * elements:[],
  42442. * zoom:23,
  42443. * length:2,
  42444. * 0:{property:"line-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  42445. * 1:{preoperty:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  42446. * },
  42447. * {
  42448. * attachment:"two",
  42449. * elements:[],
  42450. * zoom:23,
  42451. * length:2,
  42452. * 0:{property:"polygon-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  42453. * 1:{property:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  42454. * }
  42455. * ];
  42456. */
  42457. }, {
  42458. key: "getShaders",
  42459. value: function getShaders() {
  42460. return this.shaders;
  42461. }
  42462. /**
  42463. * @function SuperMap.CartoCSS.prototype.destroy
  42464. * @description CartoCSS解析对象的析构函数,用于销毁CartoCSS解析对象
  42465. */
  42466. }, {
  42467. key: "destroy",
  42468. value: function destroy() {
  42469. this.cartoStr = null;
  42470. this.env = null;
  42471. this.ruleSet = null;
  42472. this.parser = null;
  42473. this.shaders = null;
  42474. }
  42475. }]);
  42476. return CartoCSS;
  42477. }();
  42478. SuperMap._mapnik_reference_latest = {
  42479. "version": "2.1.1",
  42480. "style": {
  42481. "filter-mode": {
  42482. "type": ["all", "first"],
  42483. "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)",
  42484. "default-value": "all",
  42485. "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."
  42486. },
  42487. "image-filters": {
  42488. "css": "image-filters",
  42489. "default-value": "none",
  42490. "default-meaning": "no filters",
  42491. "type": "functions",
  42492. "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]],
  42493. "doc": "A list of image filters."
  42494. },
  42495. "comp-op": {
  42496. "css": "comp-op",
  42497. "default-value": "src-over",
  42498. "default-meaning": "add the current layer on top of other layers",
  42499. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  42500. "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"]
  42501. },
  42502. "opacity": {
  42503. "css": "opacity",
  42504. "type": "float",
  42505. "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)",
  42506. "default-value": 1,
  42507. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  42508. }
  42509. },
  42510. "layer": {
  42511. "name": {
  42512. "default-value": "",
  42513. "type": "string",
  42514. "required": true,
  42515. "default-meaning": "No layer name has been provided",
  42516. "doc": "The name of a layer. Can be anything you wish and is not strictly validated, but ideally unique in the map"
  42517. },
  42518. "srs": {
  42519. "default-value": "",
  42520. "type": "string",
  42521. "default-meaning": "No srs value is provided and the value will be inherited from the Map's srs",
  42522. "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'"
  42523. },
  42524. "status": {
  42525. "default-value": true,
  42526. "type": "boolean",
  42527. "default-meaning": "This layer will be marked as active and available for processing",
  42528. "doc": "A property that can be set to false to disable this layer from being processed"
  42529. },
  42530. "minzoom": {
  42531. "default-value": "0",
  42532. "type": "float",
  42533. "default-meaning": "The layer will be visible at the minimum possible scale",
  42534. "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"
  42535. },
  42536. "maxzoom": {
  42537. "default-value": "1.79769e+308",
  42538. "type": "float",
  42539. "default-meaning": "The layer will be visible at the maximum possible scale",
  42540. "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"
  42541. },
  42542. "queryable": {
  42543. "default-value": false,
  42544. "type": "boolean",
  42545. "default-meaning": "The layer will not be available for the direct querying of data values",
  42546. "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"
  42547. },
  42548. "clear-label-cache": {
  42549. "default-value": false,
  42550. "type": "boolean",
  42551. "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",
  42552. "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"
  42553. },
  42554. "group-by": {
  42555. "default-value": "",
  42556. "type": "string",
  42557. "default-meaning": "No special layer grouping will be used during rendering",
  42558. "doc": "https://github.com/mapnik/mapnik/wiki/Grouped-rendering"
  42559. },
  42560. "buffer-size": {
  42561. "default-value": "0",
  42562. "type": "float",
  42563. "default-meaning": "No buffer will be used",
  42564. "doc": "Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"
  42565. },
  42566. "maximum-extent": {
  42567. "default-value": "none",
  42568. "type": "bbox",
  42569. "default-meaning": "No clipping extent will be used",
  42570. "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."
  42571. }
  42572. },
  42573. "symbolizers": {
  42574. "*": {
  42575. "image-filters": {
  42576. "css": "image-filters",
  42577. "default-value": "none",
  42578. "default-meaning": "no filters",
  42579. "type": "functions",
  42580. "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]],
  42581. "doc": "A list of image filters."
  42582. },
  42583. "comp-op": {
  42584. "css": "comp-op",
  42585. "default-value": "src-over",
  42586. "default-meaning": "add the current layer on top of other layers",
  42587. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  42588. "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"]
  42589. },
  42590. "opacity": {
  42591. "css": "opacity",
  42592. "type": "float",
  42593. "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)",
  42594. "default-value": 1,
  42595. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  42596. }
  42597. },
  42598. "map": {
  42599. "background-color": {
  42600. "css": "background-color",
  42601. "default-value": "none",
  42602. "default-meaning": "transparent",
  42603. "type": "color",
  42604. "doc": "Map Background color"
  42605. },
  42606. "background-image": {
  42607. "css": "background-image",
  42608. "type": "uri",
  42609. "default-value": "",
  42610. "default-meaning": "transparent",
  42611. "doc": "An image that is repeated below all features on a map as a background.",
  42612. "description": "Map Background image"
  42613. },
  42614. "srs": {
  42615. "css": "srs",
  42616. "type": "string",
  42617. "default-value": "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
  42618. "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",
  42619. "doc": "Map spatial reference (proj4 string)"
  42620. },
  42621. "buffer-size": {
  42622. "css": "buffer-size",
  42623. "default-value": "0",
  42624. "type": "float",
  42625. "default-meaning": "No buffer will be used",
  42626. "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\"."
  42627. },
  42628. "maximum-extent": {
  42629. "css": "",
  42630. "default-value": "none",
  42631. "type": "bbox",
  42632. "default-meaning": "No clipping extent will be used",
  42633. "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."
  42634. },
  42635. "base": {
  42636. "css": "base",
  42637. "default-value": "",
  42638. "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.",
  42639. "type": "string",
  42640. "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."
  42641. },
  42642. "paths-from-xml": {
  42643. "css": "",
  42644. "default-value": true,
  42645. "default-meaning": "Paths read from XML will be interpreted from the location of the XML",
  42646. "type": "boolean",
  42647. "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()"
  42648. },
  42649. "minimum-version": {
  42650. "css": "",
  42651. "default-value": "none",
  42652. "default-meaning": "Mapnik version will not be detected and no error will be thrown about compatibility",
  42653. "type": "string",
  42654. "doc": "The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"
  42655. },
  42656. "font-directory": {
  42657. "css": "font-directory",
  42658. "type": "uri",
  42659. "default-value": "none",
  42660. "default-meaning": "No map-specific fonts will be registered",
  42661. "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)."
  42662. }
  42663. },
  42664. "polygon": {
  42665. "fill": {
  42666. "css": "polygon-fill",
  42667. "type": "color",
  42668. "default-value": "rgba(128,128,128,1)",
  42669. "default-meaning": "gray and fully opaque (alpha = 1), same as rgb(128,128,128)",
  42670. "doc": "Fill color to assign to a polygon"
  42671. },
  42672. "fill-opacity": {
  42673. "css": "polygon-opacity",
  42674. "type": "float",
  42675. "doc": "The opacity of the polygon",
  42676. "default-value": 1,
  42677. "default-meaning": "opaque"
  42678. },
  42679. "gamma": {
  42680. "css": "polygon-gamma",
  42681. "type": "float",
  42682. "default-value": 1,
  42683. "default-meaning": "fully antialiased",
  42684. "range": "0-1",
  42685. "doc": "Level of antialiasing of polygon edges"
  42686. },
  42687. "gamma-method": {
  42688. "css": "polygon-gamma-method",
  42689. "type": ["power", "linear", "none", "threshold", "multiply"],
  42690. "default-value": "power",
  42691. "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",
  42692. "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"
  42693. },
  42694. "clip": {
  42695. "css": "polygon-clip",
  42696. "type": "boolean",
  42697. "default-value": true,
  42698. "default-meaning": "geometry will be clipped to map bounds before rendering",
  42699. "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."
  42700. },
  42701. "smooth": {
  42702. "css": "polygon-smooth",
  42703. "type": "float",
  42704. "default-value": 0,
  42705. "default-meaning": "no smoothing",
  42706. "range": "0-1",
  42707. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  42708. },
  42709. "geometry-transform": {
  42710. "css": "polygon-geometry-transform",
  42711. "type": "functions",
  42712. "default-value": "none",
  42713. "default-meaning": "geometry will not be transformed",
  42714. "doc": "Allows transformation functions to be applied to the geometry.",
  42715. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  42716. },
  42717. "comp-op": {
  42718. "css": "polygon-comp-op",
  42719. "default-value": "src-over",
  42720. "default-meaning": "add the current symbolizer on top of other symbolizer",
  42721. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  42722. "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"]
  42723. }
  42724. },
  42725. "line": {
  42726. "stroke": {
  42727. "css": "line-color",
  42728. "default-value": "rgba(0,0,0,1)",
  42729. "type": "color",
  42730. "default-meaning": "black and fully opaque (alpha = 1), same as rgb(0,0,0)",
  42731. "doc": "The color of a drawn line"
  42732. },
  42733. "stroke-width": {
  42734. "css": "line-width",
  42735. "default-value": 1,
  42736. "type": "float",
  42737. "doc": "The width of a line in pixels"
  42738. },
  42739. "stroke-opacity": {
  42740. "css": "line-opacity",
  42741. "default-value": 1,
  42742. "type": "float",
  42743. "default-meaning": "opaque",
  42744. "doc": "The opacity of a line"
  42745. },
  42746. "stroke-linejoin": {
  42747. "css": "line-join",
  42748. "default-value": "miter",
  42749. "type": ["miter", "round", "bevel"],
  42750. "doc": "The behavior of lines when joining"
  42751. },
  42752. "stroke-linecap": {
  42753. "css": "line-cap",
  42754. "default-value": "butt",
  42755. "type": ["butt", "round", "square"],
  42756. "doc": "The display of line endings"
  42757. },
  42758. "stroke-gamma": {
  42759. "css": "line-gamma",
  42760. "type": "float",
  42761. "default-value": 1,
  42762. "default-meaning": "fully antialiased",
  42763. "range": "0-1",
  42764. "doc": "Level of antialiasing of stroke line"
  42765. },
  42766. "stroke-gamma-method": {
  42767. "css": "line-gamma-method",
  42768. "type": ["power", "linear", "none", "threshold", "multiply"],
  42769. "default-value": "power",
  42770. "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",
  42771. "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"
  42772. },
  42773. "stroke-dasharray": {
  42774. "css": "line-dasharray",
  42775. "type": "numbers",
  42776. "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.",
  42777. "default-value": "none",
  42778. "default-meaning": "solid line"
  42779. },
  42780. "stroke-dashoffset": {
  42781. "css": "line-dash-offset",
  42782. "type": "numbers",
  42783. "doc": "valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)",
  42784. "default-value": "none",
  42785. "default-meaning": "solid line"
  42786. },
  42787. "stroke-miterlimit": {
  42788. "css": "line-miterlimit",
  42789. "type": "float",
  42790. "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.",
  42791. "default-value": 4.0,
  42792. "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 )'"
  42793. },
  42794. "clip": {
  42795. "css": "line-clip",
  42796. "type": "boolean",
  42797. "default-value": true,
  42798. "default-meaning": "geometry will be clipped to map bounds before rendering",
  42799. "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."
  42800. },
  42801. "smooth": {
  42802. "css": "line-smooth",
  42803. "type": "float",
  42804. "default-value": 0,
  42805. "default-meaning": "no smoothing",
  42806. "range": "0-1",
  42807. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  42808. },
  42809. "offset": {
  42810. "css": "line-offset",
  42811. "type": "float",
  42812. "default-value": 0,
  42813. "default-meaning": "no offset",
  42814. "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)."
  42815. },
  42816. "rasterizer": {
  42817. "css": "line-rasterizer",
  42818. "type": ["full", "fast"],
  42819. "default-value": "full",
  42820. "doc": "Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."
  42821. },
  42822. "geometry-transform": {
  42823. "css": "line-geometry-transform",
  42824. "type": "functions",
  42825. "default-value": "none",
  42826. "default-meaning": "geometry will not be transformed",
  42827. "doc": "Allows transformation functions to be applied to the geometry.",
  42828. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  42829. },
  42830. "comp-op": {
  42831. "css": "line-comp-op",
  42832. "default-value": "src-over",
  42833. "default-meaning": "add the current symbolizer on top of other symbolizer",
  42834. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  42835. "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"]
  42836. }
  42837. },
  42838. "markers": {
  42839. "file": {
  42840. "css": "marker-file",
  42841. "doc": "An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.",
  42842. "default-value": "",
  42843. "default-meaning": "An ellipse or circle, if width equals height",
  42844. "type": "uri"
  42845. },
  42846. "opacity": {
  42847. "css": "marker-opacity",
  42848. "doc": "The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke",
  42849. "default-value": 1,
  42850. "default-meaning": "The stroke-opacity and fill-opacity will be used",
  42851. "type": "float"
  42852. },
  42853. "fill-opacity": {
  42854. "css": "marker-fill-opacity",
  42855. "doc": "The fill opacity of the marker",
  42856. "default-value": 1,
  42857. "default-meaning": "opaque",
  42858. "type": "float"
  42859. },
  42860. "stroke": {
  42861. "css": "marker-line-color",
  42862. "doc": "The color of the stroke around a marker shape.",
  42863. "default-value": "black",
  42864. "type": "color"
  42865. },
  42866. "stroke-width": {
  42867. "css": "marker-line-width",
  42868. "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.",
  42869. "type": "float"
  42870. },
  42871. "stroke-opacity": {
  42872. "css": "marker-line-opacity",
  42873. "default-value": 1,
  42874. "default-meaning": "opaque",
  42875. "doc": "The opacity of a line",
  42876. "type": "float"
  42877. },
  42878. "placement": {
  42879. "css": "marker-placement",
  42880. "type": ["point", "line", "interior"],
  42881. "default-value": "point",
  42882. "default-meaning": "Place markers at the center point (centroid) of the geometry",
  42883. "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"
  42884. },
  42885. "multi-policy": {
  42886. "css": "marker-multi-policy",
  42887. "type": ["each", "whole", "largest"],
  42888. "default-value": "each",
  42889. "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",
  42890. "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)."
  42891. },
  42892. "marker-type": {
  42893. "css": "marker-type",
  42894. "type": ["arrow", "ellipse"],
  42895. "default-value": "ellipse",
  42896. "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)"
  42897. },
  42898. "width": {
  42899. "css": "marker-width",
  42900. "default-value": 10,
  42901. "doc": "The width of the marker, if using one of the default types.",
  42902. "type": "expression"
  42903. },
  42904. "height": {
  42905. "css": "marker-height",
  42906. "default-value": 10,
  42907. "doc": "The height of the marker, if using one of the default types.",
  42908. "type": "expression"
  42909. },
  42910. "fill": {
  42911. "css": "marker-fill",
  42912. "default-value": "blue",
  42913. "doc": "The color of the area of the marker.",
  42914. "type": "color"
  42915. },
  42916. "allow-overlap": {
  42917. "css": "marker-allow-overlap",
  42918. "type": "boolean",
  42919. "default-value": false,
  42920. "doc": "Control whether overlapping markers are shown or hidden.",
  42921. "default-meaning": "Do not allow makers to overlap with each other - overlapping markers will not be shown."
  42922. },
  42923. "ignore-placement": {
  42924. "css": "marker-ignore-placement",
  42925. "type": "boolean",
  42926. "default-value": false,
  42927. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  42928. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  42929. },
  42930. "spacing": {
  42931. "css": "marker-spacing",
  42932. "doc": "Space between repeated labels",
  42933. "default-value": 100,
  42934. "type": "float"
  42935. },
  42936. "max-error": {
  42937. "css": "marker-max-error",
  42938. "type": "float",
  42939. "default-value": 0.2,
  42940. "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."
  42941. },
  42942. "transform": {
  42943. "css": "marker-transform",
  42944. "type": "functions",
  42945. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  42946. "default-value": "",
  42947. "default-meaning": "No transformation",
  42948. "doc": "SVG transformation definition"
  42949. },
  42950. "clip": {
  42951. "css": "marker-clip",
  42952. "type": "boolean",
  42953. "default-value": true,
  42954. "default-meaning": "geometry will be clipped to map bounds before rendering",
  42955. "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."
  42956. },
  42957. "smooth": {
  42958. "css": "marker-smooth",
  42959. "type": "float",
  42960. "default-value": 0,
  42961. "default-meaning": "no smoothing",
  42962. "range": "0-1",
  42963. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  42964. },
  42965. "geometry-transform": {
  42966. "css": "marker-geometry-transform",
  42967. "type": "functions",
  42968. "default-value": "none",
  42969. "default-meaning": "geometry will not be transformed",
  42970. "doc": "Allows transformation functions to be applied to the geometry.",
  42971. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  42972. },
  42973. "comp-op": {
  42974. "css": "marker-comp-op",
  42975. "default-value": "src-over",
  42976. "default-meaning": "add the current symbolizer on top of other symbolizer",
  42977. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  42978. "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"]
  42979. }
  42980. },
  42981. "shield": {
  42982. "name": {
  42983. "css": "shield-name",
  42984. "type": "expression",
  42985. "serialization": "content",
  42986. "doc": "Value to use for a shield\"s text label. Data columns are specified using brackets like [column_name]"
  42987. },
  42988. "file": {
  42989. "css": "shield-file",
  42990. "required": true,
  42991. "type": "uri",
  42992. "default-value": "none",
  42993. "doc": "Image file to render behind the shield text"
  42994. },
  42995. "face-name": {
  42996. "css": "shield-face-name",
  42997. "type": "string",
  42998. "validate": "font",
  42999. "doc": "Font name and style to use for the shield text",
  43000. "default-value": "",
  43001. "required": true
  43002. },
  43003. "unlock-image": {
  43004. "css": "shield-unlock-image",
  43005. "type": "boolean",
  43006. "doc": "This parameter should be set to true if you are trying to position text beside rather than on top of the shield image",
  43007. "default-value": false,
  43008. "default-meaning": "text alignment relative to the shield image uses the center of the image as the anchor for text positioning."
  43009. },
  43010. "size": {
  43011. "css": "shield-size",
  43012. "type": "float",
  43013. "doc": "The size of the shield text in pixels"
  43014. },
  43015. "fill": {
  43016. "css": "shield-fill",
  43017. "type": "color",
  43018. "doc": "The color of the shield text"
  43019. },
  43020. "placement": {
  43021. "css": "shield-placement",
  43022. "type": ["point", "line", "vertex", "interior"],
  43023. "default-value": "point",
  43024. "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."
  43025. },
  43026. "avoid-edges": {
  43027. "css": "shield-avoid-edges",
  43028. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  43029. "type": "boolean",
  43030. "default-value": false
  43031. },
  43032. "allow-overlap": {
  43033. "css": "shield-allow-overlap",
  43034. "type": "boolean",
  43035. "default-value": false,
  43036. "doc": "Control whether overlapping shields are shown or hidden.",
  43037. "default-meaning": "Do not allow shields to overlap with other map elements already placed."
  43038. },
  43039. "minimum-distance": {
  43040. "css": "shield-min-distance",
  43041. "type": "float",
  43042. "default-value": 0,
  43043. "doc": "Minimum distance to the next shield symbol, not necessarily the same shield."
  43044. },
  43045. "spacing": {
  43046. "css": "shield-spacing",
  43047. "type": "float",
  43048. "default-value": 0,
  43049. "doc": "The spacing between repeated occurrences of the same shield on a line"
  43050. },
  43051. "minimum-padding": {
  43052. "css": "shield-min-padding",
  43053. "default-value": 0,
  43054. "doc": "Determines the minimum amount of padding that a shield gets relative to other shields",
  43055. "type": "float"
  43056. },
  43057. "wrap-width": {
  43058. "css": "shield-wrap-width",
  43059. "type": "unsigned",
  43060. "default-value": 0,
  43061. "doc": "Length of a chunk of text in characters before wrapping text"
  43062. },
  43063. "wrap-before": {
  43064. "css": "shield-wrap-before",
  43065. "type": "boolean",
  43066. "default-value": false,
  43067. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  43068. },
  43069. "wrap-character": {
  43070. "css": "shield-wrap-character",
  43071. "type": "string",
  43072. "default-value": " ",
  43073. "doc": "Use this character instead of a space to wrap long names."
  43074. },
  43075. "halo-fill": {
  43076. "css": "shield-halo-fill",
  43077. "type": "color",
  43078. "default-value": "#FFFFFF",
  43079. "default-meaning": "white",
  43080. "doc": "Specifies the color of the halo around the text."
  43081. },
  43082. "halo-radius": {
  43083. "css": "shield-halo-radius",
  43084. "doc": "Specify the radius of the halo in pixels",
  43085. "default-value": 0,
  43086. "default-meaning": "no halo",
  43087. "type": "float"
  43088. },
  43089. "character-spacing": {
  43090. "css": "shield-character-spacing",
  43091. "type": "unsigned",
  43092. "default-value": 0,
  43093. "doc": "Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."
  43094. },
  43095. "line-spacing": {
  43096. "css": "shield-line-spacing",
  43097. "doc": "Vertical spacing between lines of multiline labels (in pixels)",
  43098. "type": "unsigned"
  43099. },
  43100. "dx": {
  43101. "css": "shield-text-dx",
  43102. "type": "float",
  43103. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  43104. "default-value": 0
  43105. },
  43106. "dy": {
  43107. "css": "shield-text-dy",
  43108. "type": "float",
  43109. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  43110. "default-value": 0
  43111. },
  43112. "shield-dx": {
  43113. "css": "shield-dx",
  43114. "type": "float",
  43115. "doc": "Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  43116. "default-value": 0
  43117. },
  43118. "shield-dy": {
  43119. "css": "shield-dy",
  43120. "type": "float",
  43121. "doc": "Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  43122. "default-value": 0
  43123. },
  43124. "opacity": {
  43125. "css": "shield-opacity",
  43126. "type": "float",
  43127. "doc": "(Default 1.0) - opacity of the image used for the shield",
  43128. "default-value": 1
  43129. },
  43130. "text-opacity": {
  43131. "css": "shield-text-opacity",
  43132. "type": "float",
  43133. "doc": "(Default 1.0) - opacity of the text placed on top of the shield",
  43134. "default-value": 1
  43135. },
  43136. "horizontal-alignment": {
  43137. "css": "shield-horizontal-alignment",
  43138. "type": ["left", "middle", "right", "auto"],
  43139. "doc": "The shield's horizontal alignment from its centerpoint",
  43140. "default-value": "auto"
  43141. },
  43142. "vertical-alignment": {
  43143. "css": "shield-vertical-alignment",
  43144. "type": ["top", "middle", "bottom", "auto"],
  43145. "doc": "The shield's vertical alignment from its centerpoint",
  43146. "default-value": "middle"
  43147. },
  43148. "text-transform": {
  43149. "css": "shield-text-transform",
  43150. "type": ["none", "uppercase", "lowercase", "capitalize"],
  43151. "doc": "Transform the case of the characters",
  43152. "default-value": "none"
  43153. },
  43154. "justify-alignment": {
  43155. "css": "shield-justify-alignment",
  43156. "type": ["left", "center", "right", "auto"],
  43157. "doc": "Define how text in a shield's label is justified",
  43158. "default-value": "auto"
  43159. },
  43160. "clip": {
  43161. "css": "shield-clip",
  43162. "type": "boolean",
  43163. "default-value": true,
  43164. "default-meaning": "geometry will be clipped to map bounds before rendering",
  43165. "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."
  43166. },
  43167. "comp-op": {
  43168. "css": "shield-comp-op",
  43169. "default-value": "src-over",
  43170. "default-meaning": "add the current symbolizer on top of other symbolizer",
  43171. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  43172. "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"]
  43173. }
  43174. },
  43175. "line-pattern": {
  43176. "file": {
  43177. "css": "line-pattern-file",
  43178. "type": "uri",
  43179. "default-value": "none",
  43180. "required": true,
  43181. "doc": "An image file to be repeated and warped along a line"
  43182. },
  43183. "clip": {
  43184. "css": "line-pattern-clip",
  43185. "type": "boolean",
  43186. "default-value": true,
  43187. "default-meaning": "geometry will be clipped to map bounds before rendering",
  43188. "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."
  43189. },
  43190. "smooth": {
  43191. "css": "line-pattern-smooth",
  43192. "type": "float",
  43193. "default-value": 0,
  43194. "default-meaning": "no smoothing",
  43195. "range": "0-1",
  43196. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  43197. },
  43198. "geometry-transform": {
  43199. "css": "line-pattern-geometry-transform",
  43200. "type": "functions",
  43201. "default-value": "none",
  43202. "default-meaning": "geometry will not be transformed",
  43203. "doc": "Allows transformation functions to be applied to the geometry.",
  43204. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  43205. },
  43206. "comp-op": {
  43207. "css": "line-pattern-comp-op",
  43208. "default-value": "src-over",
  43209. "default-meaning": "add the current symbolizer on top of other symbolizer",
  43210. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  43211. "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"]
  43212. }
  43213. },
  43214. "polygon-pattern": {
  43215. "file": {
  43216. "css": "polygon-pattern-file",
  43217. "type": "uri",
  43218. "default-value": "none",
  43219. "required": true,
  43220. "doc": "Image to use as a repeated pattern fill within a polygon"
  43221. },
  43222. "alignment": {
  43223. "css": "polygon-pattern-alignment",
  43224. "type": ["local", "global"],
  43225. "default-value": "local",
  43226. "doc": "Specify whether to align pattern fills to the layer or to the map."
  43227. },
  43228. "gamma": {
  43229. "css": "polygon-pattern-gamma",
  43230. "type": "float",
  43231. "default-value": 1,
  43232. "default-meaning": "fully antialiased",
  43233. "range": "0-1",
  43234. "doc": "Level of antialiasing of polygon pattern edges"
  43235. },
  43236. "opacity": {
  43237. "css": "polygon-pattern-opacity",
  43238. "type": "float",
  43239. "doc": "(Default 1.0) - Apply an opacity level to the image used for the pattern",
  43240. "default-value": 1,
  43241. "default-meaning": "The image is rendered without modifications"
  43242. },
  43243. "clip": {
  43244. "css": "polygon-pattern-clip",
  43245. "type": "boolean",
  43246. "default-value": true,
  43247. "default-meaning": "geometry will be clipped to map bounds before rendering",
  43248. "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."
  43249. },
  43250. "smooth": {
  43251. "css": "polygon-pattern-smooth",
  43252. "type": "float",
  43253. "default-value": 0,
  43254. "default-meaning": "no smoothing",
  43255. "range": "0-1",
  43256. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  43257. },
  43258. "geometry-transform": {
  43259. "css": "polygon-pattern-geometry-transform",
  43260. "type": "functions",
  43261. "default-value": "none",
  43262. "default-meaning": "geometry will not be transformed",
  43263. "doc": "Allows transformation functions to be applied to the geometry.",
  43264. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  43265. },
  43266. "comp-op": {
  43267. "css": "polygon-pattern-comp-op",
  43268. "default-value": "src-over",
  43269. "default-meaning": "add the current symbolizer on top of other symbolizer",
  43270. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  43271. "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"]
  43272. }
  43273. },
  43274. "raster": {
  43275. "opacity": {
  43276. "css": "raster-opacity",
  43277. "default-value": 1,
  43278. "default-meaning": "opaque",
  43279. "type": "float",
  43280. "doc": "The opacity of the raster symbolizer on top of other symbolizers."
  43281. },
  43282. "filter-factor": {
  43283. "css": "raster-filter-factor",
  43284. "default-value": -1,
  43285. "default-meaning": "Allow the datasource to choose appropriate downscaling.",
  43286. "type": "float",
  43287. "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."
  43288. },
  43289. "scaling": {
  43290. "css": "raster-scaling",
  43291. "type": ["near", "fast", "bilinear", "bilinear8", "bicubic", "spline16", "spline36", "hanning", "hamming", "hermite", "kaiser", "quadric", "catrom", "gaussian", "bessel", "mitchell", "sinc", "lanczos", "blackman"],
  43292. "default-value": "near",
  43293. "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."
  43294. },
  43295. "mesh-size": {
  43296. "css": "raster-mesh-size",
  43297. "default-value": 16,
  43298. "default-meaning": "Reprojection mesh will be 1/16 of the resolution of the source image",
  43299. "type": "unsigned",
  43300. "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."
  43301. },
  43302. "comp-op": {
  43303. "css": "raster-comp-op",
  43304. "default-value": "src-over",
  43305. "default-meaning": "add the current symbolizer on top of other symbolizer",
  43306. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  43307. "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"]
  43308. }
  43309. },
  43310. "point": {
  43311. "file": {
  43312. "css": "point-file",
  43313. "type": "uri",
  43314. "required": false,
  43315. "default-value": "none",
  43316. "doc": "Image file to represent a point"
  43317. },
  43318. "allow-overlap": {
  43319. "css": "point-allow-overlap",
  43320. "type": "boolean",
  43321. "default-value": false,
  43322. "doc": "Control whether overlapping points are shown or hidden.",
  43323. "default-meaning": "Do not allow points to overlap with each other - overlapping markers will not be shown."
  43324. },
  43325. "ignore-placement": {
  43326. "css": "point-ignore-placement",
  43327. "type": "boolean",
  43328. "default-value": false,
  43329. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  43330. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  43331. },
  43332. "opacity": {
  43333. "css": "point-opacity",
  43334. "type": "float",
  43335. "default-value": 1.0,
  43336. "default-meaning": "Fully opaque",
  43337. "doc": "A value from 0 to 1 to control the opacity of the point"
  43338. },
  43339. "placement": {
  43340. "css": "point-placement",
  43341. "type": ["centroid", "interior"],
  43342. "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.",
  43343. "default-value": "centroid"
  43344. },
  43345. "transform": {
  43346. "css": "point-transform",
  43347. "type": "functions",
  43348. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  43349. "default-value": "",
  43350. "default-meaning": "No transformation",
  43351. "doc": "SVG transformation definition"
  43352. },
  43353. "comp-op": {
  43354. "css": "point-comp-op",
  43355. "default-value": "src-over",
  43356. "default-meaning": "add the current symbolizer on top of other symbolizer",
  43357. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  43358. "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"]
  43359. }
  43360. },
  43361. "text": {
  43362. "name": {
  43363. "css": "text-name",
  43364. "type": "expression",
  43365. "required": true,
  43366. "default-value": "",
  43367. "serialization": "content",
  43368. "doc": "Value to use for a text label. Data columns are specified using brackets like [column_name]"
  43369. },
  43370. "face-name": {
  43371. "css": "text-face-name",
  43372. "type": "string",
  43373. "validate": "font",
  43374. "doc": "Font name and style to render a label in",
  43375. "required": true
  43376. },
  43377. "size": {
  43378. "css": "text-size",
  43379. "type": "float",
  43380. "default-value": 10,
  43381. "doc": "Text size in pixels"
  43382. },
  43383. "text-ratio": {
  43384. "css": "text-ratio",
  43385. "doc": "Define the amount of text (of the total) present on successive lines when wrapping occurs",
  43386. "default-value": 0,
  43387. "type": "unsigned"
  43388. },
  43389. "wrap-width": {
  43390. "css": "text-wrap-width",
  43391. "doc": "Length of a chunk of text in characters before wrapping text",
  43392. "default-value": 0,
  43393. "type": "unsigned"
  43394. },
  43395. "wrap-before": {
  43396. "css": "text-wrap-before",
  43397. "type": "boolean",
  43398. "default-value": false,
  43399. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  43400. },
  43401. "wrap-character": {
  43402. "css": "text-wrap-character",
  43403. "type": "string",
  43404. "default-value": " ",
  43405. "doc": "Use this character instead of a space to wrap long text."
  43406. },
  43407. "spacing": {
  43408. "css": "text-spacing",
  43409. "type": "unsigned",
  43410. "doc": "Distance between repeated text labels on a line (aka. label-spacing)"
  43411. },
  43412. "character-spacing": {
  43413. "css": "text-character-spacing",
  43414. "type": "float",
  43415. "default-value": 0,
  43416. "doc": "Horizontal spacing adjustment between characters in pixels"
  43417. },
  43418. "line-spacing": {
  43419. "css": "text-line-spacing",
  43420. "default-value": 0,
  43421. "type": "unsigned",
  43422. "doc": "Vertical spacing adjustment between lines in pixels"
  43423. },
  43424. "label-position-tolerance": {
  43425. "css": "text-label-position-tolerance",
  43426. "default-value": 0,
  43427. "type": "unsigned",
  43428. "doc": "Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"
  43429. },
  43430. "max-char-angle-delta": {
  43431. "css": "text-max-char-angle-delta",
  43432. "type": "float",
  43433. "default-value": "22.5",
  43434. "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."
  43435. },
  43436. "fill": {
  43437. "css": "text-fill",
  43438. "doc": "Specifies the color for the text",
  43439. "default-value": "#000000",
  43440. "type": "color"
  43441. },
  43442. "opacity": {
  43443. "css": "text-opacity",
  43444. "doc": "A number from 0 to 1 specifying the opacity for the text",
  43445. "default-value": 1.0,
  43446. "default-meaning": "Fully opaque",
  43447. "type": "float"
  43448. },
  43449. "halo-fill": {
  43450. "css": "text-halo-fill",
  43451. "type": "color",
  43452. "default-value": "#FFFFFF",
  43453. "default-meaning": "white",
  43454. "doc": "Specifies the color of the halo around the text."
  43455. },
  43456. "halo-radius": {
  43457. "css": "text-halo-radius",
  43458. "doc": "Specify the radius of the halo in pixels",
  43459. "default-value": 0,
  43460. "default-meaning": "no halo",
  43461. "type": "float"
  43462. },
  43463. "dx": {
  43464. "css": "text-dx",
  43465. "type": "float",
  43466. "doc": "Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  43467. "default-value": 0
  43468. },
  43469. "dy": {
  43470. "css": "text-dy",
  43471. "type": "float",
  43472. "doc": "Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  43473. "default-value": 0
  43474. },
  43475. "vertical-alignment": {
  43476. "css": "text-vertical-alignment",
  43477. "type": ["top", "middle", "bottom", "auto"],
  43478. "doc": "Position of label relative to point position.",
  43479. "default-value": "auto",
  43480. "default-meaning": "Default affected by value of dy; \"bottom\" for dy>0, \"top\" for dy<0."
  43481. },
  43482. "avoid-edges": {
  43483. "css": "text-avoid-edges",
  43484. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  43485. "default-value": false,
  43486. "type": "boolean"
  43487. },
  43488. "minimum-distance": {
  43489. "css": "text-min-distance",
  43490. "doc": "Minimum permitted distance to the next text symbolizer.",
  43491. "type": "float"
  43492. },
  43493. "minimum-padding": {
  43494. "css": "text-min-padding",
  43495. "doc": "Determines the minimum amount of padding that a text symbolizer gets relative to other text",
  43496. "type": "float"
  43497. },
  43498. "minimum-path-length": {
  43499. "css": "text-min-path-length",
  43500. "type": "float",
  43501. "default-value": 0,
  43502. "default-meaning": "place labels on all paths",
  43503. "doc": "Place labels only on paths longer than this value."
  43504. },
  43505. "allow-overlap": {
  43506. "css": "text-allow-overlap",
  43507. "type": "boolean",
  43508. "default-value": false,
  43509. "doc": "Control whether overlapping text is shown or hidden.",
  43510. "default-meaning": "Do not allow text to overlap with other text - overlapping markers will not be shown."
  43511. },
  43512. "orientation": {
  43513. "css": "text-orientation",
  43514. "type": "expression",
  43515. "doc": "Rotate the text."
  43516. },
  43517. "placement": {
  43518. "css": "text-placement",
  43519. "type": ["point", "line", "vertex", "interior"],
  43520. "default-value": "point",
  43521. "doc": "Control the style of placement of a point versus the geometry it is attached to."
  43522. },
  43523. "placement-type": {
  43524. "css": "text-placement-type",
  43525. "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.",
  43526. "type": ["dummy", "simple"],
  43527. "default-value": "dummy"
  43528. },
  43529. "placements": {
  43530. "css": "text-placements",
  43531. "type": "string",
  43532. "default-value": "",
  43533. "doc": "If \"placement-type\" is set to \"simple\", use this \"POSITIONS,[SIZES]\" string. An example is `text-placements: \"E,NE,SE,W,NW,SW\";` "
  43534. },
  43535. "text-transform": {
  43536. "css": "text-transform",
  43537. "type": ["none", "uppercase", "lowercase", "capitalize"],
  43538. "doc": "Transform the case of the characters",
  43539. "default-value": "none"
  43540. },
  43541. "horizontal-alignment": {
  43542. "css": "text-horizontal-alignment",
  43543. "type": ["left", "middle", "right", "auto"],
  43544. "doc": "The text's horizontal alignment from its centerpoint",
  43545. "default-value": "auto"
  43546. },
  43547. "justify-alignment": {
  43548. "css": "text-align",
  43549. "type": ["left", "right", "center", "auto"],
  43550. "doc": "Define how text is justified",
  43551. "default-value": "auto",
  43552. "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"
  43553. },
  43554. "clip": {
  43555. "css": "text-clip",
  43556. "type": "boolean",
  43557. "default-value": true,
  43558. "default-meaning": "geometry will be clipped to map bounds before rendering",
  43559. "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."
  43560. },
  43561. "comp-op": {
  43562. "css": "text-comp-op",
  43563. "default-value": "src-over",
  43564. "default-meaning": "add the current symbolizer on top of other symbolizer",
  43565. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  43566. "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"]
  43567. }
  43568. },
  43569. "building": {
  43570. "fill": {
  43571. "css": "building-fill",
  43572. "default-value": "#FFFFFF",
  43573. "doc": "The color of the buildings walls.",
  43574. "type": "color"
  43575. },
  43576. "fill-opacity": {
  43577. "css": "building-fill-opacity",
  43578. "type": "float",
  43579. "doc": "The opacity of the building as a whole, including all walls.",
  43580. "default-value": 1
  43581. },
  43582. "height": {
  43583. "css": "building-height",
  43584. "doc": "The height of the building in pixels.",
  43585. "type": "expression",
  43586. "default-value": "0"
  43587. }
  43588. }
  43589. },
  43590. "colors": {
  43591. "aliceblue": [240, 248, 255],
  43592. "antiquewhite": [250, 235, 215],
  43593. "aqua": [0, 255, 255],
  43594. "aquamarine": [127, 255, 212],
  43595. "azure": [240, 255, 255],
  43596. "beige": [245, 245, 220],
  43597. "bisque": [255, 228, 196],
  43598. "black": [0, 0, 0],
  43599. "blanchedalmond": [255, 235, 205],
  43600. "blue": [0, 0, 255],
  43601. "blueviolet": [138, 43, 226],
  43602. "brown": [165, 42, 42],
  43603. "burlywood": [222, 184, 135],
  43604. "cadetblue": [95, 158, 160],
  43605. "chartreuse": [127, 255, 0],
  43606. "chocolate": [210, 105, 30],
  43607. "coral": [255, 127, 80],
  43608. "cornflowerblue": [100, 149, 237],
  43609. "cornsilk": [255, 248, 220],
  43610. "crimson": [220, 20, 60],
  43611. "cyan": [0, 255, 255],
  43612. "darkblue": [0, 0, 139],
  43613. "darkcyan": [0, 139, 139],
  43614. "darkgoldenrod": [184, 134, 11],
  43615. "darkgray": [169, 169, 169],
  43616. "darkgreen": [0, 100, 0],
  43617. "darkgrey": [169, 169, 169],
  43618. "darkkhaki": [189, 183, 107],
  43619. "darkmagenta": [139, 0, 139],
  43620. "darkolivegreen": [85, 107, 47],
  43621. "darkorange": [255, 140, 0],
  43622. "darkorchid": [153, 50, 204],
  43623. "darkred": [139, 0, 0],
  43624. "darksalmon": [233, 150, 122],
  43625. "darkseagreen": [143, 188, 143],
  43626. "darkslateblue": [72, 61, 139],
  43627. "darkslategrey": [47, 79, 79],
  43628. "darkturquoise": [0, 206, 209],
  43629. "darkviolet": [148, 0, 211],
  43630. "deeppink": [255, 20, 147],
  43631. "deepskyblue": [0, 191, 255],
  43632. "dimgray": [105, 105, 105],
  43633. "dimgrey": [105, 105, 105],
  43634. "dodgerblue": [30, 144, 255],
  43635. "firebrick": [178, 34, 34],
  43636. "floralwhite": [255, 250, 240],
  43637. "forestgreen": [34, 139, 34],
  43638. "fuchsia": [255, 0, 255],
  43639. "gainsboro": [220, 220, 220],
  43640. "ghostwhite": [248, 248, 255],
  43641. "gold": [255, 215, 0],
  43642. "goldenrod": [218, 165, 32],
  43643. "gray": [128, 128, 128],
  43644. "grey": [128, 128, 128],
  43645. "green": [0, 128, 0],
  43646. "greenyellow": [173, 255, 47],
  43647. "honeydew": [240, 255, 240],
  43648. "hotpink": [255, 105, 180],
  43649. "indianred": [205, 92, 92],
  43650. "indigo": [75, 0, 130],
  43651. "ivory": [255, 255, 240],
  43652. "khaki": [240, 230, 140],
  43653. "lavender": [230, 230, 250],
  43654. "lavenderblush": [255, 240, 245],
  43655. "lawngreen": [124, 252, 0],
  43656. "lemonchiffon": [255, 250, 205],
  43657. "lightblue": [173, 216, 230],
  43658. "lightcoral": [240, 128, 128],
  43659. "lightcyan": [224, 255, 255],
  43660. "lightgoldenrodyellow": [250, 250, 210],
  43661. "lightgray": [211, 211, 211],
  43662. "lightgreen": [144, 238, 144],
  43663. "lightgrey": [211, 211, 211],
  43664. "lightpink": [255, 182, 193],
  43665. "lightsalmon": [255, 160, 122],
  43666. "lightseagreen": [32, 178, 170],
  43667. "lightskyblue": [135, 206, 250],
  43668. "lightslategray": [119, 136, 153],
  43669. "lightslategrey": [119, 136, 153],
  43670. "lightsteelblue": [176, 196, 222],
  43671. "lightyellow": [255, 255, 224],
  43672. "lime": [0, 255, 0],
  43673. "limegreen": [50, 205, 50],
  43674. "linen": [250, 240, 230],
  43675. "magenta": [255, 0, 255],
  43676. "maroon": [128, 0, 0],
  43677. "mediumaquamarine": [102, 205, 170],
  43678. "mediumblue": [0, 0, 205],
  43679. "mediumorchid": [186, 85, 211],
  43680. "mediumpurple": [147, 112, 219],
  43681. "mediumseagreen": [60, 179, 113],
  43682. "mediumslateblue": [123, 104, 238],
  43683. "mediumspringgreen": [0, 250, 154],
  43684. "mediumturquoise": [72, 209, 204],
  43685. "mediumvioletred": [199, 21, 133],
  43686. "midnightblue": [25, 25, 112],
  43687. "mintcream": [245, 255, 250],
  43688. "mistyrose": [255, 228, 225],
  43689. "moccasin": [255, 228, 181],
  43690. "navajowhite": [255, 222, 173],
  43691. "navy": [0, 0, 128],
  43692. "oldlace": [253, 245, 230],
  43693. "olive": [128, 128, 0],
  43694. "olivedrab": [107, 142, 35],
  43695. "orange": [255, 165, 0],
  43696. "orangered": [255, 69, 0],
  43697. "orchid": [218, 112, 214],
  43698. "palegoldenrod": [238, 232, 170],
  43699. "palegreen": [152, 251, 152],
  43700. "paleturquoise": [175, 238, 238],
  43701. "palevioletred": [219, 112, 147],
  43702. "papayawhip": [255, 239, 213],
  43703. "peachpuff": [255, 218, 185],
  43704. "peru": [205, 133, 63],
  43705. "pink": [255, 192, 203],
  43706. "plum": [221, 160, 221],
  43707. "powderblue": [176, 224, 230],
  43708. "purple": [128, 0, 128],
  43709. "red": [255, 0, 0],
  43710. "rosybrown": [188, 143, 143],
  43711. "royalblue": [65, 105, 225],
  43712. "saddlebrown": [139, 69, 19],
  43713. "salmon": [250, 128, 114],
  43714. "sandybrown": [244, 164, 96],
  43715. "seagreen": [46, 139, 87],
  43716. "seashell": [255, 245, 238],
  43717. "sienna": [160, 82, 45],
  43718. "silver": [192, 192, 192],
  43719. "skyblue": [135, 206, 235],
  43720. "slateblue": [106, 90, 205],
  43721. "slategray": [112, 128, 144],
  43722. "slategrey": [112, 128, 144],
  43723. "snow": [255, 250, 250],
  43724. "springgreen": [0, 255, 127],
  43725. "steelblue": [70, 130, 180],
  43726. "tan": [210, 180, 140],
  43727. "teal": [0, 128, 128],
  43728. "thistle": [216, 191, 216],
  43729. "tomato": [255, 99, 71],
  43730. "turquoise": [64, 224, 208],
  43731. "violet": [238, 130, 238],
  43732. "wheat": [245, 222, 179],
  43733. "white": [255, 255, 255],
  43734. "whitesmoke": [245, 245, 245],
  43735. "yellow": [255, 255, 0],
  43736. "yellowgreen": [154, 205, 50],
  43737. "transparent": [0, 0, 0, 0]
  43738. },
  43739. "filter": {
  43740. "value": ["true", "false", "null", "point", "linestring", "polygon", "collection"]
  43741. }
  43742. };
  43743. CartoCSS_CartoCSS['mapnik_reference'] = {
  43744. version: {
  43745. latest: SuperMap._mapnik_reference_latest,
  43746. '2.1.1': SuperMap._mapnik_reference_latest
  43747. }
  43748. };
  43749. SuperMap.CartoCSS = CartoCSS_CartoCSS;
  43750. SuperMap.CartoCSS.Tree = {};
  43751. SuperMap.CartoCSS.Tree.operate = function (op, a, b) {
  43752. switch (op) {
  43753. case '+':
  43754. return a + b;
  43755. case '-':
  43756. return a - b;
  43757. case '*':
  43758. return a * b;
  43759. case '%':
  43760. return a % b;
  43761. case '/':
  43762. return a / b;
  43763. }
  43764. };
  43765. SuperMap.CartoCSS.Tree.functions = {
  43766. rgb: function rgb(r, g, b) {
  43767. return this.rgba(r, g, b, 1.0);
  43768. },
  43769. rgba: function rgba(r, g, b, a) {
  43770. var me = this;
  43771. var rgb = [r, g, b].map(function (c) {
  43772. return me.number(c);
  43773. });
  43774. a = me.number(a);
  43775. if (rgb.some(isNaN) || isNaN(a)) {
  43776. return null;
  43777. }
  43778. return new SuperMap.CartoCSS.Tree.Color(rgb, a);
  43779. },
  43780. // Only require val
  43781. stop: function stop(val) {
  43782. var color, mode;
  43783. if (arguments.length > 1) {
  43784. color = arguments[1];
  43785. }
  43786. if (arguments.length > 2) {
  43787. mode = arguments[2];
  43788. }
  43789. return {
  43790. is: 'tag',
  43791. val: val,
  43792. color: color,
  43793. mode: mode,
  43794. toString: function toString(env) {
  43795. return '\n\t<stop value="' + val.ev(env) + '"' + (color ? ' color="' + color.ev(env) + '" ' : '') + (mode ? ' mode="' + mode.ev(env) + '" ' : '') + '/>';
  43796. }
  43797. };
  43798. },
  43799. hsl: function hsl(h, s, l) {
  43800. return this.hsla(h, s, l, 1.0);
  43801. },
  43802. hsla: function hsla(h, s, l, a) {
  43803. h = this.number(h) % 360 / 360;
  43804. s = this.number(s);
  43805. l = this.number(l);
  43806. a = this.number(a);
  43807. if ([h, s, l, a].some(isNaN)) {
  43808. return null;
  43809. }
  43810. var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s,
  43811. m1 = l * 2 - m2;
  43812. return this.rgba(hue(h + 1 / 3) * 255, hue(h) * 255, hue(h - 1 / 3) * 255, a);
  43813. function hue(h) {
  43814. h = h < 0 ? h + 1 : h > 1 ? h - 1 : h;
  43815. if (h * 6 < 1) {
  43816. return m1 + (m2 - m1) * h * 6;
  43817. } else if (h * 2 < 1) {
  43818. return m2;
  43819. } else if (h * 3 < 2) {
  43820. return m1 + (m2 - m1) * (2 / 3 - h) * 6;
  43821. } else {
  43822. return m1;
  43823. }
  43824. }
  43825. },
  43826. hue: function hue(color) {
  43827. if (!('toHSL' in color)) {
  43828. return null;
  43829. }
  43830. return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().h));
  43831. },
  43832. saturation: function saturation(color) {
  43833. if (!('toHSL' in color)) {
  43834. return null;
  43835. }
  43836. return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().s * 100), '%');
  43837. },
  43838. lightness: function lightness(color) {
  43839. if (!('toHSL' in color)) {
  43840. return null;
  43841. }
  43842. return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().l * 100), '%');
  43843. },
  43844. alpha: function alpha(color) {
  43845. if (!('toHSL' in color)) {
  43846. return null;
  43847. }
  43848. return new SuperMap.CartoCSS.Tree.Dimension(color.toHSL().a);
  43849. },
  43850. saturate: function saturate(color, amount) {
  43851. if (!('toHSL' in color)) {
  43852. return null;
  43853. }
  43854. var hsl = color.toHSL();
  43855. hsl.s += amount.value / 100;
  43856. hsl.s = this.clamp(hsl.s);
  43857. return this.hsla_simple(hsl);
  43858. },
  43859. desaturate: function desaturate(color, amount) {
  43860. if (!('toHSL' in color)) {
  43861. return null;
  43862. }
  43863. var hsl = color.toHSL();
  43864. hsl.s -= amount.value / 100;
  43865. hsl.s = this.clamp(hsl.s);
  43866. return this.hsla_simple(hsl);
  43867. },
  43868. lighten: function lighten(color, amount) {
  43869. if (!('toHSL' in color)) {
  43870. return null;
  43871. }
  43872. var hsl = color.toHSL();
  43873. hsl.l += amount.value / 100;
  43874. hsl.l = this.clamp(hsl.l);
  43875. return this.hsla_simple(hsl);
  43876. },
  43877. darken: function darken(color, amount) {
  43878. if (!('toHSL' in color)) {
  43879. return null;
  43880. }
  43881. var hsl = color.toHSL();
  43882. hsl.l -= amount.value / 100;
  43883. hsl.l = this.clamp(hsl.l);
  43884. return this.hsla_simple(hsl);
  43885. },
  43886. fadein: function fadein(color, amount) {
  43887. if (!('toHSL' in color)) {
  43888. return null;
  43889. }
  43890. var hsl = color.toHSL();
  43891. hsl.a += amount.value / 100;
  43892. hsl.a = this.clamp(hsl.a);
  43893. return this.hsla_simple(hsl);
  43894. },
  43895. fadeout: function fadeout(color, amount) {
  43896. if (!('toHSL' in color)) {
  43897. return null;
  43898. }
  43899. var hsl = color.toHSL();
  43900. hsl.a -= amount.value / 100;
  43901. hsl.a = this.clamp(hsl.a);
  43902. return this.hsla_simple(hsl);
  43903. },
  43904. spin: function spin(color, amount) {
  43905. if (!('toHSL' in color)) {
  43906. return null;
  43907. }
  43908. var hsl = color.toHSL();
  43909. var hue = (hsl.h + amount.value) % 360;
  43910. hsl.h = hue < 0 ? 360 + hue : hue;
  43911. return this.hsla_simple(hsl);
  43912. },
  43913. replace: function replace(entity, a, b) {
  43914. if (entity.is === 'field') {
  43915. return entity.toString + '.replace(' + a.toString() + ', ' + b.toString() + ')';
  43916. } else {
  43917. return entity.replace(a, b);
  43918. }
  43919. },
  43920. //
  43921. // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
  43922. // http://sass-lang.com
  43923. //
  43924. mix: function mix(color1, color2, weight) {
  43925. var p = weight.value / 100.0;
  43926. var w = p * 2 - 1;
  43927. var a = color1.toHSL().a - color2.toHSL().a;
  43928. var w1 = ((w * a == -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
  43929. var w2 = 1 - w1;
  43930. 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];
  43931. var alpha = color1.alpha * p + color2.alpha * (1 - p);
  43932. return new SuperMap.CartoCSS.Tree.Color(rgb, alpha);
  43933. },
  43934. greyscale: function greyscale(color) {
  43935. return this.desaturate(color, new SuperMap.CartoCSS.Tree.Dimension(100));
  43936. },
  43937. '%': function _(quoted
  43938. /* arg, arg, ...*/
  43939. ) {
  43940. var args = Array.prototype.slice.call(arguments, 1),
  43941. str = quoted.value;
  43942. for (var i = 0; i < args.length; i++) {
  43943. str = str.replace(/%s/, args[i].value).replace(/%[da]/, args[i].toString());
  43944. }
  43945. str = str.replace(/%%/g, '%');
  43946. return new SuperMap.CartoCSS.Tree.Quoted(str);
  43947. },
  43948. hsla_simple: function hsla_simple(h) {
  43949. return this.hsla(h.h, h.s, h.l, h.a);
  43950. },
  43951. number: function number(n) {
  43952. if (n instanceof SuperMap.CartoCSS.Tree.Dimension) {
  43953. return parseFloat(n.unit === '%' ? n.value / 100 : n.value);
  43954. } else if (typeof n === 'number') {
  43955. return n;
  43956. } else {
  43957. return NaN;
  43958. }
  43959. },
  43960. clamp: function clamp(val) {
  43961. return Math.min(1, Math.max(0, val));
  43962. }
  43963. };
  43964. SuperMap.CartoCSS.Tree.Call = /*#__PURE__*/function () {
  43965. function Call(name, args, index) {
  43966. CartoCSS_classCallCheck(this, Call);
  43967. this.is = 'call';
  43968. this.name = name;
  43969. this.args = args;
  43970. this.index = index;
  43971. } // When evuating a function call,
  43972. // we either find the function in `tree.functions` [1],
  43973. // in which case we call it, passing the evaluated arguments,
  43974. // or we simply print it out as it appeared originally [2].
  43975. // The *functions.js* file contains the built-in functions.
  43976. // The reason why we evaluate the arguments, is in the case where
  43977. // we try to pass a variable to a function, like: `saturate(@color)`.
  43978. // The function should receive the value, not the variable.
  43979. CartoCSS_createClass(Call, [{
  43980. key: 'ev',
  43981. value: function ev(env) {
  43982. var args = this.args.map(function (a) {
  43983. return a.ev(env);
  43984. });
  43985. for (var i = 0; i < args.length; i++) {
  43986. if (args[i].is === 'undefined') {
  43987. return {
  43988. is: 'undefined',
  43989. value: 'undefined'
  43990. };
  43991. }
  43992. }
  43993. if (this.name in SuperMap.CartoCSS.Tree.functions) {
  43994. if (SuperMap.CartoCSS.Tree.functions[this.name].length <= args.length) {
  43995. var val = SuperMap.CartoCSS.Tree.functions[this.name].apply(SuperMap.CartoCSS.Tree.functions, args);
  43996. if (val === null) {
  43997. env.error({
  43998. message: 'incorrect arguments given to ' + this.name + '()',
  43999. index: this.index,
  44000. type: 'runtime',
  44001. filename: this.filename
  44002. });
  44003. return {
  44004. is: 'undefined',
  44005. value: 'undefined'
  44006. };
  44007. }
  44008. return val;
  44009. } else {
  44010. env.error({
  44011. message: 'incorrect number of arguments for ' + this.name + '(). ' + SuperMap.CartoCSS.Tree.functions[this.name].length + ' expected.',
  44012. index: this.index,
  44013. type: 'runtime',
  44014. filename: this.filename
  44015. });
  44016. return {
  44017. is: 'undefined',
  44018. value: 'undefined'
  44019. };
  44020. }
  44021. } else {
  44022. var fn = SuperMap.CartoCSS.Tree.Reference.mapnikFunctions[this.name];
  44023. if (fn === undefined) {
  44024. var functions = lodash_topairs_default()(SuperMap.CartoCSS.Tree.Reference.mapnikFunctions); // cheap closest, needs improvement.
  44025. var name = this.name;
  44026. var mean = functions.map(function (f) {
  44027. return [f[0], SuperMap.CartoCSS.Tree.Reference.editDistance(name, f[0]), f[1]];
  44028. }).sort(function (a, b) {
  44029. return a[1] - b[1];
  44030. });
  44031. env.error({
  44032. message: 'unknown function ' + this.name + '(), did you mean ' + mean[0][0] + '(' + mean[0][2] + ')',
  44033. index: this.index,
  44034. type: 'runtime',
  44035. filename: this.filename
  44036. });
  44037. return {
  44038. is: 'undefined',
  44039. value: 'undefined'
  44040. };
  44041. }
  44042. if (fn !== args.length && // support variable-arg functions like `colorize-alpha`
  44043. fn !== -1) {
  44044. env.error({
  44045. message: 'function ' + this.name + '() takes ' + fn + ' arguments and was given ' + args.length,
  44046. index: this.index,
  44047. type: 'runtime',
  44048. filename: this.filename
  44049. });
  44050. return {
  44051. is: 'undefined',
  44052. value: 'undefined'
  44053. };
  44054. } else {
  44055. // Save the evaluated versions of arguments
  44056. this.args = args;
  44057. return this;
  44058. }
  44059. }
  44060. }
  44061. }, {
  44062. key: "toString",
  44063. value: function toString(env, format) {
  44064. if (this.args.length) {
  44065. return this.name + '(' + this.args.join(',') + ')';
  44066. } else {
  44067. return this.name;
  44068. }
  44069. }
  44070. }]);
  44071. return Call;
  44072. }();
  44073. SuperMap.CartoCSS.Tree.Color = /*#__PURE__*/function () {
  44074. function Color(rgb, a) {
  44075. CartoCSS_classCallCheck(this, Color);
  44076. this.is = 'color'; // The end goal here, is to parse the arguments
  44077. // into an integer triplet, such as `128, 255, 0`
  44078. //
  44079. // This facilitates operations and conversions.
  44080. if (Array.isArray(rgb)) {
  44081. this.rgb = rgb.slice(0, 3);
  44082. } else if (rgb.length == 6) {
  44083. this.rgb = rgb.match(/.{2}/g).map(function (c) {
  44084. return parseInt(c, 16);
  44085. });
  44086. } else {
  44087. this.rgb = rgb.split('').map(function (c) {
  44088. return parseInt(c + c, 16);
  44089. });
  44090. }
  44091. if (typeof a === 'number') {
  44092. this.alpha = a;
  44093. } else if (rgb.length === 4) {
  44094. this.alpha = rgb[3];
  44095. } else {
  44096. this.alpha = 1;
  44097. }
  44098. }
  44099. CartoCSS_createClass(Color, [{
  44100. key: 'ev',
  44101. value: function ev() {
  44102. return this;
  44103. } // If we have some transparency, the only way to represent it
  44104. // is via `rgba`. Otherwise, we use the hex representation,
  44105. // which has better compatibility with older browsers.
  44106. // Values are capped between `0` and `255`, rounded and zero-padded.
  44107. }, {
  44108. key: "toString",
  44109. value: function toString() {
  44110. /* if (this.alpha < 1.0) {*/
  44111. return 'rgba(' + this.rgb.map(function (c) {
  44112. return Math.round(c);
  44113. }).concat(this.alpha).join(', ') + ')';
  44114. /*} else {
  44115. return '#' + this.rgb.map(function(i) {
  44116. i = Math.round(i);
  44117. i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
  44118. return i.length === 1 ? '0' + i : i;
  44119. }).join('');
  44120. }*/
  44121. } // Operations have to be done per-channel, if not,
  44122. // channels will spill onto each other. Once we have
  44123. // our result, in the form of an integer triplet,
  44124. // we create a new Color node to hold the result.
  44125. }, {
  44126. key: "operate",
  44127. value: function operate(env, op, other) {
  44128. var result = [];
  44129. if (!(other instanceof SuperMap.CartoCSS.Tree.Color)) {
  44130. other = other.toColor();
  44131. }
  44132. for (var c = 0; c < 3; c++) {
  44133. result[c] = SuperMap.CartoCSS.Tree.operate(op, this.rgb[c], other.rgb[c]);
  44134. }
  44135. return new SuperMap.CartoCSS.Tree.Color(result);
  44136. }
  44137. }, {
  44138. key: "toHSL",
  44139. value: function toHSL() {
  44140. var r = this.rgb[0] / 255,
  44141. g = this.rgb[1] / 255,
  44142. b = this.rgb[2] / 255,
  44143. a = this.alpha;
  44144. var max = Math.max(r, g, b),
  44145. min = Math.min(r, g, b);
  44146. var h,
  44147. s,
  44148. l = (max + min) / 2,
  44149. d = max - min;
  44150. if (max === min) {
  44151. h = s = 0;
  44152. } else {
  44153. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  44154. switch (max) {
  44155. case r:
  44156. h = (g - b) / d + (g < b ? 6 : 0);
  44157. break;
  44158. case g:
  44159. h = (b - r) / d + 2;
  44160. break;
  44161. case b:
  44162. h = (r - g) / d + 4;
  44163. break;
  44164. default:
  44165. break;
  44166. }
  44167. h /= 6;
  44168. }
  44169. return {
  44170. h: h * 360,
  44171. s: s,
  44172. l: l,
  44173. a: a
  44174. };
  44175. }
  44176. }]);
  44177. return Color;
  44178. }();
  44179. SuperMap.CartoCSS.Tree.Comment = /*#__PURE__*/function () {
  44180. function Comment(value, silent) {
  44181. CartoCSS_classCallCheck(this, Comment);
  44182. this.value = value;
  44183. this.silent = !!silent;
  44184. }
  44185. CartoCSS_createClass(Comment, [{
  44186. key: "toString",
  44187. value: function toString(env) {
  44188. return '<!--' + this.value + '-->';
  44189. }
  44190. }, {
  44191. key: 'ev',
  44192. value: function ev() {
  44193. return this;
  44194. }
  44195. }]);
  44196. return Comment;
  44197. }();
  44198. SuperMap.CartoCSS.Tree.Definition = /*#__PURE__*/function () {
  44199. function Definition(selector, rules) {
  44200. CartoCSS_classCallCheck(this, Definition);
  44201. this.elements = selector.elements; //assert.ok(selector.filters instanceof SuperMap.CartoCSS.Tree.Filterset);
  44202. this.rules = rules;
  44203. this.ruleIndex = {};
  44204. for (var i = 0; i < this.rules.length; i++) {
  44205. if ('zoom' in this.rules[i]) {
  44206. this.rules[i] = this.rules[i].clone();
  44207. }
  44208. this.rules[i].zoom = selector.zoom;
  44209. this.ruleIndex[this.rules[i].updateID()] = true;
  44210. }
  44211. this.filters = selector.filters;
  44212. this.zoom = selector.zoom;
  44213. this.attachment = selector.attachment || '__default__';
  44214. this.specificity = selector.specificity();
  44215. }
  44216. CartoCSS_createClass(Definition, [{
  44217. key: "toString",
  44218. value: function toString() {
  44219. var str = this.filters.toString();
  44220. for (var i = 0; i < this.rules.length; i++) {
  44221. str += '\n ' + this.rules[i];
  44222. }
  44223. return str;
  44224. }
  44225. }, {
  44226. key: "toJS",
  44227. value: function toJS(env) {
  44228. var shaderAttrs = {}; // merge conditions from filters with zoom condition of the
  44229. // definition
  44230. var zoom = this.zoom; //var frame_offset = this.frame_offset;
  44231. var _if = this.filters.toJS(env);
  44232. var filters = [zoom];
  44233. if (_if) {
  44234. filters.push(_if);
  44235. } //if(frame_offset) filters.push('ctx["frame-offset"] === ' + frame_offset);
  44236. _if = filters.join(" && ");
  44237. function eachRule(rule) {
  44238. if (rule instanceof SuperMap.CartoCSS.Tree.Rule) {
  44239. shaderAttrs[rule.name] = shaderAttrs[rule.name] || [];
  44240. if (_if) {
  44241. shaderAttrs[rule.name].push("if(" + _if + "){" + rule.value.toJS(env) + "}");
  44242. } else {
  44243. shaderAttrs[rule.name].push(rule.value.toJS(env));
  44244. }
  44245. } else {
  44246. if (rule instanceof SuperMap.CartoCSS.Tree.Ruleset) {
  44247. var sh = rule.toJS(env);
  44248. for (var v in sh) {
  44249. shaderAttrs[v] = shaderAttrs[v] || [];
  44250. for (var attr in sh[v]) {
  44251. shaderAttrs[v].push(sh[v][attr]);
  44252. }
  44253. }
  44254. }
  44255. }
  44256. }
  44257. for (var id in this.rules) {
  44258. eachRule(this.rules[id]);
  44259. }
  44260. return shaderAttrs;
  44261. }
  44262. }]);
  44263. return Definition;
  44264. }();
  44265. SuperMap.CartoCSS.Tree.Dimension = /*#__PURE__*/function () {
  44266. function Dimension(value, unit, index) {
  44267. CartoCSS_classCallCheck(this, Dimension);
  44268. this.is = 'float';
  44269. this.physical_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc'];
  44270. this.screen_units = ['px', '%'];
  44271. this.all_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc', 'px', '%'];
  44272. this.densities = {
  44273. m: 0.0254,
  44274. mm: 25.4,
  44275. cm: 2.54,
  44276. pt: 72,
  44277. pc: 6
  44278. };
  44279. this.value = parseFloat(value);
  44280. this.unit = unit || null;
  44281. this.index = index;
  44282. }
  44283. CartoCSS_createClass(Dimension, [{
  44284. key: "ev",
  44285. value: function ev(env) {
  44286. if (this.unit && this.all_units.indexOf(this.unit) < 0) {
  44287. env.error({
  44288. message: "Invalid unit: '" + this.unit + "'",
  44289. index: this.index
  44290. });
  44291. return {
  44292. is: 'undefined',
  44293. value: 'undefined'
  44294. };
  44295. } // normalize units which are not px or %
  44296. if (this.unit && this.physical_units.indexOf(this.unit) >= 0) {
  44297. if (!env.ppi) {
  44298. env.error({
  44299. message: "ppi is not set, so metric units can't be used",
  44300. index: this.index
  44301. });
  44302. return {
  44303. is: 'undefined',
  44304. value: 'undefined'
  44305. };
  44306. } // convert all units to inch
  44307. // convert inch to px using ppi
  44308. this.value = this.value / this.densities[this.unit] * env.ppi;
  44309. this.unit = 'px';
  44310. }
  44311. return this;
  44312. }
  44313. }, {
  44314. key: "toColor",
  44315. value: function toColor() {
  44316. return new SuperMap.CartoCSS.Tree.Color([this.value, this.value, this.value]);
  44317. }
  44318. }, {
  44319. key: "round",
  44320. value: function round() {
  44321. this.value = Math.round(this.value);
  44322. return this;
  44323. }
  44324. }, {
  44325. key: "toString",
  44326. value: function toString() {
  44327. return this.value.toString();
  44328. }
  44329. }, {
  44330. key: "operate",
  44331. value: function operate(env, op, other) {
  44332. if (this.unit === '%' && other.unit !== '%') {
  44333. env.error({
  44334. message: 'If two operands differ, the first must not be %',
  44335. index: this.index
  44336. });
  44337. return {
  44338. is: 'undefined',
  44339. value: 'undefined'
  44340. };
  44341. }
  44342. if (this.unit !== '%' && other.unit === '%') {
  44343. if (op === '*' || op === '/' || op === '%') {
  44344. env.error({
  44345. message: 'Percent values can only be added or subtracted from other values',
  44346. index: this.index
  44347. });
  44348. return {
  44349. is: 'undefined',
  44350. value: 'undefined'
  44351. };
  44352. }
  44353. return new SuperMap.CartoCSS.Tree.Dimension(SuperMap.CartoCSS.Tree.operate(op, this.value, this.value * other.value * 0.01), this.unit);
  44354. } //here the operands are either the same (% or undefined or px), or one is undefined and the other is px
  44355. return new SuperMap.CartoCSS.Tree.Dimension(SuperMap.CartoCSS.Tree.operate(op, this.value, other.value), this.unit || other.unit);
  44356. }
  44357. }]);
  44358. return Dimension;
  44359. }();
  44360. SuperMap.CartoCSS.Tree.Element = /*#__PURE__*/function () {
  44361. function Element(value) {
  44362. CartoCSS_classCallCheck(this, Element);
  44363. this.value = value.trim();
  44364. if (this.value[0] === '#') {
  44365. this.type = 'id';
  44366. this.clean = this.value.replace(/^#/, '');
  44367. }
  44368. if (this.value[0] === '.') {
  44369. this.type = 'class';
  44370. this.clean = this.value.replace(/^\./, '');
  44371. }
  44372. if (this.value.indexOf('*') !== -1) {
  44373. this.type = 'wildcard';
  44374. }
  44375. }
  44376. CartoCSS_createClass(Element, [{
  44377. key: "specificity",
  44378. value: function specificity() {
  44379. return [this.type === 'id' ? 1 : 0, // a
  44380. this.type === 'class' ? 1 : 0 // b
  44381. ];
  44382. }
  44383. }, {
  44384. key: "toString",
  44385. value: function toString() {
  44386. return this.value;
  44387. }
  44388. }]);
  44389. return Element;
  44390. }();
  44391. SuperMap.CartoCSS.Tree.Expression = /*#__PURE__*/function () {
  44392. function Expression(value) {
  44393. CartoCSS_classCallCheck(this, Expression);
  44394. this.is = 'expression';
  44395. this.value = value;
  44396. }
  44397. CartoCSS_createClass(Expression, [{
  44398. key: "ev",
  44399. value: function ev(env) {
  44400. if (this.value.length > 1) {
  44401. return new SuperMap.CartoCSS.Tree.Expression(this.value.map(function (e) {
  44402. return e.ev(env);
  44403. }));
  44404. } else {
  44405. return this.value[0].ev(env);
  44406. }
  44407. }
  44408. }, {
  44409. key: "toString",
  44410. value: function toString(env) {
  44411. return this.value.map(function (e) {
  44412. return e.toString(env);
  44413. }).join(' ');
  44414. }
  44415. }]);
  44416. return Expression;
  44417. }();
  44418. SuperMap.CartoCSS.Tree.Field = /*#__PURE__*/function () {
  44419. function Field(content) {
  44420. CartoCSS_classCallCheck(this, Field);
  44421. this.is = 'field';
  44422. this.value = content || '';
  44423. }
  44424. CartoCSS_createClass(Field, [{
  44425. key: "toString",
  44426. value: function toString() {
  44427. return '["' + this.value.toUpperCase() + '"]';
  44428. }
  44429. }, {
  44430. key: 'ev',
  44431. value: function ev() {
  44432. return this;
  44433. }
  44434. }]);
  44435. return Field;
  44436. }();
  44437. SuperMap.CartoCSS.Tree.Filter = /*#__PURE__*/function () {
  44438. function Filter(key, op, val, index, filename) {
  44439. CartoCSS_classCallCheck(this, Filter);
  44440. this.ops = {
  44441. '<': [' &lt; ', 'numeric'],
  44442. '>': [' &gt; ', 'numeric'],
  44443. '=': [' = ', 'both'],
  44444. '!=': [' != ', 'both'],
  44445. '<=': [' &lt;= ', 'numeric'],
  44446. '>=': [' &gt;= ', 'numeric'],
  44447. '=~': ['.match(', 'string', ')']
  44448. };
  44449. this.key = key;
  44450. this.op = op;
  44451. this.val = val;
  44452. this.index = index;
  44453. this.filename = filename;
  44454. this.id = this.key + this.op + this.val;
  44455. }
  44456. CartoCSS_createClass(Filter, [{
  44457. key: "ev",
  44458. value: function ev(env) {
  44459. this.key = this.key.ev(env);
  44460. this.val = this.val.ev(env);
  44461. return this;
  44462. }
  44463. }, {
  44464. key: "toString",
  44465. value: function toString() {
  44466. return '[' + this.id + ']';
  44467. }
  44468. }]);
  44469. return Filter;
  44470. }();
  44471. SuperMap.CartoCSS.Tree.Filterset = /*#__PURE__*/function () {
  44472. function Filterset() {
  44473. CartoCSS_classCallCheck(this, Filterset);
  44474. this.filters = {};
  44475. }
  44476. CartoCSS_createClass(Filterset, [{
  44477. key: "toJS",
  44478. value: function toJS(env) {
  44479. function eachFilter(filter) {
  44480. var op = filter.op;
  44481. if (op === "=") {
  44482. op = "==";
  44483. }
  44484. var val = filter.val;
  44485. if (filter._val !== undefined) {
  44486. val = filter._val.toString(true);
  44487. } //对scale进行特殊处理,将值转换成数值
  44488. if (filter.key && filter.key.value === 'scale') {
  44489. val = +val;
  44490. } else if (typeof val === 'string' || CartoCSS_typeof(val) === 'object') {
  44491. val = "'" + val + "'";
  44492. }
  44493. var attrs = "attributes";
  44494. return attrs + "&&" + attrs + filter.key + "&&" + attrs + filter.key + " " + op + val;
  44495. }
  44496. var results = [];
  44497. for (var id in this.filters) {
  44498. results.push(eachFilter(this.filters[id]));
  44499. }
  44500. return results.join(' && ');
  44501. }
  44502. }, {
  44503. key: "toString",
  44504. value: function toString() {
  44505. var arr = [];
  44506. for (var id in this.filters) {
  44507. arr.push(this.filters[id].id);
  44508. }
  44509. return arr.sort().join('\t');
  44510. }
  44511. }, {
  44512. key: "ev",
  44513. value: function ev(env) {
  44514. for (var i in this.filters) {
  44515. this.filters[i].ev(env);
  44516. }
  44517. return this;
  44518. }
  44519. }, {
  44520. key: "clone",
  44521. value: function clone() {
  44522. var clone = new SuperMap.CartoCSS.Tree.Filterset();
  44523. for (var id in this.filters) {
  44524. clone.filters[id] = this.filters[id];
  44525. }
  44526. return clone;
  44527. }
  44528. }, {
  44529. key: "cloneWith",
  44530. value: function cloneWith(other) {
  44531. var additions = [];
  44532. for (var id in other.filters) {
  44533. var status = this.addable(other.filters[id]); // status is true, false or null. if it's null we don't fail this
  44534. // clone nor do we add the filter.
  44535. if (status === false) {
  44536. return false;
  44537. }
  44538. if (status === true) {
  44539. // Adding the filter will override another value.
  44540. additions.push(other.filters[id]);
  44541. }
  44542. } // Adding the other filters doesn't make this filterset invalid, but it
  44543. // doesn't add anything to it either.
  44544. if (!additions.length) {
  44545. return null;
  44546. } // We can successfully add all filters. Now clone the filterset and add the
  44547. // new rules.
  44548. var clone = new SuperMap.CartoCSS.Tree.Filterset(); // We can add the rules that are already present without going through the
  44549. // add function as a Filterset is always in it's simplest canonical form.
  44550. for (id in this.filters) {
  44551. clone.filters[id] = this.filters[id];
  44552. } // Only add new filters that actually change the filter.
  44553. while (id = additions.shift()) {
  44554. clone.add(id);
  44555. }
  44556. return clone;
  44557. }
  44558. }, {
  44559. key: "addable",
  44560. value: function addable(filter) {
  44561. var key = filter.key.toString(),
  44562. value = filter.val.toString();
  44563. if (value.match(/^[0-9]+(\.[0-9]*)?_match/)) {
  44564. value = parseFloat(value);
  44565. }
  44566. switch (filter.op) {
  44567. case '=':
  44568. // if there is already foo= and we're adding foo=
  44569. if (this.filters[key + '='] !== undefined) {
  44570. if (this.filters[key + '='].val.toString() != value) {
  44571. return false;
  44572. } else {
  44573. return null;
  44574. }
  44575. }
  44576. if (this.filters[key + '!=' + value] !== undefined) {
  44577. return false;
  44578. }
  44579. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  44580. return false;
  44581. }
  44582. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  44583. return false;
  44584. }
  44585. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  44586. return false;
  44587. }
  44588. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  44589. return false;
  44590. }
  44591. return true;
  44592. case '=~':
  44593. return true;
  44594. case '!=':
  44595. if (this.filters[key + '='] !== undefined) {
  44596. return this.filters[key + '='].val === value ? false : null;
  44597. }
  44598. if (this.filters[key + '!=' + value] !== undefined) {
  44599. return null;
  44600. }
  44601. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  44602. return null;
  44603. }
  44604. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  44605. return null;
  44606. }
  44607. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  44608. return null;
  44609. }
  44610. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  44611. return null;
  44612. }
  44613. return true;
  44614. case '>':
  44615. if (key + '=' in this.filters) {
  44616. if (this.filters[key + '='].val <= value) {
  44617. return false;
  44618. } else {
  44619. return null;
  44620. }
  44621. }
  44622. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  44623. return false;
  44624. }
  44625. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  44626. return false;
  44627. }
  44628. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  44629. return null;
  44630. }
  44631. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  44632. return null;
  44633. }
  44634. return true;
  44635. case '>=':
  44636. if (this.filters[key + '='] !== undefined) {
  44637. return this.filters[key + '='].val < value ? false : null;
  44638. }
  44639. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  44640. return false;
  44641. }
  44642. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  44643. return false;
  44644. }
  44645. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  44646. return null;
  44647. }
  44648. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  44649. return null;
  44650. }
  44651. return true;
  44652. case '<':
  44653. if (this.filters[key + '='] !== undefined) {
  44654. return this.filters[key + '='].val >= value ? false : null;
  44655. }
  44656. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  44657. return false;
  44658. }
  44659. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  44660. return false;
  44661. }
  44662. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  44663. return null;
  44664. }
  44665. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  44666. return null;
  44667. }
  44668. return true;
  44669. case '<=':
  44670. if (this.filters[key + '='] !== undefined) {
  44671. return this.filters[key + '='].val > value ? false : null;
  44672. }
  44673. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  44674. return false;
  44675. }
  44676. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  44677. return false;
  44678. }
  44679. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  44680. return null;
  44681. }
  44682. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  44683. return null;
  44684. }
  44685. return true;
  44686. default:
  44687. break;
  44688. }
  44689. }
  44690. }, {
  44691. key: "conflict",
  44692. value: function conflict(filter) {
  44693. var key = filter.key.toString(),
  44694. value = filter.val.toString();
  44695. if (!isNaN(parseFloat(value))) {
  44696. value = parseFloat(value);
  44697. } // if (a=b) && (a=c)
  44698. // if (a=b) && (a!=b)
  44699. // or (a!=b) && (a=b)
  44700. 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()) {
  44701. return filter.toString() + ' added to ' + this.toString() + ' produces an invalid filter';
  44702. }
  44703. return false;
  44704. }
  44705. }, {
  44706. key: "add",
  44707. value: function add(filter, env) {
  44708. var key = filter.key.toString(),
  44709. op = filter.op,
  44710. conflict = this.conflict(filter),
  44711. numval;
  44712. if (conflict) {
  44713. return conflict;
  44714. }
  44715. if (op === '=') {
  44716. for (var i in this.filters) {
  44717. if (this.filters[i].key === key) {
  44718. delete this.filters[i];
  44719. }
  44720. }
  44721. this.filters[key + '='] = filter;
  44722. } else if (op === '!=') {
  44723. this.filters[key + '!=' + filter.val] = filter;
  44724. } else if (op === '=~') {
  44725. this.filters[key + '=~' + filter.val] = filter;
  44726. } else if (op === '>') {
  44727. // If there are other filters that are also >
  44728. // but are less than this one, they don't matter, so
  44729. // remove them.
  44730. for (var j in this.filters) {
  44731. if (this.filters[j].key === key && this.filters[j].val <= filter.val) {
  44732. delete this.filters[j];
  44733. }
  44734. }
  44735. this.filters[key + '>'] = filter;
  44736. } else if (op === '>=') {
  44737. for (var k in this.filters) {
  44738. numval = +this.filters[k].val.toString();
  44739. if (this.filters[k].key === key && numval < filter.val) {
  44740. delete this.filters[k];
  44741. }
  44742. }
  44743. if (this.filters[key + '!=' + filter.val] !== undefined) {
  44744. delete this.filters[key + '!=' + filter.val];
  44745. filter.op = '>';
  44746. this.filters[key + '>'] = filter;
  44747. } else {
  44748. this.filters[key + '>='] = filter;
  44749. }
  44750. } else if (op === '<') {
  44751. for (var l in this.filters) {
  44752. numval = +this.filters[l].val.toString();
  44753. if (this.filters[l].key === key && numval >= filter.val) {
  44754. delete this.filters[l];
  44755. }
  44756. }
  44757. this.filters[key + '<'] = filter;
  44758. } else if (op === '<=') {
  44759. for (var m in this.filters) {
  44760. numval = +this.filters[m].val.toString();
  44761. if (this.filters[m].key === key && numval > filter.val) {
  44762. delete this.filters[m];
  44763. }
  44764. }
  44765. if (this.filters[key + '!=' + filter.val] !== undefined) {
  44766. delete this.filters[key + '!=' + filter.val];
  44767. filter.op = '<';
  44768. this.filters[key + '<'] = filter;
  44769. } else {
  44770. this.filters[key + '<='] = filter;
  44771. }
  44772. }
  44773. }
  44774. }]);
  44775. return Filterset;
  44776. }();
  44777. SuperMap.CartoCSS.Tree.Fontset = function Fontset(env, fonts) {
  44778. CartoCSS_classCallCheck(this, Fontset);
  44779. this.fonts = fonts;
  44780. this.name = 'fontset-' + env.effects.length;
  44781. };
  44782. SuperMap.CartoCSS.Tree.Invalid = /*#__PURE__*/function () {
  44783. function Invalid(chunk, index, message) {
  44784. CartoCSS_classCallCheck(this, Invalid);
  44785. this.is = 'invalid';
  44786. this.chunk = chunk;
  44787. this.index = index;
  44788. this.type = 'syntax';
  44789. this.message = message || "Invalid code: " + this.chunk;
  44790. }
  44791. CartoCSS_createClass(Invalid, [{
  44792. key: "ev",
  44793. value: function ev(env) {
  44794. env.error({
  44795. chunk: this.chunk,
  44796. index: this.index,
  44797. type: 'syntax',
  44798. message: this.message || "Invalid code: " + this.chunk
  44799. });
  44800. return {
  44801. is: 'undefined'
  44802. };
  44803. }
  44804. }]);
  44805. return Invalid;
  44806. }();
  44807. SuperMap.CartoCSS.Tree.Keyword = /*#__PURE__*/function () {
  44808. CartoCSS_createClass(Keyword, [{
  44809. key: "ev",
  44810. value: function ev() {
  44811. return this;
  44812. }
  44813. }]);
  44814. function Keyword(value) {
  44815. CartoCSS_classCallCheck(this, Keyword);
  44816. this.value = value;
  44817. var special = {
  44818. 'transparent': 'color',
  44819. 'true': 'boolean',
  44820. 'false': 'boolean'
  44821. };
  44822. this.is = special[value] ? special[value] : 'keyword';
  44823. }
  44824. CartoCSS_createClass(Keyword, [{
  44825. key: "toString",
  44826. value: function toString() {
  44827. return this.value;
  44828. }
  44829. }]);
  44830. return Keyword;
  44831. }();
  44832. /*Layer:class Invalid ),*/
  44833. SuperMap.CartoCSS.Tree.Literal = /*#__PURE__*/function () {
  44834. function Literal(content) {
  44835. CartoCSS_classCallCheck(this, Literal);
  44836. this.value = content || '';
  44837. this.is = 'field';
  44838. }
  44839. CartoCSS_createClass(Literal, [{
  44840. key: "toString",
  44841. value: function toString() {
  44842. return this.value;
  44843. }
  44844. }, {
  44845. key: 'ev',
  44846. value: function ev() {
  44847. return this;
  44848. }
  44849. }]);
  44850. return Literal;
  44851. }();
  44852. SuperMap.CartoCSS.Tree.Operation = /*#__PURE__*/function () {
  44853. function Operation(op, operands, index) {
  44854. CartoCSS_classCallCheck(this, Operation);
  44855. this.is = 'operation';
  44856. this.op = op.trim();
  44857. this.operands = operands;
  44858. this.index = index;
  44859. }
  44860. CartoCSS_createClass(Operation, [{
  44861. key: "ev",
  44862. value: function ev(env) {
  44863. var a = this.operands[0].ev(env),
  44864. b = this.operands[1].ev(env),
  44865. temp;
  44866. if (a.is === 'undefined' || b.is === 'undefined') {
  44867. return {
  44868. is: 'undefined',
  44869. value: 'undefined'
  44870. };
  44871. }
  44872. if (a instanceof SuperMap.CartoCSS.Tree.Dimension && b instanceof SuperMap.CartoCSS.Tree.Color) {
  44873. if (this.op === '*' || this.op === '+') {
  44874. temp = b;
  44875. b = a;
  44876. a = temp;
  44877. } else {
  44878. env.error({
  44879. name: "OperationError",
  44880. message: "Can't substract or divide a color from a number",
  44881. index: this.index
  44882. });
  44883. }
  44884. } // Only concatenate plain strings, because this is easily
  44885. // pre-processed
  44886. if (a instanceof SuperMap.CartoCSS.Tree.Quoted && b instanceof SuperMap.CartoCSS.Tree.Quoted && this.op !== '+') {
  44887. env.error({
  44888. message: "Can't subtract, divide, or multiply strings.",
  44889. index: this.index,
  44890. type: 'runtime',
  44891. filename: this.filename
  44892. });
  44893. return {
  44894. is: 'undefined',
  44895. value: 'undefined'
  44896. };
  44897. } // Fields, literals, dimensions, and quoted strings can be combined.
  44898. 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) {
  44899. if (a.is === 'color' || b.is === 'color') {
  44900. env.error({
  44901. message: "Can't subtract, divide, or multiply colors in expressions.",
  44902. index: this.index,
  44903. type: 'runtime',
  44904. filename: this.filename
  44905. });
  44906. return {
  44907. is: 'undefined',
  44908. value: 'undefined'
  44909. };
  44910. } else {
  44911. return new SuperMap.CartoCSS.Tree.Literal(a.ev(env).toString(true) + this.op + b.ev(env).toString(true));
  44912. }
  44913. }
  44914. if (a.operate === undefined) {
  44915. env.error({
  44916. message: 'Cannot do math with type ' + a.is + '.',
  44917. index: this.index,
  44918. type: 'runtime',
  44919. filename: this.filename
  44920. });
  44921. return {
  44922. is: 'undefined',
  44923. value: 'undefined'
  44924. };
  44925. }
  44926. return a.operate(env, this.op, b);
  44927. }
  44928. }]);
  44929. return Operation;
  44930. }();
  44931. SuperMap.CartoCSS.Tree.Quoted = /*#__PURE__*/function () {
  44932. function Quoted(content) {
  44933. CartoCSS_classCallCheck(this, Quoted);
  44934. this.is = 'string';
  44935. this.value = content || '';
  44936. }
  44937. CartoCSS_createClass(Quoted, [{
  44938. key: "toString",
  44939. value: function toString(quotes) {
  44940. var escapedValue = this.value.replace(/&/g, '&amp;');
  44941. var xmlvalue = escapedValue.replace(/\'/g, '\\\'').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/\>/g, '&gt;');
  44942. return quotes === true ? "'" + xmlvalue + "'" : escapedValue;
  44943. }
  44944. }, {
  44945. key: "ev",
  44946. value: function ev() {
  44947. return this;
  44948. }
  44949. }, {
  44950. key: "operate",
  44951. value: function operate(env, op, other) {
  44952. return new SuperMap.CartoCSS.Tree.Quoted(SuperMap.CartoCSS.Tree.operate(op, this.toString(), other.toString(this.contains_field)));
  44953. }
  44954. }]);
  44955. return Quoted;
  44956. }();
  44957. SuperMap.CartoCSS.Tree.Reference = {
  44958. _validateValue: {
  44959. 'font': function font(env, value) {
  44960. if (env.validation_data && env.validation_data.fonts) {
  44961. return env.validation_data.fonts.indexOf(value) != -1;
  44962. } else {
  44963. return true;
  44964. }
  44965. }
  44966. },
  44967. setData: function setData(data) {
  44968. this.data = data;
  44969. this.selector_cache = generateSelectorCache(data);
  44970. this.mapnikFunctions = generateMapnikFunctions(data);
  44971. this.required_cache = generateRequiredProperties(data);
  44972. function generateSelectorCache(data) {
  44973. var index = {};
  44974. for (var i in data.symbolizers) {
  44975. for (var j in data.symbolizers[i]) {
  44976. if (data.symbolizers[i][j].hasOwnProperty('css')) {
  44977. index[data.symbolizers[i][j].css] = [data.symbolizers[i][j], i, j];
  44978. }
  44979. }
  44980. }
  44981. return index;
  44982. }
  44983. function generateMapnikFunctions(data) {
  44984. var functions = {};
  44985. for (var i in data.symbolizers) {
  44986. for (var j in data.symbolizers[i]) {
  44987. if (data.symbolizers[i][j].type === 'functions') {
  44988. for (var k = 0; k < data.symbolizers[i][j].functions.length; k++) {
  44989. var fn = data.symbolizers[i][j].functions[k];
  44990. functions[fn[0]] = fn[1];
  44991. }
  44992. }
  44993. }
  44994. }
  44995. return functions;
  44996. }
  44997. function generateRequiredProperties(data) {
  44998. var cache = {};
  44999. for (var symbolizer_name in data.symbolizers) {
  45000. cache[symbolizer_name] = [];
  45001. for (var j in data.symbolizers[symbolizer_name]) {
  45002. if (data.symbolizers[symbolizer_name][j].required) {
  45003. cache[symbolizer_name].push(data.symbolizers[symbolizer_name][j].css);
  45004. }
  45005. }
  45006. }
  45007. return cache;
  45008. }
  45009. },
  45010. setVersion: function setVersion(version) {
  45011. if (SuperMap.CartoCSS.mapnik_reference.version.hasOwnProperty(version)) {
  45012. this.setData(SuperMap.CartoCSS.mapnik_reference.version[version]);
  45013. return true;
  45014. }
  45015. return false;
  45016. },
  45017. selectorData: function selectorData(selector, i) {
  45018. if (this.selector_cache && this.selector_cache[selector]) {
  45019. return this.selector_cache[selector][i];
  45020. }
  45021. },
  45022. validSelector: function validSelector(selector) {
  45023. return !!this.selector_cache[selector];
  45024. },
  45025. selectorName: function selectorName(selector) {
  45026. return this.selectorData(selector, 2);
  45027. },
  45028. selector: function selector(_selector) {
  45029. return this.selectorData(_selector, 0);
  45030. },
  45031. symbolizer: function symbolizer(selector) {
  45032. return this.selectorData(selector, 1);
  45033. },
  45034. requiredProperties: function requiredProperties(symbolizer_name, rules) {
  45035. var req = this.required_cache[symbolizer_name];
  45036. for (var i in req) {
  45037. if (!(req[i] in rules)) {
  45038. return 'Property ' + req[i] + ' required for defining ' + symbolizer_name + ' styles.';
  45039. }
  45040. }
  45041. },
  45042. isFont: function isFont(selector) {
  45043. return this.selector(selector).validate === 'font';
  45044. },
  45045. editDistance: function editDistance(a, b) {
  45046. if (a.length === 0) {
  45047. return b.length;
  45048. }
  45049. if (b.length === 0) {
  45050. return a.length;
  45051. }
  45052. var matrix = [];
  45053. for (var i = 0; i <= b.length; i++) {
  45054. matrix[i] = [i];
  45055. }
  45056. for (var j = 0; j <= a.length; j++) {
  45057. matrix[0][j] = j;
  45058. }
  45059. for (i = 1; i <= b.length; i++) {
  45060. for (j = 1; j <= a.length; j++) {
  45061. if (b.charAt(i - 1) === a.charAt(j - 1)) {
  45062. matrix[i][j] = matrix[i - 1][j - 1];
  45063. } else {
  45064. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
  45065. Math.min(matrix[i][j - 1] + 1, // insertion
  45066. matrix[i - 1][j] + 1)); // deletion
  45067. }
  45068. }
  45069. }
  45070. return matrix[b.length][a.length];
  45071. },
  45072. validValue: function validValue(env, selector, value) {
  45073. function validateFunctions(value, selector) {
  45074. if (value.value[0].is === 'string') {
  45075. return true;
  45076. }
  45077. for (var i in value.value) {
  45078. for (var j in value.value[i].value) {
  45079. if (value.value[i].value[j].is !== 'call') {
  45080. return false;
  45081. }
  45082. var f = find(this.selector(selector).functions, function (x) {
  45083. //NOSONAR
  45084. return x[0] === value.value[i].value[j].name;
  45085. });
  45086. if (!(f && f[1] === -1)) {
  45087. // This filter is unknown or given an incorrect number of arguments
  45088. if (!f || f[1] !== value.value[i].value[j].args.length) {
  45089. return false;
  45090. }
  45091. }
  45092. }
  45093. }
  45094. return true;
  45095. }
  45096. function validateKeyword(value, selector) {
  45097. if (CartoCSS_typeof(this.selector(selector).type) === 'object') {
  45098. return this.selector(selector).type.indexOf(value.value[0].value) !== -1;
  45099. } else {
  45100. // allow unquoted keywords as strings
  45101. return this.selector(selector).type === 'string';
  45102. }
  45103. }
  45104. var i;
  45105. if (!this.selector(selector)) {
  45106. return false;
  45107. } else if (value.value[0].is === 'keyword') {
  45108. return validateKeyword(value, selector);
  45109. } else if (value.value[0].is === 'undefined') {
  45110. // caught earlier in the chain - ignore here so that
  45111. // error is not overridden
  45112. return true;
  45113. } else if (this.selector(selector).type === 'numbers') {
  45114. for (i in value.value) {
  45115. if (value.value[i].is !== 'float') {
  45116. return false;
  45117. }
  45118. }
  45119. return true;
  45120. } else if (this.selector(selector).type === 'tags') {
  45121. if (!value.value) {
  45122. return false;
  45123. }
  45124. if (!value.value[0].value) {
  45125. return value.value[0].is === 'tag';
  45126. }
  45127. for (i = 0; i < value.value[0].value.length; i++) {
  45128. if (value.value[0].value[i].is !== 'tag') {
  45129. return false;
  45130. }
  45131. }
  45132. return true;
  45133. } else if (this.selector(selector).type == 'functions') {
  45134. // For backwards compatibility, you can specify a string for `functions`-compatible
  45135. // values, though they will not be validated.
  45136. return validateFunctions(value, selector);
  45137. } else if (this.selector(selector).type === 'expression') {
  45138. return true;
  45139. } else if (this.selector(selector).type === 'unsigned') {
  45140. if (value.value[0].is === 'float') {
  45141. value.value[0].round();
  45142. return true;
  45143. } else {
  45144. return false;
  45145. }
  45146. } else {
  45147. if (this.selector(selector).validate) {
  45148. var valid = false;
  45149. for (i = 0; i < value.value.length; i++) {
  45150. if (this.selector(selector).type === value.value[i].is && this._validateValue[this.selector(selector).validate](env, value.value[i].value)) {
  45151. return true;
  45152. }
  45153. }
  45154. return valid;
  45155. } else {
  45156. return this.selector(selector).type === value.value[0].is;
  45157. }
  45158. }
  45159. }
  45160. };
  45161. SuperMap.CartoCSS.Tree.Reference.setVersion("latest");
  45162. SuperMap.CartoCSS.Tree.Rule = /*#__PURE__*/function () {
  45163. function Rule(name, value, index, filename) {
  45164. CartoCSS_classCallCheck(this, Rule);
  45165. this.is = 'rule';
  45166. var parts = name.split('/');
  45167. this.name = parts.pop();
  45168. this.instance = parts.length ? parts[0] : '__default__';
  45169. this.value = value instanceof SuperMap.CartoCSS.Tree.Value ? value : new SuperMap.CartoCSS.Tree.Value([value]);
  45170. this.index = index;
  45171. this.symbolizer = SuperMap.CartoCSS.Tree.Reference.symbolizer(this.name);
  45172. this.filename = filename;
  45173. this.variable = name.charAt(0) === '@';
  45174. }
  45175. CartoCSS_createClass(Rule, [{
  45176. key: "clone",
  45177. value: function clone() {
  45178. var clone = Object.create(SuperMap.CartoCSS.Tree.Rule.prototype);
  45179. clone.name = this.name;
  45180. clone.value = this.value;
  45181. clone.index = this.index;
  45182. clone.instance = this.instance;
  45183. clone.symbolizer = this.symbolizer;
  45184. clone.filename = this.filename;
  45185. clone.variable = this.variable;
  45186. return clone;
  45187. }
  45188. }, {
  45189. key: "updateID",
  45190. value: function updateID() {
  45191. return this.id = this.zoom + '#' + this.instance + '#' + this.name;
  45192. }
  45193. }, {
  45194. key: "toString",
  45195. value: function toString() {
  45196. return '[' + SuperMap.CartoCSS.Tree.Zoom.toString(this.zoom) + '] ' + this.name + ': ' + this.value;
  45197. }
  45198. }, {
  45199. key: "ev",
  45200. value: function ev(context) {
  45201. return new SuperMap.CartoCSS.Tree.Rule(this.name, this.value.ev(context), this.index, this.filename);
  45202. }
  45203. }]);
  45204. return Rule;
  45205. }();
  45206. SuperMap.CartoCSS.Tree.Ruleset = /*#__PURE__*/function () {
  45207. function Ruleset(selectors, rules) {
  45208. CartoCSS_classCallCheck(this, Ruleset);
  45209. this.is = 'ruleset';
  45210. this.selectors = selectors;
  45211. this.rules = rules; // static cache of find() function
  45212. this._lookups = {};
  45213. }
  45214. CartoCSS_createClass(Ruleset, [{
  45215. key: "ev",
  45216. value: function ev(env) {
  45217. var i,
  45218. rule,
  45219. ruleset = new SuperMap.CartoCSS.Tree.Ruleset(this.selectors, this.rules.slice(0));
  45220. ruleset.root = this.root; // push the current ruleset to the frames stack
  45221. env.frames.unshift(ruleset); // Evaluate everything else
  45222. for (i = 0, rule; i < ruleset.rules.length; i++) {
  45223. rule = ruleset.rules[i];
  45224. ruleset.rules[i] = rule.ev ? rule.ev(env) : rule;
  45225. } // Pop the stack
  45226. env.frames.shift();
  45227. return ruleset;
  45228. }
  45229. }, {
  45230. key: "match",
  45231. value: function match(args) {
  45232. return !args || args.length === 0;
  45233. }
  45234. }, {
  45235. key: "variables",
  45236. value: function variables() {
  45237. if (this._variables) {
  45238. return this._variables;
  45239. } else {
  45240. return this._variables = this.rules.reduce(function (hash, r) {
  45241. if (r instanceof SuperMap.CartoCSS.Tree.Rule && r.variable === true) {
  45242. hash[r.name] = r;
  45243. }
  45244. return hash;
  45245. }, {});
  45246. }
  45247. }
  45248. }, {
  45249. key: "variable",
  45250. value: function variable(name) {
  45251. return this.variables()[name];
  45252. }
  45253. }, {
  45254. key: "rulesets",
  45255. value: function rulesets() {
  45256. if (this._rulesets) {
  45257. return this._rulesets;
  45258. } else {
  45259. return this._rulesets = this.rules.filter(function (r) {
  45260. return r instanceof SuperMap.CartoCSS.Tree.Ruleset;
  45261. });
  45262. }
  45263. }
  45264. }, {
  45265. key: "find",
  45266. value: function find(selector, self) {
  45267. self = self || this;
  45268. var rules = [],
  45269. match,
  45270. key = selector.toString();
  45271. if (key in this._lookups) {
  45272. return this._lookups[key];
  45273. }
  45274. this.rulesets().forEach(function (rule) {
  45275. if (rule !== self) {
  45276. for (var j = 0; j < rule.selectors.length; j++) {
  45277. match = selector.match(rule.selectors[j]);
  45278. if (match) {
  45279. if (selector.elements.length > 1) {
  45280. Array.prototype.push.apply(rules, rule.find(new SuperMap.CartoCSS.Tree.Selector(null, null, selector.elements.slice(1)), self));
  45281. } else {
  45282. rules.push(rule);
  45283. }
  45284. break;
  45285. }
  45286. }
  45287. }
  45288. });
  45289. return this._lookups[key] = rules;
  45290. } // Zooms can use variables. This replaces SuperMap.CartoCSS.Tree.Zoom objects on selectors
  45291. // with simple bit-arrays that we can compare easily.
  45292. }, {
  45293. key: "evZooms",
  45294. value: function evZooms(env) {
  45295. for (var i = 0; i < this.selectors.length; i++) {
  45296. var zval = SuperMap.CartoCSS.Tree.Zoom.all;
  45297. for (var z = 0; z < this.selectors[i].zoom.length; z++) {
  45298. zval = this.selectors[i].zoom[z].ev(env).zoom;
  45299. }
  45300. this.selectors[i].zoom = zval;
  45301. }
  45302. }
  45303. }, {
  45304. key: "flatten",
  45305. value: function flatten(result, parents, env) {
  45306. var selectors = [],
  45307. i,
  45308. j;
  45309. if (this.selectors.length === 0) {
  45310. env.frames = env.frames.concat(this.rules);
  45311. } // evaluate zoom variables on this object.
  45312. this.evZooms(env);
  45313. for (i = 0; i < this.selectors.length; i++) {
  45314. var child = this.selectors[i];
  45315. if (!child.filters) {
  45316. // This is an invalid filterset.
  45317. continue;
  45318. }
  45319. if (parents.length) {
  45320. for (j = 0; j < parents.length; j++) {
  45321. var parent = parents[j];
  45322. var mergedFilters = parent.filters.cloneWith(child.filters);
  45323. if (mergedFilters === null) {
  45324. // Filters could be added, but they didn't change the
  45325. // filters. This means that we only have to clone when
  45326. // the zoom levels or the attachment is different too.
  45327. if (parent.zoom === child.zoom && parent.attachment === child.attachment && parent.elements.join() === child.elements.join()) {
  45328. selectors.push(parent);
  45329. continue;
  45330. } else {
  45331. mergedFilters = parent.filters;
  45332. }
  45333. } else if (!mergedFilters) {
  45334. // The merged filters are invalid, that means we don't
  45335. // have to clone.
  45336. continue;
  45337. }
  45338. var clone = Object.create(SuperMap.CartoCSS.Tree.Selector.prototype);
  45339. clone.filters = mergedFilters;
  45340. clone.zoom = child.zoom;
  45341. clone.elements = parent.elements.concat(child.elements);
  45342. if (parent.attachment && child.attachment) {
  45343. clone.attachment = parent.attachment + '/' + child.attachment;
  45344. } else {
  45345. clone.attachment = child.attachment || parent.attachment;
  45346. }
  45347. clone.conditions = parent.conditions + child.conditions;
  45348. clone.index = child.index;
  45349. selectors.push(clone);
  45350. }
  45351. } else {
  45352. selectors.push(child);
  45353. }
  45354. }
  45355. var rules = [];
  45356. for (i = 0; i < this.rules.length; i++) {
  45357. var rule = this.rules[i]; // Recursively flatten any nested rulesets
  45358. if (rule instanceof SuperMap.CartoCSS.Tree.Ruleset) {
  45359. rule.flatten(result, selectors, env);
  45360. } else if (rule instanceof SuperMap.CartoCSS.Tree.Rule) {
  45361. rules.push(rule);
  45362. } else if (rule instanceof SuperMap.CartoCSS.Tree.Invalid) {
  45363. env.error(rule);
  45364. }
  45365. }
  45366. var index = rules.length ? rules[0].index : false;
  45367. for (i = 0; i < selectors.length; i++) {
  45368. // For specificity sort, use the position of the first rule to allow
  45369. // defining attachments that are under current element as a descendant
  45370. // selector.
  45371. if (index !== false) {
  45372. selectors[i].index = index;
  45373. }
  45374. result.push(new SuperMap.CartoCSS.Tree.Definition(selectors[i], rules.slice()));
  45375. }
  45376. return result;
  45377. }
  45378. }]);
  45379. return Ruleset;
  45380. }();
  45381. SuperMap.CartoCSS.Tree.Selector = /*#__PURE__*/function () {
  45382. function Selector(filters, zoom, elements, attachment, conditions, index) {
  45383. CartoCSS_classCallCheck(this, Selector);
  45384. this.elements = elements || [];
  45385. this.attachment = attachment;
  45386. this.filters = filters || {};
  45387. this.zoom = typeof zoom !== 'undefined' ? zoom : SuperMap.CartoCSS.Tree.Zoom.all;
  45388. this.conditions = conditions;
  45389. this.index = index;
  45390. }
  45391. CartoCSS_createClass(Selector, [{
  45392. key: "specificity",
  45393. value: function specificity() {
  45394. return this.elements.reduce(function (memo, e) {
  45395. var spec = e.specificity();
  45396. memo[0] += spec[0];
  45397. memo[1] += spec[1];
  45398. return memo;
  45399. }, [0, 0, this.conditions, this.index]);
  45400. }
  45401. }]);
  45402. return Selector;
  45403. }();
  45404. /*style:class Invalid ),*/
  45405. SuperMap.CartoCSS.Tree.URL = /*#__PURE__*/function () {
  45406. function URL(val, paths) {
  45407. CartoCSS_classCallCheck(this, URL);
  45408. this.is = 'uri';
  45409. this.value = val;
  45410. this.paths = paths;
  45411. }
  45412. CartoCSS_createClass(URL, [{
  45413. key: "toString",
  45414. value: function toString() {
  45415. return this.value.toString();
  45416. }
  45417. }, {
  45418. key: "ev",
  45419. value: function ev(ctx) {
  45420. return new SuperMap.CartoCSS.Tree.URL(this.value.ev(ctx), this.paths);
  45421. }
  45422. }]);
  45423. return URL;
  45424. }();
  45425. SuperMap.CartoCSS.Tree.Value = /*#__PURE__*/function () {
  45426. function Value(value) {
  45427. CartoCSS_classCallCheck(this, Value);
  45428. this.is = 'value';
  45429. this.value = value;
  45430. }
  45431. CartoCSS_createClass(Value, [{
  45432. key: "ev",
  45433. value: function ev(env) {
  45434. if (this.value.length === 1) {
  45435. return this.value[0].ev(env);
  45436. } else {
  45437. return new SuperMap.CartoCSS.Tree.Value(this.value.map(function (v) {
  45438. return v.ev(env);
  45439. }));
  45440. }
  45441. }
  45442. }, {
  45443. key: "toJS",
  45444. value: function toJS(env) {
  45445. //var v = this.value[0].value[0];
  45446. var val = this.ev(env);
  45447. var v = val.toString();
  45448. if (val.is === "color" || val.is === 'uri' || val.is === 'string' || val.is === 'keyword') {
  45449. v = "'" + v + "'";
  45450. } else if (val.is === 'field') {
  45451. // replace [varuable] by ctx['variable']
  45452. v = v.replace(/\[(.*)\]/g, "attributes['\_match1']");
  45453. } else if (val.value && CartoCSS_typeof(val.value) === "object") {
  45454. v = "[" + v + "]";
  45455. }
  45456. return "_value = " + v + ";";
  45457. }
  45458. }, {
  45459. key: "toString",
  45460. value: function toString(env, selector, sep, format) {
  45461. return this.value.map(function (e) {
  45462. return e.toString(env, format);
  45463. }).join(sep || ', ');
  45464. }
  45465. }, {
  45466. key: "clone",
  45467. value: function clone() {
  45468. var obj = Object.create(SuperMap.CartoCSS.Tree.Value.prototype);
  45469. if (Array.isArray(obj)) {
  45470. obj.value = this.value.slice();
  45471. } else {
  45472. obj.value = this.value;
  45473. }
  45474. obj.is = this.is;
  45475. return obj;
  45476. }
  45477. }]);
  45478. return Value;
  45479. }();
  45480. SuperMap.CartoCSS.Tree.Variable = /*#__PURE__*/function () {
  45481. function Variable(name, index, filename) {
  45482. CartoCSS_classCallCheck(this, Variable);
  45483. this.is = 'variable';
  45484. this.name = name;
  45485. this.index = index;
  45486. this.filename = filename;
  45487. }
  45488. CartoCSS_createClass(Variable, [{
  45489. key: "toString",
  45490. value: function toString() {
  45491. return this.name;
  45492. }
  45493. }, {
  45494. key: "ev",
  45495. value: function ev(env) {
  45496. if (this._css) {
  45497. return this._css;
  45498. }
  45499. var thisframe = env.frames.filter(function (f) {
  45500. return f.name === this.name;
  45501. }.bind(this));
  45502. if (thisframe.length) {
  45503. return thisframe[0].value.ev(env);
  45504. } else {
  45505. env.error({
  45506. message: 'variable ' + this.name + ' is undefined',
  45507. index: this.index,
  45508. type: 'runtime',
  45509. filename: this.filename
  45510. });
  45511. return {
  45512. is: 'undefined',
  45513. value: 'undefined'
  45514. };
  45515. }
  45516. }
  45517. }]);
  45518. return Variable;
  45519. }();
  45520. SuperMap.CartoCSS.Tree.Zoom = /*#__PURE__*/function () {
  45521. function Zoom(op, value, index) {
  45522. CartoCSS_classCallCheck(this, Zoom);
  45523. this.op = op;
  45524. this.value = value;
  45525. this.index = index;
  45526. }
  45527. CartoCSS_createClass(Zoom, [{
  45528. key: "setZoom",
  45529. value: function setZoom(zoom) {
  45530. this.zoom = zoom;
  45531. return this;
  45532. }
  45533. }, {
  45534. key: "ev",
  45535. value: function ev(env) {
  45536. var value = parseInt(this.value.ev(env).toString(), 10);
  45537. if (value > SuperMap.CartoCSS.Tree.Zoom.maxZoom || value < 0) {
  45538. env.error({
  45539. message: 'Only zoom levels between 0 and ' + SuperMap.CartoCSS.Tree.Zoom.maxZoom + ' supported.',
  45540. index: this.index
  45541. });
  45542. }
  45543. switch (this.op) {
  45544. case '=':
  45545. this.zoom = "zoom && zoom === " + value;
  45546. return this;
  45547. case '>':
  45548. this.zoom = "zoom && zoom > " + value;
  45549. break;
  45550. case '>=':
  45551. this.zoom = "zoom && zoom >= " + value;
  45552. break;
  45553. case '<':
  45554. this.zoom = "zoom && zoom < " + value;
  45555. break;
  45556. case '<=':
  45557. this.zoom = "zoom && zoom <= " + value;
  45558. break;
  45559. default:
  45560. return this;
  45561. break;
  45562. }
  45563. /*
  45564. for (var i = 0; i <= SuperMap.CartoCSS.Tree.Zoom.maxZoom; i++) {
  45565. if (i >= start && i <= end) {
  45566. zoom |= (1 << i);
  45567. }
  45568. }
  45569. this.zoom = zoom;
  45570. this.zoom=value+this.op+"zoom";*/
  45571. return this;
  45572. }
  45573. }, {
  45574. key: "toString",
  45575. value: function toString() {
  45576. var str = '';
  45577. for (var i = 0; i <= SuperMap.CartoCSS.Tree.Zoom.maxZoom; i++) {
  45578. str += this.zoom & 1 << i ? 'X' : '.';
  45579. }
  45580. return str;
  45581. }
  45582. }]);
  45583. return Zoom;
  45584. }(); // Covers all zoomlevels from 0 to 22
  45585. SuperMap.CartoCSS.Tree.Zoom.all = 23;
  45586. SuperMap.CartoCSS.Tree.Zoom.maxZoom = 22;
  45587. SuperMap.CartoCSS.Tree.Zoom.ranges = {
  45588. 0: 1000000000,
  45589. 1: 500000000,
  45590. 2: 200000000,
  45591. 3: 100000000,
  45592. 4: 50000000,
  45593. 5: 25000000,
  45594. 6: 12500000,
  45595. 7: 6500000,
  45596. 8: 3000000,
  45597. 9: 1500000,
  45598. 10: 750000,
  45599. 11: 400000,
  45600. 12: 200000,
  45601. 13: 100000,
  45602. 14: 50000,
  45603. 15: 25000,
  45604. 16: 12500,
  45605. 17: 5000,
  45606. 18: 2500,
  45607. 19: 1500,
  45608. 20: 750,
  45609. 21: 500,
  45610. 22: 250,
  45611. 23: 100
  45612. };
  45613. // CONCATENATED MODULE: ./src/common/style/ThemeStyle.js
  45614. function ThemeStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45615. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  45616. * This program are made available under the terms of the Apache License, Version 2.0
  45617. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45618. /**
  45619. * @class SuperMap.ThemeStyle
  45620. * @classdesc 客户端专题图风格类。
  45621. * @category Visualization Theme
  45622. * @param {Object} options - 可选参数。
  45623. * @param {boolean} [options.fill=true] - 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  45624. * @param {string} [options.fillColor='#000000'] - 十六进制填充颜色。
  45625. * @param {number} [options.fillOpacity=1] - 填充不透明度。取值范围[0, 1]。
  45626. * @param {boolean} [options.stroke=false] - 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  45627. * @param {string} [options.strokeColor='#000000'] - 十六进制描边颜色。
  45628. * @param {number} [options.strokeOpacity=1] - 描边的不透明度。取值范围[0, 1]。
  45629. * @param {number} [options.strokeWidth=1] - 线宽度/描边宽度。
  45630. * @param {string} [options.strokeLinecap='butt'] - 线帽样式。strokeLinecap 有三种类型 “butt", "round", "square"。
  45631. * @param {string} [options.strokeLineJoin='iter'] - 线段连接样式。strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  45632. * @param {string} [options.strokeDashstyle='solid'] - 虚线类型。strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"。solid 表示实线。
  45633. * @param {number} [options.pointRadius=6] - 点半径,单位为像素。
  45634. * @param {number} [options.shadowBlur=0] - 阴影模糊度,(大于 0 有效;)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  45635. * @param {string} [options.shadowColor='#000000'] - 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  45636. * @param {number} [options.shadowOffsetX=0] - 阴影 X 方向偏移值。
  45637. * @param {number} [options.shadowOffsetY=0] - 阴影 Y 方向偏移值。
  45638. * @param {string} options.label - 专题要素附加文本标签内容。
  45639. * @param {string} [options.fontColor] - 附加文本字体颜色。
  45640. * @param {number} [options.fontSize=12] - 附加文本字体大小,单位是像素。
  45641. * @param {string} [options.fontStyle='normal'] - 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  45642. * @param {string} [options.fontVariant='normal'] - 附加文本字体变体。可设值:"normal", "small-caps"。
  45643. * @param {string} [options.fontWeight='normal'] - 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  45644. * @param {string} [options.fontFamily='arial,sans-serif'] - 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,
  45645. * 浏览器会使用它可识别的第一个可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称
  45646. * ("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  45647. * @param {string} [options.labelPosition='top'] - 附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。
  45648. * @param {string} [options.labelAlign='center'] - 附加文本水平对齐。可以是 'left', 'right', 'center'。
  45649. * @param {string} [options.labelBaseline='middle'] - 附加文本垂直对齐。 可以是 'top', 'bottom', 'middle' 。
  45650. * @param {number} [options.labelXOffset=0] - 附加文本在x轴方向的偏移量。
  45651. * @param {number} [options.labelYOffset=0] - 附加文本在y轴方向的偏移量。
  45652. */
  45653. var ThemeStyle_ThemeStyle = function ThemeStyle(options) {
  45654. ThemeStyle_classCallCheck(this, ThemeStyle);
  45655. options = options || {};
  45656. /**
  45657. * @member {boolean} [SuperMap.ThemeStyle.prototype.fill=true]
  45658. * @description 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  45659. */
  45660. this.fill = true;
  45661. /**
  45662. * @member {string} [SuperMap.ThemeStyle.prototype.fillColor="#000000"]
  45663. * @description 十六进制填充颜色。
  45664. */
  45665. this.fillColor = "#000000";
  45666. /**
  45667. * @member {number} [SuperMap.ThemeStyle.prototype.fillOpacity=1]
  45668. * @description 填充不透明度。取值范围[0, 1]。
  45669. */
  45670. this.fillOpacity = 1;
  45671. /**
  45672. * @member {boolean} [SuperMap.ThemeStyle.prototype.stroke=false]
  45673. * @description 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  45674. */
  45675. this.stroke = false;
  45676. /**
  45677. * @member {string} [SuperMap.ThemeStyle.prototype.strokeColor="#000000"]
  45678. * @description 十六进制描边颜色。
  45679. */
  45680. this.strokeColor = "#000000";
  45681. /**
  45682. * @member {number} [SuperMap.ThemeStyle.prototype.strokeOpacity=1]
  45683. * @description 描边的不透明度。取值范围[0, 1]。
  45684. */
  45685. this.strokeOpacity = 1;
  45686. /**
  45687. * @member {number} [SuperMap.ThemeStyle.prototype.strokeWidth=1]
  45688. * @description 线宽度/描边宽度。
  45689. */
  45690. this.strokeWidth = 1;
  45691. /**
  45692. * @member {string} [SuperMap.ThemeStyle.prototype.strokeLinecap="butt"]
  45693. * @description 线帽样式;strokeLinecap 有三种类型 “butt", "round", "square" 。
  45694. */
  45695. this.strokeLinecap = "butt";
  45696. /**
  45697. * @member {string} [SuperMap.ThemeStyle.prototype.strokeLineJoin="miter"]
  45698. * @description 线段连接样式;strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  45699. */
  45700. this.strokeLineJoin = "miter";
  45701. /**
  45702. * @member {string} [SuperMap.ThemeStyle.prototype.strokeDashstyle="solid"]
  45703. * @description 虚线类型; strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted";
  45704. * solid 表示实线。
  45705. */
  45706. this.strokeDashstyle = "solid";
  45707. /**
  45708. * @member {number} [SuperMap.ThemeStyle.prototype.pointRadius=6]
  45709. * @description 点半径。单位为像素。
  45710. */
  45711. this.pointRadius = 6;
  45712. /**
  45713. * @member {number} [SuperMap.ThemeStyle.prototype.shadowBlur=0]
  45714. * @description 阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  45715. */
  45716. this.shadowBlur = 0;
  45717. /**
  45718. * @member {string} [SuperMap.ThemeStyle.prototype.shadowColor='#000000']
  45719. * @description 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  45720. */
  45721. this.shadowColor = "#000000";
  45722. /**
  45723. * @member {number} [SuperMap.ThemeStyle.prototype.shadowOffsetX=0]
  45724. * @description 阴影 X 方向偏移值。
  45725. */
  45726. this.shadowOffsetX = 0;
  45727. /**
  45728. * @member {number} SuperMap.ThemeStyle.prototype.shadowOffsetY
  45729. * @description Y 方向偏移值。
  45730. */
  45731. this.shadowOffsetY = 0;
  45732. /**
  45733. * @member {string} [SuperMap.ThemeStyle.prototype.label]
  45734. * @description 专题要素附加文本标签内容。
  45735. */
  45736. this.label = "";
  45737. /**
  45738. * @member {boolean} [SuperMap.ThemeStyle.prototype.labelRect=false]
  45739. * @description 是否显示文本标签矩形背景。
  45740. */
  45741. this.labelRect = false;
  45742. /**
  45743. * @member {string} [SuperMap.ThemeStyle.prototype.fontColor]
  45744. * @description 附加文本字体颜色。
  45745. */
  45746. this.fontColor = "";
  45747. /**
  45748. * @member {number} [SuperMap.ThemeStyle.prototype.fontSize=12]
  45749. * @description 附加文本字体大小,单位是像素。
  45750. */
  45751. this.fontSize = 12;
  45752. /**
  45753. * @member {string} [SuperMap.ThemeStyle.prototype.fontStyle="normal"]
  45754. * @description 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  45755. */
  45756. this.fontStyle = "normal";
  45757. /**
  45758. * @member {string} [SuperMap.ThemeStyle.prototype.fontVariant="normal"]
  45759. * @description 附加文本字体变体。可设值:"normal", "small-caps"。
  45760. */
  45761. this.fontVariant = "normal";
  45762. /**
  45763. * @member {string} [SuperMap.ThemeStyle.prototype.fontWeight="normal"]
  45764. * @description 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  45765. */
  45766. this.fontWeight = "normal";
  45767. /**
  45768. * @member {string} [SuperMap.ThemeStyle.prototype.fontFamily="arial,sans-serif"]
  45769. * @description 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个
  45770. * 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  45771. */
  45772. this.fontFamily = "arial,sans-serif";
  45773. /**
  45774. * @member {string} [SuperMap.ThemeStyle.prototype.labelPosition='top']
  45775. * @description 附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。
  45776. */
  45777. this.labelPosition = "top";
  45778. /**
  45779. * @member {string} [SuperMap.ThemeStyle.prototype.labelAlign='center']
  45780. * @description 附加文本水平对齐。可以是 'left', 'right', 'center'。
  45781. */
  45782. this.labelAlign = "center";
  45783. /**
  45784. * @member {string} [SuperMap.ThemeStyle.prototype.labelBaseline='middle']
  45785. * @description 附加文本垂直对齐。 可以是 'top', 'bottom', 'middle'。
  45786. */
  45787. this.labelBaseline = "middle";
  45788. /**
  45789. * @member {number} [SuperMap.ThemeStyle.prototype.labelXOffset=0]
  45790. * @description 附加文本在 X 轴方向的偏移量。
  45791. */
  45792. this.labelXOffset = 0;
  45793. /**
  45794. * @member {number} [SuperMap.ThemeStyle.prototype.labelYOffset=0]
  45795. * @description 附加文本在 Y 轴方向的偏移量。
  45796. */
  45797. this.labelYOffset = 0;
  45798. Util_Util.extend(this, options);
  45799. };
  45800. SuperMap.ThemeStyle = ThemeStyle_ThemeStyle;
  45801. // CONCATENATED MODULE: ./src/common/style/index.js
  45802. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  45803. * This program are made available under the terms of the Apache License, Version 2.0
  45804. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45805. // CONCATENATED MODULE: ./src/common/overlay/feature/ShapeParameters.js
  45806. function ShapeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45807. 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); } }
  45808. function ShapeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeParameters_defineProperties(Constructor, staticProps); return Constructor; }
  45809. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  45810. * This program are made available under the terms of the Apache License, Version 2.0
  45811. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45812. /**
  45813. * @class SuperMap.Feature.ShapeParameters
  45814. * @category Visualization Theme
  45815. * @classdesc 图形参数基类,此类不可实例化
  45816. */
  45817. var ShapeParameters = /*#__PURE__*/function () {
  45818. /**
  45819. * @function SuperMap.Feature.ShapeParameters.prototype.constructor
  45820. * @description 图形参数对象。
  45821. * @returns {SuperMap.Feature.ShapeParameters} 图形参数对象。
  45822. */
  45823. function ShapeParameters() {
  45824. ShapeParameters_classCallCheck(this, ShapeParameters);
  45825. /**
  45826. * @member {Array} [SuperMap.Feature.ShapeParameters.prototype.refOriginalPosition=[0,0]]
  45827. * @description 图形参考原点位置,图形的参考中心位置。
  45828. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  45829. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  45830. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  45831. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  45832. * 图形(Shape) 的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  45833. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  45834. * refOriginalPosition 的值为 [0, 0] 时,图形的位置信息才是 canvas 绝对位置。
  45835. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  45836. */
  45837. this.refOriginalPosition = [0, 0];
  45838. /**
  45839. * @member {string} SuperMap.Feature.ShapeParameters.prototype.refDataID
  45840. * @description 图形所关联数据的 ID(<{@link SuperMap.Feature.Vector}> 的 id)。
  45841. */
  45842. this.refDataID = null;
  45843. /**
  45844. * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.isHoverByRefDataID
  45845. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  45846. */
  45847. this.isHoverByRefDataID = false;
  45848. /**
  45849. * @member {string} SuperMap.Feature.ShapeParameters.prototype.refDataHoverGroup
  45850. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  45851. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  45852. */
  45853. this.refDataHoverGroup = null;
  45854. /**
  45855. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.dataInfo
  45856. * @description 图形携带的附加数据。
  45857. */
  45858. this.dataInfo = null;
  45859. /**
  45860. * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.clickable
  45861. * @description 是否可点击。
  45862. */
  45863. this.clickable = true;
  45864. /**
  45865. * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.hoverable
  45866. * @description 是否可点击。
  45867. */
  45868. this.hoverable = true;
  45869. /**
  45870. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.style
  45871. * @description 图形样式对象,可设样式属性在子类中确定。
  45872. */
  45873. this.style = null;
  45874. /**
  45875. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.highlightStyle
  45876. * @description 高亮样式对象,可设样式属性与 style 的可设样式属性相同。
  45877. */
  45878. this.highlightStyle = {};
  45879. this.CLASS_NAME = "SuperMap.Feature.ShapeParameters";
  45880. }
  45881. /**
  45882. * @function SuperMap.Feature.ShapeParameters.prototype.destroy
  45883. * @description 销毁对象。
  45884. */
  45885. ShapeParameters_createClass(ShapeParameters, [{
  45886. key: "destroy",
  45887. value: function destroy() {
  45888. this.refOriginalPosition = null;
  45889. this.refDataID = null;
  45890. this.isHoverByRefDataID = null;
  45891. this.refDataHoverGroup = null;
  45892. this.dataInfo = null;
  45893. this.clickable = null;
  45894. this.hoverable = null;
  45895. this.style = null;
  45896. this.highlightStyle = null;
  45897. }
  45898. }]);
  45899. return ShapeParameters;
  45900. }();
  45901. SuperMap.Feature = SuperMap.Feature || {};
  45902. SuperMap.Feature.ShapeParameters = ShapeParameters;
  45903. // CONCATENATED MODULE: ./src/common/overlay/feature/Point.js
  45904. 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); }
  45905. function feature_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45906. 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); } }
  45907. function feature_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Point_defineProperties(Constructor, staticProps); return Constructor; }
  45908. 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); }
  45909. function feature_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Point_getPrototypeOf(object); if (object === null) break; } return object; }
  45910. 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); }
  45911. 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); }
  45912. 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); }; }
  45913. function feature_Point_possibleConstructorReturn(self, call) { if (call && (feature_Point_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Point_assertThisInitialized(self); }
  45914. function feature_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45915. 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; } }
  45916. 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); }
  45917. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  45918. * This program are made available under the terms of the Apache License, Version 2.0
  45919. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45920. /**
  45921. * @class SuperMap.Feature.ShapeParameters.Point
  45922. * @category Visualization Theme
  45923. * @classdesc 点参数对象。
  45924. * @extends {SuperMap.Feature.ShapeParameters}
  45925. */
  45926. var feature_Point_Point = /*#__PURE__*/function (_ShapeParameters) {
  45927. feature_Point_inherits(Point, _ShapeParameters);
  45928. var _super = feature_Point_createSuper(Point);
  45929. /**
  45930. * @function SuperMap.Feature.ShapeParameters.Point.prototype.constructor
  45931. * @description 创建一个图形点参数对象。
  45932. * @param {number} x - 点 x 坐标,必设参数。
  45933. * @param {number} y - 点 y 坐标,必设参数。
  45934. * @returns {SuperMap.Feature.ShapeParameters.Point} 标签参数对象。
  45935. */
  45936. function Point(x, y) {
  45937. var _this;
  45938. feature_Point_classCallCheck(this, Point);
  45939. _this = _super.call(this, x, y);
  45940. /**
  45941. * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.x
  45942. * @description 点 x 坐标。
  45943. */
  45944. _this.x = !isNaN(x) ? x : 0;
  45945. /**
  45946. * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.y
  45947. * @description 点 y 坐标。
  45948. */
  45949. _this.y = !isNaN(y) ? y : 0;
  45950. /**
  45951. * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.r
  45952. * @description 点的半径。
  45953. */
  45954. _this.r = 6;
  45955. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Point";
  45956. return _this;
  45957. }
  45958. /**
  45959. * @function SuperMap.Feature.ShapeParameters.Point.prototype.destroy
  45960. * @description 销毁对象。
  45961. */
  45962. feature_Point_createClass(Point, [{
  45963. key: "destroy",
  45964. value: function destroy() {
  45965. this.x = null;
  45966. this.y = null;
  45967. this.r = null;
  45968. feature_Point_get(feature_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  45969. }
  45970. }]);
  45971. return Point;
  45972. }(ShapeParameters);
  45973. /**
  45974. * @typedef {Object} SuperMap.Feature.ShapeParameters.Point.style
  45975. * @property {number} pointRadius - 点的半径,默认值:6。
  45976. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45977. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  45978. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  45979. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45980. * @property {string} strokeColor - 十六进制描边颜色。
  45981. * @property {number} strokeWidth - 描边宽度,默认值 1。
  45982. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  45983. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  45984. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  45985. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  45986. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  45987. */
  45988. SuperMap.Feature = SuperMap.Feature || {};
  45989. SuperMap.Feature.ShapeParameters.Point = feature_Point_Point;
  45990. // CONCATENATED MODULE: ./src/common/overlay/feature/Line.js
  45991. 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); }
  45992. function Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45993. 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); } }
  45994. function Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) Line_defineProperties(Constructor, staticProps); return Constructor; }
  45995. 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); }
  45996. function Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Line_getPrototypeOf(object); if (object === null) break; } return object; }
  45997. 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); }
  45998. function Line_setPrototypeOf(o, p) { Line_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Line_setPrototypeOf(o, p); }
  45999. 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); }; }
  46000. function Line_possibleConstructorReturn(self, call) { if (call && (Line_typeof(call) === "object" || typeof call === "function")) { return call; } return Line_assertThisInitialized(self); }
  46001. function Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46002. 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; } }
  46003. function Line_getPrototypeOf(o) { Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Line_getPrototypeOf(o); }
  46004. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  46005. * This program are made available under the terms of the Apache License, Version 2.0
  46006. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46007. /**
  46008. * @class SuperMap.Feature.ShapeParameters.Line
  46009. * @category Visualization Theme
  46010. * @classdesc 线参数对象。
  46011. * @extends {SuperMap.Feature.ShapeParameters}
  46012. */
  46013. var Line_Line = /*#__PURE__*/function (_ShapeParameters) {
  46014. Line_inherits(Line, _ShapeParameters);
  46015. var _super = Line_createSuper(Line);
  46016. /**
  46017. * @function SuperMap.Feature.ShapeParameters.Line.prototype.constructor
  46018. * @description 创建一个图形线参数对象。
  46019. * @param {Array} pointList - 线要素节点数组,二维数组,必设参数。
  46020. * @returns {SuperMap.Feature.ShapeParameters.Line} 圆形参数对象。
  46021. */
  46022. function Line(pointList) {
  46023. var _this;
  46024. Line_classCallCheck(this, Line);
  46025. _this = _super.call(this, pointList);
  46026. /**
  46027. * @member {Array} SuperMap.Feature.ShapeParameters.Line.prototype.pointList
  46028. * @description 线要素节点数组,二维数组。
  46029. * 数组形如:
  46030. * (start code)
  46031. * [
  46032. * [10, 20], //节点
  46033. * [30, 40],
  46034. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  46035. * ]
  46036. * (end)
  46037. */
  46038. _this.pointList = pointList;
  46039. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Line";
  46040. return _this;
  46041. }
  46042. /**
  46043. * @function SuperMap.Feature.ShapeParameters.Line.prototype.destroy
  46044. * @description 销毁对象。
  46045. */
  46046. Line_createClass(Line, [{
  46047. key: "destroy",
  46048. value: function destroy() {
  46049. this.pointList = null;
  46050. Line_get(Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  46051. }
  46052. }]);
  46053. return Line;
  46054. }(ShapeParameters);
  46055. /**
  46056. * @typedef {Object} SuperMap.Feature.ShapeParameters.Line.style
  46057. * @property {string} strokeColor - 十六进制线颜色。
  46058. * @property {number} strokeWidth - 线宽度,默认值 1。
  46059. * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
  46060. * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
  46061. * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
  46062. * @property {number} strokeOpacity - 线的不透明度。取值范围[0, 1],默认值 1。
  46063. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  46064. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  46065. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  46066. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  46067. */
  46068. SuperMap.Feature = SuperMap.Feature || {};
  46069. SuperMap.Feature.ShapeParameters.Line = Line_Line;
  46070. // CONCATENATED MODULE: ./src/common/overlay/feature/Polygon.js
  46071. 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); }
  46072. function feature_Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46073. 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); } }
  46074. function feature_Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Polygon_defineProperties(Constructor, staticProps); return Constructor; }
  46075. 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); }
  46076. function Polygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Polygon_getPrototypeOf(object); if (object === null) break; } return object; }
  46077. 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); }
  46078. 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); }
  46079. 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); }; }
  46080. function feature_Polygon_possibleConstructorReturn(self, call) { if (call && (feature_Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Polygon_assertThisInitialized(self); }
  46081. function feature_Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46082. 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; } }
  46083. 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); }
  46084. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  46085. * This program are made available under the terms of the Apache License, Version 2.0
  46086. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46087. /**
  46088. * @class SuperMap.Feature.ShapeParameters.Polygon
  46089. * @category Visualization Theme
  46090. * @classdesc 面参数对象。
  46091. * @extends {SuperMap.Feature.ShapeParameters}
  46092. */
  46093. var Polygon_Polygon = /*#__PURE__*/function (_ShapeParameters) {
  46094. feature_Polygon_inherits(Polygon, _ShapeParameters);
  46095. var _super = feature_Polygon_createSuper(Polygon);
  46096. /**
  46097. * @function SuperMap.Feature.ShapeParameters.Polygon.prototype.constructor
  46098. * @description 创建一个图形面参数对象。
  46099. * @param {Array} pointList - 横坐标,必设参数。
  46100. * @returns {SuperMap.Feature.ShapeParameters.Polygon} 标签参数对象。
  46101. */
  46102. function Polygon(pointList) {
  46103. var _this;
  46104. feature_Polygon_classCallCheck(this, Polygon);
  46105. _this = _super.call(this, pointList);
  46106. /**
  46107. * @member {Array} SuperMap.Feature.ShapeParameters.Polygon.prototype.pointList
  46108. * @description 面要素节点数组,二维数组。
  46109. * 数组形如:
  46110. * (start code)
  46111. * [
  46112. * [10, 20], //节点
  46113. * [30, 40],
  46114. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  46115. * ]
  46116. * (end)
  46117. */
  46118. _this.pointList = pointList;
  46119. /**
  46120. * @member {Array} SuperMap.Feature.ShapeParameters.Polygon.prototype.holePolygonPointLists
  46121. * @description 岛洞面多边形顶点数组(三维数组)
  46122. */
  46123. _this.holePolygonPointLists = null;
  46124. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Polygon";
  46125. return _this;
  46126. }
  46127. /**
  46128. * @function SuperMap.Feature.ShapeParameters.Polygon.prototype.destroy
  46129. * @description 销毁对象。
  46130. */
  46131. feature_Polygon_createClass(Polygon, [{
  46132. key: "destroy",
  46133. value: function destroy() {
  46134. this.pointList = null;
  46135. this.holePolygonPointLists = null;
  46136. Polygon_get(feature_Polygon_getPrototypeOf(Polygon.prototype), "destroy", this).call(this);
  46137. }
  46138. }]);
  46139. return Polygon;
  46140. }(ShapeParameters);
  46141. /**
  46142. * @typedef {Object} SuperMap.Feature.ShapeParameters.Polygon.style
  46143. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  46144. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  46145. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  46146. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  46147. * @property {string} strokeColor - 十六进制描边颜色。
  46148. * @property {number} strokeWidth - 描边宽度,默认值 1。
  46149. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  46150. * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
  46151. * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
  46152. * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
  46153. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  46154. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  46155. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  46156. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  46157. */
  46158. SuperMap.Feature = SuperMap.Feature || {};
  46159. SuperMap.Feature.ShapeParameters.Polygon = Polygon_Polygon;
  46160. // CONCATENATED MODULE: ./src/common/overlay/feature/Rectangle.js
  46161. 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); }
  46162. function feature_Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46163. 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); } }
  46164. function feature_Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Rectangle_defineProperties(Constructor, staticProps); return Constructor; }
  46165. 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); }
  46166. function Rectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Rectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  46167. 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); }
  46168. 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); }
  46169. 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); }; }
  46170. function feature_Rectangle_possibleConstructorReturn(self, call) { if (call && (feature_Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Rectangle_assertThisInitialized(self); }
  46171. function feature_Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46172. 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; } }
  46173. 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); }
  46174. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  46175. * This program are made available under the terms of the Apache License, Version 2.0
  46176. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46177. /**
  46178. * @class SuperMap.Feature.ShapeParameters.Rectangle
  46179. * @category Visualization Theme
  46180. * @classdesc 矩形参数对象。
  46181. * @extends {SuperMap.Feature.ShapeParameters}
  46182. */
  46183. var feature_Rectangle_Rectangle = /*#__PURE__*/function (_ShapeParameters) {
  46184. feature_Rectangle_inherits(Rectangle, _ShapeParameters);
  46185. var _super = feature_Rectangle_createSuper(Rectangle);
  46186. /**
  46187. * @function SuperMap.Feature.ShapeParameters.Rectangle.prototype.constructor
  46188. * @description 创建一个图形矩形参数对象。
  46189. * @param {number} x - 矩形 x 坐标,必设参数。
  46190. * @param {number} y - 矩形 y 坐标,必设参数。
  46191. * @param {number} width - 矩形 width 坐标,必设参数。
  46192. * @param {number} height - 矩形 height 坐标,必设参数。
  46193. * @returns {SuperMap.Feature.ShapeParameters.Rectangle} 图形矩形参数对象。
  46194. */
  46195. function Rectangle(x, y, width, height) {
  46196. var _this;
  46197. feature_Rectangle_classCallCheck(this, Rectangle);
  46198. _this = _super.call(this, x, y, width, height);
  46199. /**
  46200. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.x
  46201. * @description 左上角 x 坐标。
  46202. */
  46203. _this.x = !isNaN(x) ? x : 0;
  46204. /**
  46205. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.y
  46206. * @description 左上角 y 坐标。
  46207. */
  46208. _this.y = !isNaN(x) ? y : 0;
  46209. /**
  46210. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.width
  46211. * @description 宽度。
  46212. */
  46213. _this.width = !isNaN(width) ? width : 0;
  46214. /**
  46215. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.height
  46216. * @description 高度。
  46217. */
  46218. _this.height = !isNaN(height) ? height : 0;
  46219. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Rectangle";
  46220. return _this;
  46221. }
  46222. /**
  46223. * @function SuperMap.Feature.ShapeParameters.Rectangle.prototype.destroy
  46224. * @description 销毁对象。
  46225. */
  46226. feature_Rectangle_createClass(Rectangle, [{
  46227. key: "destroy",
  46228. value: function destroy() {
  46229. this.x = null;
  46230. this.y = null;
  46231. this.width = null;
  46232. this.height = null;
  46233. Rectangle_get(feature_Rectangle_getPrototypeOf(Rectangle.prototype), "destroy", this).call(this);
  46234. }
  46235. }]);
  46236. return Rectangle;
  46237. }(ShapeParameters);
  46238. /**
  46239. * @typedef {Object} SuperMap.Feature.ShapeParameters.Rectangle.style
  46240. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  46241. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  46242. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  46243. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  46244. * @property {string} strokeColor - 十六进制描边颜色。
  46245. * @property {number} strokeWidth - 描边宽度,默认值 1。
  46246. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  46247. * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
  46248. * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
  46249. * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
  46250. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  46251. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  46252. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  46253. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  46254. */
  46255. SuperMap.Feature = SuperMap.Feature || {};
  46256. SuperMap.Feature.ShapeParameters.Rectangle = feature_Rectangle_Rectangle;
  46257. // CONCATENATED MODULE: ./src/common/overlay/feature/Sector.js
  46258. 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); }
  46259. function Sector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46260. 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); } }
  46261. function Sector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Sector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Sector_defineProperties(Constructor, staticProps); return Constructor; }
  46262. 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); }
  46263. function Sector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Sector_getPrototypeOf(object); if (object === null) break; } return object; }
  46264. 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); }
  46265. function Sector_setPrototypeOf(o, p) { Sector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Sector_setPrototypeOf(o, p); }
  46266. 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); }; }
  46267. function Sector_possibleConstructorReturn(self, call) { if (call && (Sector_typeof(call) === "object" || typeof call === "function")) { return call; } return Sector_assertThisInitialized(self); }
  46268. function Sector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46269. 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; } }
  46270. function Sector_getPrototypeOf(o) { Sector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Sector_getPrototypeOf(o); }
  46271. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  46272. * This program are made available under the terms of the Apache License, Version 2.0
  46273. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46274. /**
  46275. * @class SuperMap.Feature.ShapeParameters.Sector
  46276. * @category Visualization Theme
  46277. * @classdesc 扇形参数对象。
  46278. * @extends {SuperMap.Feature.ShapeParameters}
  46279. */
  46280. var Sector = /*#__PURE__*/function (_ShapeParameters) {
  46281. Sector_inherits(Sector, _ShapeParameters);
  46282. var _super = Sector_createSuper(Sector);
  46283. /**
  46284. * @function SuperMap.Feature.ShapeParameters.Sector.prototype.constructor
  46285. * @description 创建一个扇形参数对象。
  46286. * @param {number} x - 圆心 x 坐标,必设参数。
  46287. * @param {number} y - 圆心 y 坐标,必设参数。
  46288. * @param {number} r - 外圆半径,必设参数。
  46289. * @param {number} startAngle - 起始角度,必设参数。取值范围[0, 360)。
  46290. * @param {number} endAngle - 结束角度,必设参数。取值范围(0, 360]。
  46291. * @param {number} [r0=0] - 内圆半径,指定后将出现内弧,同时扇边长度为'r - r0'。取值范围[0, r)。
  46292. * @returns {SuperMap.Feature.ShapeParameters.Sector} 扇形参数对象。
  46293. */
  46294. function Sector(x, y, r, startAngle, endAngle, r0, clockWise) {
  46295. var _this;
  46296. Sector_classCallCheck(this, Sector);
  46297. _this = _super.call(this, x, y, r, startAngle, endAngle, r0, clockWise);
  46298. /**
  46299. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.x
  46300. * @description 圆心 x 坐标。
  46301. */
  46302. _this.x = !isNaN(x) ? x : 0;
  46303. /**
  46304. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.Y
  46305. * @description 圆心 Y 坐标。
  46306. */
  46307. _this.y = !isNaN(y) ? y : 0;
  46308. /**
  46309. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.r
  46310. * @description 外圆半径。
  46311. */
  46312. _this.r = !isNaN(r) ? r : 0;
  46313. /**
  46314. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.startAngle
  46315. * @description 起始角度。取值范围[0, 360),默认值:null。
  46316. */
  46317. _this.startAngle = !isNaN(startAngle) ? startAngle : 0;
  46318. /**
  46319. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.endAngle
  46320. * @description 结束角度。取值范围(0, 360],默认值:null。
  46321. */
  46322. _this.endAngle = !isNaN(endAngle) ? endAngle : 0;
  46323. /**
  46324. * @member {number} [SuperMap.Feature.ShapeParameters.Sector.prototype.r0=0]
  46325. * @description 内圆半径,指定后将出现内弧,同时扇边长度为 r 减 r0。取值范围[0, r)。
  46326. */
  46327. _this.r0 = !isNaN(r0) ? r0 : 0;
  46328. /**
  46329. * @member {number} [SuperMap.Feature.ShapeParameters.Sector.prototype.clockWise=false]
  46330. * @description 是否是顺时针。默认值:false。
  46331. */
  46332. _this.clockWise = clockWise;
  46333. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Sector";
  46334. return _this;
  46335. }
  46336. /**
  46337. * @function SuperMap.Feature.ShapeParameters.Sector.prototype.destroy
  46338. * @description 销毁对象。
  46339. */
  46340. Sector_createClass(Sector, [{
  46341. key: "destroy",
  46342. value: function destroy() {
  46343. this.x = null;
  46344. this.y = null;
  46345. this.r = null;
  46346. this.startAngle = null;
  46347. this.endAngle = null;
  46348. this.r0 = null;
  46349. this.clockWise = null;
  46350. Sector_get(Sector_getPrototypeOf(Sector.prototype), "destroy", this).call(this);
  46351. }
  46352. }]);
  46353. return Sector;
  46354. }(ShapeParameters);
  46355. /**
  46356. * @typedef {Object} SuperMap.Feature.ShapeParameters.Sector.style
  46357. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  46358. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  46359. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  46360. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  46361. * @property {string} strokeColor - 十六进制描边颜色。
  46362. * @property {number} strokeWidth - 描边宽度,默认值 1。
  46363. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  46364. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  46365. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  46366. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  46367. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  46368. */
  46369. SuperMap.Feature = SuperMap.Feature || {};
  46370. SuperMap.Feature.ShapeParameters.Sector = Sector;
  46371. // CONCATENATED MODULE: ./src/common/overlay/feature/Label.js
  46372. 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); }
  46373. function Label_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46374. 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); } }
  46375. function Label_createClass(Constructor, protoProps, staticProps) { if (protoProps) Label_defineProperties(Constructor.prototype, protoProps); if (staticProps) Label_defineProperties(Constructor, staticProps); return Constructor; }
  46376. 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); }
  46377. function Label_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Label_getPrototypeOf(object); if (object === null) break; } return object; }
  46378. 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); }
  46379. function Label_setPrototypeOf(o, p) { Label_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Label_setPrototypeOf(o, p); }
  46380. 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); }; }
  46381. function Label_possibleConstructorReturn(self, call) { if (call && (Label_typeof(call) === "object" || typeof call === "function")) { return call; } return Label_assertThisInitialized(self); }
  46382. function Label_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46383. 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; } }
  46384. function Label_getPrototypeOf(o) { Label_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Label_getPrototypeOf(o); }
  46385. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  46386. * This program are made available under the terms of the Apache License, Version 2.0
  46387. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46388. /**
  46389. * @class SuperMap.Feature.ShapeParameters.Label
  46390. * @category Visualization Theme
  46391. * @classdesc 标签参数对象。
  46392. * @extent {SuperMap.Feature.ShapeParameters}
  46393. */
  46394. var Label_Label = /*#__PURE__*/function (_ShapeParameters) {
  46395. Label_inherits(Label, _ShapeParameters);
  46396. var _super = Label_createSuper(Label);
  46397. /**
  46398. * @function SuperMap.Feature.ShapeParameters.Label.prototype.constructor
  46399. * @description 创建一个标签参数对象。
  46400. * @param {number} x - 横坐标,必设参数。
  46401. * @param {number} y - 纵坐标,必设参数。
  46402. * @param {string} text - 图形中的附加文本,必设参数。
  46403. * @returns {SuperMap.Feature.ShapeParameters.Label} 标签参数对象。
  46404. */
  46405. function Label(x, y, text) {
  46406. var _this;
  46407. Label_classCallCheck(this, Label);
  46408. _this = _super.call(this, x, y, text);
  46409. /**
  46410. * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.x
  46411. * @description 标签 x 坐标。
  46412. */
  46413. _this.x = x;
  46414. /**
  46415. * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.y
  46416. * @description 标签 y 坐标。
  46417. */
  46418. _this.y = y;
  46419. /**
  46420. * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.text
  46421. * @description 标签的文本内容。
  46422. */
  46423. _this.text = text;
  46424. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Label";
  46425. return _this;
  46426. }
  46427. /**
  46428. * @function SuperMap.Feature.ShapeParameters.Label.prototype.destroy
  46429. * @description 销毁对象。
  46430. */
  46431. Label_createClass(Label, [{
  46432. key: "destroy",
  46433. value: function destroy() {
  46434. this.x = null;
  46435. this.y = null;
  46436. this.text = null;
  46437. Label_get(Label_getPrototypeOf(Label.prototype), "destroy", this).call(this);
  46438. }
  46439. }]);
  46440. return Label;
  46441. }(ShapeParameters);
  46442. /**
  46443. * @typedef {Object} SuperMap.Feature.ShapeParameters.Label.style
  46444. * @property {boolean} fill - 是否填充,不需要填充则设置为 false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  46445. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  46446. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  46447. * @property {boolean} stroke - 是否描边,不需要描边则设置为false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  46448. * @property {string} strokeColor - 十六进制描边颜色。
  46449. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  46450. * @property {number} strokeWidth -描边宽度,默认值 1。
  46451. * @property {number} maxWidth - 最大宽度限制。默认值:null。
  46452. * @property {number} fontSize - 标签文本字体大小。默认值 12,单位是像素。
  46453. * @property {string} fontStyle - 标签文本字体样式。可设值:"normal", "italic", "oblique"; 默认值:"normal" 。
  46454. * @property {string} fontVariant - 标签文本字体变体。可设值:"normal", "small-caps"; 默认值:"normal" 。
  46455. * @property {string} fontWeight - 标签文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"; 默认值:"normal" 。
  46456. * @property {string} fontFamily - 标签文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个值。
  46457. * 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。默认值:"arial,sans-serif".
  46458. * @property {string} labelBaseline - 标签文本垂直对齐, 可以是 'top', 'bottom', 'middle',默认值 'middle'。
  46459. * @property {string} labelAlign - 标签文本水平对齐。可以是 'left', 'right', 'center'; 默认值 'center'。
  46460. * @property {number} shadowBlur - 阴影模糊度,大于 0 有效。默认值:0。
  46461. * @property {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  46462. * @property {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  46463. * @property {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  46464. */
  46465. SuperMap.Feature = SuperMap.Feature || {};
  46466. SuperMap.Feature.ShapeParameters.Label = Label_Label;
  46467. // CONCATENATED MODULE: ./src/common/overlay/feature/Image.js
  46468. 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); }
  46469. function feature_Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46470. 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); } }
  46471. function feature_Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Image_defineProperties(Constructor, staticProps); return Constructor; }
  46472. 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); }
  46473. function feature_Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Image_getPrototypeOf(object); if (object === null) break; } return object; }
  46474. 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); }
  46475. 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); }
  46476. 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); }; }
  46477. function feature_Image_possibleConstructorReturn(self, call) { if (call && (feature_Image_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Image_assertThisInitialized(self); }
  46478. function feature_Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46479. 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; } }
  46480. 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); }
  46481. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  46482. * This program are made available under the terms of the Apache License, Version 2.0
  46483. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46484. /**
  46485. * @class SuperMap.Feature.ShapeParameters.Image
  46486. * @category Visualization Theme
  46487. * @classdesc 图片参数对象。
  46488. * @extends {SuperMap.Feature.ShapeParameters}
  46489. */
  46490. var Image_Image = /*#__PURE__*/function (_ShapeParameters) {
  46491. feature_Image_inherits(Image, _ShapeParameters);
  46492. var _super = feature_Image_createSuper(Image);
  46493. /**
  46494. * @function SuperMap.Feature.ShapeParameters.Image.prototype.constructor
  46495. * @description 创建一个图片参数对象。
  46496. * @param {number} x - 左上角横坐标,必设参数。
  46497. * @param {number} y - 左上角纵坐标,必设参数。
  46498. * @param {(string|Object)} image - 图片地址或Cavans对象,必设参数。
  46499. * @param {number} width - 绘制到画布上的宽度,默认为图片高度。
  46500. * @param {number} height - 绘制到画布上的高度,默认为图片高度。
  46501. * @param {number} sx - 从图片中裁剪的左上角横坐标。
  46502. * @param {number} sy - 从图片中裁剪的左上角纵坐标。
  46503. * @param {number} sWidth - 从图片中裁剪的宽度,默认为图片高度。
  46504. * @param {number} sHeight - 绘制到画布上的高度,默认为图片高度。
  46505. * @returns {SuperMap.Feature.ShapeParameters.Image} 圆形参数对象。
  46506. */
  46507. function Image(x, y, image, width, height, sx, sy, sWidth, sHeight) {
  46508. var _this;
  46509. feature_Image_classCallCheck(this, Image);
  46510. _this = _super.call(this, x, y, image, width, height, sx, sy, sWidth, sHeight);
  46511. /**
  46512. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.x
  46513. * @description 左上角横坐标,必设参数。
  46514. */
  46515. _this.x = x;
  46516. /**
  46517. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.y
  46518. * @description 左上角纵坐标,必设参数。
  46519. */
  46520. _this.y = y;
  46521. /**
  46522. * @member {(string|Object)} SuperMap.Feature.ShapeParameters.Image.prototype.image
  46523. * @description 图片地址。
  46524. */
  46525. _this.image = image;
  46526. /**
  46527. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.width
  46528. * @description 绘制到画布上的宽度,默认为图片高度。
  46529. */
  46530. _this.width = width;
  46531. /**
  46532. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.height
  46533. * @description 绘制到画布上的高度,默认为图片高度。
  46534. */
  46535. _this.height = height;
  46536. /**
  46537. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sx
  46538. * @description 从图片中裁剪的左上角横坐标。
  46539. */
  46540. _this.sx = sx;
  46541. /**
  46542. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sy
  46543. * @description 从图片中裁剪的左上角纵坐标。
  46544. */
  46545. _this.sy = sy;
  46546. /**
  46547. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sWidth
  46548. * @description 从图片中裁剪的宽度,默认为图片高度。
  46549. */
  46550. _this.sWidth = sWidth;
  46551. /**
  46552. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sHeight
  46553. * @description 绘制到画布上的高度,默认为图片高度。
  46554. */
  46555. _this.sHeight = sHeight;
  46556. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Image";
  46557. return _this;
  46558. }
  46559. /**
  46560. * @function SuperMap.Feature.ShapeParameters.Image.prototype.destroy
  46561. * @description 销毁对象。
  46562. */
  46563. feature_Image_createClass(Image, [{
  46564. key: "destroy",
  46565. value: function destroy() {
  46566. this.x = null;
  46567. this.y = null;
  46568. this.image = null;
  46569. this.width = null;
  46570. this.height = null;
  46571. this.sx = null;
  46572. this.sy = null;
  46573. this.sWidth = null;
  46574. this.sHeight = null;
  46575. feature_Image_get(feature_Image_getPrototypeOf(Image.prototype), "destroy", this).call(this);
  46576. }
  46577. }]);
  46578. return Image;
  46579. }(ShapeParameters);
  46580. SuperMap.Feature = SuperMap.Feature || {};
  46581. SuperMap.Feature.ShapeParameters.Image = Image_Image;
  46582. // CONCATENATED MODULE: ./src/common/overlay/feature/Circle.js
  46583. 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); }
  46584. function Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46585. 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); } }
  46586. function Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Circle_defineProperties(Constructor, staticProps); return Constructor; }
  46587. 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); }
  46588. function Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  46589. 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); }
  46590. function Circle_setPrototypeOf(o, p) { Circle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Circle_setPrototypeOf(o, p); }
  46591. 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); }; }
  46592. function Circle_possibleConstructorReturn(self, call) { if (call && (Circle_typeof(call) === "object" || typeof call === "function")) { return call; } return Circle_assertThisInitialized(self); }
  46593. function Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46594. 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; } }
  46595. function Circle_getPrototypeOf(o) { Circle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Circle_getPrototypeOf(o); }
  46596. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  46597. * This program are made available under the terms of the Apache License, Version 2.0
  46598. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46599. /**
  46600. * @class SuperMap.Feature.ShapeParameters.Circle
  46601. * @classdesc 圆形参数对象。
  46602. * @category Visualization Theme
  46603. * @extends {SuperMap.Feature.ShapeParameters}
  46604. */
  46605. var Circle_Circle = /*#__PURE__*/function (_ShapeParameters) {
  46606. Circle_inherits(Circle, _ShapeParameters);
  46607. var _super = Circle_createSuper(Circle);
  46608. /**
  46609. * @function SuperMap.Feature.ShapeParameters.Circle.prototype.constructor
  46610. * @description 创建一个圆形参数对象。
  46611. * @param {number} x - 圆心 x 坐标,必设参数。
  46612. * @param {number} y - 圆心 y 坐标,必设参数。
  46613. * @param {number} r - 圆半径,必设参数。
  46614. * @returns {SuperMap.Feature.ShapeParameters.Circle} 圆形参数对象。
  46615. */
  46616. function Circle(x, y, r) {
  46617. var _this;
  46618. Circle_classCallCheck(this, Circle);
  46619. _this = _super.call(this, x, y, r);
  46620. /**
  46621. * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.x
  46622. * @description 圆心 x 坐标。
  46623. */
  46624. _this.x = !isNaN(x) ? x : 0;
  46625. /**
  46626. * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.y
  46627. * @description 圆心 y 坐标。
  46628. */
  46629. _this.y = !isNaN(y) ? y : 0;
  46630. /**
  46631. * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.r
  46632. * @description 圆半径。
  46633. */
  46634. _this.r = !isNaN(r) ? r : 0;
  46635. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Circle";
  46636. return _this;
  46637. }
  46638. /**
  46639. * @function SuperMap.Feature.ShapeParameters.Circle.prototype.destroy
  46640. * @description 销毁对象。
  46641. */
  46642. Circle_createClass(Circle, [{
  46643. key: "destroy",
  46644. value: function destroy() {
  46645. this.x = null;
  46646. this.y = null;
  46647. this.r = null;
  46648. Circle_get(Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  46649. }
  46650. }]);
  46651. return Circle;
  46652. }(ShapeParameters);
  46653. SuperMap.Feature = SuperMap.Feature || {};
  46654. SuperMap.Feature.ShapeParameters.Circle = Circle_Circle;
  46655. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Eventful.js
  46656. function Eventful_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46657. 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); } }
  46658. function Eventful_createClass(Constructor, protoProps, staticProps) { if (protoProps) Eventful_defineProperties(Constructor.prototype, protoProps); if (staticProps) Eventful_defineProperties(Constructor, staticProps); return Constructor; }
  46659. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  46660. * This program are made available under the terms of the Apache License, Version 2.0
  46661. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46662. /**
  46663. * @class SuperMap.LevelRenderer.Eventful
  46664. * @category Visualization Theme
  46665. * @classdesc 事件分发器超类,所有支持事件处理的类均是此类的子类。
  46666. * 此类不可实例化。
  46667. * @private
  46668. */
  46669. var Eventful = /*#__PURE__*/function () {
  46670. /**
  46671. * @function SuperMap.LevelRenderer.Eventful.prototype.constructor
  46672. * @description 构造函数。对象可以通过 onxxxx 绑定事件。
  46673. * 支持的事件:
  46674. * Symbolizer properties:
  46675. * onclick - {function} 默认值:null。
  46676. * onmouseover - {function} 默认值:null。
  46677. * onmouseout - {function} 默认值:null。
  46678. * onmousemove - {function} 默认值:null。
  46679. * onmousewheel - {function} 默认值:null。
  46680. * onmousedown - {function} 默认值:null。
  46681. * onmouseup - {function} 默认值:null。
  46682. * ondragstart - {function} 默认值:null。
  46683. * ondragend - {function} 默认值:null。
  46684. * ondragenter - {function} 默认值:null。
  46685. * ondragleave - {function} 默认值:null。
  46686. * ondragover - {function} 默认值:null。
  46687. * ondrop - {function} 默认值:null。
  46688. */
  46689. function Eventful() {
  46690. Eventful_classCallCheck(this, Eventful);
  46691. /**
  46692. * @member {Object} SuperMap.LevelRenderer.Eventful.prototype._handlers
  46693. * @description 事件处理对象(事件分发器)。
  46694. */
  46695. this._handlers = {};
  46696. this.CLASS_NAME = "SuperMap.LevelRenderer.Eventful";
  46697. }
  46698. /**
  46699. * @function {Object} SuperMap.LevelRenderer.Eventful.prototype.destroy
  46700. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  46701. */
  46702. Eventful_createClass(Eventful, [{
  46703. key: "destroy",
  46704. value: function destroy() {
  46705. this._handlers = null;
  46706. }
  46707. /**
  46708. * @function SuperMap.LevelRenderer.Eventful.prototype.one
  46709. * @description 单次触发绑定,dispatch后销毁。
  46710. * @param {string} event - 事件名。
  46711. * @param {boolean} handler - 响应函数。
  46712. * @param {Object} context - context。
  46713. * @returns {SuperMap.LevelRenderer.Eventful} this
  46714. */
  46715. }, {
  46716. key: "one",
  46717. value: function one(event, handler, context) {
  46718. var _h = this._handlers;
  46719. if (!handler || !event) {
  46720. return this;
  46721. }
  46722. if (!_h[event]) {
  46723. _h[event] = [];
  46724. }
  46725. _h[event].push({
  46726. h: handler,
  46727. one: true,
  46728. ctx: context || this
  46729. });
  46730. return this;
  46731. }
  46732. /**
  46733. * @function SuperMap.LevelRenderer.Eventful.prototype.bind
  46734. * @description 绑定事件。
  46735. * @param {string} event - 事件名。
  46736. * @param {boolean} handler - 响应函数。
  46737. * @param {Object} context - context。
  46738. * @returns {SuperMap.LevelRenderer.Eventful} this
  46739. */
  46740. }, {
  46741. key: "bind",
  46742. value: function bind(event, handler, context) {
  46743. var _h = this._handlers;
  46744. if (!handler || !event) {
  46745. return this;
  46746. }
  46747. if (!_h[event]) {
  46748. _h[event] = [];
  46749. }
  46750. _h[event].push({
  46751. h: handler,
  46752. one: false,
  46753. ctx: context || this
  46754. });
  46755. return this;
  46756. }
  46757. /**
  46758. * @function SuperMap.LevelRenderer.Eventful.prototype.unbind
  46759. * @description 解绑事件。
  46760. * @param {string} event - 事件名。
  46761. * @param {boolean} handler - 响应函数。
  46762. * @returns {SuperMap.LevelRenderer.Eventful} this
  46763. */
  46764. }, {
  46765. key: "unbind",
  46766. value: function unbind(event, handler) {
  46767. var _h = this._handlers;
  46768. if (!event) {
  46769. this._handlers = {};
  46770. return this;
  46771. }
  46772. if (handler) {
  46773. if (_h[event]) {
  46774. var newList = [];
  46775. for (var i = 0, l = _h[event].length; i < l; i++) {
  46776. if (_h[event][i]['h'] != handler) {
  46777. newList.push(_h[event][i]);
  46778. }
  46779. }
  46780. _h[event] = newList;
  46781. }
  46782. if (_h[event] && _h[event].length === 0) {
  46783. delete _h[event];
  46784. }
  46785. } else {
  46786. delete _h[event];
  46787. }
  46788. return this;
  46789. }
  46790. /**
  46791. * @function SuperMap.LevelRenderer.Eventful.prototype.dispatch
  46792. * @description 事件分发。
  46793. * @param {string} type - 事件类型。
  46794. * @returns {SuperMap.LevelRenderer.Eventful} this
  46795. */
  46796. }, {
  46797. key: "dispatch",
  46798. value: function dispatch(type) {
  46799. if (this._handlers[type]) {
  46800. var args = arguments;
  46801. var argLen = args.length;
  46802. if (argLen > 3) {
  46803. args = Array.prototype.slice.call(args, 1);
  46804. }
  46805. var _h = this._handlers[type];
  46806. var len = _h.length;
  46807. for (var i = 0; i < len;) {
  46808. // Optimize advise from backbone
  46809. switch (argLen) {
  46810. case 1:
  46811. _h[i]['h'].call(_h[i]['ctx']);
  46812. break;
  46813. case 2:
  46814. _h[i]['h'].call(_h[i]['ctx'], args[1]);
  46815. break;
  46816. case 3:
  46817. _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]);
  46818. break;
  46819. default:
  46820. // have more than 2 given arguments
  46821. _h[i]['h'].apply(_h[i]['ctx'], args);
  46822. break;
  46823. }
  46824. if (_h[i]['one']) {
  46825. _h.splice(i, 1);
  46826. len--;
  46827. } else {
  46828. i++;
  46829. }
  46830. }
  46831. }
  46832. return this;
  46833. }
  46834. /**
  46835. * @function SuperMap.LevelRenderer.Eventful.prototype.dispatchWithContext
  46836. * @description 带有context的事件分发,最后一个参数是事件回调的 context。
  46837. * @param {string} type - 事件类型。
  46838. * @returns {SuperMap.LevelRenderer.Eventful} this
  46839. */
  46840. }, {
  46841. key: "dispatchWithContext",
  46842. value: function dispatchWithContext(type) {
  46843. if (this._handlers[type]) {
  46844. var args = arguments;
  46845. var argLen = args.length;
  46846. if (argLen > 4) {
  46847. args = Array.prototype.slice.call(args, 1, args.length - 1);
  46848. }
  46849. var ctx = args[args.length - 1];
  46850. var _h = this._handlers[type];
  46851. var len = _h.length;
  46852. for (var i = 0; i < len;) {
  46853. // Optimize advise from backbone
  46854. switch (argLen) {
  46855. case 1:
  46856. _h[i]['h'].call(ctx);
  46857. break;
  46858. case 2:
  46859. _h[i]['h'].call(ctx, args[1]);
  46860. break;
  46861. case 3:
  46862. _h[i]['h'].call(ctx, args[1], args[2]);
  46863. break;
  46864. default:
  46865. // have more than 2 given arguments
  46866. _h[i]['h'].apply(ctx, args);
  46867. break;
  46868. }
  46869. if (_h[i]['one']) {
  46870. _h.splice(i, 1);
  46871. len--;
  46872. } else {
  46873. i++;
  46874. }
  46875. }
  46876. }
  46877. return this;
  46878. }
  46879. }]);
  46880. return Eventful;
  46881. }();
  46882. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Vector.js
  46883. function levelRenderer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46884. 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); } }
  46885. function levelRenderer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) levelRenderer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) levelRenderer_Vector_defineProperties(Constructor, staticProps); return Constructor; }
  46886. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  46887. * This program are made available under the terms of the Apache License, Version 2.0
  46888. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46889. /**
  46890. * @private
  46891. * @class SuperMap.LevelRenderer.Tool.Vector
  46892. * @category Visualization Theme
  46893. * @classdesc LevelRenderer 二维向量类
  46894. *
  46895. */
  46896. var levelRenderer_Vector_Vector = /*#__PURE__*/function () {
  46897. /**
  46898. * @function SuperMap.LevelRenderer.Tool.Vector.constructor
  46899. * @description 构造函数
  46900. */
  46901. function Vector() {
  46902. levelRenderer_Vector_classCallCheck(this, Vector);
  46903. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  46904. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Vector";
  46905. }
  46906. /**
  46907. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.create
  46908. * @description 创建一个向量。
  46909. *
  46910. * @param {number} x - x坐标
  46911. * @param {number} y - Y坐标
  46912. * @return {Vector2} 向量。
  46913. */
  46914. levelRenderer_Vector_createClass(Vector, [{
  46915. key: "create",
  46916. value: function create(x, y) {
  46917. var ArrayCtor = this.ArrayCtor;
  46918. var out = new ArrayCtor(2);
  46919. out[0] = x || 0;
  46920. out[1] = y || 0;
  46921. return out;
  46922. }
  46923. /**
  46924. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.copy
  46925. * @description 复制一个向量。
  46926. *
  46927. * @param {Vector2} out - 基础向量。
  46928. * @param {Vector2} v - 向量。
  46929. * @return {Vector2} 克隆向量。
  46930. */
  46931. }, {
  46932. key: "copy",
  46933. value: function copy(out, v) {
  46934. out[0] = v[0];
  46935. out[1] = v[1];
  46936. return out;
  46937. }
  46938. /**
  46939. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.set
  46940. * @description 设置向量的两个项。
  46941. *
  46942. * @param {Vector2} out - 基础向量。
  46943. * @param {number} a - 项 a。
  46944. * @param {number} b - 项 b。
  46945. * @return {Vector2} 结果。
  46946. */
  46947. }, {
  46948. key: "set",
  46949. value: function set(out, a, b) {
  46950. out[0] = a;
  46951. out[1] = b;
  46952. return out;
  46953. }
  46954. /**
  46955. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.add
  46956. * @description 向量相加。
  46957. *
  46958. * @param {Vector2} out - 基础向量。
  46959. * @param {Vector2} v1 - 向量 v1。
  46960. * @param {Vector2} v2 - 向量 v2。
  46961. * @return {Vector2} 结果。
  46962. */
  46963. }, {
  46964. key: "add",
  46965. value: function add(out, v1, v2) {
  46966. out[0] = v1[0] + v2[0];
  46967. out[1] = v1[1] + v2[1];
  46968. return out;
  46969. }
  46970. /**
  46971. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.scaleAndAdd
  46972. * @description 向量缩放后相加。
  46973. * @param {Vector2} out - 基础向量。
  46974. * @param {Vector2} v1 - 向量 v1。
  46975. * @param {Vector2} v2 - 向量 v2(缩放向量)。
  46976. * @param {number} a - 缩放参数。
  46977. * @return {Vector2} 结果。
  46978. */
  46979. }, {
  46980. key: "scaleAndAdd",
  46981. value: function scaleAndAdd(out, v1, v2, a) {
  46982. out[0] = v1[0] + v2[0] * a;
  46983. out[1] = v1[1] + v2[1] * a;
  46984. return out;
  46985. }
  46986. /**
  46987. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.sub
  46988. * @description 向量相减。
  46989. * @param {Vector2} out - 基础向量。
  46990. * @param {Vector2} v1 - 向量 v1。
  46991. * @param {Vector2} v2 - 向量 v2。
  46992. * @return {Vector2} 结果。
  46993. */
  46994. }, {
  46995. key: "sub",
  46996. value: function sub(out, v1, v2) {
  46997. out[0] = v1[0] - v2[0];
  46998. out[1] = v1[1] - v2[1];
  46999. return out;
  47000. }
  47001. /**
  47002. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.len
  47003. * @description 向量长度。
  47004. * @param {Vector2} v - 向量。
  47005. * @return {number} 向量长度。
  47006. */
  47007. }, {
  47008. key: "len",
  47009. value: function len(v) {
  47010. return Math.sqrt(this.lenSquare(v));
  47011. }
  47012. /**
  47013. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lenSquare
  47014. * @description 向量长度平方。
  47015. * @param {Vector2} v - 向量。
  47016. * @return {number} 向量长度平方。
  47017. */
  47018. }, {
  47019. key: "lenSquare",
  47020. value: function lenSquare(v) {
  47021. return v[0] * v[0] + v[1] * v[1];
  47022. }
  47023. /**
  47024. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.mul
  47025. * @description 向量乘法。
  47026. * @param {Vector2} out - 基础向量。
  47027. * @param {Vector2} v1 - 向量 v1。
  47028. * @param {Vector2} v2 - 向量 v2。
  47029. * @return {Vector2} 结果。
  47030. */
  47031. }, {
  47032. key: "mul",
  47033. value: function mul(out, v1, v2) {
  47034. out[0] = v1[0] * v2[0];
  47035. out[1] = v1[1] * v2[1];
  47036. return out;
  47037. }
  47038. /**
  47039. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.div
  47040. * @description 向量除法。
  47041. *
  47042. * @param {Vector2} out - 基础向量。
  47043. * @param {Vector2} v1 - 向量 v1。
  47044. * @param {Vector2} v2 - 向量 v2。
  47045. * @return {Vector2} 结果。
  47046. */
  47047. }, {
  47048. key: "div",
  47049. value: function div(out, v1, v2) {
  47050. out[0] = v1[0] / v2[0];
  47051. out[1] = v1[1] / v2[1];
  47052. return out;
  47053. }
  47054. /**
  47055. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.dot
  47056. * @description 向量点乘。
  47057. *
  47058. * @param {Vector2} v1 - 向量 v1。
  47059. * @param {Vector2} v2 - 向量 v2。
  47060. * @return {number} 向量点乘。
  47061. */
  47062. }, {
  47063. key: "dot",
  47064. value: function dot(v1, v2) {
  47065. return v1[0] * v2[0] + v1[1] * v2[1];
  47066. }
  47067. /**
  47068. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.scale
  47069. * @description 向量缩放。
  47070. *
  47071. * @param {Vector2} out - 基础向量。
  47072. * @param {Vector2} v - 向量v。
  47073. * @param {number} s -缩放参数。
  47074. * @return {Vector2} 结果。
  47075. */
  47076. }, {
  47077. key: "scale",
  47078. value: function scale(out, v, s) {
  47079. out[0] = v[0] * s;
  47080. out[1] = v[1] * s;
  47081. return out;
  47082. }
  47083. /**
  47084. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.normalize
  47085. * @description 向量归一化。
  47086. *
  47087. * @param {Vector2} out - 基础向量。
  47088. * @param {Vector2} v - 向量 v。
  47089. * @return {Vector2} 结果。
  47090. */
  47091. }, {
  47092. key: "normalize",
  47093. value: function normalize(out, v) {
  47094. var d = this.len(v);
  47095. if (d === 0) {
  47096. out[0] = 0;
  47097. out[1] = 0;
  47098. } else {
  47099. out[0] = v[0] / d;
  47100. out[1] = v[1] / d;
  47101. }
  47102. return out;
  47103. }
  47104. /**
  47105. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distance
  47106. * @description 计算向量间距离。
  47107. *
  47108. * @param {Vector2} v1 - 向量 v1。
  47109. * @param {Vector2} v2 - 向量 v2。
  47110. * @return {number} 向量间距离。
  47111. */
  47112. }, {
  47113. key: "distance",
  47114. value: function distance(v1, v2) {
  47115. return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));
  47116. }
  47117. /**
  47118. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distanceSquare
  47119. * @description 向量距离平方。
  47120. *
  47121. * @param {Vector2} v1 - 向量 v1。
  47122. * @param {Vector2} v2 - 向量 v2。
  47123. * @return {number} 向量距离平方。
  47124. */
  47125. }, {
  47126. key: "distanceSquare",
  47127. value: function distanceSquare(v1, v2) {
  47128. return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);
  47129. }
  47130. /**
  47131. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.negate
  47132. * @description 求负向量。
  47133. *
  47134. * @param {Vector2} out - 基础向量。
  47135. * @param {Vector2} v - 向量 v。
  47136. * @return {Vector2} 负向量。
  47137. */
  47138. }, {
  47139. key: "negate",
  47140. value: function negate(out, v) {
  47141. out[0] = -v[0];
  47142. out[1] = -v[1];
  47143. return out;
  47144. }
  47145. /**
  47146. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lerp
  47147. * @description 两点之间线性插值。
  47148. *
  47149. * @param {Vector2} out - 基础向量。
  47150. * @param {Vector2} v1 - 向量 v1。
  47151. * @param {Vector2} v2 - 向量 v2。
  47152. * @param {number} t
  47153. * @return {Vector2} 结果。
  47154. */
  47155. }, {
  47156. key: "lerp",
  47157. value: function lerp(out, v1, v2, t) {
  47158. out[0] = v1[0] + t * (v2[0] - v1[0]);
  47159. out[1] = v1[1] + t * (v2[1] - v1[1]);
  47160. return out;
  47161. }
  47162. /**
  47163. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.applyTransform
  47164. * @description 矩阵左乘向量。
  47165. *
  47166. * @param {Vector2} out - 基础向量。
  47167. * @param {Vector2} v1 - 向量 v1。
  47168. * @param {Vector2} v2 - 向量 v2。
  47169. * @return {Vector2} 结果。
  47170. */
  47171. }, {
  47172. key: "applyTransform",
  47173. value: function applyTransform(out, v, m) {
  47174. var x = v[0];
  47175. var y = v[1];
  47176. out[0] = m[0] * x + m[2] * y + m[4];
  47177. out[1] = m[1] * x + m[3] * y + m[5];
  47178. return out;
  47179. }
  47180. /**
  47181. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.min
  47182. * @description 求两个向量最小值。
  47183. * @param {Vector2} out - 基础向量。
  47184. * @param {Vector2} v1 - 向量 v1。
  47185. * @param {Vector2} v2 - 向量 v2。
  47186. * @return {Vector2} 结果。
  47187. */
  47188. }, {
  47189. key: "min",
  47190. value: function min(out, v1, v2) {
  47191. out[0] = Math.min(v1[0], v2[0]);
  47192. out[1] = Math.min(v1[1], v2[1]);
  47193. return out;
  47194. }
  47195. /**
  47196. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.max
  47197. * @description 求两个向量最大值。
  47198. *
  47199. * @param {Vector2} out - 基础向量。
  47200. * @param {Vector2} v1 - 向量 v1。
  47201. * @param {Vector2} v2 - 向量 v2。
  47202. * @return {Vector2} 结果。
  47203. */
  47204. }, {
  47205. key: "max",
  47206. value: function max(out, v1, v2) {
  47207. out[0] = Math.max(v1[0], v2[0]);
  47208. out[1] = Math.max(v1[1], v2[1]);
  47209. return out;
  47210. }
  47211. /**
  47212. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.length
  47213. * @description 向量长度。
  47214. *
  47215. * @param {Vector2} v - 向量。
  47216. * @return {number} 向量长度。
  47217. */
  47218. }, {
  47219. key: "length",
  47220. value: function length(v) {
  47221. return this.len(v);
  47222. }
  47223. /**
  47224. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lengthSquare
  47225. * @description 向量长度平方。
  47226. *
  47227. * @param {Vector2} v - 向量。
  47228. * @return {number} 向量长度平方。
  47229. */
  47230. }, {
  47231. key: "lengthSquare",
  47232. value: function lengthSquare(v) {
  47233. return this.lenSquare(v);
  47234. }
  47235. /**
  47236. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.dist
  47237. * @description 计算向量间距离。
  47238. *
  47239. * @param {Vector2} v1 - 向量 v1。
  47240. * @param {Vector2} v2 - 向量 v2。
  47241. * @return {number} 向量间距离。
  47242. */
  47243. }, {
  47244. key: "dist",
  47245. value: function dist(v1, v2) {
  47246. return this.distance(v1, v2);
  47247. }
  47248. /**
  47249. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distSquare
  47250. * @description 向量距离平方。
  47251. *
  47252. * @param {Vector2} v1 - 向量 v1。
  47253. * @param {Vector2} v2 - 向量 v2。
  47254. * @return {number} 向量距离平方
  47255. */
  47256. }, {
  47257. key: "distSquare",
  47258. value: function distSquare(v1, v2) {
  47259. return this.distanceSquare(v1, v2);
  47260. }
  47261. }]);
  47262. return Vector;
  47263. }();
  47264. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Curve.js
  47265. function levelRenderer_Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47266. 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); } }
  47267. function Curve_createClass(Constructor, protoProps, staticProps) { if (protoProps) Curve_defineProperties(Constructor.prototype, protoProps); if (staticProps) Curve_defineProperties(Constructor, staticProps); return Constructor; }
  47268. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  47269. * This program are made available under the terms of the Apache License, Version 2.0
  47270. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47271. /**
  47272. * @class SuperMap.LevelRenderer.Tool.Curve
  47273. * @category Visualization Theme
  47274. * @classdesc LevelRenderer 工具-曲线
  47275. * @private
  47276. */
  47277. var levelRenderer_Curve_Curve = /*#__PURE__*/function () {
  47278. /**
  47279. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.constructor
  47280. * @description 构造函数。
  47281. */
  47282. function Curve() {
  47283. levelRenderer_Curve_classCallCheck(this, Curve);
  47284. /**
  47285. * @member {SuperMap.LevelRenderer.Tool.Vector} SuperMap.LevelRenderer.Tool.Curve.prototype.vector
  47286. * @description 矢量工具。
  47287. */
  47288. this.vector = new levelRenderer_Vector_Vector();
  47289. /**
  47290. * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.EPSILON
  47291. * @description e。
  47292. */
  47293. this.EPSILON = 1e-4;
  47294. /**
  47295. * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.THREE_SQRT
  47296. * @description 3 的平方根。
  47297. */
  47298. this.THREE_SQRT = Math.sqrt(3);
  47299. /**
  47300. * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.ONE_THIRD
  47301. * @description 1/3。
  47302. */
  47303. this.ONE_THIRD = 1 / 3;
  47304. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Curve";
  47305. }
  47306. /*
  47307. * Method: evalCubicCoeff
  47308. *
  47309. * Parameters:
  47310. * a - {number} 值。
  47311. * b - {number} 值。
  47312. * c - {number} 值。
  47313. * d - {number} 值。
  47314. * t - {number} 值。
  47315. *
  47316. * Returns:
  47317. * {number}
  47318. */
  47319. /*
  47320. evalCubicCoeff: function(a, b, c, d, t){
  47321. return ((a * t + b) * t + c) * t + d;
  47322. },
  47323. */
  47324. /**
  47325. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.isAroundZero
  47326. * @description 判断一个值是否趋于0,判断参考值:1e-4。
  47327. * @param {number} val - 值。
  47328. * @returns {boolean} 值是否趋于0。
  47329. */
  47330. Curve_createClass(Curve, [{
  47331. key: "isAroundZero",
  47332. value: function isAroundZero(val) {
  47333. return val > -this.EPSILON && val < this.EPSILON;
  47334. }
  47335. /**
  47336. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.isNotAroundZero
  47337. * @description 判断一个值是否不趋于0,判断参考值:1e-4。
  47338. * @param {number} val - 值。
  47339. * @returns {boolean} 值是否不趋于0。
  47340. */
  47341. }, {
  47342. key: "isNotAroundZero",
  47343. value: function isNotAroundZero(val) {
  47344. return val > this.EPSILON || val < -this.EPSILON;
  47345. }
  47346. /**
  47347. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicAt
  47348. * @description 计算三次贝塞尔值
  47349. * @param {number} p0 - 点p0。
  47350. * @param {number} p1 - 点p1。
  47351. * @param {number} p2 - 点p2。
  47352. * @param {number} p3 - 点p3。
  47353. * @param {number} t - t值。
  47354. * @returns {number} 三次贝塞尔值。
  47355. */
  47356. }, {
  47357. key: "cubicAt",
  47358. value: function cubicAt(p0, p1, p2, p3, t) {
  47359. var onet = 1 - t;
  47360. return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2);
  47361. }
  47362. /**
  47363. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicDerivativeAt
  47364. * @description 计算三次贝塞尔导数值
  47365. * @param {number} p0 - 点p0。
  47366. * @param {number} p1 - 点p1。
  47367. * @param {number} p2 - 点p2。
  47368. * @param {number} p3 - 点p3。
  47369. * @param {number} t - t值。
  47370. * @returns {number} 三次贝塞尔导数值。
  47371. */
  47372. }, {
  47373. key: "cubicDerivativeAt",
  47374. value: function cubicDerivativeAt(p0, p1, p2, p3, t) {
  47375. var onet = 1 - t;
  47376. return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t);
  47377. }
  47378. /**
  47379. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicRootAt
  47380. * @description 计算三次贝塞尔方程根,使用盛金公式
  47381. * @param {number} p0 - 点p0。
  47382. * @param {number} p1 - 点p1。
  47383. * @param {number} p2 - 点p2。
  47384. * @param {number} p3 - 点p3。
  47385. * @param {number} val - 值。
  47386. * @param {Array.<number>} roots - 有效根数目。
  47387. * @returns {number} 有效根。
  47388. */
  47389. }, {
  47390. key: "cubicRootAt",
  47391. value: function cubicRootAt(p0, p1, p2, p3, val, roots) {
  47392. // Evaluate roots of cubic functions
  47393. var a = p3 + 3 * (p1 - p2) - p0;
  47394. var b = 3 * (p2 - p1 * 2 + p0);
  47395. var c = 3 * (p1 - p0);
  47396. var d = p0 - val;
  47397. var A = b * b - 3 * a * c;
  47398. var B = b * c - 9 * a * d;
  47399. var C = c * c - 3 * b * d;
  47400. var n = 0;
  47401. if (this.isAroundZero(A) && this.isAroundZero(B)) {
  47402. if (this.isAroundZero(b)) {
  47403. roots[0] = 0;
  47404. } else {
  47405. var t1 = -c / b; //t1, t2, t3, b is not zero
  47406. if (t1 >= 0 && t1 <= 1) {
  47407. roots[n++] = t1;
  47408. }
  47409. }
  47410. } else {
  47411. var disc = B * B - 4 * A * C;
  47412. if (this.isAroundZero(disc)) {
  47413. var K = B / A;
  47414. var _t2 = -b / a + K; // t1, a is not zero
  47415. var t2 = -K / 2; // t2, t3
  47416. if (_t2 >= 0 && _t2 <= 1) {
  47417. roots[n++] = _t2;
  47418. }
  47419. if (t2 >= 0 && t2 <= 1) {
  47420. roots[n++] = t2;
  47421. }
  47422. } else if (disc > 0) {
  47423. var discSqrt = Math.sqrt(disc);
  47424. var Y1 = A * b + 1.5 * a * (-B + discSqrt);
  47425. var Y2 = A * b + 1.5 * a * (-B - discSqrt);
  47426. if (Y1 < 0) {
  47427. Y1 = -Math.pow(-Y1, this.ONE_THIRD);
  47428. } else {
  47429. Y1 = Math.pow(Y1, this.ONE_THIRD);
  47430. }
  47431. if (Y2 < 0) {
  47432. Y2 = -Math.pow(-Y2, this.ONE_THIRD);
  47433. } else {
  47434. Y2 = Math.pow(Y2, this.ONE_THIRD);
  47435. }
  47436. var _t3 = (-b - (Y1 + Y2)) / (3 * a);
  47437. if (_t3 >= 0 && _t3 <= 1) {
  47438. roots[n++] = _t3;
  47439. }
  47440. } else {
  47441. var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A));
  47442. var theta = Math.acos(T) / 3;
  47443. var ASqrt = Math.sqrt(A);
  47444. var tmp = Math.cos(theta);
  47445. var _t4 = (-b - 2 * ASqrt * tmp) / (3 * a);
  47446. var _t5 = (-b + ASqrt * (tmp + this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  47447. var t3 = (-b + ASqrt * (tmp - this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  47448. if (_t4 >= 0 && _t4 <= 1) {
  47449. roots[n++] = _t4;
  47450. }
  47451. if (_t5 >= 0 && _t5 <= 1) {
  47452. roots[n++] = _t5;
  47453. }
  47454. if (t3 >= 0 && t3 <= 1) {
  47455. roots[n++] = t3;
  47456. }
  47457. }
  47458. }
  47459. return n;
  47460. }
  47461. /**
  47462. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicRootAt
  47463. * @description 计算三次贝塞尔方程极限值的位置
  47464. * @param {number} p0 - 点p0。
  47465. * @param {number} p1 - 点p1。
  47466. * @param {number} p2 - 点p2。
  47467. * @param {number} p3 - 点p3。
  47468. * @param {Array.<number>} extrema - 值。
  47469. * @returns {number} 有效数目。
  47470. */
  47471. }, {
  47472. key: "cubicExtrema",
  47473. value: function cubicExtrema(p0, p1, p2, p3, extrema) {
  47474. var b = 6 * p2 - 12 * p1 + 6 * p0;
  47475. var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;
  47476. var c = 3 * p1 - 3 * p0;
  47477. var n = 0;
  47478. if (this.isAroundZero(a)) {
  47479. if (this.isNotAroundZero(b)) {
  47480. var t1 = -c / b;
  47481. if (t1 >= 0 && t1 <= 1) {
  47482. extrema[n++] = t1;
  47483. }
  47484. }
  47485. } else {
  47486. var disc = b * b - 4 * a * c;
  47487. if (this.isAroundZero(disc)) {
  47488. extrema[0] = -b / (2 * a);
  47489. } else if (disc > 0) {
  47490. var discSqrt = Math.sqrt(disc);
  47491. var _t6 = (-b + discSqrt) / (2 * a);
  47492. var t2 = (-b - discSqrt) / (2 * a);
  47493. if (_t6 >= 0 && _t6 <= 1) {
  47494. extrema[n++] = _t6;
  47495. }
  47496. if (t2 >= 0 && t2 <= 1) {
  47497. extrema[n++] = t2;
  47498. }
  47499. }
  47500. }
  47501. return n;
  47502. }
  47503. /**
  47504. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicSubdivide
  47505. * @description 细分三次贝塞尔曲线
  47506. * @param {number} p0 - 点p0。
  47507. * @param {number} p1 - 点p1。
  47508. * @param {number} p2 - 点p2。
  47509. * @param {number} p3 - 点p3。
  47510. * @param {number} t - t值。
  47511. * @param {Array.<number>} out - 投射点。
  47512. * @returns {number} 投射点。
  47513. */
  47514. }, {
  47515. key: "cubicSubdivide",
  47516. value: function cubicSubdivide(p0, p1, p2, p3, t, out) {
  47517. var p01 = (p1 - p0) * t + p0;
  47518. var p12 = (p2 - p1) * t + p1;
  47519. var p23 = (p3 - p2) * t + p2;
  47520. var p012 = (p12 - p01) * t + p01;
  47521. var p123 = (p23 - p12) * t + p12;
  47522. var p0123 = (p123 - p012) * t + p012; // Seg0
  47523. out[0] = p0;
  47524. out[1] = p01;
  47525. out[2] = p012;
  47526. out[3] = p0123; // Seg1
  47527. out[4] = p0123;
  47528. out[5] = p123;
  47529. out[6] = p23;
  47530. out[7] = p3;
  47531. }
  47532. /**
  47533. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicProjectPoint
  47534. * @description 投射点到三次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  47535. * @param {number} x0 - 点p0横坐标。
  47536. * @param {number} y0 - 点p0纵坐标。
  47537. * @param {number} x1 - 点p1横坐标。
  47538. * @param {number} y1 - 点p1纵坐标。
  47539. * @param {number} x2 - 点p2横坐标。
  47540. * @param {number} y2 - 点p2纵坐标。
  47541. * @param {number} x3 - 点p3横坐标。
  47542. * @param {number} y3 - 点p3纵坐标。
  47543. * @param {number} x - 点p横坐标。
  47544. * @param {number} y - 点p纵坐标。
  47545. * @param {Array.<number>} out - 投射点。
  47546. * @returns {number} 投射点。
  47547. */
  47548. }, {
  47549. key: "cubicProjectPoint",
  47550. value: function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {
  47551. // 临时变量
  47552. var _v0 = this.vector.create();
  47553. var _v1 = this.vector.create();
  47554. var _v2 = this.vector.create(); // var _v3 = vector.create();
  47555. // http://pomax.github.io/bezierinfo/#projections
  47556. var t;
  47557. var interval = 0.005;
  47558. var d = Infinity;
  47559. _v0[0] = x;
  47560. _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值
  47561. // PENDING
  47562. for (var _t = 0; _t < 1; _t += 0.05) {
  47563. _v1[0] = this.cubicAt(x0, x1, x2, x3, _t);
  47564. _v1[1] = this.cubicAt(y0, y1, y2, y3, _t);
  47565. var d1 = this.vector.distSquare(_v0, _v1);
  47566. if (d1 < d) {
  47567. t = _t;
  47568. d = d1;
  47569. }
  47570. }
  47571. d = Infinity; // At most 32 iteration
  47572. for (var i = 0; i < 32; i++) {
  47573. if (interval < this.EPSILON) {
  47574. break;
  47575. }
  47576. var prev = t - interval;
  47577. var next = t + interval; // t - interval
  47578. _v1[0] = this.cubicAt(x0, x1, x2, x3, prev);
  47579. _v1[1] = this.cubicAt(y0, y1, y2, y3, prev);
  47580. var _d = this.vector.distSquare(_v1, _v0);
  47581. if (prev >= 0 && _d < d) {
  47582. t = prev;
  47583. d = _d;
  47584. } else {
  47585. // t + interval
  47586. _v2[0] = this.cubicAt(x0, x1, x2, x3, next);
  47587. _v2[1] = this.cubicAt(y0, y1, y2, y3, next);
  47588. var d2 = this.vector.distSquare(_v2, _v0);
  47589. if (next <= 1 && d2 < d) {
  47590. t = next;
  47591. d = d2;
  47592. } else {
  47593. interval *= 0.5;
  47594. }
  47595. }
  47596. } // t
  47597. if (out) {
  47598. out[0] = this.cubicAt(x0, x1, x2, x3, t);
  47599. out[1] = this.cubicAt(y0, y1, y2, y3, t);
  47600. } // console.log(interval, i);
  47601. return Math.sqrt(d);
  47602. }
  47603. /**
  47604. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticAt
  47605. * @description 计算二次方贝塞尔值。
  47606. * @param {number} p0 - 点p0。
  47607. * @param {number} p1 - 点p1。
  47608. * @param {number} p2 - 点p2。
  47609. * @param {number} t - t值。
  47610. * @returns {number} 二次方贝塞尔值。
  47611. */
  47612. }, {
  47613. key: "quadraticAt",
  47614. value: function quadraticAt(p0, p1, p2, t) {
  47615. var onet = 1 - t;
  47616. return onet * (onet * p0 + 2 * t * p1) + t * t * p2;
  47617. }
  47618. /**
  47619. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticAt
  47620. * @description 计算二次方贝塞尔导数值。
  47621. * @param {number} p0 - 点p0。
  47622. * @param {number} p1 - 点p1。
  47623. * @param {number} p2 - 点p2。
  47624. * @param {number} t - t值。
  47625. * @returns {number} 二次方贝塞尔导数值。
  47626. */
  47627. }, {
  47628. key: "quadraticDerivativeAt",
  47629. value: function quadraticDerivativeAt(p0, p1, p2, t) {
  47630. return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));
  47631. }
  47632. /**
  47633. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticRootAt
  47634. * @description 计算二次方贝塞尔方程根
  47635. * @param {number} p0 - 点p0。
  47636. * @param {number} p1 - 点p1。
  47637. * @param {number} p2 - 点p2。
  47638. * @param {number} val - 值。
  47639. * @param {Array.<number>} roots - 有效根数目。
  47640. * @returns {number} 有效根数目。
  47641. */
  47642. }, {
  47643. key: "quadraticRootAt",
  47644. value: function quadraticRootAt(p0, p1, p2, val, roots) {
  47645. var a = p0 - 2 * p1 + p2;
  47646. var b = 2 * (p1 - p0);
  47647. var c = p0 - val;
  47648. var n = 0;
  47649. if (this.isAroundZero(a)) {
  47650. if (this.isNotAroundZero(b)) {
  47651. var t1 = -c / b;
  47652. if (t1 >= 0 && t1 <= 1) {
  47653. roots[n++] = t1;
  47654. }
  47655. }
  47656. } else {
  47657. var disc = b * b - 4 * a * c;
  47658. if (this.isAroundZero(disc)) {
  47659. var _t7 = -b / (2 * a);
  47660. if (_t7 >= 0 && _t7 <= 1) {
  47661. roots[n++] = _t7;
  47662. }
  47663. } else if (disc > 0) {
  47664. var discSqrt = Math.sqrt(disc);
  47665. var _t8 = (-b + discSqrt) / (2 * a);
  47666. var t2 = (-b - discSqrt) / (2 * a);
  47667. if (_t8 >= 0 && _t8 <= 1) {
  47668. roots[n++] = _t8;
  47669. }
  47670. if (t2 >= 0 && t2 <= 1) {
  47671. roots[n++] = t2;
  47672. }
  47673. }
  47674. }
  47675. return n;
  47676. }
  47677. /**
  47678. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticExtremum
  47679. * @description 计算二次贝塞尔方程极限值
  47680. * @param {number} p0 - 点p0。
  47681. * @param {number} p1 - 点p1。
  47682. * @param {number} p2 - 点p2。
  47683. * @returns {number} 二次贝塞尔方程极限值。
  47684. */
  47685. }, {
  47686. key: "quadraticExtremum",
  47687. value: function quadraticExtremum(p0, p1, p2) {
  47688. var divider = p0 + p2 - 2 * p1;
  47689. if (divider === 0) {
  47690. // p1 is center of p0 and p2
  47691. return 0.5;
  47692. } else {
  47693. return (p0 - p1) / divider;
  47694. }
  47695. }
  47696. /**
  47697. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticProjectPoint
  47698. * @description 投射点到二次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  47699. * @param {number} x0 - 点p0横坐标。
  47700. * @param {number} y0 - 点p0纵坐标。
  47701. * @param {number} x1 - 点p1横坐标。
  47702. * @param {number} y1 - 点p1纵坐标。
  47703. * @param {number} x2 - 点p2横坐标。
  47704. * @param {number} y2 - 点p2纵坐标。
  47705. * @param {number} x - 点p横坐标。
  47706. * @param {number} y - 点p纵坐标。
  47707. * @param {Array.<number>} out - 投射点。
  47708. * @returns {number} 投射距离。
  47709. */
  47710. }, {
  47711. key: "quadraticProjectPoint",
  47712. value: function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {
  47713. // 临时变量
  47714. var _v0 = this.vector.create();
  47715. var _v1 = this.vector.create();
  47716. var _v2 = this.vector.create(); // http://pomax.github.io/bezierinfo/#projections
  47717. var t;
  47718. var interval = 0.005;
  47719. var d = Infinity;
  47720. _v0[0] = x;
  47721. _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值
  47722. // PENDING
  47723. for (var _t = 0; _t < 1; _t += 0.05) {
  47724. _v1[0] = this.quadraticAt(x0, x1, x2, _t);
  47725. _v1[1] = this.quadraticAt(y0, y1, y2, _t);
  47726. var d1 = this.vector.distSquare(_v0, _v1);
  47727. if (d1 < d) {
  47728. t = _t;
  47729. d = d1;
  47730. }
  47731. }
  47732. d = Infinity; // At most 32 iteration
  47733. for (var i = 0; i < 32; i++) {
  47734. if (interval < this.EPSILON) {
  47735. break;
  47736. }
  47737. var prev = t - interval;
  47738. var next = t + interval; // t - interval
  47739. _v1[0] = this.quadraticAt(x0, x1, x2, prev);
  47740. _v1[1] = this.quadraticAt(y0, y1, y2, prev);
  47741. var _d2 = this.vector.distSquare(_v1, _v0);
  47742. if (prev >= 0 && _d2 < d) {
  47743. t = prev;
  47744. d = _d2;
  47745. } else {
  47746. // t + interval
  47747. _v2[0] = this.quadraticAt(x0, x1, x2, next);
  47748. _v2[1] = this.quadraticAt(y0, y1, y2, next);
  47749. var d2 = this.vector.distSquare(_v2, _v0);
  47750. if (next <= 1 && d2 < d) {
  47751. t = next;
  47752. d = d2;
  47753. } else {
  47754. interval *= 0.5;
  47755. }
  47756. }
  47757. } // t
  47758. if (out) {
  47759. out[0] = this.quadraticAt(x0, x1, x2, t);
  47760. out[1] = this.quadraticAt(y0, y1, y2, t);
  47761. } // console.log(interval, i);
  47762. return Math.sqrt(d);
  47763. }
  47764. }]);
  47765. return Curve;
  47766. }();
  47767. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Area.js
  47768. function Area_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47769. 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); } }
  47770. function Area_createClass(Constructor, protoProps, staticProps) { if (protoProps) Area_defineProperties(Constructor.prototype, protoProps); if (staticProps) Area_defineProperties(Constructor, staticProps); return Constructor; }
  47771. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  47772. * This program are made available under the terms of the Apache License, Version 2.0
  47773. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47774. /**
  47775. * @class SuperMap.LevelRenderer.Tool.Area
  47776. * @category Visualization Theme
  47777. * @classdesc LevelRenderer 工具-图形范围判断
  47778. * @private
  47779. */
  47780. var Area_Area = /*#__PURE__*/function () {
  47781. /**
  47782. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.constructor
  47783. * @description 构造函数。
  47784. */
  47785. function Area() {
  47786. Area_classCallCheck(this, Area);
  47787. /**
  47788. * @member {SuperMap.LevelRenderer.Tool.Util} SuperMap.LevelRenderer.Tool.Areal.prototype.util
  47789. * @description 基础工具对象。
  47790. */
  47791. this.util = new levelRenderer_Util_Util();
  47792. /**
  47793. * @member {SuperMap.LevelRenderer.Tool.Curve} SuperMap.LevelRenderer.Tool.Areal.prototype.curve
  47794. * @description 曲线工具对象
  47795. */
  47796. this.curve = new levelRenderer_Curve_Curve();
  47797. /**
  47798. * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._ctx
  47799. * @description Cavans2D 渲染上下文
  47800. */
  47801. this._ctx = null;
  47802. /**
  47803. * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._textWidthCache
  47804. * @description 文本宽度缓存
  47805. */
  47806. this._textWidthCache = {};
  47807. /**
  47808. * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._textHeightCache
  47809. * @description 文本高度缓存
  47810. */
  47811. this._textHeightCache = {};
  47812. /**
  47813. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype._textWidthCacheCounter
  47814. * @description 文本宽度缓存数量
  47815. */
  47816. this._textWidthCacheCounter = 0;
  47817. /**
  47818. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype._textHeightCacheCounter
  47819. * @description 文本高度缓存数量
  47820. */
  47821. this._textHeightCacheCounter = 0;
  47822. /**
  47823. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype.TEXT_CACHE_MAX
  47824. * @description 文本最大缓存数量
  47825. */
  47826. this.TEXT_CACHE_MAX = 5000;
  47827. /**
  47828. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype.PI2
  47829. * @description 2*PI 的值
  47830. */
  47831. this.PI2 = Math.PI * 2;
  47832. /**
  47833. * @member {Array} SuperMap.LevelRenderer.Tool.Areal.prototype.roots
  47834. * @description 临时数组
  47835. */
  47836. this.roots = [-1, -1, -1];
  47837. /**
  47838. * @member {Array} SuperMap.LevelRenderer.Tool.Areal.prototype.extrema
  47839. * @description 临时数组
  47840. */
  47841. this.extrema = [-1, -1];
  47842. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Area";
  47843. }
  47844. /**
  47845. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.normalizeRadian
  47846. * @description 弧度标准化函数。
  47847. * @param {number} angle - 弧度值。
  47848. * @returns {number} 标准化后的弧度值。
  47849. */
  47850. Area_createClass(Area, [{
  47851. key: "normalizeRadian",
  47852. value: function normalizeRadian(angle) {
  47853. angle %= this.PI2;
  47854. if (angle < 0) {
  47855. angle += this.PI2;
  47856. }
  47857. return angle;
  47858. }
  47859. /**
  47860. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInside
  47861. * @description 包含判断。
  47862. * @param {Object} shape - 图形。
  47863. * @param {number} area - 目标区域。
  47864. * @param {number} x - 横坐标。
  47865. * @param {number} y - 纵坐标。
  47866. * @returns {boolean} 图形是否包含鼠标位置。
  47867. */
  47868. }, {
  47869. key: "isInside",
  47870. value: function isInside(shape, area, x, y) {
  47871. if (!area || !shape) {
  47872. // 无参数或不支持类型
  47873. return false;
  47874. }
  47875. var zoneType = shape.type;
  47876. this._ctx = this._ctx || this.util.getContext(); // 未实现或不可用时则数学运算,主要是line,brokenLine,ring
  47877. var _mathReturn = this._mathMethod(shape, area, x, y);
  47878. if (typeof _mathReturn != 'undefined') {
  47879. return _mathReturn;
  47880. }
  47881. if (shape.buildPath && this._ctx.isPointInPath) {
  47882. return this._buildPathMethod(shape, this._ctx, area, x, y);
  47883. } // 上面的方法都行不通时
  47884. switch (zoneType) {
  47885. case 'ellipse': // Todo,不精确
  47886. case 'smicellipse':
  47887. // Todo,不精确
  47888. return true;
  47889. // 旋轮曲线 不准确
  47890. case 'trochoid':
  47891. var _r = area.location == 'out' ? area.r1 + area.r2 + area.d : area.r1 - area.r2 + area.d;
  47892. return this.isInsideCircle(area, x, y, _r);
  47893. // 玫瑰线 不准确
  47894. case 'rose':
  47895. return this.isInsideCircle(area, x, y, area.maxr);
  47896. // 路径,椭圆,曲线等-----------------13
  47897. default:
  47898. return false;
  47899. // Todo,暂不支持
  47900. }
  47901. }
  47902. /**
  47903. * @function SuperMap.LevelRenderer.Tool.Areal.prototype._mathMethod
  47904. * @description 包含判断。用数学方法判断,三个方法中最快,但是支持的shape少。
  47905. * @param {Object} shape - 图形。
  47906. * @param {number} area - 目标区域。
  47907. * @param {number} x - 横坐标。
  47908. * @param {number} y - 纵坐标。
  47909. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  47910. */
  47911. }, {
  47912. key: "_mathMethod",
  47913. value: function _mathMethod(shape, area, x, y) {
  47914. var zoneType = shape.type; // 在矩形内则部分图形需要进一步判断
  47915. switch (zoneType) {
  47916. // 贝塞尔曲线
  47917. case 'bezier-curve':
  47918. if (typeof area.cpX2 === 'undefined') {
  47919. return this.isInsideQuadraticStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.xEnd, area.yEnd, area.lineWidth, x, y);
  47920. }
  47921. return this.isInsideCubicStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.cpX2, area.cpY2, area.xEnd, area.yEnd, area.lineWidth, x, y);
  47922. // 线
  47923. case 'line':
  47924. return this.isInsideLine(area.xStart, area.yStart, area.xEnd, area.yEnd, area.lineWidth, x, y);
  47925. // 折线
  47926. case 'broken-line':
  47927. return this.isInsideBrokenLine(area.pointList, area.lineWidth, x, y);
  47928. // 扩展折线
  47929. case 'smicbroken-line':
  47930. {
  47931. // SMIC-修改 - start
  47932. var icX = x;
  47933. var icY = y;
  47934. if (shape.refOriginalPosition) {
  47935. icX = x - shape.refOriginalPosition[0];
  47936. icY = y - shape.refOriginalPosition[1];
  47937. }
  47938. return this.isInsideBrokenLine(area.pointList, area.lineWidth, icX, icY);
  47939. }
  47940. //初始代码:
  47941. // return isInsideBrokenLine(
  47942. // area.pointList, area.lineWidth, x, y
  47943. // );
  47944. // SMIC-修改 - end
  47945. // 圆环
  47946. case 'ring':
  47947. return this.isInsideRing(area.x, area.y, area.r0, area.r, x, y);
  47948. case 'smicring':
  47949. {
  47950. var areaX = area.x;
  47951. var areaY = area.y;
  47952. if (shape.refOriginalPosition) {
  47953. areaX = area.x + shape.refOriginalPosition[0];
  47954. areaY = area.y + shape.refOriginalPosition[1];
  47955. }
  47956. return this.isInsideRing(areaX, areaY, area.r0, area.r, x, y);
  47957. }
  47958. // 圆形
  47959. case 'circle':
  47960. return this.isInsideCircle(area.x, area.y, area.r, x, y);
  47961. // 扩展-点
  47962. case 'smicpoint':
  47963. {
  47964. // SMIC-修改 - start
  47965. var _icX = x;
  47966. var _icY = y;
  47967. if (shape.refOriginalPosition) {
  47968. _icX = x - shape.refOriginalPosition[0];
  47969. _icY = y - shape.refOriginalPosition[1];
  47970. }
  47971. return this.isInsideCircle(area.x, area.y, area.r, _icX, _icY);
  47972. }
  47973. //初始代码:
  47974. // 无
  47975. // SMIC-修改 - end
  47976. // 扇形
  47977. case 'sector':
  47978. {
  47979. var startAngle = area.startAngle * Math.PI / 180;
  47980. var endAngle = area.endAngle * Math.PI / 180;
  47981. if (!area.clockWise) {
  47982. startAngle = -startAngle;
  47983. endAngle = -endAngle;
  47984. }
  47985. return this.isInsideSector(area.x, area.y, area.r0, area.r, startAngle, endAngle, !area.clockWise, x, y);
  47986. }
  47987. //初始代码:
  47988. // 无
  47989. // SMIC-增加 - end
  47990. // 扇形
  47991. case 'smicsector':
  47992. {
  47993. var _startAngle = area.startAngle * Math.PI / 180;
  47994. var _endAngle = area.endAngle * Math.PI / 180;
  47995. if (!area.clockWise) {
  47996. _startAngle = -_startAngle;
  47997. _endAngle = -_endAngle;
  47998. }
  47999. var _areaX = area.x;
  48000. var _areaY = area.y;
  48001. if (shape.refOriginalPosition) {
  48002. _areaX = area.x + shape.refOriginalPosition[0];
  48003. _areaY = area.y + shape.refOriginalPosition[1];
  48004. }
  48005. return this.isInsideSector(_areaX, _areaY, area.r0, area.r, _startAngle, _endAngle, !area.clockWise, x, y);
  48006. }
  48007. // 多边形
  48008. case 'path':
  48009. return this.isInsidePath(area.pathArray, Math.max(area.lineWidth, 5), area.brushType, x, y);
  48010. case 'polygon':
  48011. case 'star':
  48012. case 'smicstar':
  48013. case 'isogon':
  48014. case 'smicisogon':
  48015. return this.isInsidePolygon(area.pointList, x, y);
  48016. // 扩展多边形
  48017. case 'smicpolygon':
  48018. {
  48019. // SMIC-修改 - start
  48020. var _icX2 = x;
  48021. var _icY2 = y;
  48022. if (shape.refOriginalPosition) {
  48023. _icX2 = x - shape.refOriginalPosition[0];
  48024. _icY2 = y - shape.refOriginalPosition[1];
  48025. } //岛洞面
  48026. if (shape.holePolygonPointLists && shape.holePolygonPointLists.length > 0) {
  48027. var isOnBase = this.isInsidePolygon(area.pointList, _icX2, _icY2); // 遍历岛洞子面
  48028. var holePLS = shape.holePolygonPointLists;
  48029. var isOnHole = false;
  48030. for (var i = 0, holePLSen = holePLS.length; i < holePLSen; i++) {
  48031. var holePL = holePLS[i];
  48032. var isOnSubHole = this.isInsidePolygon(holePL, _icX2, _icY2);
  48033. if (isOnSubHole === true) {
  48034. isOnHole = true;
  48035. }
  48036. } // 捕获判断
  48037. return isOnBase === true && isOnHole === false;
  48038. } else {
  48039. return this.isInsidePolygon(area.pointList, _icX2, _icY2);
  48040. }
  48041. }
  48042. // 初始代码:
  48043. // 无
  48044. // SMIC-修改 - end
  48045. // 文本
  48046. case 'text':
  48047. var rect = area.__rect || shape.getRect(area);
  48048. return this.isInsideRect(rect.x, rect.y, rect.width, rect.height, x, y);
  48049. // 扩展文本
  48050. case 'smictext':
  48051. //用文本背景矩形判断
  48052. var textBg = shape.getTextBackground(area);
  48053. return this.isInsidePolygon(textBg, x, y);
  48054. //初始代码:
  48055. // 无
  48056. // SMIC-修改 - end
  48057. // 矩形
  48058. case 'rectangle':
  48059. case 'image':
  48060. // 图片
  48061. return this.isInsideRect(area.x, area.y, area.width, area.height, x, y);
  48062. case 'smicimage':
  48063. {
  48064. var _areaX2 = area.x;
  48065. var _areaY2 = area.y;
  48066. if (shape.refOriginalPosition) {
  48067. _areaX2 = area.x + shape.refOriginalPosition[0];
  48068. _areaY2 = area.y + shape.refOriginalPosition[1];
  48069. }
  48070. return this.isInsideRect(_areaX2, _areaY2, area.width, area.height, x, y);
  48071. }
  48072. //// 扩展矩形
  48073. //case 'smicpolygon':
  48074. // // SMIC-修改 - start
  48075. // var icX = x;
  48076. // var icY = y;
  48077. // if(shape.refOriginalPosition) {
  48078. // icX = x - shape.refOriginalPosition[0];
  48079. // icY = y - shape.refOriginalPosition[1];
  48080. // }
  48081. // return this.isInsideRect(
  48082. // area.x, area.y, area.width, area.height, icX, icY
  48083. // );
  48084. //初始代码:
  48085. // 无
  48086. // SMIC-修改 - end
  48087. }
  48088. }
  48089. /**
  48090. * @function SuperMap.LevelRenderer.Tool.Areal.prototype._buildPathMethod
  48091. * @description 包含判断。通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的 shape。
  48092. * @param {Object} shape - 图形。
  48093. * @param {Object} context - 上下文。
  48094. * @param {number} area - 目标区域。
  48095. * @param {number} x - 横坐标。
  48096. * @param {number} y - 纵坐标。
  48097. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  48098. */
  48099. }, {
  48100. key: "_buildPathMethod",
  48101. value: function _buildPathMethod(shape, context, area, x, y) {
  48102. // 图形类实现路径创建了则用类的path
  48103. context.beginPath();
  48104. shape.buildPath(context, area);
  48105. context.closePath();
  48106. return context.isPointInPath(x, y);
  48107. }
  48108. /**
  48109. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isOutside
  48110. * @description 图形是否不包含鼠标位置。
  48111. * @param {Object} shape - 图形。
  48112. * @param {number} area - 目标区域。
  48113. * @param {number} x - 横坐标。
  48114. * @param {number} y - 纵坐标。
  48115. * @returns {boolean} 图形是否不包含鼠标位置, true表示坐标处在图形外。
  48116. */
  48117. }, {
  48118. key: "isOutside",
  48119. value: function isOutside(shape, area, x, y) {
  48120. return !this.isInside(shape, area, x, y);
  48121. }
  48122. /**
  48123. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideLine
  48124. * @description 线段包含判断。
  48125. * @param {number} x0 - 线起始点横坐标。
  48126. * @param {number} y0 - 线起始点纵坐标。
  48127. * @param {number} x1 - 线终点横坐标。
  48128. * @param {number} y1 - 线终点纵坐标。
  48129. * @param {number} lineWidth - 线宽。
  48130. * @param {number} x - 鼠标位置横坐标。
  48131. * @param {number} y - 鼠标位置纵坐标。
  48132. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形内。
  48133. */
  48134. }, {
  48135. key: "isInsideLine",
  48136. value: function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) {
  48137. if (lineWidth === 0) {
  48138. return false;
  48139. }
  48140. var _l = Math.max(lineWidth, 5);
  48141. var _a = 0;
  48142. var _b = 0; // Quick reject
  48143. 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) {
  48144. return false;
  48145. }
  48146. if (x0 !== x1) {
  48147. _a = (y0 - y1) / (x0 - x1);
  48148. _b = (x0 * y1 - x1 * y0) / (x0 - x1);
  48149. } else {
  48150. return Math.abs(x - x0) <= _l / 2;
  48151. }
  48152. var tmp = _a * x - y + _b;
  48153. var _s = tmp * tmp / (_a * _a + 1);
  48154. return _s <= _l / 2 * _l / 2;
  48155. }
  48156. /**
  48157. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideCubicStroke
  48158. * @description 三次贝塞尔曲线描边包含判断。
  48159. * @param {number} x0 - 点1横坐标。
  48160. * @param {number} y0 - 点1纵坐标。
  48161. * @param {number} x1 - 点2横坐标。
  48162. * @param {number} y1 - 点2纵坐标。
  48163. * @param {number} x2 - 点3纵坐标。
  48164. * @param {number} y2 - 点3纵坐标。
  48165. * @param {number} lineWidth - 线宽。
  48166. * @param {number} x - 鼠标位置横坐标。
  48167. * @param {number} y - 鼠标位置纵坐标。
  48168. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  48169. */
  48170. }, {
  48171. key: "isInsideCubicStroke",
  48172. value: function isInsideCubicStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {
  48173. if (lineWidth === 0) {
  48174. return false;
  48175. }
  48176. var _l = Math.max(lineWidth, 5); // Quick reject
  48177. 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) {
  48178. return false;
  48179. }
  48180. var d = this.curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);
  48181. return d <= _l / 2;
  48182. }
  48183. /**
  48184. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideQuadraticStroke
  48185. * @description 二次贝塞尔曲线描边包含判断。
  48186. * @param {number} x0 - 点1横坐标。
  48187. * @param {number} y0 - 点1纵坐标。
  48188. * @param {number} x1 - 点2横坐标。
  48189. * @param {number} y1 - 点2纵坐标。
  48190. * @param {number} x2 - 点3纵坐标。
  48191. * @param {number} y2 - 点3纵坐标。
  48192. * @param {number} lineWidth - 线宽。
  48193. * @param {number} x - 鼠标位置横坐标。
  48194. * @param {number} y - 鼠标位置纵坐标。
  48195. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  48196. */
  48197. }, {
  48198. key: "isInsideQuadraticStroke",
  48199. value: function isInsideQuadraticStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {
  48200. if (lineWidth === 0) {
  48201. return false;
  48202. }
  48203. var _l = Math.max(lineWidth, 5); // Quick reject
  48204. 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) {
  48205. return false;
  48206. }
  48207. var d = this.curve.quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);
  48208. return d <= _l / 2;
  48209. }
  48210. /**
  48211. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideArcStroke
  48212. * @description 圆弧描边包含判断。
  48213. * @param {number} cx - 圆心横坐标。
  48214. * @param {number} cy - 圆心纵坐标。
  48215. * @param {number} r - 圆半径。
  48216. * @param {number} startAngle - 起始角度。
  48217. * @param {number} endAngle - 终止角度。
  48218. * @param {number} anticlockwise - 顺时针还是逆时针。
  48219. * @param {number} lineWidth - 线宽。
  48220. * @param {number} x - 鼠标位置横坐标。
  48221. * @param {number} y - 鼠标位置纵坐标。
  48222. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  48223. */
  48224. }, {
  48225. key: "isInsideArcStroke",
  48226. value: function isInsideArcStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {
  48227. var PI2 = this.PI2;
  48228. if (lineWidth === 0) {
  48229. return false;
  48230. }
  48231. var _l = Math.max(lineWidth, 5);
  48232. x -= cx;
  48233. y -= cy;
  48234. var d = Math.sqrt(x * x + y * y);
  48235. if (d - _l > r || d + _l < r) {
  48236. return false;
  48237. }
  48238. if (Math.abs(startAngle - endAngle) >= PI2) {
  48239. // Is a circle
  48240. return true;
  48241. }
  48242. if (anticlockwise) {
  48243. var tmp = startAngle;
  48244. startAngle = this.normalizeRadian(endAngle);
  48245. endAngle = this.normalizeRadian(tmp);
  48246. } else {
  48247. startAngle = this.normalizeRadian(startAngle);
  48248. endAngle = this.normalizeRadian(endAngle);
  48249. }
  48250. if (startAngle > endAngle) {
  48251. endAngle += PI2;
  48252. }
  48253. var angle = Math.atan2(y, x);
  48254. if (angle < 0) {
  48255. angle += PI2;
  48256. }
  48257. return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle;
  48258. }
  48259. /**
  48260. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideBrokenLine
  48261. * @description 图形 BrokenLine 是否包含鼠标位置, true表示坐标处在图形内。
  48262. * @param {Array} points - 曲线点对象。
  48263. * @param {number} lineWidth - 线宽。
  48264. * @param {number} x - 鼠标位置横坐标。
  48265. * @param {number} y - 鼠标位置纵坐标。
  48266. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  48267. */
  48268. }, {
  48269. key: "isInsideBrokenLine",
  48270. value: function isInsideBrokenLine(points, lineWidth, x, y) {
  48271. var _lineWidth = Math.max(lineWidth, 10);
  48272. for (var i = 0, l = points.length - 1; i < l; i++) {
  48273. var x0 = points[i][0];
  48274. var y0 = points[i][1];
  48275. var x1 = points[i + 1][0];
  48276. var y1 = points[i + 1][1];
  48277. if (this.isInsideLine(x0, y0, x1, y1, _lineWidth, x, y)) {
  48278. return true;
  48279. }
  48280. }
  48281. return false;
  48282. }
  48283. /**
  48284. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideRing
  48285. * @description 图形 Ring 是否包含鼠标位置, true表示坐标处在图形内。
  48286. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  48287. */
  48288. }, {
  48289. key: "isInsideRing",
  48290. value: function isInsideRing(cx, cy, r0, r, x, y) {
  48291. var d = (x - cx) * (x - cx) + (y - cy) * (y - cy);
  48292. return d < r * r && d > r0 * r0;
  48293. }
  48294. /**
  48295. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideRect
  48296. * @description 图形 Rect 是否包含鼠标位置, true表示坐标处在图形内。
  48297. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  48298. */
  48299. }, {
  48300. key: "isInsideRect",
  48301. value: function isInsideRect(x0, y0, width, height, x, y) {
  48302. return x >= x0 && x <= x0 + width && y >= y0 && y <= y0 + height;
  48303. }
  48304. /**
  48305. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideCircle
  48306. * @description 图形 Circle 是否包含鼠标位置, true表示坐标处在图形内。
  48307. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  48308. */
  48309. }, {
  48310. key: "isInsideCircle",
  48311. value: function isInsideCircle(x0, y0, r, x, y) {
  48312. return (x - x0) * (x - x0) + (y - y0) * (y - y0) < r * r;
  48313. }
  48314. /**
  48315. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideSector
  48316. * @description 图形 Sector 是否包含鼠标位置, true表示坐标处在图形内。
  48317. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  48318. */
  48319. }, {
  48320. key: "isInsideSector",
  48321. value: function isInsideSector(cx, cy, r0, r, startAngle, endAngle, anticlockwise, x, y) {
  48322. return this.isInsideArcStroke(cx, cy, (r0 + r) / 2, startAngle, endAngle, anticlockwise, r - r0, x, y);
  48323. }
  48324. /**
  48325. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsidePolygon
  48326. * @description 图形 Polygon 是否包含鼠标位置, true表示坐标处在图形内。与 canvas 一样采用 non-zero winding rule
  48327. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  48328. */
  48329. }, {
  48330. key: "isInsidePolygon",
  48331. value: function isInsidePolygon(points, x, y) {
  48332. var N = points.length;
  48333. var w = 0;
  48334. for (var i = 0, j = N - 1; i < N; i++) {
  48335. var x0 = points[j][0];
  48336. var y0 = points[j][1];
  48337. var x1 = points[i][0];
  48338. var y1 = points[i][1];
  48339. w += this.windingLine(x0, y0, x1, y1, x, y);
  48340. j = i;
  48341. }
  48342. return w !== 0;
  48343. }
  48344. /**
  48345. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingLine
  48346. */
  48347. }, {
  48348. key: "windingLine",
  48349. value: function windingLine(x0, y0, x1, y1, x, y) {
  48350. if (y > y0 && y > y1 || y < y0 && y < y1) {
  48351. return 0;
  48352. }
  48353. if (y1 == y0) {
  48354. return 0;
  48355. }
  48356. var dir = y1 < y0 ? 1 : -1;
  48357. var t = (y - y0) / (y1 - y0);
  48358. var x_ = t * (x1 - x0) + x0;
  48359. return x_ > x ? dir : 0;
  48360. }
  48361. /**
  48362. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.swapExtrema
  48363. */
  48364. }, {
  48365. key: "swapExtrema",
  48366. value: function swapExtrema() {
  48367. var tmp = this.extrema[0];
  48368. this.extrema[0] = this.extrema[1];
  48369. this.extrema[1] = tmp;
  48370. }
  48371. /**
  48372. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingCubic
  48373. */
  48374. }, {
  48375. key: "windingCubic",
  48376. value: function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {
  48377. var curve = this.curve;
  48378. var roots = this.roots;
  48379. var extrema = this.extrema; // Quick reject
  48380. if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) {
  48381. return 0;
  48382. }
  48383. var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);
  48384. if (nRoots === 0) {
  48385. return 0;
  48386. } else {
  48387. var w = 0;
  48388. var nExtrema = -1;
  48389. var y0_, y1_;
  48390. for (var i = 0; i < nRoots; i++) {
  48391. var t = roots[i];
  48392. var x_ = curve.cubicAt(x0, x1, x2, x3, t);
  48393. if (x_ < x) {
  48394. // Quick reject
  48395. continue;
  48396. }
  48397. if (nExtrema < 0) {
  48398. nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);
  48399. if (extrema[1] < extrema[0] && nExtrema > 1) {
  48400. this.swapExtrema();
  48401. }
  48402. y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);
  48403. if (nExtrema > 1) {
  48404. y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);
  48405. }
  48406. }
  48407. if (nExtrema == 2) {
  48408. // 分成三段单调函数
  48409. if (t < extrema[0]) {
  48410. w += y0_ < y0 ? 1 : -1;
  48411. } else if (t < extrema[1]) {
  48412. w += y1_ < y0_ ? 1 : -1;
  48413. } else {
  48414. w += y3 < y1_ ? 1 : -1;
  48415. }
  48416. } else {
  48417. // 分成两段单调函数
  48418. if (t < extrema[0]) {
  48419. w += y0_ < y0 ? 1 : -1;
  48420. } else {
  48421. w += y3 < y0_ ? 1 : -1;
  48422. }
  48423. }
  48424. }
  48425. return w;
  48426. }
  48427. }
  48428. /**
  48429. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingQuadratic
  48430. */
  48431. }, {
  48432. key: "windingQuadratic",
  48433. value: function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {
  48434. var curve = this.curve;
  48435. var roots = this.roots; // Quick reject
  48436. if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) {
  48437. return 0;
  48438. }
  48439. var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);
  48440. if (nRoots === 0) {
  48441. return 0;
  48442. } else {
  48443. var t = curve.quadraticExtremum(y0, y1, y2);
  48444. if (t >= 0 && t <= 1) {
  48445. var w = 0;
  48446. var y_ = curve.quadraticAt(y0, y1, y2, t);
  48447. for (var i = 0; i < nRoots; i++) {
  48448. var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);
  48449. if (x_ > x) {
  48450. continue;
  48451. }
  48452. if (roots[i] < t) {
  48453. w += y_ < y0 ? 1 : -1;
  48454. } else {
  48455. w += y2 < y_ ? 1 : -1;
  48456. }
  48457. }
  48458. return w;
  48459. } else {
  48460. var _x_ = curve.quadraticAt(x0, x1, x2, roots[0]);
  48461. if (_x_ > x) {
  48462. return 0;
  48463. }
  48464. return y2 < y0 ? 1 : -1;
  48465. }
  48466. }
  48467. }
  48468. /**
  48469. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingArc
  48470. * // TODO Arc 旋转
  48471. */
  48472. }, {
  48473. key: "windingArc",
  48474. value: function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {
  48475. var roots = this.roots;
  48476. var PI2 = this.PI2;
  48477. y -= cy;
  48478. if (y > r || y < -r) {
  48479. return 0;
  48480. }
  48481. var tmp = Math.sqrt(r * r - y * y);
  48482. roots[0] = -tmp;
  48483. roots[1] = tmp;
  48484. if (Math.abs(startAngle - endAngle) >= PI2) {
  48485. // Is a circle
  48486. startAngle = 0;
  48487. endAngle = PI2;
  48488. var dir = anticlockwise ? 1 : -1;
  48489. if (x >= roots[0] + cx && x <= roots[1] + cx) {
  48490. return dir;
  48491. } else {
  48492. return 0;
  48493. }
  48494. }
  48495. if (anticlockwise) {
  48496. var _tmp = startAngle;
  48497. startAngle = this.normalizeRadian(endAngle);
  48498. endAngle = this.normalizeRadian(_tmp);
  48499. } else {
  48500. startAngle = this.normalizeRadian(startAngle);
  48501. endAngle = this.normalizeRadian(endAngle);
  48502. }
  48503. if (startAngle > endAngle) {
  48504. endAngle += PI2;
  48505. }
  48506. var w = 0;
  48507. for (var i = 0; i < 2; i++) {
  48508. var x_ = roots[i];
  48509. if (x_ + cx > x) {
  48510. var angle = Math.atan2(y, x_);
  48511. var _dir = anticlockwise ? 1 : -1;
  48512. if (angle < 0) {
  48513. angle = PI2 + angle;
  48514. }
  48515. if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {
  48516. if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {
  48517. _dir = -_dir;
  48518. }
  48519. w += _dir;
  48520. }
  48521. }
  48522. }
  48523. return w;
  48524. }
  48525. /**
  48526. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsidePath
  48527. * @description 与 canvas 一样采用 non-zero winding rule
  48528. */
  48529. }, {
  48530. key: "isInsidePath",
  48531. value: function isInsidePath(pathArray, lineWidth, brushType, x, y) {
  48532. var w = 0;
  48533. var xi = 0;
  48534. var yi = 0;
  48535. var x0 = 0;
  48536. var y0 = 0;
  48537. var beginSubpath = true;
  48538. var firstCmd = true;
  48539. brushType = brushType || 'fill';
  48540. var hasStroke = brushType === 'stroke' || brushType === 'both';
  48541. var hasFill = brushType === 'fill' || brushType === 'both'; // var roots = [-1, -1, -1];
  48542. for (var i = 0; i < pathArray.length; i++) {
  48543. var seg = pathArray[i];
  48544. var p = seg.points; // Begin a new subpath
  48545. if (beginSubpath || seg.command === 'M') {
  48546. if (i > 0) {
  48547. // Close previous subpath
  48548. if (hasFill) {
  48549. w += this.windingLine(xi, yi, x0, y0, x, y);
  48550. }
  48551. if (w !== 0) {
  48552. return true;
  48553. }
  48554. }
  48555. x0 = p[p.length - 2];
  48556. y0 = p[p.length - 1];
  48557. beginSubpath = false;
  48558. if (firstCmd && seg.command !== 'A') {
  48559. // 如果第一个命令不是M, 是lineTo, bezierCurveTo
  48560. // 等绘制命令的话,是会从该绘制的起点开始算的
  48561. // Arc 会在之后做单独处理所以这里忽略
  48562. firstCmd = false;
  48563. xi = x0;
  48564. yi = y0;
  48565. }
  48566. }
  48567. switch (seg.command) {
  48568. case 'M':
  48569. xi = p[0];
  48570. yi = p[1];
  48571. break;
  48572. case 'L':
  48573. if (hasStroke) {
  48574. if (this.isInsideLine(xi, yi, p[0], p[1], lineWidth, x, y)) {
  48575. return true;
  48576. }
  48577. }
  48578. if (hasFill) {
  48579. w += this.windingLine(xi, yi, p[0], p[1], x, y);
  48580. }
  48581. xi = p[0];
  48582. yi = p[1];
  48583. break;
  48584. case 'C':
  48585. if (hasStroke) {
  48586. if (this.isInsideCubicStroke(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], lineWidth, x, y)) {
  48587. return true;
  48588. }
  48589. }
  48590. if (hasFill) {
  48591. w += this.windingCubic(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y);
  48592. }
  48593. xi = p[4];
  48594. yi = p[5];
  48595. break;
  48596. case 'Q':
  48597. if (hasStroke) {
  48598. if (this.isInsideQuadraticStroke(xi, yi, p[0], p[1], p[2], p[3], lineWidth, x, y)) {
  48599. return true;
  48600. }
  48601. }
  48602. if (hasFill) {
  48603. w += this.windingQuadratic(xi, yi, p[0], p[1], p[2], p[3], x, y);
  48604. }
  48605. xi = p[2];
  48606. yi = p[3];
  48607. break;
  48608. case 'A':
  48609. // TODO Arc 旋转
  48610. // TODO Arc 判断的开销比较大
  48611. var cx = p[0];
  48612. var cy = p[1];
  48613. var rx = p[2];
  48614. var ry = p[3];
  48615. var theta = p[4];
  48616. var dTheta = p[5];
  48617. var x1 = Math.cos(theta) * rx + cx;
  48618. var y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令
  48619. if (!firstCmd) {
  48620. w += this.windingLine(xi, yi, x1, y1);
  48621. } else {
  48622. firstCmd = false; // 第一个命令起点还未定义
  48623. x0 = x1;
  48624. y0 = y1;
  48625. } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放
  48626. var _x = (x - cx) * ry / rx + cx;
  48627. if (hasStroke) {
  48628. if (this.isInsideArcStroke(cx, cy, ry, theta, theta + dTheta, 1 - p[7], lineWidth, _x, y)) {
  48629. return true;
  48630. }
  48631. }
  48632. if (hasFill) {
  48633. w += this.windingArc(cx, cy, ry, theta, theta + dTheta, 1 - p[7], _x, y);
  48634. }
  48635. xi = Math.cos(theta + dTheta) * rx + cx;
  48636. yi = Math.sin(theta + dTheta) * ry + cy;
  48637. break;
  48638. case 'z':
  48639. if (hasStroke) {
  48640. if (this.isInsideLine(xi, yi, x0, y0, lineWidth, x, y)) {
  48641. return true;
  48642. }
  48643. }
  48644. beginSubpath = true;
  48645. break;
  48646. }
  48647. }
  48648. if (hasFill) {
  48649. w += this.windingLine(xi, yi, x0, y0, x, y);
  48650. }
  48651. return w !== 0;
  48652. }
  48653. /**
  48654. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.getTextWidth
  48655. * @description 测算多行文本宽度
  48656. */
  48657. }, {
  48658. key: "getTextWidth",
  48659. value: function getTextWidth(text, textFont) {
  48660. var key = text + ':' + textFont;
  48661. if (this._textWidthCache[key]) {
  48662. return this._textWidthCache[key];
  48663. }
  48664. this._ctx = this._ctx || this.util.getContext();
  48665. this._ctx.save();
  48666. if (textFont) {
  48667. this._ctx.font = textFont;
  48668. }
  48669. text = (text + '').split('\n');
  48670. var width = 0;
  48671. for (var i = 0, l = text.length; i < l; i++) {
  48672. width = Math.max(this._ctx.measureText(text[i]).width, width);
  48673. }
  48674. this._ctx.restore();
  48675. this._textWidthCache[key] = width;
  48676. if (++this._textWidthCacheCounter > this.TEXT_CACHE_MAX) {
  48677. // 内存释放
  48678. this._textWidthCacheCounter = 0;
  48679. this._textWidthCache = {};
  48680. }
  48681. return width;
  48682. }
  48683. /**
  48684. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.getTextHeight
  48685. * @description 测算多行文本高度
  48686. */
  48687. }, {
  48688. key: "getTextHeight",
  48689. value: function getTextHeight(text, textFont) {
  48690. var key = text + ':' + textFont;
  48691. if (this._textHeightCache[key]) {
  48692. return this._textHeightCache[key];
  48693. }
  48694. this._ctx = this._ctx || this.util.getContext();
  48695. this._ctx.save();
  48696. if (textFont) {
  48697. this._ctx.font = textFont;
  48698. }
  48699. text = (text + '').split('\n'); // 比较粗暴
  48700. //var height = (this._ctx.measureText('国').width + 2) * text.length; //打包不支持中文,替换掉
  48701. var height = (this._ctx.measureText('ZH').width + 2) * text.length;
  48702. this._ctx.restore();
  48703. this._textHeightCache[key] = height;
  48704. if (++this._textHeightCacheCounter > this.TEXT_CACHE_MAX) {
  48705. // 内存释放
  48706. this._textHeightCacheCounter = 0;
  48707. this._textHeightCache = {};
  48708. }
  48709. return height;
  48710. }
  48711. }]);
  48712. return Area;
  48713. }();
  48714. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/ComputeBoundingBox.js
  48715. function ComputeBoundingBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48716. 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); } }
  48717. function ComputeBoundingBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeBoundingBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeBoundingBox_defineProperties(Constructor, staticProps); return Constructor; }
  48718. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  48719. * This program are made available under the terms of the Apache License, Version 2.0
  48720. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48721. /**
  48722. * @class SuperMap.LevelRenderer.Tool.ComputeBoundingBox
  48723. * @category Visualization Theme
  48724. * @classdesc LevelRenderer 工具-图形 Bounds 计算
  48725. * @private
  48726. */
  48727. var ComputeBoundingBox_ComputeBoundingBox = /*#__PURE__*/function () {
  48728. /**
  48729. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.constructor
  48730. * @description 构造函数。
  48731. */
  48732. function ComputeBoundingBox() {
  48733. ComputeBoundingBox_classCallCheck(this, ComputeBoundingBox);
  48734. if (arguments.length === 3) {
  48735. this.computeBoundingBox(arguments);
  48736. }
  48737. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.ComputeBoundingBox";
  48738. }
  48739. /**
  48740. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.computeBoundingBox
  48741. * @description 从顶点数组中计算出最小包围盒,写入'min'和'max'中。
  48742. * @param {Array.<Object>} points - 顶点数组。
  48743. * @param {Array} min - 最小
  48744. * @param {Array} max - 最大
  48745. */
  48746. ComputeBoundingBox_createClass(ComputeBoundingBox, [{
  48747. key: "computeBoundingBox",
  48748. value: function computeBoundingBox(points, min, max) {
  48749. if (points.length === 0) {
  48750. return;
  48751. }
  48752. var left = points[0][0];
  48753. var right = points[0][0];
  48754. var top = points[0][1];
  48755. var bottom = points[0][1];
  48756. for (var i = 1; i < points.length; i++) {
  48757. var p = points[i];
  48758. if (p[0] < left) {
  48759. left = p[0];
  48760. }
  48761. if (p[0] > right) {
  48762. right = p[0];
  48763. }
  48764. if (p[1] < top) {
  48765. top = p[1];
  48766. }
  48767. if (p[1] > bottom) {
  48768. bottom = p[1];
  48769. }
  48770. }
  48771. min[0] = left;
  48772. min[1] = top;
  48773. max[0] = right;
  48774. max[1] = bottom;
  48775. }
  48776. /**
  48777. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.cubeBezier
  48778. * @description 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入'min'和'max'中。原:computeCubeBezierBoundingBox。
  48779. * @param {Array.<number>} p0 - 三阶贝塞尔曲线p0点
  48780. * @param {Array.<number>} p1 - 三阶贝塞尔曲线p1点
  48781. * @param {Array.<number>} p2 - 三阶贝塞尔曲线p2点
  48782. * @param {Array.<number>} p3 - 三阶贝塞尔曲线p3点
  48783. * @param {Array.<number>} min - 最小
  48784. * @param {Array.<number>} max - 最大
  48785. */
  48786. }, {
  48787. key: "cubeBezier",
  48788. value: function cubeBezier(p0, p1, p2, p3, min, max) {
  48789. var curve = new levelRenderer_Curve_Curve();
  48790. var xDim = [];
  48791. curve.cubicExtrema(p0[0], p1[0], p2[0], p3[0], xDim);
  48792. for (var i = 0; i < xDim.length; i++) {
  48793. xDim[i] = curve.cubicAt(p0[0], p1[0], p2[0], p3[0], xDim[i]);
  48794. }
  48795. var yDim = [];
  48796. curve.cubicExtrema(p0[1], p1[1], p2[1], p3[1], yDim);
  48797. for (var _i = 0; _i < yDim.length; _i++) {
  48798. yDim[_i] = curve.cubicAt(p0[1], p1[1], p2[1], p3[1], yDim[_i]);
  48799. }
  48800. xDim.push(p0[0], p3[0]);
  48801. yDim.push(p0[1], p3[1]);
  48802. var left = Math.min.apply(null, xDim);
  48803. var right = Math.max.apply(null, xDim);
  48804. var top = Math.min.apply(null, yDim);
  48805. var bottom = Math.max.apply(null, yDim);
  48806. min[0] = left;
  48807. min[1] = top;
  48808. max[0] = right;
  48809. max[1] = bottom;
  48810. }
  48811. /**
  48812. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.quadraticBezier
  48813. * @description 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入'min'和'max'中。原:computeQuadraticBezierBoundingBox。
  48814. * @param {Array.<number>} p0 - 二阶贝塞尔曲线p0点
  48815. * @param {Array.<number>} p1 - 二阶贝塞尔曲线p1点
  48816. * @param {Array.<number>} p2 - 二阶贝塞尔曲线p2点
  48817. * @param {Array.<number>} min - 最小
  48818. * @param {Array.<number>} max - 最大
  48819. */
  48820. }, {
  48821. key: "quadraticBezier",
  48822. value: function quadraticBezier(p0, p1, p2, min, max) {
  48823. var curve = new levelRenderer_Curve_Curve(); // Find extremities, where derivative in x dim or y dim is zero
  48824. var t1 = curve.quadraticExtremum(p0[0], p1[0], p2[0]);
  48825. var t2 = curve.quadraticExtremum(p0[1], p1[1], p2[1]);
  48826. t1 = Math.max(Math.min(t1, 1), 0);
  48827. t2 = Math.max(Math.min(t2, 1), 0);
  48828. var ct1 = 1 - t1;
  48829. var ct2 = 1 - t2;
  48830. var x1 = ct1 * ct1 * p0[0] + 2 * ct1 * t1 * p1[0] + t1 * t1 * p2[0];
  48831. var y1 = ct1 * ct1 * p0[1] + 2 * ct1 * t1 * p1[1] + t1 * t1 * p2[1];
  48832. var x2 = ct2 * ct2 * p0[0] + 2 * ct2 * t2 * p1[0] + t2 * t2 * p2[0];
  48833. var y2 = ct2 * ct2 * p0[1] + 2 * ct2 * t2 * p1[1] + t2 * t2 * p2[1];
  48834. min[0] = Math.min(p0[0], p2[0], x1, x2);
  48835. min[1] = Math.min(p0[1], p2[1], y1, y2);
  48836. max[0] = Math.max(p0[0], p2[0], x1, x2);
  48837. max[1] = Math.max(p0[1], p2[1], y1, y2);
  48838. }
  48839. /**
  48840. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.arc
  48841. * @description 从圆弧中计算出最小包围盒,写入'min'和'max'中。原:computeArcBoundingBox。
  48842. * @param {number} x - 圆弧中心点 x
  48843. * @param {number} y - 圆弧中心点 y
  48844. * @param {number} r - 圆弧半径
  48845. * @param {number} startAngle - 圆弧开始角度
  48846. * @param {number} endAngle - 圆弧结束角度
  48847. * @param {number} anticlockwise - 是否是顺时针
  48848. * @param {number} min - 最小
  48849. * @param {number} max - 最大
  48850. */
  48851. }, {
  48852. key: "arc",
  48853. value: function arc(x, y, r, startAngle, endAngle, anticlockwise, min, max) {
  48854. var vec2 = new levelRenderer_Vector_Vector();
  48855. var start = vec2.create();
  48856. var end = vec2.create();
  48857. var extremity = vec2.create();
  48858. start[0] = Math.cos(startAngle) * r + x;
  48859. start[1] = Math.sin(startAngle) * r + y;
  48860. end[0] = Math.cos(endAngle) * r + x;
  48861. end[1] = Math.sin(endAngle) * r + y;
  48862. vec2.min(min, start, end);
  48863. vec2.max(max, start, end); // Thresh to [0, Math.PI * 2]
  48864. startAngle = startAngle % (Math.PI * 2);
  48865. if (startAngle < 0) {
  48866. startAngle = startAngle + Math.PI * 2;
  48867. }
  48868. endAngle = endAngle % (Math.PI * 2);
  48869. if (endAngle < 0) {
  48870. endAngle = endAngle + Math.PI * 2;
  48871. }
  48872. if (startAngle > endAngle && !anticlockwise) {
  48873. endAngle += Math.PI * 2;
  48874. } else if (startAngle < endAngle && anticlockwise) {
  48875. startAngle += Math.PI * 2;
  48876. }
  48877. if (anticlockwise) {
  48878. var tmp = endAngle;
  48879. endAngle = startAngle;
  48880. startAngle = tmp;
  48881. } // var number = 0;
  48882. // var step = (anticlockwise ? -Math.PI : Math.PI) / 2;
  48883. for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {
  48884. if (angle > startAngle) {
  48885. extremity[0] = Math.cos(angle) * r + x;
  48886. extremity[1] = Math.sin(angle) * r + y;
  48887. vec2.min(min, extremity, min);
  48888. vec2.max(max, extremity, max);
  48889. }
  48890. }
  48891. }
  48892. }]);
  48893. return ComputeBoundingBox;
  48894. }();
  48895. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Env.js
  48896. function Env_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48897. 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); } }
  48898. function Env_createClass(Constructor, protoProps, staticProps) { if (protoProps) Env_defineProperties(Constructor.prototype, protoProps); if (staticProps) Env_defineProperties(Constructor, staticProps); return Constructor; }
  48899. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  48900. * This program are made available under the terms of the Apache License, Version 2.0
  48901. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48902. /**
  48903. * @class SuperMap.LevelRenderer.Tool.Env
  48904. * @category Visualization Theme
  48905. * @classdesc 环境识别
  48906. * @private
  48907. */
  48908. var Env = /*#__PURE__*/function () {
  48909. function Env() {
  48910. Env_classCallCheck(this, Env);
  48911. // Zepto.js
  48912. // (c) 2010-2013 Thomas Fuchs
  48913. // Zepto.js may be freely distributed under the MIT license.
  48914. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Env";
  48915. var me = this;
  48916. function detect(ua) {
  48917. var os = me.os = {};
  48918. var browser = me.browser = {};
  48919. var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/);
  48920. var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
  48921. var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
  48922. var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
  48923. var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
  48924. var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/);
  48925. var touchpad = webos && ua.match(/TouchPad/);
  48926. var kindle = ua.match(/Kindle\/([\d.]+)/);
  48927. var silk = ua.match(/Silk\/([\d._]+)/);
  48928. var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/);
  48929. var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/);
  48930. var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/);
  48931. var playbook = ua.match(/PlayBook/);
  48932. var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/);
  48933. var firefox = ua.match(/Firefox\/([\d.]+)/);
  48934. var ie = ua.match(/MSIE ([\d.]+)/);
  48935. var safari = webkit && ua.match(/Mobile\//) && !chrome;
  48936. var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; // Todo: clean this up with a better OS/browser seperation:
  48937. // - discern (more) between multiple browsers on android
  48938. // - decide if kindle fire in silk mode is android or not
  48939. // - Firefox on Android doesn't specify the Android version
  48940. // - possibly devide in os, device and browser hashes
  48941. /*eslint-disable*/
  48942. if (browser.webkit = !!webkit) {
  48943. browser.version = webkit[1];
  48944. }
  48945. if (android) {
  48946. os.android = true;
  48947. os.version = android[2];
  48948. }
  48949. if (iphone && !ipod) {
  48950. os.ios = os.iphone = true;
  48951. os.version = iphone[2].replace(/_/g, '.');
  48952. }
  48953. if (ipad) {
  48954. os.ios = os.ipad = true;
  48955. os.version = ipad[2].replace(/_/g, '.');
  48956. }
  48957. if (ipod) {
  48958. os.ios = os.ipod = true;
  48959. os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
  48960. }
  48961. if (webos) {
  48962. os.webos = true;
  48963. os.version = webos[2];
  48964. }
  48965. if (touchpad) {
  48966. os.touchpad = true;
  48967. }
  48968. if (blackberry) {
  48969. os.blackberry = true;
  48970. os.version = blackberry[2];
  48971. }
  48972. if (bb10) {
  48973. os.bb10 = true;
  48974. os.version = bb10[2];
  48975. }
  48976. if (rimtabletos) {
  48977. os.rimtabletos = true;
  48978. os.version = rimtabletos[2];
  48979. }
  48980. if (playbook) {
  48981. browser.playbook = true;
  48982. }
  48983. if (kindle) {
  48984. os.kindle = true;
  48985. os.version = kindle[1];
  48986. }
  48987. if (silk) {
  48988. browser.silk = true;
  48989. browser.version = silk[1];
  48990. }
  48991. if (!silk && os.android && ua.match(/Kindle Fire/)) {
  48992. browser.silk = true;
  48993. }
  48994. if (chrome) {
  48995. browser.chrome = true;
  48996. browser.version = chrome[1];
  48997. }
  48998. if (firefox) {
  48999. browser.firefox = true;
  49000. browser.version = firefox[1];
  49001. }
  49002. if (ie) {
  49003. browser.ie = true;
  49004. browser.version = ie[1];
  49005. }
  49006. if (safari && (ua.match(/Safari/) || !!os.ios)) {
  49007. browser.safari = true;
  49008. }
  49009. if (webview) {
  49010. browser.webview = true;
  49011. }
  49012. if (ie) {
  49013. browser.ie = true;
  49014. browser.version = ie[1];
  49015. }
  49016. os.tablet = !!(ipad || playbook || android && !ua.match(/Mobile/) || firefox && ua.match(/Tablet/) || ie && !ua.match(/Phone/) && ua.match(/Touch/));
  49017. 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/)));
  49018. return {
  49019. browser: browser,
  49020. os: os,
  49021. // 原生canvas支持
  49022. canvasSupported: document.createElement('canvas').getContext ? true : false
  49023. };
  49024. }
  49025. return detect(navigator.userAgent);
  49026. }
  49027. Env_createClass(Env, [{
  49028. key: "destory",
  49029. value: function destory() {
  49030. return true;
  49031. }
  49032. }]);
  49033. return Env;
  49034. }();
  49035. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Event.js
  49036. function Event_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49037. 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); } }
  49038. function Event_createClass(Constructor, protoProps, staticProps) { if (protoProps) Event_defineProperties(Constructor.prototype, protoProps); if (staticProps) Event_defineProperties(Constructor, staticProps); return Constructor; }
  49039. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  49040. * This program are made available under the terms of the Apache License, Version 2.0
  49041. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49042. /**
  49043. * @class SuperMap.LevelRenderer.Tool.Event
  49044. * @category Visualization Theme
  49045. * @classdesc LevelRenderer 工具-事件辅助类
  49046. * @private
  49047. */
  49048. var Event_Event = /*#__PURE__*/function () {
  49049. /**
  49050. * @function SuperMap.LevelRenderer.Tool.Event.prototype.constructor
  49051. * @description 构造函数。
  49052. */
  49053. function Event() {
  49054. Event_classCallCheck(this, Event);
  49055. /**
  49056. * @member {function} SuperMap.LevelRenderer.Tool.Event.prototype.stop
  49057. * @description 停止冒泡和阻止默认行为
  49058. */
  49059. this.stop = typeof window.addEventListener === 'function' ? function (e) {
  49060. e.preventDefault();
  49061. e.stopPropagation();
  49062. e.cancelBubble = true;
  49063. } : function (e) {
  49064. e.returnValue = false;
  49065. e.cancelBubble = true;
  49066. };
  49067. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Event";
  49068. }
  49069. /**
  49070. * @function SuperMap.LevelRenderer.Tool.Event.prototype.getX
  49071. * @description 提取鼠标(手指)x坐标。
  49072. * @param {Event} e - 事件。
  49073. * @returns {number} 鼠标(手指)x坐标。
  49074. */
  49075. Event_createClass(Event, [{
  49076. key: "getX",
  49077. value: function getX(e) {
  49078. 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;
  49079. }
  49080. /**
  49081. * @function SuperMap.LevelRenderer.Tool.Event.prototype.getY
  49082. * @description 提取鼠标(手指)y坐标。
  49083. * @param {Event} e - 事件。
  49084. * @returns {number} 鼠标(手指)y坐标。
  49085. */
  49086. }, {
  49087. key: "getY",
  49088. value: function getY(e) {
  49089. 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;
  49090. }
  49091. /**
  49092. * @function SuperMap.LevelRenderer.Tool.Event.prototype.getDelta
  49093. * @description 提取鼠标滚轮变化。
  49094. * @param {Event} e - 事件。
  49095. * @returns {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动。
  49096. */
  49097. }, {
  49098. key: "getDelta",
  49099. value: function getDelta(e) {
  49100. return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail;
  49101. }
  49102. }]);
  49103. return Event;
  49104. }();
  49105. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Http.js
  49106. 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); }
  49107. function Http_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49108. 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); } }
  49109. function Http_createClass(Constructor, protoProps, staticProps) { if (protoProps) Http_defineProperties(Constructor.prototype, protoProps); if (staticProps) Http_defineProperties(Constructor, staticProps); return Constructor; }
  49110. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  49111. * This program are made available under the terms of the Apache License, Version 2.0
  49112. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49113. /**
  49114. * @private
  49115. * @class SuperMap.LevelRenderer.Tool.Http
  49116. * @category Visualization Theme
  49117. * @classdesc LevelRenderer 工具-Http
  49118. */
  49119. var Http = /*#__PURE__*/function () {
  49120. /**
  49121. * @function SuperMap.LevelRenderer.Tool.Http.constructor
  49122. * @description 构造函数。
  49123. */
  49124. function Http() {
  49125. Http_classCallCheck(this, Http);
  49126. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Http";
  49127. }
  49128. /**
  49129. * @function SuperMap.LevelRenderer.Tool.Http.prototype.get
  49130. * @description get请求。
  49131. * @param {(string|IHTTPGetOption)} url - 请求url
  49132. * @param {function} onsuccess - 请求成功函数
  49133. * @param {function} onerror - 请求失败函数
  49134. * @param {Object} opts - 额外参数
  49135. * @returns {number} cos值
  49136. */
  49137. Http_createClass(Http, [{
  49138. key: "get",
  49139. value: function get(url, onsuccess, onerror) {
  49140. if (Http_typeof(url) === 'object') {
  49141. var obj = url;
  49142. url = obj.url;
  49143. onsuccess = obj.onsuccess;
  49144. onerror = obj.onerror;
  49145. }
  49146. var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new window.ActiveXObject('Microsoft.XMLHTTP');
  49147. xhr.open('GET', url, true);
  49148. xhr.onreadystatechange = function () {
  49149. if (xhr.readyState == 4) {
  49150. if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
  49151. onsuccess && onsuccess(xhr.responseText);
  49152. } else {
  49153. onerror && onerror();
  49154. }
  49155. xhr.onreadystatechange = new Function();
  49156. xhr = null;
  49157. }
  49158. };
  49159. xhr.send(null);
  49160. }
  49161. }]);
  49162. return Http;
  49163. }();
  49164. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Config.js
  49165. function Config_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49166. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  49167. * This program are made available under the terms of the Apache License, Version 2.0
  49168. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49169. var Config = function Config() {
  49170. Config_classCallCheck(this, Config);
  49171. };
  49172. /**
  49173. * @enum EVENT
  49174. * @description 事件
  49175. * @type {Object}
  49176. * @private
  49177. */
  49178. Config.EVENT = {
  49179. //窗口大小变化
  49180. RESIZE: 'resize',
  49181. //鼠标按钮被(手指)按下,事件对象是:目标图形元素或空
  49182. CLICK: 'click',
  49183. //双击事件
  49184. DBLCLICK: 'dblclick',
  49185. //鼠标滚轮变化,事件对象是:目标图形元素或空
  49186. MOUSEWHEEL: 'mousewheel',
  49187. //鼠标(手指)被移动,事件对象是:目标图形元素或空
  49188. MOUSEMOVE: 'mousemove',
  49189. //鼠标移到某图形元素之上,事件对象是:目标图形元素
  49190. MOUSEOVER: 'mouseover',
  49191. //鼠标从某图形元素移开,事件对象是:目标图形元素
  49192. MOUSEOUT: 'mouseout',
  49193. //鼠标按钮(手指)被按下,事件对象是:目标图形元素或空
  49194. MOUSEDOWN: 'mousedown',
  49195. //鼠标按键(手指)被松开,事件对象是:目标图形元素或空
  49196. MOUSEUP: 'mouseup',
  49197. //全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定
  49198. GLOBALOUT: 'globalout',
  49199. // 一次成功元素拖拽的行为事件过程是:
  49200. // dragstart > dragenter > dragover [> dragleave] > drop > dragend
  49201. //开始拖拽时触发,事件对象是:被拖拽图形元素
  49202. DRAGSTART: 'dragstart',
  49203. //拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素
  49204. DRAGEND: 'dragend',
  49205. //拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素
  49206. DRAGENTER: 'dragenter',
  49207. //拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素
  49208. DRAGOVER: 'dragover',
  49209. //拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素
  49210. DRAGLEAVE: 'dragleave',
  49211. //拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素
  49212. DROP: 'drop',
  49213. //touch end - start < delay is click
  49214. touchClickDelay: 300
  49215. };
  49216. /**
  49217. * @enum catchBrushException
  49218. * @description 是否异常捕获
  49219. * @type {boolean}
  49220. * @private
  49221. */
  49222. Config.catchBrushException = false;
  49223. /**
  49224. * @enum debugMode
  49225. * @description debug 日志选项:catchBrushException 为 true 下有效。
  49226. * 0 : 不生成debug数据,发布用
  49227. * 1 : 异常抛出,调试用
  49228. * 2 : 控制台输出,调试用
  49229. * @type {boolean}
  49230. * @private
  49231. */
  49232. Config.debugMode = 0;
  49233. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Log.js
  49234. function Log_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49235. 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); } }
  49236. function Log_createClass(Constructor, protoProps, staticProps) { if (protoProps) Log_defineProperties(Constructor.prototype, protoProps); if (staticProps) Log_defineProperties(Constructor, staticProps); return Constructor; }
  49237. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  49238. * This program are made available under the terms of the Apache License, Version 2.0
  49239. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49240. /**
  49241. * @private
  49242. * @class SuperMap.LevelRenderer.Tool.Log
  49243. * @category Visualization Theme
  49244. * @classdesc LevelRenderer 工具-日志
  49245. */
  49246. var Log_Log = /*#__PURE__*/function () {
  49247. /**
  49248. * @function SuperMap.LevelRenderer.Tool.Log.constructor
  49249. * @description 构造函数。
  49250. */
  49251. function Log() {
  49252. Log_classCallCheck(this, Log);
  49253. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Log";
  49254. return function () {
  49255. if (Config.debugMode === 0) {
  49256. return;
  49257. } else if (Config.debugMode == 1) {
  49258. for (var k in arguments) {
  49259. throw new Error(arguments[k]);
  49260. }
  49261. } else if (Config.debugMode > 1) {
  49262. for (var _k in arguments) {
  49263. console.log(arguments[_k]);
  49264. }
  49265. }
  49266. };
  49267. /* for debug
  49268. return function(mes) {
  49269. document.getElementById('wrong-message').innerHTML =
  49270. mes + ' ' + (new Date() - 0)
  49271. + '<br/>'
  49272. + document.getElementById('wrong-message').innerHTML;
  49273. };
  49274. */
  49275. }
  49276. Log_createClass(Log, [{
  49277. key: "destory",
  49278. value: function destory() {
  49279. return true;
  49280. }
  49281. }]);
  49282. return Log;
  49283. }();
  49284. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Math.js
  49285. function Math_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49286. 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); } }
  49287. function Math_createClass(Constructor, protoProps, staticProps) { if (protoProps) Math_defineProperties(Constructor.prototype, protoProps); if (staticProps) Math_defineProperties(Constructor, staticProps); return Constructor; }
  49288. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  49289. * This program are made available under the terms of the Apache License, Version 2.0
  49290. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49291. /**
  49292. * @private
  49293. * @class SuperMap.LevelRenderer.Tool.Math
  49294. * @category Visualization Theme
  49295. * @classdesc LevelRenderer 工具-数学辅助类
  49296. */
  49297. var MathTool = /*#__PURE__*/function () {
  49298. /**
  49299. * @function SuperMap.LevelRenderer.Tool.Math.constructor
  49300. * @description 构造函数。
  49301. */
  49302. function MathTool() {
  49303. Math_classCallCheck(this, MathTool);
  49304. /**
  49305. * @member {number} SuperMap.LevelRenderer.Tool.Math._radians
  49306. * @description 角度与弧度转化参数
  49307. */
  49308. this._radians = window.Math.PI / 180;
  49309. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Math";
  49310. }
  49311. /**
  49312. * @function SuperMap.LevelRenderer.Tool.Math.prototype.sin
  49313. * @description 正弦函数。
  49314. * @param {number} angle - 弧度(角度)参数。
  49315. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  49316. * @returns {number} sin 值。
  49317. */
  49318. Math_createClass(MathTool, [{
  49319. key: "sin",
  49320. value: function sin(angle, isDegrees) {
  49321. return window.Math.sin(isDegrees ? angle * this._radians : angle);
  49322. }
  49323. /**
  49324. * @function SuperMap.LevelRenderer.Tool.Math.prototype.cos
  49325. * @description 余弦函数。
  49326. * @param {number} angle - 弧度(角度)参数。
  49327. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  49328. * @returns {number} cos 值。
  49329. */
  49330. }, {
  49331. key: "cos",
  49332. value: function cos(angle, isDegrees) {
  49333. return window.Math.cos(isDegrees ? angle * this._radians : angle);
  49334. }
  49335. /**
  49336. * @function SuperMap.LevelRenderer.Tool.Math.prototype.degreeToRadian
  49337. * @description 角度转弧度。
  49338. * @param {number} angle - 弧度(角度)参数。
  49339. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  49340. * @returns {number} 弧度值。
  49341. */
  49342. }, {
  49343. key: "degreeToRadian",
  49344. value: function degreeToRadian(angle) {
  49345. return angle * this._radians;
  49346. }
  49347. /**
  49348. * @function SuperMap.LevelRenderer.Tool.Math.prototype.radianToDegree
  49349. * @description 弧度转角度。
  49350. * @param {number} angle - 弧度(角度)参数。
  49351. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  49352. * @returns {number} 角度。
  49353. */
  49354. }, {
  49355. key: "radianToDegree",
  49356. value: function radianToDegree(angle) {
  49357. return angle / this._radians;
  49358. }
  49359. }]);
  49360. return MathTool;
  49361. }();
  49362. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Matrix.js
  49363. function Matrix_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49364. 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); } }
  49365. function Matrix_createClass(Constructor, protoProps, staticProps) { if (protoProps) Matrix_defineProperties(Constructor.prototype, protoProps); if (staticProps) Matrix_defineProperties(Constructor, staticProps); return Constructor; }
  49366. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  49367. * This program are made available under the terms of the Apache License, Version 2.0
  49368. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49369. /**
  49370. * @private
  49371. * @class SuperMap.LevelRenderer.Tool.Matrix
  49372. * @category Visualization Theme
  49373. * @classdesc LevelRenderer 工具-3x2矩阵操作类
  49374. */
  49375. var Matrix = /*#__PURE__*/function () {
  49376. /**
  49377. * @function SuperMap.LevelRenderer.Tool.Matrix.constructor
  49378. * @description 构造函数。
  49379. */
  49380. function Matrix() {
  49381. Matrix_classCallCheck(this, Matrix);
  49382. /**
  49383. * @member {Object} SuperMap.LevelRenderer.Tool.Matrix.prototype.ArrayCtor
  49384. * @description 数组类型控制
  49385. */
  49386. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  49387. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Matrix";
  49388. }
  49389. /**
  49390. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.create
  49391. * @description 创建一个单位矩阵。
  49392. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  49393. */
  49394. Matrix_createClass(Matrix, [{
  49395. key: "create",
  49396. value: function create() {
  49397. var ArrayCtor = this.ArrayCtor;
  49398. var out = new ArrayCtor(6);
  49399. this.identity(out);
  49400. return out;
  49401. }
  49402. /**
  49403. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.identity
  49404. * @description 设置矩阵为单位矩阵。
  49405. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  49406. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  49407. */
  49408. }, {
  49409. key: "identity",
  49410. value: function identity(out) {
  49411. out[0] = 1;
  49412. out[1] = 0;
  49413. out[2] = 0;
  49414. out[3] = 1;
  49415. out[4] = 0;
  49416. out[5] = 0;
  49417. return out;
  49418. }
  49419. /**
  49420. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.copy
  49421. * @description 复制矩阵。
  49422. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  49423. * @returns {(Float32Array|Array.<number>)} 克隆矩阵。
  49424. */
  49425. }, {
  49426. key: "copy",
  49427. value: function copy(out, m) {
  49428. out[0] = m[0];
  49429. out[1] = m[1];
  49430. out[2] = m[2];
  49431. out[3] = m[3];
  49432. out[4] = m[4];
  49433. out[5] = m[5];
  49434. return out;
  49435. }
  49436. /**
  49437. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mul
  49438. * @description 矩阵相乘。
  49439. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  49440. * @param {(Float32Array|Array.<number>)} m1 - 矩阵m1。
  49441. * @param {(Float32Array|Array.<number>)} m2- 矩阵m2。
  49442. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  49443. */
  49444. }, {
  49445. key: "mul",
  49446. value: function mul(out, m1, m2) {
  49447. out[0] = m1[0] * m2[0] + m1[2] * m2[1];
  49448. out[1] = m1[1] * m2[0] + m1[3] * m2[1];
  49449. out[2] = m1[0] * m2[2] + m1[2] * m2[3];
  49450. out[3] = m1[1] * m2[2] + m1[3] * m2[3];
  49451. out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
  49452. out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
  49453. return out;
  49454. }
  49455. /**
  49456. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mul
  49457. * @description 平移变换。
  49458. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  49459. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  49460. * @param {(Float32Array|Array.<number>)} v- 平移参数。
  49461. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  49462. */
  49463. }, {
  49464. key: "translate",
  49465. value: function translate(out, a, v) {
  49466. out[0] = a[0];
  49467. out[1] = a[1];
  49468. out[2] = a[2];
  49469. out[3] = a[3];
  49470. out[4] = a[4] + v[0];
  49471. out[5] = a[5] + v[1];
  49472. return out;
  49473. }
  49474. /**
  49475. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.rotate
  49476. * @description 平移变换。
  49477. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  49478. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  49479. * @param {(Float32Array|Array.<number>)} rad - 旋转参数。
  49480. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  49481. */
  49482. }, {
  49483. key: "rotate",
  49484. value: function rotate(out, a, rad) {
  49485. var aa = a[0];
  49486. var ac = a[2];
  49487. var atx = a[4];
  49488. var ab = a[1];
  49489. var ad = a[3];
  49490. var aty = a[5];
  49491. var st = Math.sin(rad);
  49492. var ct = Math.cos(rad);
  49493. out[0] = aa * ct + ab * st;
  49494. out[1] = -aa * st + ab * ct;
  49495. out[2] = ac * ct + ad * st;
  49496. out[3] = -ac * st + ct * ad;
  49497. out[4] = ct * atx + st * aty;
  49498. out[5] = ct * aty - st * atx;
  49499. return out;
  49500. }
  49501. /**
  49502. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.scale
  49503. * @description 缩放变换。
  49504. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  49505. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  49506. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  49507. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  49508. */
  49509. }, {
  49510. key: "scale",
  49511. value: function scale(out, a, v) {
  49512. var vx = v[0];
  49513. var vy = v[1];
  49514. out[0] = a[0] * vx;
  49515. out[1] = a[1] * vy;
  49516. out[2] = a[2] * vx;
  49517. out[3] = a[3] * vy;
  49518. out[4] = a[4] * vx;
  49519. out[5] = a[5] * vy;
  49520. return out;
  49521. }
  49522. /**
  49523. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.invert
  49524. * @description 求逆矩阵。
  49525. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  49526. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  49527. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  49528. */
  49529. }, {
  49530. key: "invert",
  49531. value: function invert(out, a) {
  49532. var aa = a[0];
  49533. var ac = a[2];
  49534. var atx = a[4];
  49535. var ab = a[1];
  49536. var ad = a[3];
  49537. var aty = a[5];
  49538. var det = aa * ad - ab * ac;
  49539. if (!det) {
  49540. return null;
  49541. }
  49542. det = 1.0 / det;
  49543. out[0] = ad * det;
  49544. out[1] = -ab * det;
  49545. out[2] = -ac * det;
  49546. out[3] = aa * det;
  49547. out[4] = (ac * aty - ad * atx) * det;
  49548. out[5] = (ab * atx - aa * aty) * det;
  49549. return out;
  49550. }
  49551. /**
  49552. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mulVector
  49553. * @description 矩阵左乘向量。
  49554. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  49555. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  49556. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  49557. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  49558. */
  49559. }, {
  49560. key: "mulVector",
  49561. value: function mulVector(out, a, v) {
  49562. var aa = a[0];
  49563. var ac = a[2];
  49564. var atx = a[4];
  49565. var ab = a[1];
  49566. var ad = a[3];
  49567. var aty = a[5];
  49568. out[0] = v[0] * aa + v[1] * ac + atx;
  49569. out[1] = v[0] * ab + v[1] * ad + aty;
  49570. return out;
  49571. }
  49572. }]);
  49573. return Matrix;
  49574. }();
  49575. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SUtil.js
  49576. function SUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49577. 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); } }
  49578. function SUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) SUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) SUtil_defineProperties(Constructor, staticProps); return Constructor; }
  49579. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  49580. * This program are made available under the terms of the Apache License, Version 2.0
  49581. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49582. var SUtil = /*#__PURE__*/function () {
  49583. function SUtil() {
  49584. SUtil_classCallCheck(this, SUtil);
  49585. }
  49586. SUtil_createClass(SUtil, null, [{
  49587. key: "SUtil_smoothBezier",
  49588. /**
  49589. * @function SuperMap.LevelRenderer.SUtil.SUtil_smoothBezier
  49590. * @description 贝塞尔平滑曲线。
  49591. * @private
  49592. * @param {Array} points - 线段顶点数组。
  49593. * @param {number} smooth - 平滑等级, 0-1。
  49594. * @param {boolean} isLoop - isLoop。
  49595. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  49596. * @param {Array} [originalPosition=[0, 0]] - 参考原点。
  49597. * @return {Array} 生成的平滑节点数组。
  49598. */
  49599. value: function SUtil_smoothBezier(points, smooth, isLoop, constraint, originalPosition) {
  49600. if (!originalPosition || originalPosition !== 2) {
  49601. originalPosition = [0, 0];
  49602. }
  49603. var __OP = originalPosition;
  49604. var cps = [];
  49605. var v = [];
  49606. var v1 = [];
  49607. var v2 = [];
  49608. var hasConstraint = !!constraint;
  49609. var min, max;
  49610. if (hasConstraint) {
  49611. min = [Infinity, Infinity];
  49612. max = [-Infinity, -Infinity];
  49613. var _len = points.length;
  49614. for (var i = 0; i < _len; i++) {
  49615. SUtil.Util_vector.min(min, min, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  49616. SUtil.Util_vector.max(max, max, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  49617. } // 与指定的包围盒做并集
  49618. SUtil.Util_vector.min(min, min, constraint[0]);
  49619. SUtil.Util_vector.max(max, max, constraint[1]);
  49620. }
  49621. var len = points.length;
  49622. for (var _i = 0; _i < len; _i++) {
  49623. var point = [points[_i][0] + __OP[0], points[_i][1] + __OP[1]];
  49624. var prevPoint = void 0;
  49625. var nextPoint = void 0;
  49626. if (isLoop) {
  49627. prevPoint = [points[_i ? _i - 1 : len - 1][0] + __OP[0], points[_i ? _i - 1 : len - 1][1] + __OP[1]];
  49628. nextPoint = [points[(_i + 1) % len][0] + __OP[0], points[(_i + 1) % len][1] + __OP[1]];
  49629. } else {
  49630. if (_i === 0 || _i === len - 1) {
  49631. cps.push([points[_i][0] + __OP[0], points[_i][1] + __OP[1]]);
  49632. continue;
  49633. } else {
  49634. prevPoint = [points[_i - 1][0] + __OP[0], points[_i - 1][1] + __OP[1]];
  49635. nextPoint = [points[_i + 1][0] + __OP[0], points[_i + 1][1] + __OP[1]];
  49636. }
  49637. }
  49638. SUtil.Util_vector.sub(v, nextPoint, prevPoint); // use degree to scale the handle length
  49639. SUtil.Util_vector.scale(v, v, smooth);
  49640. var d0 = SUtil.Util_vector.distance(point, prevPoint);
  49641. var d1 = SUtil.Util_vector.distance(point, nextPoint);
  49642. var sum = d0 + d1;
  49643. if (sum !== 0) {
  49644. d0 /= sum;
  49645. d1 /= sum;
  49646. }
  49647. SUtil.Util_vector.scale(v1, v, -d0);
  49648. SUtil.Util_vector.scale(v2, v, d1);
  49649. var cp0 = SUtil.Util_vector.add([], point, v1);
  49650. var cp1 = SUtil.Util_vector.add([], point, v2);
  49651. if (hasConstraint) {
  49652. SUtil.Util_vector.max(cp0, cp0, min);
  49653. SUtil.Util_vector.min(cp0, cp0, max);
  49654. SUtil.Util_vector.max(cp1, cp1, min);
  49655. SUtil.Util_vector.min(cp1, cp1, max);
  49656. }
  49657. cps.push(cp0);
  49658. cps.push(cp1);
  49659. }
  49660. if (isLoop) {
  49661. cps.push(cps.shift());
  49662. }
  49663. return cps;
  49664. }
  49665. /**
  49666. * @function SuperMap.LevelRenderer.SUtil.SUtil_smoothSpline
  49667. * @description 插值折线。
  49668. * @private
  49669. * @param {Array} points - 线段顶点数组。
  49670. * @param {boolean} isLoop - isLoop。
  49671. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  49672. * @param {Array} originalPosition - 参考原点。默认值:[0, 0]。
  49673. * @return {Array} 生成的平滑节点数组。
  49674. */
  49675. }, {
  49676. key: "SUtil_smoothSpline",
  49677. value: function SUtil_smoothSpline(points, isLoop, constraint, originalPosition) {
  49678. if (!originalPosition || originalPosition !== 2) {
  49679. originalPosition = [0, 0];
  49680. }
  49681. var __OP = originalPosition;
  49682. var len = points.length;
  49683. var ret = [];
  49684. var distance = 0;
  49685. for (var i = 1; i < len; i++) {
  49686. 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]]);
  49687. }
  49688. var segs = distance / 5;
  49689. segs = segs < len ? len : segs;
  49690. for (var _i2 = 0; _i2 < segs; _i2++) {
  49691. var pos = _i2 / (segs - 1) * (isLoop ? len : len - 1);
  49692. var idx = Math.floor(pos);
  49693. var w = pos - idx;
  49694. var p0 = void 0;
  49695. var p1 = [points[idx % len][0] + __OP[0], points[idx % len][1] + __OP[1]];
  49696. var p2 = void 0;
  49697. var p3 = void 0;
  49698. if (!isLoop) {
  49699. p0 = [points[idx === 0 ? idx : idx - 1][0] + __OP[0], points[idx === 0 ? idx : idx - 1][1] + __OP[1]];
  49700. p2 = [points[idx > len - 2 ? len - 1 : idx + 1][0] + __OP[0], points[idx > len - 2 ? len - 1 : idx + 1][1] + __OP[1]];
  49701. p3 = [points[idx > len - 3 ? len - 1 : idx + 2][0] + __OP[0], points[idx > len - 3 ? len - 1 : idx + 2][1] + __OP[1]];
  49702. } else {
  49703. p0 = [points[(idx - 1 + len) % len][0] + __OP[0], points[(idx - 1 + len) % len][1] + __OP[1]];
  49704. p2 = [points[(idx + 1) % len][0] + __OP[0], points[(idx + 1) % len][1] + __OP[1]];
  49705. p3 = [points[(idx + 2) % len][0] + __OP[0], points[(idx + 2) % len][1] + __OP[1]];
  49706. }
  49707. var w2 = w * w;
  49708. var w3 = w * w2;
  49709. 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)]);
  49710. }
  49711. return ret; // inner Function
  49712. function interpolate(p0, p1, p2, p3, t, t2, t3) {
  49713. var v0 = (p2 - p0) * 0.5;
  49714. var v1 = (p3 - p1) * 0.5;
  49715. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  49716. }
  49717. }
  49718. /**
  49719. * @function SuperMap.LevelRenderer.SUtil.SUtil_dashedLineTo
  49720. * @description 虚线 lineTo。
  49721. */
  49722. }, {
  49723. key: "SUtil_dashedLineTo",
  49724. value: function SUtil_dashedLineTo(ctx, x1, y1, x2, y2, dashLength, customDashPattern) {
  49725. // http://msdn.microsoft.com/en-us/library/ie/dn265063(v=vs.85).aspx
  49726. var dashPattern = [5, 5];
  49727. dashLength = typeof dashLength != 'number' ? 5 : dashLength;
  49728. if (ctx.setLineDash) {
  49729. dashPattern[0] = dashLength;
  49730. dashPattern[1] = dashLength;
  49731. if (customDashPattern && customDashPattern instanceof Array) {
  49732. ctx.setLineDash(customDashPattern);
  49733. } else {
  49734. ctx.setLineDash(dashPattern);
  49735. } // ctx.setLineDash(dashPattern);
  49736. ctx.moveTo(x1, y1);
  49737. ctx.lineTo(x2, y2);
  49738. return;
  49739. }
  49740. var dx = x2 - x1;
  49741. var dy = y2 - y1;
  49742. var numDashes = Math.floor(Math.sqrt(dx * dx + dy * dy) / dashLength);
  49743. dx = dx / numDashes;
  49744. dy = dy / numDashes;
  49745. var flag = true;
  49746. for (var i = 0; i < numDashes; ++i) {
  49747. if (flag) {
  49748. ctx.moveTo(x1, y1);
  49749. } else {
  49750. ctx.lineTo(x1, y1);
  49751. }
  49752. flag = !flag;
  49753. x1 += dx;
  49754. y1 += dy;
  49755. }
  49756. ctx.lineTo(x2, y2);
  49757. }
  49758. }]);
  49759. return SUtil;
  49760. }(); // 把所有工具对象放到全局静态变量上,以便直接调用工具方法,
  49761. // 避免使用工具时频繁的创建工具对象带来的性能消耗。
  49762. SUtil.Util_area = new Area_Area();
  49763. SUtil.Util_color = new Color_Color();
  49764. SUtil.Util_computeBoundingBox = new ComputeBoundingBox_ComputeBoundingBox();
  49765. SUtil.Util_curve = new levelRenderer_Curve_Curve();
  49766. SUtil.Util_env = new Env();
  49767. SUtil.Util_event = new Event_Event();
  49768. SUtil.Util_http = new Http();
  49769. SUtil.Util_log = new Log_Log();
  49770. SUtil.Util_math = new MathTool();
  49771. SUtil.Util_matrix = new Matrix();
  49772. SUtil.Util = new levelRenderer_Util_Util();
  49773. SUtil.Util_vector = new levelRenderer_Vector_Vector();
  49774. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Transformable.js
  49775. function Transformable_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49776. 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); } }
  49777. function Transformable_createClass(Constructor, protoProps, staticProps) { if (protoProps) Transformable_defineProperties(Constructor.prototype, protoProps); if (staticProps) Transformable_defineProperties(Constructor, staticProps); return Constructor; }
  49778. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  49779. * This program are made available under the terms of the Apache License, Version 2.0
  49780. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49781. /**
  49782. * @private
  49783. * @class SuperMap.LevelRenderer.Transformable
  49784. * @category Visualization Theme
  49785. * @classdesc 可变换超类,所有支持 Canvas Transform 变换操作的类均是此类的子类。此类不可实例化。
  49786. */
  49787. var Transformable_Transformable = /*#__PURE__*/function () {
  49788. /**
  49789. * @function SuperMap.LevelRenderer.Transformable.constructor
  49790. * @description 构造函数。
  49791. */
  49792. function Transformable() {
  49793. Transformable_classCallCheck(this, Transformable);
  49794. /**
  49795. * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.position
  49796. * @description 平移, 默认值:[0, 0]。
  49797. */
  49798. this.position = [0, 0];
  49799. /**
  49800. * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.rotation
  49801. * @description 旋转,可以通过数组二三项指定旋转的原点, 默认值:[0, 0, 0]。
  49802. */
  49803. this.rotation = [0, 0, 0];
  49804. /**
  49805. * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.scale
  49806. * @description 缩放,可以通过数组三四项指定缩放的原点, 默认值:[1, 1, 0, 0]。
  49807. */
  49808. this.scale = [1, 1, 0, 0];
  49809. /**
  49810. * @member {boolean} SuperMap.LevelRenderer.Transformable.prototype.needLocalTransform
  49811. * @description 是否变换。默认值:false。
  49812. */
  49813. this.needLocalTransform = false;
  49814. /**
  49815. * @member {boolean} SuperMap.LevelRenderer.Transformable.prototype.needTransform
  49816. * @description 是否有坐标变换。默认值:false。
  49817. */
  49818. this.needTransform = false;
  49819. this.CLASS_NAME = "SuperMap.LevelRenderer.Transformable";
  49820. /**
  49821. * @function SuperMap.LevelRenderer.Transformable.prototype.lookAt
  49822. * @description 设置图形的朝向。
  49823. */
  49824. this.lookAt = function () {
  49825. var v = SUtil.Util_vector.create(); // {Array.<Number>|Float32Array} target
  49826. return function (target) {
  49827. if (!this.transform) {
  49828. this.transform = SUtil.Util_matrix.create();
  49829. }
  49830. var m = this.transform;
  49831. SUtil.Util_vector.sub(v, target, this.position);
  49832. if (isAroundZero(v[0]) && isAroundZero(v[1])) {
  49833. return;
  49834. }
  49835. SUtil.Util_vector.normalize(v, v); // Y Axis
  49836. // TODO Scale origin ?
  49837. m[2] = v[0] * this.scale[1];
  49838. m[3] = v[1] * this.scale[1]; // X Axis
  49839. m[0] = v[1] * this.scale[0];
  49840. m[1] = -v[0] * this.scale[0]; // Position
  49841. m[4] = this.position[0];
  49842. m[5] = this.position[1];
  49843. this.decomposeTransform();
  49844. function isAroundZero(val) {
  49845. var EPSILON = 5e-5;
  49846. return val > -EPSILON && val < EPSILON;
  49847. }
  49848. };
  49849. }();
  49850. }
  49851. /**
  49852. * @function SuperMap.LevelRenderer.Transformable.prototype.destroy
  49853. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  49854. */
  49855. Transformable_createClass(Transformable, [{
  49856. key: "destroy",
  49857. value: function destroy() {
  49858. this.position = null;
  49859. this.rotation = null;
  49860. this.scale = null;
  49861. this.needLocalTransform = null;
  49862. this.needTransform = null;
  49863. }
  49864. /**
  49865. * @function SuperMap.LevelRenderer.Transformable.prototype.updateNeedTransform
  49866. * @description 更新 needLocalTransform
  49867. */
  49868. }, {
  49869. key: "updateNeedTransform",
  49870. value: function updateNeedTransform() {
  49871. this.needLocalTransform = isNotAroundZero(this.rotation[0]) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1);
  49872. function isNotAroundZero(val) {
  49873. var EPSILON = 5e-5;
  49874. return val > EPSILON || val < -EPSILON;
  49875. }
  49876. }
  49877. /**
  49878. * @function SuperMap.LevelRenderer.Transformable.prototype.updateTransform
  49879. * @description 判断是否需要有坐标变换,更新 needTransform 属性。如果有坐标变换, 则从 position, rotation, scale 以及父节点的 transform 计算出自身的 transform 矩阵
  49880. */
  49881. }, {
  49882. key: "updateTransform",
  49883. value: function updateTransform() {
  49884. this.updateNeedTransform();
  49885. if (this.parent) {
  49886. this.needTransform = this.needLocalTransform || this.parent.needTransform;
  49887. } else {
  49888. this.needTransform = this.needLocalTransform;
  49889. }
  49890. if (!this.needTransform) {
  49891. return;
  49892. }
  49893. var origin = [0, 0];
  49894. var m = this.transform || SUtil.Util_matrix.create();
  49895. SUtil.Util_matrix.identity(m);
  49896. if (this.needLocalTransform) {
  49897. if (isNotAroundZero(this.scale[0]) || isNotAroundZero(this.scale[1])) {
  49898. origin[0] = -this.scale[2] || 0;
  49899. origin[1] = -this.scale[3] || 0;
  49900. var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  49901. if (haveOrigin) {
  49902. SUtil.Util_matrix.translate(m, m, origin);
  49903. }
  49904. SUtil.Util_matrix.scale(m, m, this.scale);
  49905. if (haveOrigin) {
  49906. origin[0] = -origin[0];
  49907. origin[1] = -origin[1];
  49908. SUtil.Util_matrix.translate(m, m, origin);
  49909. }
  49910. }
  49911. if (this.rotation instanceof Array) {
  49912. if (this.rotation[0] !== 0) {
  49913. origin[0] = -this.rotation[1] || 0;
  49914. origin[1] = -this.rotation[2] || 0;
  49915. var _haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  49916. if (_haveOrigin) {
  49917. SUtil.Util_matrix.translate(m, m, origin);
  49918. }
  49919. SUtil.Util_matrix.rotate(m, m, this.rotation[0]);
  49920. if (_haveOrigin) {
  49921. origin[0] = -origin[0];
  49922. origin[1] = -origin[1];
  49923. SUtil.Util_matrix.translate(m, m, origin);
  49924. }
  49925. }
  49926. } else {
  49927. if (this.rotation !== 0) {
  49928. SUtil.Util_matrix.rotate(m, m, this.rotation);
  49929. }
  49930. }
  49931. if (isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1])) {
  49932. SUtil.Util_matrix.translate(m, m, this.position);
  49933. }
  49934. } // 保存这个变换矩阵
  49935. this.transform = m; // 应用父节点变换
  49936. if (this.parent && this.parent.needTransform) {
  49937. if (this.needLocalTransform) {
  49938. SUtil.Util_matrix.mul(this.transform, this.parent.transform, this.transform);
  49939. } else {
  49940. SUtil.Util_matrix.copy(this.transform, this.parent.transform);
  49941. }
  49942. }
  49943. function isNotAroundZero(val) {
  49944. var EPSILON = 5e-5;
  49945. return val > EPSILON || val < -EPSILON;
  49946. }
  49947. }
  49948. /**
  49949. * @function SuperMap.LevelRenderer.Transformable.prototype.setTransform
  49950. * @description 将自己的 transform 应用到 context 上。
  49951. *
  49952. * @param {Context2D} ctx - Context2D 上下文。
  49953. */
  49954. }, {
  49955. key: "setTransform",
  49956. value: function setTransform(ctx) {
  49957. if (this.needTransform) {
  49958. var m = this.transform;
  49959. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  49960. }
  49961. }
  49962. /**
  49963. * @function SuperMap.LevelRenderer.Transformable.prototype.decomposeTransform
  49964. * @description 分解`transform`矩阵到`position`, `rotation`, `scale` 。
  49965. */
  49966. }, {
  49967. key: "decomposeTransform",
  49968. value: function decomposeTransform() {
  49969. if (!this.transform) {
  49970. return;
  49971. }
  49972. var m = this.transform;
  49973. var sx = m[0] * m[0] + m[1] * m[1];
  49974. var position = this.position;
  49975. var scale = this.scale;
  49976. var rotation = this.rotation;
  49977. if (isNotAroundZero(sx - 1)) {
  49978. sx = Math.sqrt(sx);
  49979. }
  49980. var sy = m[2] * m[2] + m[3] * m[3];
  49981. if (isNotAroundZero(sy - 1)) {
  49982. sy = Math.sqrt(sy);
  49983. }
  49984. position[0] = m[4];
  49985. position[1] = m[5];
  49986. scale[0] = sx;
  49987. scale[1] = sy;
  49988. scale[2] = scale[3] = 0;
  49989. rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx);
  49990. rotation[1] = rotation[2] = 0;
  49991. function isNotAroundZero(val) {
  49992. var EPSILON = 5e-5;
  49993. return val > EPSILON || val < -EPSILON;
  49994. }
  49995. }
  49996. }]);
  49997. return Transformable;
  49998. }();
  49999. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Shape.js
  50000. 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); }
  50001. function Shape_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50002. 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); } }
  50003. function Shape_createClass(Constructor, protoProps, staticProps) { if (protoProps) Shape_defineProperties(Constructor.prototype, protoProps); if (staticProps) Shape_defineProperties(Constructor, staticProps); return Constructor; }
  50004. 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); }
  50005. function Shape_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Shape_getPrototypeOf(object); if (object === null) break; } return object; }
  50006. 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); }
  50007. function Shape_setPrototypeOf(o, p) { Shape_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Shape_setPrototypeOf(o, p); }
  50008. 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); }; }
  50009. function Shape_possibleConstructorReturn(self, call) { if (call && (Shape_typeof(call) === "object" || typeof call === "function")) { return call; } return Shape_assertThisInitialized(self); }
  50010. function Shape_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50011. 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; } }
  50012. function Shape_getPrototypeOf(o) { Shape_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Shape_getPrototypeOf(o); }
  50013. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  50014. * This program are made available under the terms of the Apache License, Version 2.0
  50015. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50016. /**
  50017. * @private
  50018. * @class SuperMap.LevelRenderer.Shape
  50019. * @category Visualization Theme
  50020. * @classdesc 图形(shape)基类。
  50021. * @extends SuperMap.LevelRenderer.Eventful
  50022. * @extends SuperMap.LevelRenderer.Transformable
  50023. */
  50024. var Shape_Shape = /*#__PURE__*/function (_SuperMap$mixin) {
  50025. Shape_inherits(Shape, _SuperMap$mixin);
  50026. var _super = Shape_createSuper(Shape);
  50027. /**
  50028. * @function SuperMap.LevelRenderer.Shape.constructor
  50029. * @description 构造函数。
  50030. *
  50031. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  50032. *
  50033. */
  50034. function Shape(options) {
  50035. var _this;
  50036. Shape_classCallCheck(this, Shape);
  50037. _this = _super.call(this, options);
  50038. options = options || {};
  50039. /**
  50040. * @member {string} SuperMap.LevelRenderer.Shape.prototype.id
  50041. * @description 唯一标识。
  50042. */
  50043. _this.id = null;
  50044. /**
  50045. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.style
  50046. * @description 基础绘制样式。
  50047. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  50048. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  50049. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  50050. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  50051. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  50052. * @param {number} style.opacity - 绘制透明度。默认值:1。
  50053. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  50054. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  50055. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  50056. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  50057. * @param {string} style.text - 图形中的附加文本。默认值:""。
  50058. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  50059. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  50060. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  50061. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  50062. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  50063. *
  50064. */
  50065. _this.style = {};
  50066. /**
  50067. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.style.__rect
  50068. * @description 包围图形的最小矩形盒子。
  50069. *
  50070. * @param {number} x - 左上角顶点x轴坐标。
  50071. * @param {number} y - 左上角顶点y轴坐标。
  50072. * @param {number} width - 包围盒矩形宽度。
  50073. * @param {number} height - 包围盒矩形高度。
  50074. */
  50075. /**
  50076. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.highlightStyle
  50077. * @description 高亮样式。
  50078. *
  50079. * @param {string} highlightStyle.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  50080. * @param {string} highlightStyle.color - 填充颜色。默认值:"#000000'"。
  50081. * @param {string} highlightStyle.strokeColor - 描边颜色。默认值:"#000000'"。
  50082. * @param {string} highlightStyle.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  50083. * @param {number} highlightStyle.lineWidth - 描边宽度。默认值:1。
  50084. * @param {number} highlightStyle.opacity - 绘制透明度。默认值:1。
  50085. * @param {number} highlightStyle.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  50086. * @param {number} highlightStyle.shadowColor - 阴影颜色。默认值:"#000000'"。
  50087. * @param {number} highlightStyle.shadowOffsetX - 阴影横向偏移。默认值:0。
  50088. * @param {number} highlightStyle.shadowOffsetY - 阴影纵向偏移。默认值:0。
  50089. * @param {string} highlightStyle.text - 图形中的附加文本。默认值:""。
  50090. * @param {string} highlightStyle.textColor - 文本颜色。默认值:"#000000'"。
  50091. * @param {string} highlightStyle.textFont - 附加文本样式。示例:'bold 18px verdana'。
  50092. * @param {string} highlightStyle.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  50093. * @param {string} highlightStyle.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  50094. * @param {string} highlightStyle.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  50095. */
  50096. _this.highlightStyle = null;
  50097. /**
  50098. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.parent
  50099. * @description 父节点,只读属性。<SuperMap.LevelRenderer.Group>
  50100. */
  50101. _this.parent = null;
  50102. /**
  50103. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.__dirty
  50104. * @description {boolean}
  50105. */
  50106. _this.__dirty = true;
  50107. /**
  50108. * @member {Array} SuperMap.LevelRenderer.Shape.prototype.__clipShapes
  50109. * @description {Array}
  50110. *
  50111. */
  50112. _this.__clipShapes = [];
  50113. /**
  50114. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.invisible
  50115. * @description 图形是否可见,为 true 时不绘制图形,但是仍能触发鼠标事件。默认值:false。
  50116. */
  50117. _this.invisible = false;
  50118. /**
  50119. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.ignore
  50120. * @description 图形是否忽略,为 true 时忽略图形的绘制以及事件触发。默认值:false。
  50121. */
  50122. _this.ignore = false;
  50123. /**
  50124. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.zlevel
  50125. * @description z 层 level,决定绘画在哪层 canvas 中。默认值:0。
  50126. */
  50127. _this.zlevel = 0;
  50128. /**
  50129. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.draggable
  50130. * @description 是否可拖拽。默认值:false。
  50131. */
  50132. _this.draggable = false;
  50133. /**
  50134. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.clickable
  50135. * @description 是否可点击。默认值:false。
  50136. */
  50137. _this.clickable = false;
  50138. /**
  50139. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.hoverable
  50140. * @description 是否可以 hover。默认值:true。
  50141. */
  50142. _this.hoverable = true;
  50143. /**
  50144. * @member {number} SuperMap.LevelRenderer.Shape.prototype.z
  50145. * @description z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面,但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。默认值:0。
  50146. */
  50147. _this.z = 0; //地理扩展
  50148. /**
  50149. * @member {Array} SuperMap.LevelRenderer.Shape.prototype.refOriginalPosition
  50150. * @description 图形参考原点位置,图形的参考中心位置。
  50151. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  50152. *
  50153. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  50154. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  50155. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  50156. *
  50157. * 图形(Shape) 的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  50158. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  50159. * refOriginalPosition 的值为 [0, 0] 时,形的位置信息才是 canvas 绝对位置。
  50160. *
  50161. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  50162. *
  50163. * refOriginalPosition。默认值是: [0, 0]。
  50164. */
  50165. _this.refOriginalPosition = [0, 0];
  50166. /**
  50167. * @member {string} SuperMap.LevelRenderer.Shape.prototype.refDataID
  50168. * @description 图形所关联数据的 ID。
  50169. *
  50170. */
  50171. _this.refDataID = null;
  50172. /**
  50173. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.isHoverByRefDataID
  50174. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  50175. *
  50176. */
  50177. _this.isHoverByRefDataID = false;
  50178. /**
  50179. * @member {string} SuperMap.LevelRenderer.Shape.prototype.refDataHoverGroup
  50180. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  50181. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  50182. *
  50183. */
  50184. _this.refDataHoverGroup = null;
  50185. /**
  50186. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.dataInfo
  50187. * @description 图形的数据信息。
  50188. *
  50189. */
  50190. _this.dataInfo = null;
  50191. Util_Util.extend(Shape_assertThisInitialized(_this), options);
  50192. _this.id = _this.id || Util_Util.createUniqueID("smShape_");
  50193. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape";
  50194. /**
  50195. * @function SuperMap.LevelRenderer.Shape.prototype.getTansform
  50196. * @description 变换鼠标位置到 shape 的局部坐标空间
  50197. *
  50198. */
  50199. _this.getTansform = function () {
  50200. var invTransform = [];
  50201. return function (x, y) {
  50202. var originPos = [x, y]; // 对鼠标的坐标也做相同的变换
  50203. if (this.needTransform && this.transform) {
  50204. SUtil.Util_matrix.invert(invTransform, this.transform);
  50205. SUtil.Util_matrix.mulVector(originPos, invTransform, [x, y, 1]);
  50206. if (x == originPos[0] && y == originPos[1]) {
  50207. // 避免外部修改导致的 needTransform 不准确
  50208. this.updateNeedTransform();
  50209. }
  50210. }
  50211. return originPos;
  50212. };
  50213. }();
  50214. return _this;
  50215. }
  50216. /**
  50217. * @function SuperMap.LevelRenderer.Shape.prototype.destroy
  50218. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  50219. */
  50220. Shape_createClass(Shape, [{
  50221. key: "destroy",
  50222. value: function destroy() {
  50223. this.id = null;
  50224. this.style = null;
  50225. this.highlightStyle = null;
  50226. this.parent = null;
  50227. this.__dirty = null;
  50228. this.__clipShapes = null;
  50229. this.invisible = null;
  50230. this.ignore = null;
  50231. this.zlevel = null;
  50232. this.draggable = null;
  50233. this.clickable = null;
  50234. this.hoverable = null;
  50235. this.z = null;
  50236. this.refOriginalPosition = null;
  50237. this.refDataID = null;
  50238. this.refDataHoverGroup = null;
  50239. this.isHoverByRefDataID = null;
  50240. this.dataInfo = null;
  50241. Shape_get(Shape_getPrototypeOf(Shape.prototype), "destroy", this).call(this);
  50242. }
  50243. /**
  50244. * @function SuperMap.LevelRenderer.Shape.prototype.brush
  50245. * @description 绘制图形。
  50246. *
  50247. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  50248. * @param {boolean} isHighlight - 是否使用高亮属性。
  50249. * @param {Function} updateCallback - 需要异步加载资源的 shape 可以通过这个 callback(e),让painter更新视图,base.brush 没用,需要的话重载 brush。
  50250. */
  50251. }, {
  50252. key: "brush",
  50253. value: function brush(ctx, isHighlight) {
  50254. var style = this.beforeBrush(ctx, isHighlight);
  50255. ctx.beginPath();
  50256. this.buildPath(ctx, style);
  50257. switch (style.brushType) {
  50258. /* jshint ignore:start */
  50259. case 'both':
  50260. this.setCtxGlobalAlpha(ctx, "fill", style);
  50261. ctx.fill();
  50262. if (style.lineWidth > 0) {
  50263. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50264. ctx.stroke();
  50265. }
  50266. this.setCtxGlobalAlpha(ctx, "reset", style);
  50267. break;
  50268. case 'stroke':
  50269. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50270. style.lineWidth > 0 && ctx.stroke();
  50271. this.setCtxGlobalAlpha(ctx, "reset", style);
  50272. break;
  50273. /* jshint ignore:end */
  50274. default:
  50275. this.setCtxGlobalAlpha(ctx, "fill", style);
  50276. ctx.fill();
  50277. this.setCtxGlobalAlpha(ctx, "reset", style);
  50278. break;
  50279. }
  50280. this.drawText(ctx, style, this.style);
  50281. this.afterBrush(ctx);
  50282. }
  50283. /**
  50284. * @function SuperMap.LevelRenderer.Shape.prototype.beforeBrush
  50285. * @description 具体绘制操作前的一些公共操作。
  50286. *
  50287. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  50288. * @param {boolean} isHighlight - 是否使用高亮属性。
  50289. * @return {Object} 处理后的样式。
  50290. */
  50291. }, {
  50292. key: "beforeBrush",
  50293. value: function beforeBrush(ctx, isHighlight) {
  50294. var style = this.style;
  50295. if (this.brushTypeOnly) {
  50296. style.brushType = this.brushTypeOnly;
  50297. }
  50298. if (isHighlight) {
  50299. // 根据style扩展默认高亮样式
  50300. style = this.getHighlightStyle(style, this.highlightStyle || {}, this.brushTypeOnly);
  50301. }
  50302. if (this.brushTypeOnly == 'stroke') {
  50303. style.strokeColor = style.strokeColor || style.color;
  50304. }
  50305. ctx.save();
  50306. this.doClip(ctx);
  50307. this.setContext(ctx, style); // 设置transform
  50308. this.setTransform(ctx);
  50309. return style;
  50310. }
  50311. /**
  50312. * @function SuperMap.LevelRenderer.Shape.prototype.afterBrush
  50313. * @description 绘制后的处理。
  50314. *
  50315. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  50316. *
  50317. */
  50318. }, {
  50319. key: "afterBrush",
  50320. value: function afterBrush(ctx) {
  50321. ctx.restore();
  50322. }
  50323. /**
  50324. * @function SuperMap.LevelRenderer.Shape.prototype.setContext
  50325. * @description 设置 fillStyle, strokeStyle, shadow 等通用绘制样式。
  50326. *
  50327. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  50328. * @param {Object} style - 样式。
  50329. *
  50330. */
  50331. }, {
  50332. key: "setContext",
  50333. value: function setContext(ctx, style) {
  50334. 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']];
  50335. for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) {
  50336. var styleProp = STYLE_CTX_MAP[i][0];
  50337. var styleValue = style[styleProp];
  50338. var ctxProp = STYLE_CTX_MAP[i][1];
  50339. if (typeof styleValue != 'undefined') {
  50340. ctx[ctxProp] = styleValue;
  50341. }
  50342. }
  50343. }
  50344. /**
  50345. * @function SuperMap.LevelRenderer.Shape.prototype.doClip
  50346. *
  50347. */
  50348. }, {
  50349. key: "doClip",
  50350. value: function doClip(ctx) {
  50351. var clipShapeInvTransform = SUtil.Util_matrix.create();
  50352. if (this.__clipShapes) {
  50353. for (var i = 0; i < this.__clipShapes.length; i++) {
  50354. var clipShape = this.__clipShapes[i];
  50355. if (clipShape.needTransform) {
  50356. var m = clipShape.transform;
  50357. SUtil.Util_matrix.invert(clipShapeInvTransform, m);
  50358. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  50359. }
  50360. ctx.beginPath();
  50361. clipShape.buildPath(ctx, clipShape.style);
  50362. ctx.clip(); // Transform back
  50363. if (clipShape.needTransform) {
  50364. var _m = clipShapeInvTransform;
  50365. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  50366. }
  50367. }
  50368. }
  50369. }
  50370. /**
  50371. * @function SuperMap.LevelRenderer.Shape.prototype.getHighlightStyle
  50372. * @description 根据默认样式扩展高亮样式
  50373. *
  50374. * @param {Object} style - 样式。
  50375. * @param {Object} highlightStyle - 高亮样式。
  50376. * @param {string} brushTypeOnly - brushTypeOnly。
  50377. *
  50378. */
  50379. }, {
  50380. key: "getHighlightStyle",
  50381. value: function getHighlightStyle(style, highlightStyle, brushTypeOnly) {
  50382. var newStyle = {};
  50383. for (var k in style) {
  50384. newStyle[k] = style[k];
  50385. }
  50386. var highlightColor = SUtil.Util_color.getHighlightColor(); // 根据highlightStyle扩展
  50387. if (style.brushType != 'stroke') {
  50388. // 带填充则用高亮色加粗边线
  50389. newStyle.strokeColor = highlightColor; // SMIC-方法修改 - start
  50390. newStyle.lineWidth = style.lineWidth || 1; // 原始代码
  50391. // newStyle.lineWidth = (style.lineWidth || 1)
  50392. // + this.getHighlightZoom();
  50393. // 修改代码1
  50394. // if(!style.lineType || style.lineType === "solid"){
  50395. // newStyle.lineWidth = (style.lineWidth || 1)
  50396. // + this.getHighlightZoom();
  50397. // }
  50398. // else{
  50399. // newStyle.lineWidth = (style.lineWidth || 1);
  50400. // }
  50401. // SMIC-方法修改 - end
  50402. newStyle.brushType = 'both';
  50403. } else {
  50404. if (brushTypeOnly != 'stroke') {
  50405. // 描边型的则用原色加工高亮
  50406. newStyle.strokeColor = highlightColor; // SMIC-方法修改 - start
  50407. newStyle.lineWidth = style.lineWidth || 1; // 原始代码
  50408. // newStyle.lineWidth = (style.lineWidth || 1)
  50409. // + this.getHighlightZoom();
  50410. // 修改代码1
  50411. // if(!style.lineType || style.lineType === "solid"){
  50412. // newStyle.lineWidth = (style.lineWidth || 1)
  50413. // + this.getHighlightZoom();
  50414. // }
  50415. // else{
  50416. // newStyle.lineWidth = (style.lineWidth || 1);
  50417. // }
  50418. // SMIC-方法修改 - end
  50419. } else {
  50420. // 线型的则用原色加工高亮
  50421. newStyle.strokeColor = highlightStyle.strokeColor || SUtil.Util_color.mix(style.strokeColor, SUtil.Util_color.toRGB(highlightColor));
  50422. }
  50423. } // 可自定义覆盖默认值
  50424. for (var _k in highlightStyle) {
  50425. if (typeof highlightStyle[_k] != 'undefined') {
  50426. newStyle[_k] = highlightStyle[_k];
  50427. }
  50428. }
  50429. return newStyle;
  50430. }
  50431. /**
  50432. * @function SuperMap.LevelRenderer.Shape.prototype.getHighlightZoom
  50433. * @description 高亮放大效果参数,当前统一设置为6,如有需要差异设置,通过 this.type 判断实例类型
  50434. *
  50435. */
  50436. }, {
  50437. key: "getHighlightZoom",
  50438. value: function getHighlightZoom() {
  50439. return this.type != 'text' ? 6 : 2;
  50440. }
  50441. /**
  50442. * @function SuperMap.LevelRenderer.Shape.prototype.drift
  50443. * @description 移动位置
  50444. *
  50445. * @param {Object} dx - 横坐标变化。
  50446. * @param {Object} dy - 纵坐标变化。
  50447. *
  50448. */
  50449. }, {
  50450. key: "drift",
  50451. value: function drift(dx, dy) {
  50452. this.position[0] += dx;
  50453. this.position[1] += dy;
  50454. }
  50455. /**
  50456. * @function SuperMap.LevelRenderer.Shape.prototype.buildPath
  50457. * @description 构建绘制的Path。子类必须重新实现此方法。
  50458. *
  50459. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  50460. * @param {Object} style - 样式。
  50461. */
  50462. }, {
  50463. key: "buildPath",
  50464. value: function buildPath(ctx, style) {
  50465. // eslint-disable-line no-unused-vars
  50466. SUtil.Util_log('buildPath not implemented in ' + this.type);
  50467. }
  50468. /**
  50469. * @function SuperMap.LevelRenderer.Shape.prototype.getRect
  50470. * @description 计算返回包围盒矩形。子类必须重新实现此方法。
  50471. *
  50472. * @param {Object} style - 样式。
  50473. */
  50474. }, {
  50475. key: "getRect",
  50476. value: function getRect(style) {
  50477. // eslint-disable-line no-unused-vars
  50478. SUtil.Util_log('getRect not implemented in ' + this.type);
  50479. }
  50480. /**
  50481. * @function SuperMap.LevelRenderer.Shape.prototype.isCover
  50482. * @description 判断鼠标位置是否在图形内。
  50483. *
  50484. * @param {number} x - x。
  50485. * @param {number} y - y。
  50486. */
  50487. }, {
  50488. key: "isCover",
  50489. value: function isCover(x, y) {
  50490. var originPos = this.getTansform(x, y);
  50491. x = originPos[0];
  50492. y = originPos[1]; // 快速预判并保留判断矩形
  50493. var rect = this.style.__rect;
  50494. if (!rect) {
  50495. rect = this.style.__rect = this.getRect(this.style);
  50496. }
  50497. if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) {
  50498. // 矩形内
  50499. return SUtil.Util_area.isInside(this, this.style, x, y);
  50500. }
  50501. return false;
  50502. }
  50503. /**
  50504. * @function SuperMap.LevelRenderer.Shape.prototype.drawText
  50505. * @description 绘制附加文本。
  50506. *
  50507. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  50508. * @param {string} style - 样式。
  50509. * @param {string} normalStyle - normalStyle 默认样式,用于定位文字显示。
  50510. */
  50511. }, {
  50512. key: "drawText",
  50513. value: function drawText(ctx, style, normalStyle) {
  50514. if (typeof style.text == 'undefined' || style.text === false) {
  50515. return;
  50516. } // 字体颜色策略
  50517. var textColor = style.textColor || style.color || style.strokeColor;
  50518. ctx.fillStyle = textColor; // 文本与图形间空白间隙
  50519. var dd = 10;
  50520. var al; // 文本水平对齐
  50521. var bl; // 文本垂直对齐
  50522. var tx; // 文本横坐标
  50523. var ty; // 文本纵坐标
  50524. var textPosition = style.textPosition // 用户定义
  50525. || this.textPosition // shape默认
  50526. || 'top'; // 全局默认
  50527. // Smic 方法修改 -start
  50528. var __OP = [];
  50529. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  50530. __OP = [0, 0];
  50531. } else {
  50532. __OP = this.refOriginalPosition;
  50533. } //原代码:
  50534. // Smic 方法修改 -end
  50535. switch (textPosition) {
  50536. case 'inside':
  50537. case 'top':
  50538. case 'bottom':
  50539. case 'left':
  50540. case 'right':
  50541. if (this.getRect) {
  50542. var rect = (normalStyle || style).__rect || this.getRect(normalStyle || style);
  50543. switch (textPosition) {
  50544. case 'inside':
  50545. tx = rect.x + rect.width / 2;
  50546. ty = rect.y + rect.height / 2;
  50547. al = 'center';
  50548. bl = 'middle';
  50549. if (style.brushType != 'stroke' && textColor == style.color) {
  50550. ctx.fillStyle = '#fff';
  50551. }
  50552. break;
  50553. case 'left':
  50554. tx = rect.x - dd;
  50555. ty = rect.y + rect.height / 2;
  50556. al = 'end';
  50557. bl = 'middle';
  50558. break;
  50559. case 'right':
  50560. tx = rect.x + rect.width + dd;
  50561. ty = rect.y + rect.height / 2;
  50562. al = 'start';
  50563. bl = 'middle';
  50564. break;
  50565. case 'top':
  50566. tx = rect.x + rect.width / 2;
  50567. ty = rect.y - dd;
  50568. al = 'center';
  50569. bl = 'bottom';
  50570. break;
  50571. case 'bottom':
  50572. tx = rect.x + rect.width / 2;
  50573. ty = rect.y + rect.height + dd;
  50574. al = 'center';
  50575. bl = 'top';
  50576. break;
  50577. }
  50578. }
  50579. break;
  50580. case 'start':
  50581. case 'end':
  50582. var xStart = 0;
  50583. var xEnd = 0;
  50584. var yStart = 0;
  50585. var yEnd = 0;
  50586. if (typeof style.pointList != 'undefined') {
  50587. var pointList = style.pointList;
  50588. if (pointList.length < 2) {
  50589. // 少于2个点就不画了~
  50590. return;
  50591. }
  50592. var length = pointList.length;
  50593. switch (textPosition) {
  50594. // Smic 方法修改 -start
  50595. case 'start':
  50596. xStart = pointList[0][0] + __OP[0];
  50597. xEnd = pointList[1][0] + __OP[0];
  50598. yStart = pointList[0][1] + __OP[1];
  50599. yEnd = pointList[1][1] + __OP[1];
  50600. break;
  50601. case 'end':
  50602. xStart = pointList[length - 2][0] + __OP[0];
  50603. xEnd = pointList[length - 1][0] + __OP[0];
  50604. yStart = pointList[length - 2][1] + __OP[1];
  50605. yEnd = pointList[length - 1][1] + __OP[1];
  50606. break;
  50607. //原代码:
  50608. /*
  50609. case 'start':
  50610. xStart = pointList[0][0];
  50611. xEnd = pointList[1][0];
  50612. yStart = pointList[0][1];
  50613. yEnd = pointList[1][1];
  50614. break;
  50615. case 'end':
  50616. xStart = pointList[length - 2][0];
  50617. xEnd = pointList[length - 1][0];
  50618. yStart = pointList[length - 2][1];
  50619. yEnd = pointList[length - 1][1];
  50620. break;
  50621. */
  50622. // Smic 方法修改 -end
  50623. }
  50624. } else {
  50625. // Smic 方法修改 -start
  50626. xStart = style.xStart + __OP[0] || 0;
  50627. xEnd = style.xEnd + __OP[0] || 0;
  50628. yStart = style.yStart + __OP[1] || 0;
  50629. yEnd = style.yEnd + __OP[1] || 0; //原代码:
  50630. /*
  50631. xStart = style.xStart || 0;
  50632. xEnd = style.xEnd || 0;
  50633. yStart = style.yStart || 0;
  50634. yEnd = style.yEnd || 0;
  50635. */
  50636. // Smic 方法修改 -end
  50637. }
  50638. switch (textPosition) {
  50639. case 'start':
  50640. al = xStart < xEnd ? 'end' : 'start';
  50641. bl = yStart < yEnd ? 'bottom' : 'top';
  50642. tx = xStart;
  50643. ty = yStart;
  50644. break;
  50645. case 'end':
  50646. al = xStart < xEnd ? 'start' : 'end';
  50647. bl = yStart < yEnd ? 'top' : 'bottom';
  50648. tx = xEnd;
  50649. ty = yEnd;
  50650. break;
  50651. }
  50652. dd -= 4;
  50653. if (xStart && xEnd && xStart != xEnd) {
  50654. tx -= al == 'end' ? dd : -dd;
  50655. } else {
  50656. al = 'center';
  50657. }
  50658. if (yStart != yEnd) {
  50659. ty -= bl == 'bottom' ? dd : -dd;
  50660. } else {
  50661. bl = 'middle';
  50662. }
  50663. break;
  50664. case 'specific':
  50665. tx = style.textX || 0;
  50666. ty = style.textY || 0;
  50667. al = 'start';
  50668. bl = 'middle';
  50669. break;
  50670. } // Smic 方法修改 -start
  50671. if (style.labelXOffset && !isNaN(style.labelXOffset)) {
  50672. tx += style.labelXOffset;
  50673. }
  50674. if (style.labelYOffset && !isNaN(style.labelYOffset)) {
  50675. ty += style.labelYOffset;
  50676. } //原代码:
  50677. // Smic 方法修改 -end
  50678. if (tx != null && ty != null) {
  50679. Shape._fillText(ctx, style.text, tx, ty, style.textFont, style.textAlign || al, style.textBaseline || bl);
  50680. }
  50681. }
  50682. /**
  50683. * @function SuperMap.LevelRenderer.Shape.prototype.modSelf
  50684. * @description 图形发生改变
  50685. */
  50686. }, {
  50687. key: "modSelf",
  50688. value: function modSelf() {
  50689. this.__dirty = true;
  50690. if (this.style) {
  50691. this.style.__rect = null;
  50692. }
  50693. if (this.highlightStyle) {
  50694. this.highlightStyle.__rect = null;
  50695. }
  50696. }
  50697. /**
  50698. * @function SuperMap.LevelRenderer.Shape.prototype.isSilent
  50699. * @description 图形是否会触发事件,通过 bind 绑定的事件
  50700. */
  50701. }, {
  50702. key: "isSilent",
  50703. value: function isSilent() {
  50704. 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);
  50705. }
  50706. /**
  50707. * @function SuperMap.LevelRenderer.Shape.prototype.setCtxGlobalAlpha
  50708. * @description 设置 Cavans 上下文全局透明度
  50709. *
  50710. * @param {Object} _ctx - Cavans 上下文
  50711. * @param {string} type - one of 'stroke', 'fill', or 'reset'
  50712. * @param {Object} style - Symbolizer hash
  50713. */
  50714. }, {
  50715. key: "setCtxGlobalAlpha",
  50716. value: function setCtxGlobalAlpha(_ctx, type, style) {
  50717. if (type === "fill") {
  50718. _ctx.globalAlpha = typeof style["fillOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['fillOpacity'];
  50719. } else if (type === "stroke") {
  50720. _ctx.globalAlpha = typeof style["strokeOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['strokeOpacity'];
  50721. } else {
  50722. _ctx.globalAlpha = typeof style["opacity"] === "undefined" ? 1 : style['opacity'];
  50723. }
  50724. }
  50725. /**
  50726. * @function SuperMap.LevelRenderer.Shape.prototype._fillText
  50727. * @description 填充文本
  50728. */
  50729. }], [{
  50730. key: "_fillText",
  50731. value: function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) {
  50732. if (textFont) {
  50733. ctx.font = textFont;
  50734. }
  50735. ctx.textAlign = textAlign;
  50736. ctx.textBaseline = textBaseline;
  50737. var rect = Shape._getTextRect(text, x, y, textFont, textAlign, textBaseline);
  50738. text = (text + '').split('\n');
  50739. var lineHeight = SUtil.Util_area.getTextHeight('ZH', textFont);
  50740. switch (textBaseline) {
  50741. case 'top':
  50742. y = rect.y;
  50743. break;
  50744. case 'bottom':
  50745. y = rect.y + lineHeight;
  50746. break;
  50747. default:
  50748. y = rect.y + lineHeight / 2;
  50749. }
  50750. for (var i = 0, l = text.length; i < l; i++) {
  50751. ctx.fillText(text[i], x, y);
  50752. y += lineHeight;
  50753. }
  50754. }
  50755. /**
  50756. * @function SuperMap.LevelRenderer.Shape._getTextRect
  50757. * @description 返回矩形区域,用于局部刷新和文字定位
  50758. *
  50759. * @param {string} text - text。
  50760. * @param {number} x - x。
  50761. * @param {number} y - y。
  50762. * @param {string} textFont - textFont。
  50763. * @param {string} textAlign - textAlign。
  50764. * @param {string} textBaseline - textBaseline。
  50765. * @return {Object} 矩形区域。
  50766. */
  50767. }, {
  50768. key: "_getTextRect",
  50769. value: function _getTextRect(text, x, y, textFont, textAlign, textBaseline) {
  50770. var width = SUtil.Util_area.getTextWidth(text, textFont);
  50771. var lineHeight = SUtil.Util_area.getTextHeight('ZH', textFont);
  50772. text = (text + '').split('\n');
  50773. switch (textAlign) {
  50774. case 'end':
  50775. case 'right':
  50776. x -= width;
  50777. break;
  50778. case 'center':
  50779. x -= width / 2;
  50780. break;
  50781. }
  50782. switch (textBaseline) {
  50783. case 'top':
  50784. break;
  50785. case 'bottom':
  50786. y -= lineHeight * text.length;
  50787. break;
  50788. default:
  50789. y -= lineHeight * text.length / 2;
  50790. }
  50791. return {
  50792. x: x,
  50793. y: y,
  50794. width: width,
  50795. height: lineHeight * text.length
  50796. };
  50797. }
  50798. }]);
  50799. return Shape;
  50800. }(SuperMap.mixin(Eventful, Transformable_Transformable));
  50801. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPoint.js
  50802. 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); }
  50803. function SmicPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50804. 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); } }
  50805. function SmicPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPoint_defineProperties(Constructor, staticProps); return Constructor; }
  50806. 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); }
  50807. function SmicPoint_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPoint_getPrototypeOf(object); if (object === null) break; } return object; }
  50808. 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); }
  50809. function SmicPoint_setPrototypeOf(o, p) { SmicPoint_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPoint_setPrototypeOf(o, p); }
  50810. 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); }; }
  50811. function SmicPoint_possibleConstructorReturn(self, call) { if (call && (SmicPoint_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicPoint_assertThisInitialized(self); }
  50812. function SmicPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50813. 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; } }
  50814. function SmicPoint_getPrototypeOf(o) { SmicPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPoint_getPrototypeOf(o); }
  50815. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  50816. * This program are made available under the terms of the Apache License, Version 2.0
  50817. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50818. /**
  50819. * @private
  50820. * @class SuperMap.LevelRenderer.Shape.SmicPoint
  50821. * @category Visualization Theme
  50822. * @classdesc 点。
  50823. * @extends SuperMap.LevelRenderer.Shape
  50824. * @example
  50825. * var shape = new SuperMap.LevelRenderer.Shape.SmicPoint({
  50826. * style: {
  50827. * x: 100,
  50828. * y: 100,
  50829. * r: 40,
  50830. * brushType: 'both',
  50831. * color: 'blue',
  50832. * strokeColor: 'red',
  50833. * lineWidth: 3,
  50834. * text: 'point'
  50835. * }
  50836. * });
  50837. * levelRenderer.addShape(shape);
  50838. *
  50839. *
  50840. */
  50841. var SmicPoint = /*#__PURE__*/function (_Shape) {
  50842. SmicPoint_inherits(SmicPoint, _Shape);
  50843. var _super = SmicPoint_createSuper(SmicPoint);
  50844. /**
  50845. * @member {Object} SuperMap.LevelRenderer.Shape.SmicPoint.prototype.style
  50846. * @description 绘制样式。
  50847. *
  50848. * @param {number} style.x - 圆心x坐标,必设参数。
  50849. * @param {number} style.y - 圆心y坐标,必设参数。
  50850. * @param {number} style.r - 半径,必设参数。
  50851. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  50852. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  50853. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  50854. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  50855. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  50856. * @param {number} style.opacity - 绘制透明度。默认值:1。
  50857. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  50858. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  50859. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  50860. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  50861. * @param {string} style.text - 图形中的附加文本。默认值:""。
  50862. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  50863. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  50864. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  50865. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  50866. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  50867. */
  50868. //打开接口 style
  50869. /**
  50870. * @function SuperMap.LevelRenderer.Shape.SmicPoint.constructor
  50871. * @description 构造函数。
  50872. *
  50873. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  50874. *
  50875. */
  50876. function SmicPoint(options) {
  50877. var _this;
  50878. SmicPoint_classCallCheck(this, SmicPoint);
  50879. _this = _super.call(this, options);
  50880. /**
  50881. * @member {string} SuperMap.LevelRenderer.Shape.SmicPoint.prototype.type
  50882. * @description 图形类型。
  50883. */
  50884. _this.type = 'smicpoint';
  50885. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  50886. _this.refOriginalPosition = [0, 0];
  50887. }
  50888. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPoint";
  50889. return _this;
  50890. }
  50891. /**
  50892. * @function cdestroy
  50893. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  50894. */
  50895. SmicPoint_createClass(SmicPoint, [{
  50896. key: "destroy",
  50897. value: function destroy() {
  50898. this.type = null;
  50899. SmicPoint_get(SmicPoint_getPrototypeOf(SmicPoint.prototype), "destroy", this).call(this);
  50900. }
  50901. /**
  50902. * @function SuperMap.LevelRenderer.Shape.SmicPoint.prototype.buildPath
  50903. * @description 创建点触。
  50904. *
  50905. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  50906. * @param {Object} style - style。
  50907. *
  50908. */
  50909. }, {
  50910. key: "buildPath",
  50911. value: function buildPath(ctx, style) {
  50912. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  50913. this.refOriginalPosition = [0, 0];
  50914. }
  50915. var __OP = this.refOriginalPosition;
  50916. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, true);
  50917. return;
  50918. }
  50919. /**
  50920. * @function SuperMap.LevelRenderer.Shape.SmicPoint.prototype.getRect
  50921. * @description 计算返回点的包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  50922. *
  50923. * @param {Object} style - style
  50924. * @return {Object} 边框对象。包含属性:x,y,width,height。
  50925. */
  50926. }, {
  50927. key: "getRect",
  50928. value: function getRect(style) {
  50929. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  50930. this.refOriginalPosition = [0, 0];
  50931. }
  50932. var __OP = this.refOriginalPosition;
  50933. if (style.__rect) {
  50934. return style.__rect;
  50935. }
  50936. var lineWidth;
  50937. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  50938. lineWidth = style.lineWidth || 1;
  50939. } else {
  50940. lineWidth = 0;
  50941. }
  50942. style.__rect = {
  50943. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  50944. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  50945. width: style.r * 2 + lineWidth,
  50946. height: style.r * 2 + lineWidth
  50947. };
  50948. return style.__rect;
  50949. }
  50950. }]);
  50951. return SmicPoint;
  50952. }(Shape_Shape);
  50953. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicText.js
  50954. 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); }
  50955. function SmicText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50956. 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); } }
  50957. function SmicText_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicText_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicText_defineProperties(Constructor, staticProps); return Constructor; }
  50958. 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); }
  50959. function SmicText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicText_getPrototypeOf(object); if (object === null) break; } return object; }
  50960. 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); }
  50961. function SmicText_setPrototypeOf(o, p) { SmicText_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicText_setPrototypeOf(o, p); }
  50962. 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); }; }
  50963. function SmicText_possibleConstructorReturn(self, call) { if (call && (SmicText_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicText_assertThisInitialized(self); }
  50964. function SmicText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50965. 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; } }
  50966. function SmicText_getPrototypeOf(o) { SmicText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicText_getPrototypeOf(o); }
  50967. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  50968. * This program are made available under the terms of the Apache License, Version 2.0
  50969. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50970. /**
  50971. * @private
  50972. * @class SuperMap.LevelRenderer.Shape.SmicText
  50973. * @category Visualization Theme
  50974. * @extends {SuperMap.LevelRenderer.Shape}
  50975. * @example
  50976. * var shape = new SuperMap.LevelRenderer.Shape.SmicText({
  50977. * style: {
  50978. * text: 'Label',
  50979. * x: 100,
  50980. * y: 100,
  50981. * textFont: '14px Arial'
  50982. * }
  50983. * });
  50984. * levelRenderer.addShape(shape);
  50985. *
  50986. */
  50987. var SmicText_SmicText = /*#__PURE__*/function (_Shape) {
  50988. SmicText_inherits(SmicText, _Shape);
  50989. var _super = SmicText_createSuper(SmicText);
  50990. /**
  50991. * @member {Object} SuperMap.LevelRenderer.Shape.SmicText.prototype.style
  50992. * @description 绘制样式。
  50993. *
  50994. * @param {number} style.x - 横坐标,必设参数。
  50995. * @param {number} style.y - 纵坐标,必设参数。
  50996. * @param {string} style.text - 图形中的附加文本。默认值:""。
  50997. * @param {number} style.maxWidth - 最大宽度限制。默认值:null。
  50998. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  50999. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  51000. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  51001. * @param {string} style.brushType -画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  51002. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  51003. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  51004. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  51005. * @param {number} style.opacity - 绘制透明度。默认值:1。
  51006. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  51007. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  51008. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  51009. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  51010. */
  51011. //打开接口 style
  51012. /**
  51013. * @function SuperMap.LevelRenderer.Shape.SmicText.constructor
  51014. * @description 构造函数。
  51015. *
  51016. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  51017. *
  51018. */
  51019. function SmicText(options) {
  51020. var _this;
  51021. SmicText_classCallCheck(this, SmicText);
  51022. _this = _super.call(this, options);
  51023. /**
  51024. * @member {string} SuperMap.LevelRenderer.Shape.SmicText.prototype.type
  51025. * @description 图形类型.
  51026. */
  51027. _this.type = 'smictext';
  51028. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  51029. _this.refOriginalPosition = [0, 0];
  51030. }
  51031. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicText";
  51032. return _this;
  51033. }
  51034. /**
  51035. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.destroy
  51036. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  51037. */
  51038. SmicText_createClass(SmicText, [{
  51039. key: "destroy",
  51040. value: function destroy() {
  51041. this.type = null;
  51042. SmicText_get(SmicText_getPrototypeOf(SmicText.prototype), "destroy", this).call(this);
  51043. }
  51044. /**
  51045. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.brush
  51046. * @description 笔触。
  51047. *
  51048. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  51049. * @param {boolean} isHighlight - 是否使用高亮属性。
  51050. *
  51051. */
  51052. }, {
  51053. key: "brush",
  51054. value: function brush(ctx, isHighlight) {
  51055. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51056. this.refOriginalPosition = [0, 0];
  51057. }
  51058. var __OP = this.refOriginalPosition;
  51059. var style = this.style;
  51060. if (isHighlight) {
  51061. // 根据style扩展默认高亮样式
  51062. style = this.getHighlightStyle(style, this.highlightStyle || {});
  51063. }
  51064. if (typeof style.text == 'undefined' || style.text === false) {
  51065. return;
  51066. }
  51067. ctx.save();
  51068. this.doClip(ctx);
  51069. this.setContext(ctx, style); // 设置transform
  51070. this.setTransform(ctx);
  51071. if (style.textFont) {
  51072. ctx.font = style.textFont;
  51073. }
  51074. ctx.textAlign = style.textAlign || 'start';
  51075. ctx.textBaseline = style.textBaseline || 'middle';
  51076. var text = (style.text + '').split('\n');
  51077. var lineHeight = SUtil.Util_area.getTextHeight('ZH', style.textFont);
  51078. var rect = this.getRectNoRotation(style); // var x = style.x;
  51079. var x = style.x + __OP[0];
  51080. var y;
  51081. if (style.textBaseline == 'top') {
  51082. y = rect.y;
  51083. } else if (style.textBaseline == 'bottom') {
  51084. y = rect.y + lineHeight;
  51085. } else {
  51086. y = rect.y + lineHeight / 2;
  51087. }
  51088. var ox = style.x + __OP[0];
  51089. var oy = style.y + __OP[1]; //文本绘制
  51090. for (var i = 0, l = text.length; i < l; i++) {
  51091. //是否渲染矩形背景及颜色
  51092. if (style.labelRect) {
  51093. //+4,-2是为了让文字距边框左右边缘有点间隔
  51094. ctx.fillRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  51095. ctx.fillStyle = style.strokeColor;
  51096. ctx.strokeRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  51097. ctx.fillStyle = style.textColor;
  51098. }
  51099. switch (style.brushType) {
  51100. case 'stroke':
  51101. this.setCtxGlobalAlpha(ctx, "stroke", style);
  51102. if (style.textRotation && style.textRotation !== 0) {
  51103. ctx.save();
  51104. ctx.translate(ox, oy);
  51105. ctx.rotate(style.textRotation * Math.PI / 180);
  51106. if (style.textBaseline == 'top') {
  51107. if (style.maxWidth) {
  51108. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  51109. } else {
  51110. ctx.strokeText(text[i], 0, lineHeight * i);
  51111. }
  51112. } else if (style.textBaseline == 'bottom') {
  51113. if (style.maxWidth) {
  51114. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  51115. } else {
  51116. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  51117. }
  51118. } else {
  51119. if (style.maxWidth) {
  51120. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  51121. } else {
  51122. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  51123. }
  51124. }
  51125. ctx.restore();
  51126. } else {
  51127. if (style.maxWidth) {
  51128. ctx.strokeText(text[i], x, y, style.maxWidth);
  51129. } else {
  51130. ctx.strokeText(text[i], x, y);
  51131. }
  51132. }
  51133. this.setCtxGlobalAlpha(ctx, "reset", style);
  51134. break;
  51135. case 'both':
  51136. if (style.textRotation && style.textRotation !== 0) {
  51137. ctx.save();
  51138. ctx.translate(ox, oy);
  51139. ctx.rotate(style.textRotation * Math.PI / 180);
  51140. if (style.textBaseline == 'top') {
  51141. if (style.maxWidth) {
  51142. this.setCtxGlobalAlpha(ctx, "fill", style);
  51143. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  51144. this.setCtxGlobalAlpha(ctx, "reset", style);
  51145. this.setCtxGlobalAlpha(ctx, "stroke", style);
  51146. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  51147. this.setCtxGlobalAlpha(ctx, "reset", style);
  51148. } else {
  51149. this.setCtxGlobalAlpha(ctx, "fill", style);
  51150. ctx.fillText(text[i], 0, lineHeight * i);
  51151. this.setCtxGlobalAlpha(ctx, "reset", style);
  51152. this.setCtxGlobalAlpha(ctx, "stroke", style);
  51153. ctx.strokeText(text[i], 0, lineHeight * i);
  51154. this.setCtxGlobalAlpha(ctx, "reset", style);
  51155. }
  51156. } else if (style.textBaseline == 'bottom') {
  51157. if (style.maxWidth) {
  51158. this.setCtxGlobalAlpha(ctx, "fill", style);
  51159. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  51160. this.setCtxGlobalAlpha(ctx, "reset", style);
  51161. this.setCtxGlobalAlpha(ctx, "stroke", style);
  51162. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  51163. this.setCtxGlobalAlpha(ctx, "reset", style);
  51164. } else {
  51165. this.setCtxGlobalAlpha(ctx, "fill", style);
  51166. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  51167. this.setCtxGlobalAlpha(ctx, "reset", style);
  51168. this.setCtxGlobalAlpha(ctx, "stroke", style);
  51169. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  51170. this.setCtxGlobalAlpha(ctx, "reset", style);
  51171. }
  51172. } else {
  51173. if (style.maxWidth) {
  51174. this.setCtxGlobalAlpha(ctx, "fill", style);
  51175. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  51176. this.setCtxGlobalAlpha(ctx, "reset", style);
  51177. this.setCtxGlobalAlpha(ctx, "stroke", style);
  51178. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  51179. this.setCtxGlobalAlpha(ctx, "reset", style);
  51180. } else {
  51181. this.setCtxGlobalAlpha(ctx, "fill", style);
  51182. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  51183. this.setCtxGlobalAlpha(ctx, "reset", style);
  51184. this.setCtxGlobalAlpha(ctx, "stroke", style);
  51185. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  51186. this.setCtxGlobalAlpha(ctx, "reset", style);
  51187. }
  51188. }
  51189. ctx.restore();
  51190. } else {
  51191. if (style.maxWidth) {
  51192. this.setCtxGlobalAlpha(ctx, "fill", style);
  51193. ctx.fillText(text[i], x, y, style.maxWidth);
  51194. this.setCtxGlobalAlpha(ctx, "reset", style);
  51195. this.setCtxGlobalAlpha(ctx, "stroke", style);
  51196. ctx.strokeText(text[i], x, y, style.maxWidth);
  51197. this.setCtxGlobalAlpha(ctx, "reset", style);
  51198. } else {
  51199. this.setCtxGlobalAlpha(ctx, "fill", style);
  51200. ctx.fillText(text[i], x, y);
  51201. this.setCtxGlobalAlpha(ctx, "reset", style);
  51202. this.setCtxGlobalAlpha(ctx, "stroke", style);
  51203. ctx.strokeText(text[i], x, y);
  51204. this.setCtxGlobalAlpha(ctx, "reset", style);
  51205. }
  51206. }
  51207. break;
  51208. default:
  51209. //fill or others
  51210. this.setCtxGlobalAlpha(ctx, "fill", style);
  51211. if (style.textRotation && style.textRotation !== 0) {
  51212. ctx.save();
  51213. ctx.translate(ox, oy);
  51214. ctx.rotate(style.textRotation * Math.PI / 180);
  51215. if (style.textBaseline == 'top') {
  51216. if (style.maxWidth) {
  51217. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  51218. } else {
  51219. ctx.fillText(text[i], 0, lineHeight * i);
  51220. }
  51221. } else if (style.textBaseline == 'bottom') {
  51222. if (style.maxWidth) {
  51223. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  51224. } else {
  51225. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  51226. }
  51227. } else {
  51228. if (style.maxWidth) {
  51229. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  51230. } else {
  51231. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  51232. }
  51233. }
  51234. ctx.restore();
  51235. } else {
  51236. if (style.maxWidth) {
  51237. ctx.fillText(text[i], x, y, style.maxWidth);
  51238. } else {
  51239. ctx.fillText(text[i], x, y);
  51240. }
  51241. }
  51242. this.setCtxGlobalAlpha(ctx, "reset", style);
  51243. }
  51244. y += lineHeight;
  51245. }
  51246. ctx.restore();
  51247. return;
  51248. }
  51249. /**
  51250. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRect
  51251. * @description 返回文字包围盒矩形
  51252. */
  51253. }, {
  51254. key: "getRect",
  51255. value: function getRect(style) {
  51256. if (style.__rect) {
  51257. return style.__rect;
  51258. }
  51259. var left, top, right, bottom;
  51260. var tbg = this.getTextBackground(style, true);
  51261. for (var i = 0, len = tbg.length; i < len; i++) {
  51262. var poi = tbg[i]; //用第一个点初始化
  51263. if (i == 0) {
  51264. left = poi[0];
  51265. right = poi[0];
  51266. top = poi[1];
  51267. bottom = poi[1];
  51268. } else {
  51269. if (poi[0] < left) {
  51270. left = poi[0];
  51271. }
  51272. if (poi[0] > right) {
  51273. right = poi[0];
  51274. }
  51275. if (poi[1] < top) {
  51276. top = poi[1];
  51277. }
  51278. if (poi[1] > bottom) {
  51279. bottom = poi[1];
  51280. }
  51281. }
  51282. }
  51283. style.__rect = {
  51284. x: left,
  51285. y: top,
  51286. width: right - left,
  51287. height: bottom - top
  51288. };
  51289. return style.__rect;
  51290. }
  51291. /**
  51292. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRectNoRotation
  51293. * @description 返回忽略旋转和maxWidth时文字包围盒矩形
  51294. */
  51295. }, {
  51296. key: "getRectNoRotation",
  51297. value: function getRectNoRotation(style) {
  51298. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51299. this.refOriginalPosition = [0, 0];
  51300. }
  51301. var __OP = this.refOriginalPosition;
  51302. var lineHeight = SUtil.Util_area.getTextHeight('ZH', style.textFont);
  51303. var width = SUtil.Util_area.getTextWidth(style.text, style.textFont);
  51304. var height = SUtil.Util_area.getTextHeight(style.text, style.textFont); //处理文字位置,注:文本的绘制是由此 rect 决定
  51305. var textX = style.x + __OP[0]; // 默认start == left
  51306. if (style.textAlign == 'end' || style.textAlign == 'right') {
  51307. textX -= width;
  51308. } else if (style.textAlign == 'center') {
  51309. textX -= width / 2;
  51310. }
  51311. var textY;
  51312. if (style.textBaseline == 'top') {
  51313. // textY = style.y;
  51314. textY = style.y + __OP[1];
  51315. } else if (style.textBaseline == 'bottom') {
  51316. textY = style.y + __OP[1] - height;
  51317. } else {
  51318. // middle
  51319. textY = style.y + __OP[1] - height / 2;
  51320. }
  51321. var isWidthChangeByMaxWidth = false;
  51322. var widthBeforeChangeByMaxWidth; //处理 maxWidth
  51323. if (style.maxWidth) {
  51324. var maxWidth = parseInt(style.maxWidth);
  51325. if (maxWidth < width) {
  51326. widthBeforeChangeByMaxWidth = width;
  51327. isWidthChangeByMaxWidth = true;
  51328. width = maxWidth;
  51329. }
  51330. textX = style.x + __OP[0];
  51331. if (style.textAlign == 'end' || style.textAlign == 'right') {
  51332. textX -= width;
  51333. } else if (style.textAlign == 'center') {
  51334. textX -= width / 2;
  51335. }
  51336. } //处理斜体字
  51337. if (style.textFont) {
  51338. var textFont = style.textFont;
  51339. var textFontStr = textFont.toLowerCase();
  51340. if (textFontStr.indexOf("italic") > -1) {
  51341. if (isWidthChangeByMaxWidth === true) {
  51342. width += lineHeight / 3 * (width / widthBeforeChangeByMaxWidth);
  51343. } else {
  51344. width += lineHeight / 3;
  51345. }
  51346. }
  51347. }
  51348. var rect = {
  51349. x: textX,
  51350. y: textY,
  51351. width: width,
  51352. height: height
  51353. };
  51354. return rect;
  51355. }
  51356. /**
  51357. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getTextBackground
  51358. * @description 获取文本背景框范围
  51359. *
  51360. * @param {Object} style - 样式。
  51361. * @param {boolean} redo - 是否强制重新计算 textBackground。
  51362. */
  51363. }, {
  51364. key: "getTextBackground",
  51365. value: function getTextBackground(style, redo) {
  51366. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51367. this.refOriginalPosition = [0, 0];
  51368. }
  51369. var __OP = this.refOriginalPosition;
  51370. if (!redo && style.__textBackground) {
  51371. return style.__textBackground;
  51372. } //不旋转时矩形框
  51373. var rect = this.getRectNoRotation(style); //旋转中心点
  51374. var ox = style.x + __OP[0];
  51375. var oy = style.y + __OP[1]; //背景框
  51376. var background = [];
  51377. if (style.textRotation && style.textRotation !== 0) {
  51378. var textRotation = style.textRotation;
  51379. var ltPoi = this.getRotatedLocation(rect.x, rect.y, ox, oy, textRotation);
  51380. var rtPoi = this.getRotatedLocation(rect.x + rect.width, rect.y, ox, oy, textRotation);
  51381. var rbPoi = this.getRotatedLocation(rect.x + rect.width, rect.y + rect.height, ox, oy, textRotation);
  51382. var lbPoi = this.getRotatedLocation(rect.x, rect.y + rect.height, ox, oy, textRotation);
  51383. background.push(ltPoi);
  51384. background.push(rtPoi);
  51385. background.push(rbPoi);
  51386. background.push(lbPoi);
  51387. } else {
  51388. var _ltPoi = [rect.x, rect.y];
  51389. var _rtPoi = [rect.x + rect.width, rect.y];
  51390. var _rbPoi = [rect.x + rect.width, rect.y + rect.height];
  51391. var _lbPoi = [rect.x, rect.y + rect.height];
  51392. background.push(_ltPoi);
  51393. background.push(_rtPoi);
  51394. background.push(_rbPoi);
  51395. background.push(_lbPoi);
  51396. }
  51397. style.__textBackground = background;
  51398. return style.__textBackground;
  51399. }
  51400. /**
  51401. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRotatedLocation
  51402. * @description 获取一个点绕旋转中心顺时针旋转后的位置。(此方法用于屏幕坐标)
  51403. *
  51404. * @param {number} x - 旋转点横坐标。
  51405. * @param {number} y - 旋转点纵坐标。
  51406. * @param {number} rx - 旋转中心点横坐标。
  51407. * @param {number} ry - 旋转中心点纵坐标。
  51408. * @param {number} angle - 旋转角度(度)。
  51409. * @return {Array} 旋转后的坐标位置,长度为 2 的一维数组,数组第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  51410. */
  51411. }, {
  51412. key: "getRotatedLocation",
  51413. value: function getRotatedLocation(x, y, rx, ry, angle) {
  51414. var loc = new Array(),
  51415. x0,
  51416. y0;
  51417. y = -y;
  51418. ry = -ry;
  51419. angle = -angle; //顺时针旋转
  51420. x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
  51421. y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
  51422. loc[0] = x0;
  51423. loc[1] = -y0;
  51424. return loc;
  51425. }
  51426. }]);
  51427. return SmicText;
  51428. }(Shape_Shape);
  51429. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicCircle.js
  51430. 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); }
  51431. function SmicCircle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51432. 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); } }
  51433. function SmicCircle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicCircle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicCircle_defineProperties(Constructor, staticProps); return Constructor; }
  51434. 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); }
  51435. function SmicCircle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicCircle_getPrototypeOf(object); if (object === null) break; } return object; }
  51436. 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); }
  51437. function SmicCircle_setPrototypeOf(o, p) { SmicCircle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicCircle_setPrototypeOf(o, p); }
  51438. 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); }; }
  51439. function SmicCircle_possibleConstructorReturn(self, call) { if (call && (SmicCircle_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicCircle_assertThisInitialized(self); }
  51440. function SmicCircle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51441. 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; } }
  51442. function SmicCircle_getPrototypeOf(o) { SmicCircle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicCircle_getPrototypeOf(o); }
  51443. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  51444. * This program are made available under the terms of the Apache License, Version 2.0
  51445. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51446. /**
  51447. * @private
  51448. * @class SuperMap.LevelRenderer.Shape.SmicCircle
  51449. * @category Visualization Theme
  51450. * @classdesc 圆形
  51451. * @extends SuperMap.LevelRenderer.Shape
  51452. * @example
  51453. * var shape = new SuperMap.LevelRenderer.Shape.SmicCircle({
  51454. * style: {
  51455. * x: 100,
  51456. * y: 100,
  51457. * r: 60,
  51458. * brushType: "both",
  51459. * color: "blue",
  51460. * strokeColor: "red",
  51461. * lineWidth: 3,
  51462. * text: "Circle"
  51463. * }
  51464. * });
  51465. * levelRenderer.addShape(shape);
  51466. *
  51467. *
  51468. */
  51469. var SmicCircle = /*#__PURE__*/function (_Shape) {
  51470. SmicCircle_inherits(SmicCircle, _Shape);
  51471. var _super = SmicCircle_createSuper(SmicCircle);
  51472. /**
  51473. * @member {Object} SuperMap.LevelRenderer.Shape.SmicCircle.prototype.style
  51474. * @description 绘制样式。
  51475. *
  51476. * @param {number} x - 圆心x坐标,必设参数
  51477. * @param {number} y - 圆心y坐标,必设参数
  51478. * @param {number} r - 半径,必设参数
  51479. * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  51480. * @param {string} color - 填充颜色,默认值"#000000"
  51481. * @param {string} strokeColor - 描边颜色,默认值为'#000000'
  51482. * @param {string} lineCape — 线帽样式,可以是 butt, round, square,默认是butt
  51483. * @param {number} lineWidth - 描边宽度、默认是1
  51484. * @param {number} opacity - 绘制透明度、默认是1,不透明
  51485. * @param {number} shadowBlur - 阴影模糊度,大于0有效,默认是0
  51486. * @param {string} shadowColor - 阴影颜色,默认是'#000000'
  51487. * @param {number} shadowOffsetX - 阴影横向偏移,默认是0
  51488. * @param {number} shadowOffsetY - 阴影纵向偏移,默认是0
  51489. * @param {string} text - 图形中的附加文本,默认是0
  51490. * @param {string} textColor - 文本颜色,默认是'#000000'
  51491. * @param {string} textFont - 附加文本样式,eg:'bold 18px verdana'
  51492. * @param {string} textPosition - 附加文本位置, 可以是 inside, left, right, top, bottom
  51493. * @param {string} textAlign - 默认根据textPosition自动设置,附加文本水平对齐。可以是start, end, left, right, center
  51494. * @param {string} textBaseline 默认根据textPosition自动设置,附加文本垂直对齐。可以是top, bottom, middle, alphabetic, hanging, ideographic
  51495. */
  51496. //打开接口 style
  51497. /**
  51498. * @function SuperMap.LevelRenderer.Shape.SmicCircle.constructor
  51499. * @description 构造函数。
  51500. *
  51501. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  51502. *
  51503. */
  51504. function SmicCircle(options) {
  51505. var _this;
  51506. SmicCircle_classCallCheck(this, SmicCircle);
  51507. _this = _super.call(this, options);
  51508. /**
  51509. * @member {string} SuperMap.LevelRenderer.Shape.SmicCircle.prototype.type
  51510. * @description 图形类型。
  51511. */
  51512. _this.type = 'smiccircle';
  51513. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  51514. _this.refOriginalPosition = [0, 0];
  51515. }
  51516. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicCircle";
  51517. return _this;
  51518. }
  51519. /**
  51520. * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.destroy
  51521. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  51522. */
  51523. SmicCircle_createClass(SmicCircle, [{
  51524. key: "destroy",
  51525. value: function destroy() {
  51526. this.type = null;
  51527. SmicCircle_get(SmicCircle_getPrototypeOf(SmicCircle.prototype), "destroy", this).call(this);
  51528. }
  51529. /**
  51530. * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.buildPath
  51531. * @description 创建图形路径。
  51532. *
  51533. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  51534. * @param {Object} style - style。
  51535. *
  51536. */
  51537. }, {
  51538. key: "buildPath",
  51539. value: function buildPath(ctx, style) {
  51540. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51541. this.refOriginalPosition = [0, 0];
  51542. }
  51543. var __OP = this.refOriginalPosition;
  51544. var x = style.x + __OP[0]; // 圆心x
  51545. var y = style.y + __OP[1]; // 圆心y
  51546. ctx.moveTo(x + style.r, y);
  51547. ctx.arc(x, y, style.r, 0, Math.PI * 2, true);
  51548. return true;
  51549. }
  51550. /**
  51551. * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.getRect
  51552. * @description 返回圆形包围盒矩形
  51553. *
  51554. * @param {Object} style - style
  51555. * @return {Object} 边框对象。包含属性:x,y,width,height。
  51556. *
  51557. */
  51558. }, {
  51559. key: "getRect",
  51560. value: function getRect(style) {
  51561. if (style.__rect) {
  51562. return style.__rect;
  51563. }
  51564. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51565. this.refOriginalPosition = [0, 0];
  51566. }
  51567. var __OP = this.refOriginalPosition;
  51568. var x = style.x + __OP[0]; // 圆心x
  51569. var y = style.y + __OP[1]; // 圆心y
  51570. var r = style.r; // 圆r
  51571. var lineWidth;
  51572. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  51573. lineWidth = style.lineWidth || 1;
  51574. } else {
  51575. lineWidth = 0;
  51576. }
  51577. style.__rect = {
  51578. x: Math.round(x - r - lineWidth / 2),
  51579. y: Math.round(y - r - lineWidth / 2),
  51580. width: r * 2 + lineWidth,
  51581. height: r * 2 + lineWidth
  51582. };
  51583. return style.__rect;
  51584. }
  51585. }]);
  51586. return SmicCircle;
  51587. }(Shape_Shape);
  51588. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPolygon.js
  51589. 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); }
  51590. function SmicPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51591. 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); } }
  51592. function SmicPolygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPolygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPolygon_defineProperties(Constructor, staticProps); return Constructor; }
  51593. 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); }
  51594. function SmicPolygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPolygon_getPrototypeOf(object); if (object === null) break; } return object; }
  51595. 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); }
  51596. function SmicPolygon_setPrototypeOf(o, p) { SmicPolygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPolygon_setPrototypeOf(o, p); }
  51597. 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); }; }
  51598. function SmicPolygon_possibleConstructorReturn(self, call) { if (call && (SmicPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicPolygon_assertThisInitialized(self); }
  51599. function SmicPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51600. 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; } }
  51601. function SmicPolygon_getPrototypeOf(o) { SmicPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPolygon_getPrototypeOf(o); }
  51602. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  51603. * This program are made available under the terms of the Apache License, Version 2.0
  51604. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51605. /**
  51606. * @private
  51607. * @class SuperMap.LevelRenderer.Shape.SmicPolygon
  51608. * @category Visualization Theme
  51609. * @classdesc 多边形。
  51610. * @extends SuperMap.LevelRenderer.Shape
  51611. * @example
  51612. * var shape = new SuperMap.LevelRenderer.Shape.SmicPolygon({
  51613. * style: {
  51614. * // 100x100 的正方形
  51615. * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]],
  51616. * color: 'blue'
  51617. * }
  51618. * });
  51619. * levelRenderer.addShape(shape);
  51620. *
  51621. */
  51622. var SmicPolygon_SmicPolygon = /*#__PURE__*/function (_Shape) {
  51623. SmicPolygon_inherits(SmicPolygon, _Shape);
  51624. var _super = SmicPolygon_createSuper(SmicPolygon);
  51625. /**
  51626. * @member {Object} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.style
  51627. * @description 绘制样式。
  51628. *
  51629. * @param {Array} pointList - 节点数组,二维数组。默认值:null,必设参数。其形式如下:
  51630. * (code)
  51631. * (start code)
  51632. * [
  51633. * [10, 20], //单个节点
  51634. * [30, 40],
  51635. * [25, 30]
  51636. * ]
  51637. * (end)
  51638. * @param {string} style.smooth - 是否做平滑插值, 平滑算法可以选择 "bezier", "spline"。默认值:"";
  51639. * @param {number} style.smoothConstraint - 平滑约束。
  51640. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  51641. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  51642. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  51643. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  51644. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  51645. * @param {number} style.opacity - 绘制透明度。默认值:1。
  51646. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  51647. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  51648. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  51649. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  51650. * @param {string} style.text - 图形中的附加文本。默认值:""。
  51651. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  51652. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  51653. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  51654. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  51655. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  51656. */
  51657. //打开接口 style
  51658. /**
  51659. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.constructor
  51660. * @description 构造函数。
  51661. *
  51662. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  51663. *
  51664. */
  51665. function SmicPolygon(options) {
  51666. var _this;
  51667. SmicPolygon_classCallCheck(this, SmicPolygon);
  51668. _this = _super.call(this, options);
  51669. /**
  51670. * @member {string} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.type
  51671. * @description 图形类型.
  51672. */
  51673. _this.type = 'smicpolygon';
  51674. /**
  51675. * @member {Array} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype._holePolygonPointList
  51676. * @description 岛洞面多边形顶点数组(三维数组)
  51677. *
  51678. */
  51679. _this.holePolygonPointLists = null;
  51680. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  51681. _this.refOriginalPosition = [0, 0];
  51682. }
  51683. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPolygon";
  51684. return _this;
  51685. }
  51686. /**
  51687. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.destroy
  51688. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  51689. */
  51690. SmicPolygon_createClass(SmicPolygon, [{
  51691. key: "destroy",
  51692. value: function destroy() {
  51693. this.type = null;
  51694. this.holePolygonPointLists = null;
  51695. SmicPolygon_get(SmicPolygon_getPrototypeOf(SmicPolygon.prototype), "destroy", this).call(this);
  51696. }
  51697. /**
  51698. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.brush
  51699. * @description 笔触。
  51700. *
  51701. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  51702. * @param {boolean} isHighlight - 是否使用高亮属性。
  51703. *
  51704. */
  51705. }, {
  51706. key: "brush",
  51707. value: function brush(ctx, isHighlight) {
  51708. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51709. this.refOriginalPosition = [0, 0];
  51710. }
  51711. var style = this.style;
  51712. if (isHighlight) {
  51713. // 根据style扩展默认高亮样式
  51714. style = this.getHighlightStyle(style, this.highlightStyle || {});
  51715. }
  51716. ctx.save();
  51717. this.setContext(ctx, style); // 设置 transform
  51718. this.setTransform(ctx); // 先 fill 再stroke
  51719. var hasPath = false;
  51720. if (style.brushType == 'fill' || style.brushType == 'both' || typeof style.brushType == 'undefined') {
  51721. // 默认为fill
  51722. ctx.beginPath();
  51723. if (style.lineType == 'dashed' || style.lineType == 'dotted' || style.lineType == 'dot' || style.lineType == 'dash' || style.lineType == 'dashdot' || style.lineType == 'longdash' || style.lineType == 'longdashdot') {
  51724. // 特殊处理,虚线围不成path,实线再build一次
  51725. this.buildPath(ctx, {
  51726. lineType: 'solid',
  51727. lineWidth: style.lineWidth,
  51728. pointList: style.pointList
  51729. });
  51730. } else {
  51731. this.buildPath(ctx, style);
  51732. hasPath = true; // 这个path能用
  51733. }
  51734. ctx.closePath();
  51735. this.setCtxGlobalAlpha(ctx, "fill", style);
  51736. ctx.fill();
  51737. this.setCtxGlobalAlpha(ctx, "reset", style);
  51738. }
  51739. if (style.lineWidth > 0 && (style.brushType == 'stroke' || style.brushType == 'both')) {
  51740. if (!hasPath) {
  51741. ctx.beginPath();
  51742. this.buildPath(ctx, style);
  51743. }
  51744. this.setCtxGlobalAlpha(ctx, "stroke", style);
  51745. ctx.stroke();
  51746. this.setCtxGlobalAlpha(ctx, "reset", style);
  51747. }
  51748. this.drawText(ctx, style, this.style); //岛洞
  51749. var hpStyle = Util_Util.cloneObject(style);
  51750. if (hpStyle.pointList) {
  51751. if (this.holePolygonPointLists && this.holePolygonPointLists.length > 0) {
  51752. var holePLS = this.holePolygonPointLists;
  51753. var holePLSen = holePLS.length;
  51754. for (var i = 0; i < holePLSen; i++) {
  51755. var holePL = holePLS[i]; //岛洞面
  51756. hpStyle.pointList = holePL;
  51757. ctx.globalCompositeOperation = "destination-out"; // 先 fill 再stroke
  51758. hasPath = false;
  51759. if (hpStyle.brushType == 'fill' || hpStyle.brushType == 'both' || typeof hpStyle.brushType == 'undefined') {
  51760. // 默认为fill
  51761. ctx.beginPath();
  51762. if (hpStyle.lineType == 'dashed' || hpStyle.lineType == 'dotted' || hpStyle.lineType == 'dot' || hpStyle.lineType == 'dash' || hpStyle.lineType == 'dashdot' || hpStyle.lineType == 'longdash' || hpStyle.lineType == 'longdashdot') {
  51763. // 特殊处理,虚线围不成path,实线再build一次
  51764. this.buildPath(ctx, {
  51765. lineType: 'solid',
  51766. lineWidth: hpStyle.lineWidth,
  51767. pointList: hpStyle.pointList
  51768. });
  51769. } else {
  51770. this.buildPath(ctx, hpStyle);
  51771. hasPath = true; // 这个path能用
  51772. }
  51773. ctx.closePath();
  51774. this.setCtxGlobalAlpha(ctx, "fill", hpStyle);
  51775. ctx.fill();
  51776. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  51777. }
  51778. if (hpStyle.lineWidth > 0 && (hpStyle.brushType == 'stroke' || hpStyle.brushType == 'both')) {
  51779. if (!hasPath) {
  51780. ctx.beginPath();
  51781. this.buildPath(ctx, hpStyle);
  51782. } //如果描边,先回复 globalCompositeOperation 默认值再描边。
  51783. ctx.globalCompositeOperation = "source-over";
  51784. this.setCtxGlobalAlpha(ctx, "stroke", hpStyle);
  51785. ctx.stroke();
  51786. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  51787. } else {
  51788. ctx.globalCompositeOperation = "source-over";
  51789. }
  51790. }
  51791. }
  51792. }
  51793. ctx.restore();
  51794. return;
  51795. }
  51796. /**
  51797. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.buildPath
  51798. * @description 创建多边形路径。
  51799. *
  51800. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  51801. * @param {Object} style - style。
  51802. *
  51803. */
  51804. }, {
  51805. key: "buildPath",
  51806. value: function buildPath(ctx, style) {
  51807. if (style.showShadow) {
  51808. ctx.shadowBlur = style.shadowBlur;
  51809. ctx.shadowColor = style.shadowColor;
  51810. ctx.shadowOffsetX = style.shadowOffsetX;
  51811. ctx.shadowOffsetY = style.shadowOffsetY;
  51812. }
  51813. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51814. this.refOriginalPosition = [0, 0];
  51815. }
  51816. var __OP = this.refOriginalPosition; // 虽然能重用 brokenLine,但底层图形基于性能考虑,重复代码减少调用吧
  51817. var pointList = style.pointList;
  51818. if (pointList.length < 2) {
  51819. // 少于2个点就不画了~
  51820. return;
  51821. }
  51822. if (style.smooth && style.smooth !== 'spline') {
  51823. var controlPoints = SUtil.SUtil_smoothBezier(pointList, style.smooth, true, style.smoothConstraint, __OP);
  51824. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51825. var cp1;
  51826. var cp2;
  51827. var p;
  51828. var len = pointList.length;
  51829. for (var i = 0; i < len; i++) {
  51830. cp1 = controlPoints[i * 2];
  51831. cp2 = controlPoints[i * 2 + 1];
  51832. p = [pointList[(i + 1) % len][0] + __OP[0], pointList[(i + 1) % len][1] + __OP[1]];
  51833. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  51834. }
  51835. } else {
  51836. if (style.smooth === 'spline') {
  51837. pointList = SUtil.SUtil_smoothSpline(pointList, true, null, __OP);
  51838. }
  51839. if (!style.lineType || style.lineType == 'solid') {
  51840. // 默认为实线
  51841. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51842. for (var _i = 1; _i < pointList.length; _i++) {
  51843. ctx.lineTo(pointList[_i][0] + __OP[0], pointList[_i][1] + __OP[1]);
  51844. }
  51845. ctx.lineTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51846. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  51847. // SMIC-方法修改 - start
  51848. var dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  51849. style._dashLength = dashLengthForStyle;
  51850. var dashLength = style.lineWidth || 1;
  51851. var pattern1 = dashLength;
  51852. var pattern2 = dashLength; //dashed
  51853. if (style.lineType === 'dashed') {
  51854. pattern1 *= 5;
  51855. pattern2 *= 5;
  51856. if (style.lineCap && style.lineCap !== "butt") {
  51857. pattern1 -= dashLength;
  51858. pattern2 += dashLength;
  51859. }
  51860. } //dotted
  51861. if (style.lineType === 'dotted') {
  51862. if (style.lineCap && style.lineCap !== "butt") {
  51863. pattern1 = 1;
  51864. pattern2 += dashLength;
  51865. }
  51866. } //dot
  51867. if (style.lineType === 'dot') {
  51868. pattern2 *= 4;
  51869. if (style.lineCap && style.lineCap !== "butt") {
  51870. pattern1 = 1;
  51871. pattern2 += dashLength;
  51872. }
  51873. } //dash
  51874. if (style.lineType === 'dash') {
  51875. pattern1 *= 4;
  51876. pattern2 *= 4;
  51877. if (style.lineCap && style.lineCap !== "butt") {
  51878. pattern1 -= dashLength;
  51879. pattern2 += dashLength;
  51880. }
  51881. } //longdash
  51882. if (style.lineType === 'longdash') {
  51883. pattern1 *= 8;
  51884. pattern2 *= 4;
  51885. if (style.lineCap && style.lineCap !== "butt") {
  51886. pattern1 -= dashLength;
  51887. pattern2 += dashLength;
  51888. }
  51889. }
  51890. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51891. for (var _i2 = 1; _i2 < pointList.length; _i2++) {
  51892. 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]);
  51893. }
  51894. 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]);
  51895. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  51896. var _dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  51897. style._dashLength = _dashLengthForStyle;
  51898. var _dashLength = style.lineWidth || 1;
  51899. var _pattern = _dashLength;
  51900. var _pattern2 = _dashLength;
  51901. var pattern3 = _dashLength;
  51902. var pattern4 = _dashLength; //dashdot
  51903. if (style.lineType === 'dashdot') {
  51904. _pattern *= 4;
  51905. _pattern2 *= 4;
  51906. pattern4 *= 4;
  51907. if (style.lineCap && style.lineCap !== "butt") {
  51908. _pattern -= _dashLength;
  51909. _pattern2 += _dashLength;
  51910. pattern3 = 1;
  51911. pattern4 += _dashLength;
  51912. }
  51913. } //longdashdot
  51914. if (style.lineType === 'longdashdot') {
  51915. _pattern *= 8;
  51916. _pattern2 *= 4;
  51917. pattern4 *= 4;
  51918. if (style.lineCap && style.lineCap !== "butt") {
  51919. _pattern -= _dashLength;
  51920. _pattern2 += _dashLength;
  51921. pattern3 = 1;
  51922. pattern4 += _dashLength;
  51923. }
  51924. }
  51925. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51926. for (var _i3 = 1; _i3 < pointList.length; _i3++) {
  51927. 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]);
  51928. }
  51929. 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]);
  51930. }
  51931. }
  51932. return;
  51933. }
  51934. /**
  51935. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.getRect
  51936. * @description 计算返回多边形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  51937. *
  51938. * @param {Object} style - style
  51939. * @return {Object} 边框对象。包含属性:x,y,width,height。
  51940. *
  51941. */
  51942. }, {
  51943. key: "getRect",
  51944. value: function getRect(style, refOriginalPosition) {
  51945. var __OP;
  51946. if (!refOriginalPosition) {
  51947. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51948. this.refOriginalPosition = [0, 0];
  51949. }
  51950. __OP = this.refOriginalPosition;
  51951. } else {
  51952. __OP = refOriginalPosition;
  51953. }
  51954. if (style.__rect) {
  51955. return style.__rect;
  51956. }
  51957. var minX = Number.MAX_VALUE;
  51958. var maxX = Number.MIN_VALUE;
  51959. var minY = Number.MAX_VALUE;
  51960. var maxY = Number.MIN_VALUE;
  51961. var pointList = style.pointList;
  51962. for (var i = 0, l = pointList.length; i < l; i++) {
  51963. if (pointList[i][0] + __OP[0] < minX) {
  51964. minX = pointList[i][0] + __OP[0];
  51965. }
  51966. if (pointList[i][0] + __OP[0] > maxX) {
  51967. maxX = pointList[i][0] + __OP[0];
  51968. }
  51969. if (pointList[i][1] + __OP[1] < minY) {
  51970. minY = pointList[i][1] + __OP[1];
  51971. }
  51972. if (pointList[i][1] + __OP[1] > maxY) {
  51973. maxY = pointList[i][1] + __OP[1];
  51974. }
  51975. }
  51976. var lineWidth;
  51977. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  51978. lineWidth = style.lineWidth || 1;
  51979. } else {
  51980. lineWidth = 0;
  51981. }
  51982. style.__rect = {
  51983. x: Math.round(minX - lineWidth / 2),
  51984. y: Math.round(minY - lineWidth / 2),
  51985. width: maxX - minX + lineWidth,
  51986. height: maxY - minY + lineWidth
  51987. };
  51988. return style.__rect;
  51989. }
  51990. }]);
  51991. return SmicPolygon;
  51992. }(Shape_Shape);
  51993. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicBrokenLine.js
  51994. 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); }
  51995. function SmicBrokenLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51996. 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); } }
  51997. function SmicBrokenLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicBrokenLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicBrokenLine_defineProperties(Constructor, staticProps); return Constructor; }
  51998. 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); }
  51999. function SmicBrokenLine_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicBrokenLine_getPrototypeOf(object); if (object === null) break; } return object; }
  52000. 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); }
  52001. function SmicBrokenLine_setPrototypeOf(o, p) { SmicBrokenLine_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicBrokenLine_setPrototypeOf(o, p); }
  52002. 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); }; }
  52003. function SmicBrokenLine_possibleConstructorReturn(self, call) { if (call && (SmicBrokenLine_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicBrokenLine_assertThisInitialized(self); }
  52004. function SmicBrokenLine_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52005. 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; } }
  52006. function SmicBrokenLine_getPrototypeOf(o) { SmicBrokenLine_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicBrokenLine_getPrototypeOf(o); }
  52007. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  52008. * This program are made available under the terms of the Apache License, Version 2.0
  52009. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52010. /**
  52011. * @private
  52012. * @class SuperMap.LevelRenderer.Shape.SmicBrokenLine
  52013. * @category Visualization Theme
  52014. * @classdesc 折线(ic)。
  52015. * @extends SuperMap.LevelRenderer.Shape
  52016. * @example
  52017. * var shape = new SuperMap.LevelRenderer.Shape.SmicBrokenLine({
  52018. * style: {
  52019. * pointList: [[0, 0], [100, 100], [100, 0]],
  52020. * smooth: 'bezier',
  52021. * strokeColor: 'purple'
  52022. * }
  52023. * });
  52024. * levelRenderer.addShape(shape);
  52025. *
  52026. *
  52027. */
  52028. var SmicBrokenLine_SmicBrokenLine = /*#__PURE__*/function (_Shape) {
  52029. SmicBrokenLine_inherits(SmicBrokenLine, _Shape);
  52030. var _super = SmicBrokenLine_createSuper(SmicBrokenLine);
  52031. /**
  52032. * @member {Object} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.style
  52033. * @description 绘制样式。
  52034. *
  52035. * @param {Array} pointList - 节点数组,二维数组。默认值:null,必设参数。其形式如下:
  52036. * (code)
  52037. * (start code)
  52038. * [
  52039. * [10, 20], //单个节点
  52040. * [30, 40],
  52041. * [25, 30]
  52042. * ]
  52043. * (end)
  52044. * @param {string} smooth - 是否做平滑插值, 平滑算法可以选择 "bezier", "spline"。默认值:"";
  52045. * @param {number} smoothConstraint - 平滑约束。
  52046. * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
  52047. * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  52048. * @param {number} lineWidth - 描边宽度。默认值:1。
  52049. * @param {number} opacity - 绘制透明度。默认值:1。
  52050. * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  52051. * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  52052. * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  52053. * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  52054. * @param {string} text - 图形中的附加文本。默认值:""。
  52055. * @param {string} textColor - 文本颜色。默认值:"#000000'"。
  52056. * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
  52057. * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  52058. * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  52059. * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  52060. */
  52061. //打开接口 style
  52062. /**
  52063. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.constructor
  52064. * @description 构造函数。
  52065. *
  52066. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  52067. *
  52068. */
  52069. function SmicBrokenLine(options) {
  52070. var _this;
  52071. SmicBrokenLine_classCallCheck(this, SmicBrokenLine);
  52072. _this = _super.call(this, options);
  52073. /**
  52074. * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.brushTypeOnly
  52075. * @description 线条只能描边。
  52076. */
  52077. _this.brushTypeOnly = 'stroke';
  52078. /**
  52079. * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.textPosition
  52080. * @description 文本位置。
  52081. */
  52082. _this.textPosition = 'end';
  52083. /**
  52084. * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.type
  52085. * @description 图形类型.
  52086. */
  52087. _this.type = 'smicbroken-line';
  52088. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  52089. _this.refOriginalPosition = [0, 0];
  52090. }
  52091. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicBrokenLine";
  52092. return _this;
  52093. }
  52094. /**
  52095. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.destroy
  52096. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  52097. */
  52098. SmicBrokenLine_createClass(SmicBrokenLine, [{
  52099. key: "destroy",
  52100. value: function destroy() {
  52101. this.brushTypeOnly = null;
  52102. this.textPosition = null;
  52103. this.type = null;
  52104. SmicBrokenLine_get(SmicBrokenLine_getPrototypeOf(SmicBrokenLine.prototype), "destroy", this).call(this);
  52105. }
  52106. /**
  52107. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.buildPath
  52108. * @description 创建折线路径。
  52109. *
  52110. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52111. * @param {Object} style - style。
  52112. *
  52113. */
  52114. }, {
  52115. key: "buildPath",
  52116. value: function buildPath(ctx, style) {
  52117. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52118. this.refOriginalPosition = [0, 0];
  52119. }
  52120. var __OP = this.refOriginalPosition;
  52121. var pointList = style.pointList;
  52122. if (pointList.length < 2) {
  52123. // 少于2个点就不画了~
  52124. return;
  52125. }
  52126. var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length));
  52127. if (style.smooth && style.smooth !== 'spline') {
  52128. var controlPoints = SUtil.SUtil_smoothBezier(pointList, style.smooth, false, style.smoothConstraint, __OP);
  52129. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  52130. var cp1;
  52131. var cp2;
  52132. var p;
  52133. for (var _i = 0; _i < len - 1; _i++) {
  52134. cp1 = controlPoints[_i * 2];
  52135. cp2 = controlPoints[_i * 2 + 1];
  52136. p = [pointList[_i + 1][0] + __OP[0], pointList[_i + 1][1] + __OP[1]];
  52137. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  52138. }
  52139. } else {
  52140. if (style.smooth === 'spline') {
  52141. pointList = SUtil.SUtil_smoothSpline(pointList, null, null, __OP);
  52142. len = pointList.length;
  52143. }
  52144. if (!style.lineType || style.lineType === 'solid') {
  52145. // 默认为实线
  52146. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  52147. for (var _i2 = 1; _i2 < len; _i2++) {
  52148. ctx.lineTo(pointList[_i2][0] + __OP[0], pointList[_i2][1] + __OP[1]);
  52149. }
  52150. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  52151. var dashLength = style.lineWidth || 1;
  52152. var pattern1 = dashLength;
  52153. var pattern2 = dashLength; //dashed
  52154. if (style.lineType === 'dashed') {
  52155. pattern1 *= 5;
  52156. pattern2 *= 5;
  52157. if (style.lineCap && style.lineCap !== "butt") {
  52158. pattern1 -= dashLength;
  52159. pattern2 += dashLength;
  52160. }
  52161. } //dotted
  52162. if (style.lineType === 'dotted') {
  52163. if (style.lineCap && style.lineCap !== "butt") {
  52164. pattern1 = 1;
  52165. pattern2 += dashLength;
  52166. }
  52167. } //dot
  52168. if (style.lineType === 'dot') {
  52169. pattern2 *= 4;
  52170. if (style.lineCap && style.lineCap !== "butt") {
  52171. pattern1 = 1;
  52172. pattern2 += dashLength;
  52173. }
  52174. } //dash
  52175. if (style.lineType === 'dash') {
  52176. pattern1 *= 4;
  52177. pattern2 *= 4;
  52178. if (style.lineCap && style.lineCap !== "butt") {
  52179. pattern1 -= dashLength;
  52180. pattern2 += dashLength;
  52181. }
  52182. } //longdash
  52183. if (style.lineType === 'longdash') {
  52184. pattern1 *= 8;
  52185. pattern2 *= 4;
  52186. if (style.lineCap && style.lineCap !== "butt") {
  52187. pattern1 -= dashLength;
  52188. pattern2 += dashLength;
  52189. }
  52190. }
  52191. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  52192. for (var i = 1; i < len; i++) {
  52193. 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]);
  52194. }
  52195. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  52196. var _dashLength = style.lineWidth || 1;
  52197. var _pattern = _dashLength;
  52198. var _pattern2 = _dashLength;
  52199. var pattern3 = _dashLength;
  52200. var pattern4 = _dashLength; //dashdot
  52201. if (style.lineType === 'dashdot') {
  52202. _pattern *= 4;
  52203. _pattern2 *= 4;
  52204. pattern4 *= 4;
  52205. if (style.lineCap && style.lineCap !== "butt") {
  52206. _pattern -= _dashLength;
  52207. _pattern2 += _dashLength;
  52208. pattern3 = 1;
  52209. pattern4 += _dashLength;
  52210. }
  52211. } //longdashdot
  52212. if (style.lineType === 'longdashdot') {
  52213. _pattern *= 8;
  52214. _pattern2 *= 4;
  52215. pattern4 *= 4;
  52216. if (style.lineCap && style.lineCap !== "butt") {
  52217. _pattern -= _dashLength;
  52218. _pattern2 += _dashLength;
  52219. pattern3 = 1;
  52220. pattern4 += _dashLength;
  52221. }
  52222. }
  52223. _dashLength = (style.lineWidth || 1) * (style.lineType === 'dashed' ? 5 : 1);
  52224. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  52225. for (var _i3 = 1; _i3 < len; _i3++) {
  52226. 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]);
  52227. }
  52228. }
  52229. }
  52230. return;
  52231. }
  52232. /**
  52233. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.getRect
  52234. * @description 计算返回折线包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  52235. *
  52236. * @param {Object} style - style
  52237. * @return {Object} 边框对象。包含属性:x,y,width,height。
  52238. */
  52239. }, {
  52240. key: "getRect",
  52241. value: function getRect(style) {
  52242. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52243. this.refOriginalPosition = [0, 0];
  52244. }
  52245. var __OP = this.refOriginalPosition;
  52246. return SmicPolygon_SmicPolygon.prototype.getRect.apply(this, [style, __OP]);
  52247. }
  52248. }]);
  52249. return SmicBrokenLine;
  52250. }(Shape_Shape);
  52251. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicImage.js
  52252. 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); }
  52253. function SmicImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52254. 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); } }
  52255. function SmicImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicImage_defineProperties(Constructor, staticProps); return Constructor; }
  52256. 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); }
  52257. function SmicImage_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicImage_getPrototypeOf(object); if (object === null) break; } return object; }
  52258. 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); }
  52259. function SmicImage_setPrototypeOf(o, p) { SmicImage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicImage_setPrototypeOf(o, p); }
  52260. 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); }; }
  52261. function SmicImage_possibleConstructorReturn(self, call) { if (call && (SmicImage_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicImage_assertThisInitialized(self); }
  52262. function SmicImage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52263. 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; } }
  52264. function SmicImage_getPrototypeOf(o) { SmicImage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicImage_getPrototypeOf(o); }
  52265. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  52266. * This program are made available under the terms of the Apache License, Version 2.0
  52267. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52268. /**
  52269. * @private
  52270. * @class SuperMap.LevelRenderer.Shape.SmicImage
  52271. * @category Visualization Theme
  52272. * @classdesc 图片绘制。
  52273. * @extends SuperMap.LevelRenderer.Shape
  52274. * @example
  52275. * var shape = new SuperMap.LevelRenderer.Shape.SmicImage({
  52276. * style: {
  52277. * image: 'test.jpg',
  52278. * x: 100,
  52279. * y: 100
  52280. * }
  52281. * });
  52282. * levelRenderer.addShape(shape);
  52283. *
  52284. *
  52285. */
  52286. var SmicImage = /*#__PURE__*/function (_Shape) {
  52287. SmicImage_inherits(SmicImage, _Shape);
  52288. var _super = SmicImage_createSuper(SmicImage);
  52289. /**
  52290. * @member {Object} SuperMap.LevelRenderer.Shape.SmicImage.prototype.style
  52291. * @description 绘制样式。
  52292. *
  52293. * @param {number} style.x - 左上角横坐标,必设参数。
  52294. * @param {number} style.y - 左上角纵坐标,必设参数。
  52295. * @param {(string/Cavans)} style.image - 图片地址或cavans对象,必设参数。
  52296. * @param {number} style.width - 绘制到画布上的宽度,默认为图片高度。
  52297. * @param {number} style.height - 绘制到画布上的高度,默认为图片高度。
  52298. * @param {number} style.sx - 从图片中裁剪的左上角横坐标。
  52299. * @param {number} style.sy - 从图片中裁剪的左上角纵坐标。
  52300. * @param {number} style.sWidth - 从图片中裁剪的宽度,默认为图片高度。
  52301. * @param {number} style.sHeight - 绘制到画布上的高度,默认为图片高度。
  52302. * @param {number} style.opacity - 绘制透明度。默认值:1。
  52303. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  52304. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  52305. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  52306. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  52307. * @param {string} style.text - 图形中的附加文本。默认值:""。
  52308. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  52309. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  52310. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  52311. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  52312. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  52313. */
  52314. //打开接口 style
  52315. /**
  52316. * @function SuperMap.LevelRenderer.Shape.SmicImage.constructor
  52317. * @description 构造函数。
  52318. *
  52319. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  52320. *
  52321. */
  52322. function SmicImage(options) {
  52323. var _this;
  52324. SmicImage_classCallCheck(this, SmicImage);
  52325. _this = _super.call(this, options);
  52326. /**
  52327. * @member {string} SuperMap.LevelRenderer.Shape.SmicImage.prototype.type
  52328. * @description 图形类型。
  52329. */
  52330. _this.type = 'smicimage';
  52331. /**
  52332. * @member {string} SuperMap.LevelRenderer.Shape.SmicImage.prototype._imageCache
  52333. * @description 图片缓存。
  52334. */
  52335. _this._imageCache = {};
  52336. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  52337. _this.refOriginalPosition = [0, 0];
  52338. }
  52339. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicImage";
  52340. return _this;
  52341. }
  52342. /**
  52343. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.destroy
  52344. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  52345. */
  52346. SmicImage_createClass(SmicImage, [{
  52347. key: "destroy",
  52348. value: function destroy() {
  52349. this.type = null;
  52350. this._imageCache = null;
  52351. SmicImage_get(SmicImage_getPrototypeOf(SmicImage.prototype), "destroy", this).call(this);
  52352. }
  52353. /**
  52354. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.buildPath
  52355. * @description 创建图片。
  52356. *
  52357. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52358. * @param {Object} style - style。
  52359. *
  52360. */
  52361. }, {
  52362. key: "brush",
  52363. value: function brush(ctx, isHighlight, refresh) {
  52364. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52365. this.refOriginalPosition = [0, 0];
  52366. }
  52367. var __OP = this.refOriginalPosition;
  52368. var style = this.style || {};
  52369. if (isHighlight) {
  52370. // 根据style扩展默认高亮样式
  52371. style = this.getHighlightStyle(style, this.highlightStyle || {});
  52372. }
  52373. var image = style.image;
  52374. var me = this;
  52375. if (typeof image === 'string') {
  52376. var src = image;
  52377. if (this._imageCache[src]) {
  52378. image = this._imageCache[src];
  52379. } else {
  52380. image = new Image();
  52381. image.onload = function () {
  52382. image.onload = null;
  52383. clearTimeout(SmicImage._refreshTimeout);
  52384. SmicImage._needsRefresh.push(me); // 防止因为缓存短时间内触发多次onload事件
  52385. SmicImage._refreshTimeout = setTimeout(function () {
  52386. refresh && refresh(SmicImage._needsRefresh); // 清空 needsRefresh
  52387. SmicImage._needsRefresh = [];
  52388. }, 10);
  52389. };
  52390. image.src = src;
  52391. this._imageCache[src] = image;
  52392. }
  52393. }
  52394. if (image) {
  52395. // 图片已经加载完成
  52396. if (image.nodeName.toUpperCase() == 'IMG') {
  52397. if (window.ActiveXObject) {
  52398. if (image.readyState != 'complete') {
  52399. return;
  52400. }
  52401. } else {
  52402. if (!image.complete) {
  52403. return;
  52404. }
  52405. }
  52406. } // Else is canvas
  52407. var width = style.width || image.width;
  52408. var height = style.height || image.height;
  52409. var x = style.x + __OP[0];
  52410. var y = style.y + __OP[1]; // 图片加载失败
  52411. if (!image.width || !image.height) {
  52412. return;
  52413. }
  52414. ctx.save();
  52415. this.doClip(ctx);
  52416. this.setContext(ctx, style); // 设置transform
  52417. this.setTransform(ctx);
  52418. if (style.sWidth && style.sHeight) {
  52419. var sx = style.sx + __OP[0] || 0;
  52420. var sy = style.sy + __OP[1] || 0;
  52421. ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);
  52422. } else if (style.sx && style.sy) {
  52423. var _sx = style.sx + __OP[0];
  52424. var _sy = style.sy + __OP[1];
  52425. var sWidth = width - _sx;
  52426. var sHeight = height - _sy;
  52427. ctx.drawImage(image, _sx, _sy, sWidth, sHeight, x, y, width, height);
  52428. } else {
  52429. ctx.drawImage(image, x, y, width, height);
  52430. } // 如果没设置宽和高的话自动根据图片宽高设置
  52431. if (!style.width) {
  52432. style.width = width;
  52433. }
  52434. if (!style.height) {
  52435. style.height = height;
  52436. }
  52437. if (!this.style.width) {
  52438. this.style.width = width;
  52439. }
  52440. if (!this.style.height) {
  52441. this.style.height = height;
  52442. }
  52443. this.drawText(ctx, style, this.style);
  52444. ctx.restore();
  52445. }
  52446. }
  52447. /**
  52448. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.getRect
  52449. * @description 计算返回图片的包围盒矩形。
  52450. *
  52451. * @param {Object} style - style
  52452. * @return {Object} 边框对象。包含属性:x,y,width,height。
  52453. */
  52454. }, {
  52455. key: "getRect",
  52456. value: function getRect(style) {
  52457. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52458. this.refOriginalPosition = [0, 0];
  52459. }
  52460. var __OP = this.refOriginalPosition;
  52461. return {
  52462. x: style.x + __OP[0],
  52463. y: style.y + __OP[1],
  52464. width: style.width,
  52465. height: style.height
  52466. };
  52467. }
  52468. /**
  52469. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.clearCache
  52470. * @description 清除图片缓存。
  52471. *
  52472. * @param {Object} style - style
  52473. * @return {Object} 边框对象。包含属性:x,y,width,height。
  52474. *
  52475. */
  52476. }, {
  52477. key: "clearCache",
  52478. value: function clearCache() {
  52479. this._imageCache = {};
  52480. }
  52481. }]);
  52482. return SmicImage;
  52483. }(Shape_Shape);
  52484. SmicImage._needsRefresh = [];
  52485. SmicImage._refreshTimeout = null;
  52486. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRectangle.js
  52487. 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); }
  52488. function SmicRectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52489. 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); } }
  52490. function SmicRectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRectangle_defineProperties(Constructor, staticProps); return Constructor; }
  52491. 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); }
  52492. function SmicRectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  52493. 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); }
  52494. function SmicRectangle_setPrototypeOf(o, p) { SmicRectangle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRectangle_setPrototypeOf(o, p); }
  52495. 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); }; }
  52496. function SmicRectangle_possibleConstructorReturn(self, call) { if (call && (SmicRectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicRectangle_assertThisInitialized(self); }
  52497. function SmicRectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52498. 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; } }
  52499. function SmicRectangle_getPrototypeOf(o) { SmicRectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRectangle_getPrototypeOf(o); }
  52500. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  52501. * This program are made available under the terms of the Apache License, Version 2.0
  52502. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52503. /**
  52504. * @private
  52505. * @class SuperMap.LevelRenderer.Shape.SmicRectangle
  52506. * @category Visualization Theme
  52507. * @classdesc 矩形。
  52508. * @extends SuperMap.LevelRenderer.Shape
  52509. * @example
  52510. * var shape = new SuperMap.LevelRenderer.Shape.SmicRectangle({
  52511. * style: {
  52512. * x: 0,
  52513. * y: 0,
  52514. * width: 100,
  52515. * height: 100,
  52516. * radius: 20
  52517. * }
  52518. * });
  52519. * levelRenderer.addShape(shape);
  52520. *
  52521. */
  52522. var SmicRectangle = /*#__PURE__*/function (_Shape) {
  52523. SmicRectangle_inherits(SmicRectangle, _Shape);
  52524. var _super = SmicRectangle_createSuper(SmicRectangle);
  52525. /**
  52526. * @member {Object} SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.style
  52527. * @description 绘制样式。
  52528. *
  52529. * @param {number} style.x - 左上角 x 坐标,必设参数。
  52530. * @param {number} style.y - 左上角 y 坐标,必设参数。
  52531. * @param {number} style.width - 宽度,必设参数。
  52532. * @param {number} style.height - 高度,必设参数。
  52533. * @param {Array} style.radius - 矩形圆角,可以用数组分别指定四个角的圆角,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 则 radius为 [r1、r2、r3、r4 ]。
  52534. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  52535. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  52536. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  52537. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  52538. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  52539. * @param {number} style.opacity - 绘制透明度。默认值:1。
  52540. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  52541. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  52542. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  52543. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  52544. * @param {string} style.text - 图形中的附加文本。默认值:""。
  52545. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  52546. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  52547. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  52548. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  52549. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  52550. */
  52551. //打开接口 style
  52552. /**
  52553. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.constructor
  52554. * @description 构造函数。
  52555. *
  52556. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  52557. *
  52558. */
  52559. function SmicRectangle(options) {
  52560. var _this;
  52561. SmicRectangle_classCallCheck(this, SmicRectangle);
  52562. _this = _super.call(this, options);
  52563. /**
  52564. * @member {string} SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.type
  52565. * @description 图形类型.
  52566. */
  52567. _this.type = 'smicrectangle';
  52568. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  52569. _this.refOriginalPosition = [0, 0];
  52570. }
  52571. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRectangle";
  52572. return _this;
  52573. }
  52574. /**
  52575. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.destroy
  52576. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  52577. */
  52578. SmicRectangle_createClass(SmicRectangle, [{
  52579. key: "destroy",
  52580. value: function destroy() {
  52581. this.type = null;
  52582. SmicRectangle_get(SmicRectangle_getPrototypeOf(SmicRectangle.prototype), "destroy", this).call(this);
  52583. }
  52584. /**
  52585. * APIMethod: _buildRadiusPath
  52586. * 创建矩形的圆角路径。
  52587. *
  52588. * Parameters:
  52589. * ctx - {CanvasRenderingContext2D} Context2D 上下文。
  52590. * style - {Object} style。
  52591. *
  52592. */
  52593. }, {
  52594. key: "_buildRadiusPath",
  52595. value: function _buildRadiusPath(ctx, style) {
  52596. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52597. this.refOriginalPosition = [0, 0];
  52598. }
  52599. var __OP = this.refOriginalPosition; // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4
  52600. // r缩写为1 相当于 [1, 1, 1, 1]
  52601. // r缩写为[1] 相当于 [1, 1, 1, 1]
  52602. // r缩写为[1, 2] 相当于 [1, 2, 1, 2]
  52603. // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2]
  52604. var x = style.x + __OP[0];
  52605. var y = style.y + __OP[1];
  52606. var width = style.width;
  52607. var height = style.height;
  52608. var r = style.radius;
  52609. var r1;
  52610. var r2;
  52611. var r3;
  52612. var r4;
  52613. if (typeof r === 'number') {
  52614. r1 = r2 = r3 = r4 = r;
  52615. } else if (r instanceof Array) {
  52616. if (r.length === 1) {
  52617. r1 = r2 = r3 = r4 = r[0];
  52618. } else if (r.length === 2) {
  52619. r1 = r3 = r[0];
  52620. r2 = r4 = r[1];
  52621. } else if (r.length === 3) {
  52622. r1 = r[0];
  52623. r2 = r4 = r[1];
  52624. r3 = r[2];
  52625. } else {
  52626. r1 = r[0];
  52627. r2 = r[1];
  52628. r3 = r[2];
  52629. r4 = r[3];
  52630. }
  52631. } else {
  52632. r1 = r2 = r3 = r4 = 0;
  52633. }
  52634. var total;
  52635. if (r1 + r2 > width) {
  52636. total = r1 + r2;
  52637. r1 *= width / total;
  52638. r2 *= width / total;
  52639. }
  52640. if (r3 + r4 > width) {
  52641. total = r3 + r4;
  52642. r3 *= width / total;
  52643. r4 *= width / total;
  52644. }
  52645. if (r2 + r3 > height) {
  52646. total = r2 + r3;
  52647. r2 *= height / total;
  52648. r3 *= height / total;
  52649. }
  52650. if (r1 + r4 > height) {
  52651. total = r1 + r4;
  52652. r1 *= height / total;
  52653. r4 *= height / total;
  52654. }
  52655. ctx.moveTo(x + r1, y);
  52656. ctx.lineTo(x + width - r2, y);
  52657. r2 !== 0 && ctx.quadraticCurveTo(x + width, y, x + width, y + r2);
  52658. ctx.lineTo(x + width, y + height - r3);
  52659. r3 !== 0 && ctx.quadraticCurveTo(x + width, y + height, x + width - r3, y + height);
  52660. ctx.lineTo(x + r4, y + height);
  52661. r4 !== 0 && ctx.quadraticCurveTo(x, y + height, x, y + height - r4);
  52662. ctx.lineTo(x, y + r1);
  52663. r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y);
  52664. }
  52665. /**
  52666. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.buildPath
  52667. * @description 创建矩形路径。
  52668. *
  52669. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52670. * @param {Object} style - style。
  52671. *
  52672. */
  52673. }, {
  52674. key: "buildPath",
  52675. value: function buildPath(ctx, style) {
  52676. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52677. this.refOriginalPosition = [0, 0];
  52678. }
  52679. var __OP = this.refOriginalPosition;
  52680. if (!style.radius) {
  52681. ctx.moveTo(style.x + __OP[0], style.y + __OP[1]);
  52682. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1]);
  52683. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1] + style.height);
  52684. ctx.lineTo(style.x + __OP[0], style.y + __OP[1] + style.height);
  52685. ctx.lineTo(style.x + __OP[0], style.y + __OP[1]); // ctx.rect(style.x, style.y, style.width, style.height);
  52686. } else {
  52687. this._buildRadiusPath(ctx, style);
  52688. }
  52689. ctx.closePath();
  52690. return;
  52691. }
  52692. /**
  52693. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.getRect
  52694. * @description 计算返回矩形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  52695. *
  52696. * @param {Object} style - style
  52697. * @return {Object} 边框对象。包含属性:x,y,width,height。
  52698. */
  52699. }, {
  52700. key: "getRect",
  52701. value: function getRect(style) {
  52702. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52703. this.refOriginalPosition = [0, 0];
  52704. }
  52705. var __OP = this.refOriginalPosition;
  52706. if (style.__rect) {
  52707. return style.__rect;
  52708. }
  52709. var lineWidth;
  52710. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  52711. lineWidth = style.lineWidth || 1;
  52712. } else {
  52713. lineWidth = 0;
  52714. }
  52715. style.__rect = {
  52716. x: Math.round(style.x + __OP[0] - lineWidth / 2),
  52717. y: Math.round(style.y + __OP[1] - lineWidth / 2),
  52718. width: style.width + lineWidth,
  52719. height: style.height + lineWidth
  52720. };
  52721. return style.__rect;
  52722. }
  52723. }]);
  52724. return SmicRectangle;
  52725. }(Shape_Shape);
  52726. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicSector.js
  52727. 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); }
  52728. function SmicSector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52729. 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); } }
  52730. function SmicSector_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicSector_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicSector_defineProperties(Constructor, staticProps); return Constructor; }
  52731. 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); }
  52732. function SmicSector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicSector_getPrototypeOf(object); if (object === null) break; } return object; }
  52733. 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); }
  52734. function SmicSector_setPrototypeOf(o, p) { SmicSector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicSector_setPrototypeOf(o, p); }
  52735. 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); }; }
  52736. function SmicSector_possibleConstructorReturn(self, call) { if (call && (SmicSector_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicSector_assertThisInitialized(self); }
  52737. function SmicSector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52738. 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; } }
  52739. function SmicSector_getPrototypeOf(o) { SmicSector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicSector_getPrototypeOf(o); }
  52740. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  52741. * This program are made available under the terms of the Apache License, Version 2.0
  52742. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52743. /**
  52744. * @private
  52745. * @class SuperMap.LevelRenderer.Shape.SmicSector
  52746. * @category Visualization Theme
  52747. * @classdesc 扇形。
  52748. * @extends SuperMap.LevelRenderer.Shape
  52749. * @example
  52750. * var shape = new SuperMap.LevelRenderer.Shape.SmicSector({
  52751. * style: {
  52752. * x: 100,
  52753. * y: 100,
  52754. * r: 60,
  52755. * r0: 30,
  52756. * startAngle: 0,
  52757. * endEngle: 180
  52758. * }
  52759. * });
  52760. * levelRenderer.addShape(shape);
  52761. *
  52762. *
  52763. */
  52764. var SmicSector_SmicSector = /*#__PURE__*/function (_Shape) {
  52765. SmicSector_inherits(SmicSector, _Shape);
  52766. var _super = SmicSector_createSuper(SmicSector);
  52767. /**
  52768. * @member {Object} SuperMap.LevelRenderer.Shape.SmicSector.prototype.style
  52769. * @description 绘制样式。
  52770. *
  52771. * @param {number} style.x - 圆心 x 坐标,必设参数。
  52772. * @param {number} style.y - 圆心 y 坐标,必设参数。
  52773. * @param {number} style.r - 外圆半径,必设参数。
  52774. * @param {number} style.r0 - 内圆半径,指定后将出现内弧,同时扇边长度为`r - r0`。取值范围[0, r),默认值:0。
  52775. * @param {number} style.startAngle - 起始角度,必设参数。取值范围[0, 360)。
  52776. * @param {number} style.endAngle - 结束角度,必设参数。取值范围(0, 360。
  52777. * @param {boolean} style.clockWise - 是否是顺时针。默认值:false。
  52778. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  52779. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  52780. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  52781. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  52782. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  52783. * @param {number} style.opacity - 绘制透明度。默认值:1。
  52784. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  52785. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  52786. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  52787. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  52788. * @param {string} style.text - 图形中的附加文本。默认值:""。
  52789. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  52790. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  52791. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  52792. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  52793. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  52794. */
  52795. //打开接口 style
  52796. /**
  52797. * @function SuperMap.LevelRenderer.Shape.SmicSector.constructor
  52798. * @description 构造函数。
  52799. *
  52800. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  52801. *
  52802. */
  52803. function SmicSector(options) {
  52804. var _this;
  52805. SmicSector_classCallCheck(this, SmicSector);
  52806. _this = _super.call(this, options);
  52807. /**
  52808. * @member {string} SuperMap.LevelRenderer.Shape.SmicSector.protptype.type
  52809. * @description 图形类型。
  52810. */
  52811. _this.type = 'smicsector';
  52812. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  52813. _this.refOriginalPosition = [0, 0];
  52814. }
  52815. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicSector";
  52816. return _this;
  52817. }
  52818. /**
  52819. * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.destroy
  52820. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  52821. */
  52822. SmicSector_createClass(SmicSector, [{
  52823. key: "destroy",
  52824. value: function destroy() {
  52825. this.type = null;
  52826. SmicSector_get(SmicSector_getPrototypeOf(SmicSector.prototype), "destroy", this).call(this);
  52827. }
  52828. /**
  52829. * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.buildPath
  52830. * @description 创建扇形路径。
  52831. *
  52832. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52833. * @param {Object} style - style。
  52834. *
  52835. */
  52836. }, {
  52837. key: "buildPath",
  52838. value: function buildPath(ctx, style) {
  52839. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52840. this.refOriginalPosition = [0, 0];
  52841. }
  52842. var __OP = this.refOriginalPosition;
  52843. var x = style.x + __OP[0]; // 圆心x
  52844. var y = style.y + __OP[1]; // 圆心y
  52845. var r0 = style.r0 || 0; // 形内半径[0,r)
  52846. var r = style.r; // 扇形外半径(0,r]
  52847. var startAngle = style.startAngle; // 起始角度[0,360)
  52848. var endAngle = style.endAngle; // 结束角度(0,360]
  52849. var clockWise = style.clockWise || false;
  52850. startAngle = SUtil.Util_math.degreeToRadian(startAngle);
  52851. endAngle = SUtil.Util_math.degreeToRadian(endAngle);
  52852. if (!clockWise) {
  52853. // 扇形默认是逆时针方向,Y轴向上
  52854. // 这个跟arc的标准不一样,为了兼容echarts
  52855. startAngle = -startAngle;
  52856. endAngle = -endAngle;
  52857. }
  52858. var unitX = SUtil.Util_math.cos(startAngle);
  52859. var unitY = SUtil.Util_math.sin(startAngle);
  52860. ctx.moveTo(unitX * r0 + x, unitY * r0 + y);
  52861. ctx.lineTo(unitX * r + x, unitY * r + y);
  52862. ctx.arc(x, y, r, startAngle, endAngle, !clockWise);
  52863. ctx.lineTo(SUtil.Util_math.cos(endAngle) * r0 + x, SUtil.Util_math.sin(endAngle) * r0 + y);
  52864. if (r0 !== 0) {
  52865. ctx.arc(x, y, r0, endAngle, startAngle, clockWise);
  52866. }
  52867. ctx.closePath();
  52868. return;
  52869. }
  52870. /**
  52871. * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.getRect
  52872. * @description 返回扇形包围盒矩形
  52873. *
  52874. * @param {Object} style - style
  52875. * @return {Object} 边框对象。包含属性:x,y,width,height。
  52876. *
  52877. */
  52878. }, {
  52879. key: "getRect",
  52880. value: function getRect(style) {
  52881. if (style.__rect) {
  52882. return style.__rect;
  52883. }
  52884. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52885. this.refOriginalPosition = [0, 0];
  52886. }
  52887. var __OP = this.refOriginalPosition;
  52888. var min0 = SUtil.Util_vector.create();
  52889. var min1 = SUtil.Util_vector.create();
  52890. var max0 = SUtil.Util_vector.create();
  52891. var max1 = SUtil.Util_vector.create();
  52892. var x = style.x + __OP[0]; // 圆心x
  52893. var y = style.y + __OP[1]; // 圆心y
  52894. var r0 = style.r0 || 0; // 形内半径[0,r)
  52895. var r = style.r; // 扇形外半径(0,r]
  52896. var startAngle = SUtil.Util_math.degreeToRadian(style.startAngle);
  52897. var endAngle = SUtil.Util_math.degreeToRadian(style.endAngle);
  52898. var clockWise = style.clockWise;
  52899. if (!clockWise) {
  52900. startAngle = -startAngle;
  52901. endAngle = -endAngle;
  52902. }
  52903. if (r0 > 1) {
  52904. SUtil.Util_computeBoundingBox.arc(x, y, r0, startAngle, endAngle, !clockWise, min0, max0);
  52905. } else {
  52906. min0[0] = max0[0] = x;
  52907. min0[1] = max0[1] = y;
  52908. }
  52909. SUtil.Util_computeBoundingBox.arc(x, y, r, startAngle, endAngle, !clockWise, min1, max1);
  52910. SUtil.Util_vector.min(min0, min0, min1);
  52911. SUtil.Util_vector.max(max0, max0, max1);
  52912. style.__rect = {
  52913. x: min0[0],
  52914. y: min0[1],
  52915. width: max0[0] - min0[0],
  52916. height: max0[1] - min0[1]
  52917. };
  52918. return style.__rect;
  52919. }
  52920. }]);
  52921. return SmicSector;
  52922. }(Shape_Shape);
  52923. // CONCATENATED MODULE: ./src/common/overlay/feature/ShapeFactory.js
  52924. function ShapeFactory_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52925. 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); } }
  52926. function ShapeFactory_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeFactory_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeFactory_defineProperties(Constructor, staticProps); return Constructor; }
  52927. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  52928. * This program are made available under the terms of the Apache License, Version 2.0
  52929. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52930. /**
  52931. * @class SuperMap.Feature.ShapeFactory
  52932. * @category Visualization Theme
  52933. * @classdesc 图形工厂类。
  52934. * 目前支持创建的图形有:<br>
  52935. * 用于统计专题图:<br>
  52936. * 点 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Point}> <br>
  52937. * 线 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Line}> <br>
  52938. * 面 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Polygon}> <br>
  52939. * 矩形 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Rectangle}> <br>
  52940. * 扇形 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Sector}> <br>
  52941. * 标签 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Label}> <br>
  52942. * 图片 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Image}> <br>
  52943. * 用于符号专题图:<br>
  52944. * 圆形 - 参数对象:<{@link SuperMap.Feature.ShapeParameters.Cilcle}>
  52945. */
  52946. var ShapeFactory_ShapeFactory = /*#__PURE__*/function () {
  52947. /**
  52948. * @function SuperMap.Feature.ShapeFactory.prototype.constructor
  52949. * @description 构建图形工厂对象。
  52950. * @param {Object} shapeParameters - 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象,可选参数。
  52951. * @returns {SuperMap.Feature.ShapeFactory} 返回图形工厂类对象。
  52952. */
  52953. function ShapeFactory(shapeParameters) {
  52954. ShapeFactory_classCallCheck(this, ShapeFactory);
  52955. /**
  52956. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.shapeParameters
  52957. * @description 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象。必设参数,默认值 null。
  52958. */
  52959. this.shapeParameters = shapeParameters;
  52960. this.CLASS_NAME = "SuperMap.Feature.ShapeFactory";
  52961. }
  52962. /**
  52963. * @function SuperMap.Feature.ShapeParameters.prototype.destroy
  52964. * @description 销毁图形工厂类对象。
  52965. */
  52966. ShapeFactory_createClass(ShapeFactory, [{
  52967. key: "destroy",
  52968. value: function destroy() {
  52969. this.shapeParameters = null;
  52970. }
  52971. /**
  52972. * @function SuperMap.Feature.ShapeParameters.prototype.createShape
  52973. * @description 创建一个图形。具体图形由 shapeParameters 决定。
  52974. * @param {Object} shapeParameters - 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象。
  52975. * 此参数可选,如果使用此参数(不为 null),shapeParameters 属性值将被修改为参数的值,然后再使用 shapeParameters 属性值创建图形;
  52976. * 如果不使用此参数,createShape 方法将直接使用 shapeParameters 属性创建图形。
  52977. * @returns {Object} 图形对象(或 null - 图形创建失败)。
  52978. */
  52979. }, {
  52980. key: "createShape",
  52981. value: function createShape(shapeParameters) {
  52982. if (shapeParameters) {
  52983. this.shapeParameters = shapeParameters;
  52984. }
  52985. if (!this.shapeParameters) {
  52986. return null;
  52987. }
  52988. var sps = this.shapeParameters;
  52989. if (sps instanceof feature_Point_Point) {
  52990. // 点
  52991. //设置style
  52992. var style = new Object();
  52993. style["x"] = sps.x;
  52994. style["y"] = sps.y;
  52995. style["r"] = sps.r;
  52996. style = Util_Util.copyAttributesWithClip(style, sps.style, ['x', 'y']); //创建图形
  52997. var shape = new SmicPoint();
  52998. shape.style = ShapeFactory.transformStyle(style);
  52999. shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  53000. Util_Util.copyAttributesWithClip(shape, sps, ['x', 'y', 'style', 'highlightStyle']);
  53001. return shape;
  53002. } else if (sps instanceof Line_Line) {
  53003. // 线
  53004. //检查参数 pointList 是否存在
  53005. if (!sps.pointList) {
  53006. return null;
  53007. } // 设置style
  53008. var _style = new Object();
  53009. _style["pointList"] = sps.pointList;
  53010. _style = Util_Util.copyAttributesWithClip(_style, sps.style, ['pointList']); // 创建图形
  53011. var _shape = new SmicBrokenLine_SmicBrokenLine();
  53012. _shape.style = ShapeFactory.transformStyle(_style);
  53013. _shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  53014. Util_Util.copyAttributesWithClip(_shape, sps, ['pointList', 'style', 'highlightStyle']);
  53015. return _shape;
  53016. } else if (sps instanceof Polygon_Polygon) {
  53017. // 面
  53018. //检查参数 pointList 是否存在
  53019. if (!sps.pointList) {
  53020. return null;
  53021. } //设置style
  53022. var _style2 = new Object();
  53023. _style2["pointList"] = sps.pointList;
  53024. _style2 = Util_Util.copyAttributesWithClip(_style2, sps.style, ['pointList']); //创建图形
  53025. var _shape2 = new SmicPolygon_SmicPolygon();
  53026. _shape2.style = ShapeFactory.transformStyle(_style2);
  53027. _shape2.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  53028. Util_Util.copyAttributesWithClip(_shape2, sps, ['pointList', 'style', "highlightStyle"]);
  53029. return _shape2;
  53030. } else if (sps instanceof feature_Rectangle_Rectangle) {
  53031. // 矩形
  53032. //检查参数 pointList 是否存在
  53033. if (!sps.x && !sps.y & !sps.width & !sps.height) {
  53034. return null;
  53035. } //设置style
  53036. var _style3 = new Object();
  53037. _style3["x"] = sps.x;
  53038. _style3["y"] = sps.y;
  53039. _style3["width"] = sps.width;
  53040. _style3["height"] = sps.height;
  53041. _style3 = Util_Util.copyAttributesWithClip(_style3, sps.style, ['x', 'y', 'width', 'height']); //创建图形
  53042. var _shape3 = new SmicRectangle();
  53043. _shape3.style = ShapeFactory.transformStyle(_style3);
  53044. _shape3.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  53045. Util_Util.copyAttributesWithClip(_shape3, sps, ['x', 'y', 'width', 'height', 'style', 'highlightStyle']);
  53046. return _shape3;
  53047. } else if (sps instanceof Sector) {
  53048. // 扇形
  53049. //设置style
  53050. var _style4 = new Object();
  53051. _style4["x"] = sps.x;
  53052. _style4["y"] = sps.y;
  53053. _style4["r"] = sps.r;
  53054. _style4["startAngle"] = sps.startAngle;
  53055. _style4["endAngle"] = sps.endAngle;
  53056. if (sps["r0"]) {
  53057. _style4["r0"] = sps.r0;
  53058. }
  53059. if (sps["clockWise"]) {
  53060. _style4["clockWise"] = sps.clockWise;
  53061. }
  53062. _style4 = Util_Util.copyAttributesWithClip(_style4, sps.style, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle']); //创建图形
  53063. var _shape4 = new SmicSector_SmicSector();
  53064. _shape4.style = ShapeFactory.transformStyle(_style4);
  53065. _shape4.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  53066. Util_Util.copyAttributesWithClip(_shape4, sps, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle', 'style', 'highlightStyle']);
  53067. return _shape4;
  53068. } else if (sps instanceof Label_Label) {
  53069. // 标签
  53070. //设置style
  53071. var _style5 = new Object();
  53072. _style5["x"] = sps.x;
  53073. _style5["y"] = sps.y;
  53074. _style5["text"] = sps.text;
  53075. _style5 = Util_Util.copyAttributesWithClip(_style5, sps.style, ['x', 'y', 'text']); //创建图形
  53076. var _shape5 = new SmicText_SmicText();
  53077. _shape5.style = ShapeFactory.transformStyle(_style5);
  53078. _shape5.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  53079. Util_Util.copyAttributesWithClip(_shape5, sps, ['x', 'y', 'text', 'style', 'highlightStyle']);
  53080. return _shape5;
  53081. } else if (sps instanceof Image_Image) {
  53082. // 图片
  53083. //设置style
  53084. var _style6 = new Object();
  53085. _style6["x"] = sps.x;
  53086. _style6["y"] = sps.y;
  53087. if (sps["image"]) {
  53088. _style6["image"] = sps.image;
  53089. }
  53090. if (sps["width"]) {
  53091. _style6["width"] = sps.width;
  53092. }
  53093. if (sps["height"]) {
  53094. _style6["height"] = sps.height;
  53095. }
  53096. if (sps["sx"]) {
  53097. _style6["sx"] = sps.sx;
  53098. }
  53099. if (sps["sy"]) {
  53100. _style6["sy"] = sps.sy;
  53101. }
  53102. if (sps["sWidth"]) {
  53103. _style6["sWidth"] = sps.sWidth;
  53104. }
  53105. if (sps["sHeight"]) {
  53106. _style6["sHeight"] = sps.sHeight;
  53107. }
  53108. _style6 = Util_Util.copyAttributesWithClip(_style6, sps.style, ['x', 'y', 'image', 'width', 'height', 'sx', 'sy', 'sWidth', 'sHeight']); //创建图形
  53109. var _shape6 = new SmicImage();
  53110. _shape6.style = ShapeFactory.transformStyle(_style6);
  53111. _shape6.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  53112. Util_Util.copyAttributesWithClip(_shape6, sps, ['x', 'y', 'image', 'width', 'height', 'style', 'highlightStyle']);
  53113. return _shape6;
  53114. } else if (sps instanceof Circle_Circle) {
  53115. //圆形 用于符号专题图
  53116. //设置stytle
  53117. var _style7 = new Object();
  53118. _style7["x"] = sps.x;
  53119. _style7["r"] = sps.r;
  53120. _style7["y"] = sps.y;
  53121. _style7 = Util_Util.copyAttributesWithClip(_style7, sps.style, ['x', 'y', 'r']); //创建图形
  53122. var _shape7 = new SmicCircle();
  53123. _shape7.style = ShapeFactory.transformStyle(_style7);
  53124. _shape7.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  53125. Util_Util.copyAttributesWithClip(_shape7, sps, ['x', 'y', 'r', 'style', 'highlightStyle', 'lineWidth', 'text', 'textPosition']);
  53126. return _shape7;
  53127. }
  53128. return null;
  53129. }
  53130. /**
  53131. * @function SuperMap.Feature.ShapeParameters.prototype.transformStyle
  53132. * @description 将用户 feature.style (类 Svg style 标准) 的样式,转换为 levelRenderer 的样式标准(类 CSS-Canvas 样式)
  53133. * @param {Object} style - 用户 style。
  53134. * @returns {Object} 符合 levelRenderer 的 style。
  53135. */
  53136. }], [{
  53137. key: "transformStyle",
  53138. value: function transformStyle(style) {
  53139. var newStyle = {}; //字体 ["font-style", "font-variant", "font-weight", "font-size / line-height", "font-family"];
  53140. var fontStr = ["normal", "normal", "normal", "12", "arial,sans-serif"]; //画笔类型 ["fill", "stroke"];
  53141. var brushType = [true, false];
  53142. for (var ss in style) {
  53143. switch (ss) {
  53144. case "fill":
  53145. brushType[0] = style[ss];
  53146. break;
  53147. case "fillColor":
  53148. newStyle["color"] = style[ss];
  53149. break;
  53150. case "stroke":
  53151. brushType[1] = style[ss];
  53152. break;
  53153. case "strokeWidth":
  53154. newStyle["lineWidth"] = style[ss];
  53155. break;
  53156. case "strokeLinecap":
  53157. newStyle["lineCap"] = style[ss];
  53158. break;
  53159. case "strokeLineJoin":
  53160. newStyle["lineJoin"] = style[ss];
  53161. break;
  53162. case "strokeDashstyle":
  53163. newStyle["lineType"] = style[ss];
  53164. break;
  53165. case "pointRadius":
  53166. newStyle["r"] = style[ss];
  53167. break;
  53168. case "label":
  53169. newStyle["text"] = style[ss];
  53170. break;
  53171. case "labelRect":
  53172. newStyle["labelRect"] = style[ss];
  53173. break;
  53174. case "fontColor":
  53175. newStyle["textColor"] = style[ss];
  53176. break;
  53177. case "fontStyle":
  53178. fontStr[0] = style[ss];
  53179. break;
  53180. case "fontVariant":
  53181. fontStr[1] = style[ss];
  53182. break;
  53183. case "fontWeight":
  53184. fontStr[2] = style[ss];
  53185. break;
  53186. case "fontSize":
  53187. var unit = "";
  53188. if (style[ss] && style[ss].toString().indexOf("px") < 0) {
  53189. unit = "px";
  53190. }
  53191. fontStr[3] = style[ss] + unit;
  53192. break;
  53193. case "fontFamily":
  53194. fontStr[4] = style[ss];
  53195. break;
  53196. case "fontOpacity":
  53197. newStyle["opacity"] = style[ss];
  53198. break;
  53199. case "labelPosition":
  53200. newStyle["textPosition"] = style[ss];
  53201. break;
  53202. case "labelAlign":
  53203. newStyle["textAlign"] = style[ss];
  53204. break;
  53205. case "labelBaseline":
  53206. newStyle["textBaseline"] = style[ss];
  53207. break;
  53208. case "labelRotation":
  53209. newStyle["textRotation"] = style[ss];
  53210. break;
  53211. default:
  53212. newStyle[ss] = style[ss];
  53213. break;
  53214. }
  53215. } //拼接字体字符串
  53216. newStyle["textFont"] = fontStr.join(" "); //画笔类型
  53217. if (brushType[0] === true && brushType[1] === false) {
  53218. newStyle["brushType"] = "fill";
  53219. } else if (brushType[0] === false && brushType[1] === true) {
  53220. newStyle["brushType"] = "stroke";
  53221. } else if (brushType[0] === true && brushType[1] === true) {
  53222. newStyle["brushType"] = "both";
  53223. } else {
  53224. newStyle["brushType"] = "fill";
  53225. } //默认线宽 1
  53226. if (newStyle["lineWidth"] == null) {
  53227. newStyle["lineWidth"] = 1;
  53228. }
  53229. return newStyle;
  53230. }
  53231. /**
  53232. * @function SuperMap.Feature.ShapeParameters.prototype.Background
  53233. * @description 创建一个矩形背景框图形对象。
  53234. * @param {SuperMap.Feature.ShapeFactory} shapeFactory - 图形工厂对象,必设参数。
  53235. * @param {Array.<number>} box - 框区域,长度为 4 的一维数组,像素坐标,[left, bottom, right, top],必设参数。
  53236. * @param {Object} setting - 图表配置参数,必设参数。本函数中图形配置对象 setting 可设属性:
  53237. * @param {Object} setting.backgroundStyle - 背景样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Rectangle#style>。
  53238. * @param {Array} [setting.backgroundRadius=[0,0,0,0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  53239. * @returns {Object} 背景框图形,一个可视化图形(矩形)对象。
  53240. */
  53241. }, {
  53242. key: "Background",
  53243. value: function Background(shapeFactory, box, setting) {
  53244. var sets = setting ? setting : {}; // 背景框图形参数对象
  53245. var bgSP = new feature_Rectangle_Rectangle(box[0], box[3], Math.abs(box[2] - box[0]), Math.abs(box[3] - box[1])); // 默认样式
  53246. bgSP.style = {
  53247. fillColor: "#f3f3f3"
  53248. }; // 设置用户 style
  53249. if (sets.backgroundStyle) {
  53250. Util_Util.copyAttributesWithClip(bgSP.style, sets.backgroundStyle);
  53251. } // 设置背景框圆角参数
  53252. if (sets.backgroundRadius) {
  53253. bgSP.style["radius"] = sets.backgroundRadius;
  53254. } // 禁止背景框响应事件
  53255. bgSP.clickable = false;
  53256. bgSP.hoverable = false;
  53257. return shapeFactory.createShape(bgSP);
  53258. }
  53259. /**
  53260. * @function SuperMap.Feature.ShapeParameters.prototype.GraphAxis
  53261. * @description 创建一个统计图表坐标轴图形对象组。
  53262. * @param {SuperMap.Feature.ShapeFactory} shapeFactory - 图形工厂对象,必设参数。
  53263. * @param {Array.<number>} dataViewBox - 统计图表模型的数据视图框,长度为 4 的一维数组,像素坐标,[left, bottom, right, top],必设参数。
  53264. * @param {Object} setting - 图表配置参数,必设参数。
  53265. * @param {Object} setting.axisStyle - 坐标轴样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Line#style>。
  53266. * @param {boolean} [setting.axisUseArrow=false] - 坐标轴是否使用箭头。
  53267. * @param {number} [setting.axisYTick=0] - y 轴刻度数量,0表示不使用箭头。
  53268. * @param {Array.<string>} setting.axisYLabels - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  53269. * @param {Object} setting.axisYLabelsStyle - y 轴上的标签组样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Label#style>。
  53270. * @param {Array.<number>} [setting.axisYLabelsOffset=[0,0]] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正,默认值:0。
  53271. * @param {Array.<string>} setting.axisXLabels - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  53272. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xPositions 数量相同(即标签个数与数据个数相等时), 按照 xPositions 提供的位置在水平方向上排布标签,否则沿数据视图框下面条边等距排布标签。
  53273. * @param {Object} setting.axisXLabelsStyle - x 轴上的标签组样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Label#style>。
  53274. * @param {Array.<number>} [setting.axisXLabelsOffset=[0,0]] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正,默认值:0。
  53275. * @param {boolean} setting.useXReferenceLine - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  53276. * @param {Object} setting.xReferenceLineStyle - 水平参考线样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Line#style>。
  53277. * @param {number} [setting.axis3DParameter=0] - 3D 坐标轴参数,此属性值在大于等于 15 时有效。
  53278. * @param {Object} xShapeInfo - X 方向上的图形信息对象,包含两个属性。
  53279. * @param {Array.<number>} xShapeInfo.xPositions - 图形在 x 轴方向上的像素坐标值,是一个一维数组,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  53280. * @param {number} xShapeInfo.width - 图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  53281. * @returns {Array.<Object>} 统计图表坐标轴图形对象数组。
  53282. */
  53283. }, {
  53284. key: "GraphAxis",
  53285. value: function GraphAxis(shapeFactory, dataViewBox, setting, xShapeInfo) {
  53286. var dvb = dataViewBox;
  53287. var sets = setting ? setting : {}; // 参考线图形对象组
  53288. var refLines = []; //坐标轴箭头对象组
  53289. var arrows = []; // 是否使用参水平考线,默认不使用
  53290. var isAddRefLine = sets.useXReferenceLine ? sets.useXReferenceLine : false; // y 轴上的刻度
  53291. var axisytick = sets.axisYTick && !isNaN(sets.axisYTick) ? sets.axisYTick : 0; // 坐标轴节点数组
  53292. var pois = []; //z 轴箭头数组
  53293. var zArrowPois = []; // x,y 轴主干节点数组
  53294. var xMainPois = [];
  53295. if (axisytick == 0) {
  53296. xMainPois.push([dvb[0], dvb[3] - 5]);
  53297. xMainPois.push([dvb[0], dvb[1]]); // 3D 坐标轴 第三象限平分线
  53298. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  53299. var axis3DParameter = parseInt(sets.axis3DParameter);
  53300. var axis3DPoi = [dvb[0] - axis3DParameter, dvb[1] + axis3DParameter]; // 添加 3D 轴节点
  53301. if (sets.axisUseArrow) {
  53302. // 添加 3D 轴箭头节点坐标
  53303. //箭头坐标
  53304. zArrowPois.push([axis3DPoi[0] + 1.5, axis3DPoi[1] - 7.5]);
  53305. zArrowPois.push([axis3DPoi[0] - 1, axis3DPoi[1] + 1]);
  53306. zArrowPois.push([axis3DPoi[0] + 7.5, axis3DPoi[1] - 1.5]); //3D轴
  53307. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  53308. } else {
  53309. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  53310. }
  53311. xMainPois.push([dvb[0], dvb[1]]);
  53312. }
  53313. xMainPois.push([dvb[2] + 5, dvb[1]]);
  53314. } else {
  53315. // 单位刻度长度
  53316. var unitTick = Math.abs(dvb[1] - dvb[3]) / axisytick; // 刻度 y 坐标
  53317. var thckY = dvb[3];
  53318. xMainPois.push([dvb[0], thckY - 5]);
  53319. for (var i = 0; i < axisytick; i++) {
  53320. xMainPois.push([dvb[0], thckY]);
  53321. xMainPois.push([dvb[0] - 5, thckY]);
  53322. xMainPois.push([dvb[0], thckY]); // 参考线
  53323. if (isAddRefLine) {
  53324. // 参考线参数对象
  53325. var refLineSP = new Line_Line([[dvb[0], thckY], [dvb[2], thckY]]); // 参考线默认样式对象
  53326. refLineSP.style = {
  53327. strokeColor: "#cfcfcf",
  53328. strokeLinecap: "butt",
  53329. strokeLineJoin: "round",
  53330. strokeWidth: 1
  53331. }; // 禁止事件
  53332. refLineSP.clickable = false;
  53333. refLineSP.hoverable = false; // 用户style
  53334. if (sets.xReferenceLineStyle) {
  53335. Util_Util.copyAttributesWithClip(refLineSP.style, sets.xReferenceLineStyle);
  53336. } // 生成参考线图形对象
  53337. refLines.push(shapeFactory.createShape(refLineSP));
  53338. } // y 刻度增量
  53339. thckY += unitTick;
  53340. }
  53341. xMainPois.push([dvb[0], dvb[1]]); // 3D 坐标轴 第三象限平分线
  53342. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  53343. var _axis3DParameter = parseInt(sets.axis3DParameter);
  53344. var _axis3DPoi = [dvb[0] - _axis3DParameter, dvb[1] + _axis3DParameter];
  53345. /*
  53346. // 箭头计算过程
  53347. var axis3DPoiRef = [axis3DPoi[0] + 7, axis3DPoi[1] - 7]; // 7 是 10 为斜边 cos(45度)时邻边的值
  53348. var axis3DPoiLT = [axis3DPoiRef[0] - 4, axis3DPoiRef[1] - 4];
  53349. var axis3DPoiRB = [axis3DPoiRef[0] + 4, axis3DPoiRef[1] + 4];
  53350. if(sets.axisUseArrow){
  53351. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  53352. xMainPois.push([axis3DPoiLT[0], axis3DPoiLT[1]]);
  53353. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  53354. xMainPois.push([axis3DPoiRB[0], axis3DPoiRB[1]]);
  53355. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  53356. }
  53357. else{
  53358. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  53359. }
  53360. */
  53361. // 添加 3D 轴节点
  53362. if (sets.axisUseArrow) {
  53363. // 添加 3D 轴和箭头坐标
  53364. //箭头坐标
  53365. zArrowPois.push([_axis3DPoi[0] + 1.5, _axis3DPoi[1] - 7.5]);
  53366. zArrowPois.push([_axis3DPoi[0] - 1, _axis3DPoi[1] + 1]);
  53367. zArrowPois.push([_axis3DPoi[0] + 7.5, _axis3DPoi[1] - 1.5]); //3D轴
  53368. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  53369. } else {
  53370. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  53371. }
  53372. xMainPois.push([dvb[0], dvb[1]]);
  53373. }
  53374. xMainPois.push([dvb[2] + 5, dvb[1]]);
  53375. } // 坐标轴箭头
  53376. if (sets.axisUseArrow) {
  53377. // x 轴箭头节点数组
  53378. var xArrowPois = [[dvb[2] + 5, dvb[1] + 4], [dvb[2] + 13, dvb[1]], [dvb[2] + 5, dvb[1] - 4]]; // y 轴箭头节点数组
  53379. var yArrowPois = [[dvb[0] - 4, dvb[3] - 5], [dvb[0], dvb[3] - 13], [dvb[0] + 4, dvb[3] - 5]]; //x轴箭头
  53380. var xSP = new Polygon_Polygon(xArrowPois);
  53381. xSP.style = {
  53382. fillColor: "#008acd"
  53383. };
  53384. Util_Util.copyAttributesWithClip(xSP.style, sets.axisStyle);
  53385. arrows.push(shapeFactory.createShape(xSP)); //y轴箭头
  53386. var ySP = new Polygon_Polygon(yArrowPois);
  53387. ySP.style = {
  53388. fillColor: "#008acd"
  53389. };
  53390. Util_Util.copyAttributesWithClip(ySP.style, sets.axisStyle);
  53391. arrows.push(shapeFactory.createShape(ySP)); // z轴箭头 坐标轴箭头是否要使用
  53392. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  53393. var zSP = new Polygon_Polygon(zArrowPois);
  53394. zSP.style = {
  53395. fillColor: "#008acd"
  53396. };
  53397. Util_Util.copyAttributesWithClip(zSP.style, sets.axisStyle);
  53398. arrows.push(shapeFactory.createShape(zSP));
  53399. }
  53400. } //不带箭头的坐标轴
  53401. pois = xMainPois; // 坐标轴参数对象
  53402. var axisSP = new Line_Line(pois); // 坐标轴默认style
  53403. axisSP.style = {
  53404. strokeLinecap: "butt",
  53405. strokeLineJoin: "round",
  53406. strokeColor: "#008acd",
  53407. strokeWidth: 1
  53408. }; // 用户 style
  53409. if (sets.axisStyle) {
  53410. Util_Util.copyAttributesWithClip(axisSP.style, sets.axisStyle);
  53411. } // 禁止事件
  53412. axisSP.clickable = false;
  53413. axisSP.hoverable = false; // 创建坐标轴图形对象
  53414. var axisMain = [shapeFactory.createShape(axisSP)]; // Y 轴标签
  53415. var yLabels = [];
  53416. if (sets.axisYLabels && sets.axisYLabels.length && sets.axisYLabels.length > 0) {
  53417. var axisYLabels = sets.axisYLabels;
  53418. var len = axisYLabels.length; // 标签偏移量
  53419. var ylOffset = [0, 0];
  53420. if (sets.axisYLabelsOffset && sets.axisYLabelsOffset.length) {
  53421. ylOffset = sets.axisYLabelsOffset;
  53422. }
  53423. if (len == 1) {
  53424. // 标签参数对象
  53425. var labelYSP = new Label_Label(dvb[0] - 5 + ylOffset[0], dvb[3] + ylOffset[1], axisYLabels[0]);
  53426. labelYSP.style = {
  53427. labelAlign: "right"
  53428. }; // 用户 style
  53429. if (sets.axisYLabelsStyle) {
  53430. Util_Util.copyAttributesWithClip(labelYSP.style, sets.axisYLabelsStyle);
  53431. } // 禁止事件
  53432. labelYSP.clickable = false;
  53433. labelYSP.hoverable = false; // 制作标签
  53434. yLabels.push(shapeFactory.createShape(labelYSP));
  53435. } else {
  53436. var labelY = dvb[3]; // y 轴标签单位距离
  53437. var yUnit = Math.abs(dvb[1] - dvb[3]) / (len - 1);
  53438. for (var j = 0; j < len; j++) {
  53439. // 标签参数对象
  53440. var _labelYSP = new Label_Label(dvb[0] - 5 + ylOffset[0], labelY + ylOffset[1], axisYLabels[j]);
  53441. _labelYSP.style = {
  53442. labelAlign: "right"
  53443. }; // 用户 style
  53444. if (sets.axisYLabelsStyle) {
  53445. Util_Util.copyAttributesWithClip(_labelYSP.style, sets.axisYLabelsStyle);
  53446. } // 禁止事件
  53447. _labelYSP.clickable = false;
  53448. _labelYSP.hoverable = false; // 制作标签
  53449. yLabels.push(shapeFactory.createShape(_labelYSP)); // y 轴标签 y 方向增量
  53450. labelY += yUnit;
  53451. }
  53452. }
  53453. } // X 轴标签
  53454. var xLabels = [];
  53455. if (sets.axisXLabels && sets.axisXLabels.length && sets.axisXLabels.length > 0) {
  53456. var axisXLabels = sets.axisXLabels;
  53457. var _len = axisXLabels.length; // 标签偏移量
  53458. var xlOffset = [0, 0];
  53459. if (sets.axisXLabelsOffset && sets.axisXLabelsOffset.length) {
  53460. xlOffset = sets.axisXLabelsOffset;
  53461. } // 标签个数与数据字段个数相等等时,标签在 x 轴均匀排列
  53462. if (xShapeInfo && xShapeInfo.xPositions && xShapeInfo.xPositions.length && xShapeInfo.xPositions.length == _len) {
  53463. var xsCenter = xShapeInfo.xPositions;
  53464. for (var K = 0; K < _len; K++) {
  53465. // 标签参数对象
  53466. var labelXSP = new Label_Label(xsCenter[K] + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[K]); // 默认 style
  53467. labelXSP.style = {
  53468. labelAlign: "center",
  53469. labelBaseline: "top"
  53470. }; // 用户 style
  53471. if (sets.axisXLabelsStyle) {
  53472. Util_Util.copyAttributesWithClip(labelXSP.style, sets.axisXLabelsStyle);
  53473. } // 禁止事件
  53474. labelXSP.clickable = false;
  53475. labelXSP.hoverable = false; // 创建标签对象
  53476. xLabels.push(shapeFactory.createShape(labelXSP));
  53477. }
  53478. } else {
  53479. if (_len == 1) {
  53480. // 标签参数对象
  53481. var _labelXSP = new Label_Label(dvb[0] - 5 + xlOffset[0], dvb[1] + xlOffset[0], axisXLabels[0]); // 默认 style
  53482. _labelXSP.style = {
  53483. labelAlign: "center",
  53484. labelBaseline: "top"
  53485. }; // 用户 style
  53486. if (sets.axisXLabelsStyle) {
  53487. Util_Util.copyAttributesWithClip(_labelXSP.style, sets.axisXLabelsStyle);
  53488. } // 禁止事件
  53489. _labelXSP.clickable = false;
  53490. _labelXSP.hoverable = false; // 创建标签对象
  53491. xLabels.push(shapeFactory.createShape(_labelXSP));
  53492. } else {
  53493. var labelX = dvb[0]; // x 轴标签单位距离
  53494. var xUnit = Math.abs(dvb[2] - dvb[0]) / (_len - 1);
  53495. for (var m = 0; m < _len; m++) {
  53496. // 标签参数对象
  53497. var _labelXSP2 = new Label_Label(labelX + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[m]); // 默认 style
  53498. _labelXSP2.style = {
  53499. labelAlign: "center",
  53500. labelBaseline: "top"
  53501. }; // 用户 style
  53502. if (sets.axisXLabelsStyle) {
  53503. Util_Util.copyAttributesWithClip(_labelXSP2.style, sets.axisXLabelsStyle);
  53504. } // 禁止事件
  53505. _labelXSP2.clickable = false;
  53506. _labelXSP2.hoverable = false; // 创建标签对象
  53507. xLabels.push(shapeFactory.createShape(_labelXSP2)); // x 轴标签 x 方向增量
  53508. labelX += xUnit;
  53509. }
  53510. }
  53511. }
  53512. } // 组装并返回构成坐标轴的图形
  53513. return refLines.concat(axisMain).concat(yLabels).concat(xLabels).concat(arrows);
  53514. }
  53515. /**
  53516. * @function SuperMap.Feature.ShapeParameters.prototype.ShapeStyleTool
  53517. * @description 一个图形 style 处理工具。此工具将指定的默认 style,通用 style,按 styleGroup 取得的 style 和按数据值 value 范围取得的 style 进行合并,得到图形最终的 style。
  53518. * @param {Object} defaultStyle - 默认style,此样式对象可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。
  53519. * @param {Object} style - 图形对象基础 style,此参数控制图形的基础样式,可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。优先级低于 styleGroup,styleByCodomain。
  53520. * @param {Array.<Object>} styleGroup - 一个 style 数组,优先级低于 styleByCodomain,高于 style。此数组每个元素是样式对象,
  53521. * 其可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。通过 index 参数从 styleGroup 中取 style。
  53522. * @param {Array.<Object>} styleByCodomain - 按数据(参数 value)所在值域范围控制数据的可视化对象样式。
  53523. * (start code)
  53524. * // styleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  53525. * // start: 值域值下限(包含);
  53526. * // end: 值域值上限(不包含);
  53527. * // style: 数据可视化图形的 style,其可设属性根据图形类型参考 <SuperMap.Feature.ShapeParameters> 子类对象的 style 属性。。
  53528. * // dataStyleByCodomain 数组形如:
  53529. * [
  53530. * {
  53531. * start:0,
  53532. * end:250,
  53533. * style:{
  53534. * fillColor:"#00CD00"
  53535. * }
  53536. * },
  53537. * {
  53538. * start:250,
  53539. * end:500,
  53540. * style:{
  53541. * fillColor:"#00EE00"
  53542. * }
  53543. * },
  53544. * {
  53545. * start:500,
  53546. * end:750,
  53547. * style:{
  53548. * fillColor:"#00FF7F"
  53549. * }
  53550. * },
  53551. * {
  53552. * start:750,
  53553. * end:1500,
  53554. * style:{
  53555. * fillColor:"#00FF00"
  53556. * }
  53557. * }
  53558. * ]
  53559. * (end)
  53560. * @param {number} index - styleGroup 的索引值,用于取出 styleGroup 指定的 style。
  53561. * @param {number} value - 数据值,用于取出 styleByCodomain 指定的 style。
  53562. * @returns {Object} 合并后的样式 (style) 对象。
  53563. */
  53564. }, {
  53565. key: "ShapeStyleTool",
  53566. value: function ShapeStyleTool(defaultStyle, style, styleGroup, styleByCodomain, index, value) {
  53567. // 用 defaultStyle 初始化 style 对象
  53568. var finalStyle = defaultStyle ? defaultStyle : {}; // 基础 style
  53569. if (style) {
  53570. Util_Util.copyAttributesWithClip(finalStyle, style);
  53571. } // 按索引赋 style
  53572. if (styleGroup && styleGroup.length && typeof index !== "undefined" && !isNaN(index) && index >= 0) {
  53573. if (styleGroup[index]) {
  53574. Util_Util.copyAttributesWithClip(finalStyle, styleGroup[index]);
  53575. }
  53576. } // 按值域赋 style
  53577. if (styleByCodomain && styleByCodomain.length && typeof value !== "undefined") {
  53578. var dsc = styleByCodomain;
  53579. var dscLen = dsc.length;
  53580. var v = parseFloat(value);
  53581. for (var i = 0; i < dscLen; i++) {
  53582. if (dsc[i].start <= v && v < dsc[i].end) {
  53583. Util_Util.copyAttributesWithClip(finalStyle, dsc[i].style);
  53584. break;
  53585. }
  53586. }
  53587. }
  53588. return finalStyle;
  53589. }
  53590. }]);
  53591. return ShapeFactory;
  53592. }();
  53593. SuperMap.Feature = SuperMap.Feature || {};
  53594. SuperMap.Feature.ShapeFactory = ShapeFactory_ShapeFactory;
  53595. // CONCATENATED MODULE: ./src/common/overlay/feature/Theme.js
  53596. function feature_Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53597. 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); } }
  53598. function feature_Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Theme_defineProperties(Constructor, staticProps); return Constructor; }
  53599. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  53600. * This program are made available under the terms of the Apache License, Version 2.0
  53601. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53602. /**
  53603. * @class SuperMap.Feature.Theme
  53604. * @category Visualization Theme
  53605. * @classdesc 专题要素基类,此类不可实例化。
  53606. */
  53607. var feature_Theme_Theme = /*#__PURE__*/function () {
  53608. /**
  53609. * @function SuperMap.Feature.Theme.prototype.constructor
  53610. * @description 构造函数。
  53611. * @param {Object} data - 用户数据,用于生成可视化 shape,必设参数。
  53612. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层,必设参数。
  53613. * @returns {SuperMap.Feature.Theme} 返回一个专题要素。
  53614. */
  53615. function Theme(data, layer) {
  53616. feature_Theme_classCallCheck(this, Theme);
  53617. if (!data) {
  53618. return;
  53619. } // layer 必须已经添加到地图, 且已初始化渲染器
  53620. if (!layer || !layer.map || !layer.renderer) {
  53621. return;
  53622. }
  53623. /**
  53624. * @member {string} SuperMap.Feature.Theme.prototype.id
  53625. * @description 专题要素唯一标识。
  53626. */
  53627. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  53628. /**
  53629. * @member {SuperMap.LonLat} SuperMap.Feature.Theme.prototype.lonlat
  53630. * @description 专题要素地理参考位置。子类中必须根据用户数据(或地理位置参数)对其赋值。
  53631. */
  53632. this.lonlat = null;
  53633. /**
  53634. * @member {Array} SuperMap.Feature.Theme.prototype.location
  53635. * @description 专题要素像素参考位置。通常由地理参考位置决定。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  53636. */
  53637. this.location = [];
  53638. /**
  53639. * @readonly
  53640. * @member {Object} SuperMap.Feature.Theme.prototype.data
  53641. * @description 用户数据,用于生成可视化 shape,可在子类中规定数据格式或类型,如:<SuperMap.Feature.Vector>。
  53642. */
  53643. this.data = data;
  53644. /**
  53645. * @readonly
  53646. * @member {Array} SuperMap.Feature.Theme.prototype.shapes
  53647. * @description 构成此专题要素的可视化图形对象数组,数组顺序控制渲染。
  53648. */
  53649. this.shapes = [];
  53650. /**
  53651. * @readonly
  53652. * @member {SuperMap.Layer.Theme} SuperMap.Feature.Theme.prototype.layer
  53653. * @description 此专题要素所在专题图层。
  53654. */
  53655. this.layer = layer;
  53656. this.CLASS_NAME = "SuperMap.Feature.Theme";
  53657. }
  53658. /**
  53659. * @function SuperMap.Feature.Theme.prototype.destroy
  53660. * @description 销毁专题要素。
  53661. */
  53662. feature_Theme_createClass(Theme, [{
  53663. key: "destroy",
  53664. value: function destroy() {
  53665. this.data = null;
  53666. this.id = null;
  53667. this.lonlat = null;
  53668. this.location = null;
  53669. this.shapes = null;
  53670. this.layer = null;
  53671. }
  53672. /**
  53673. * @function SuperMap.Feature.Theme.prototype.getLocalXY
  53674. * @description 地理坐标转为像素坐标。
  53675. * @param {(SuperMap.Geometry.Point|SuperMap.Geometry.GeoText|SuperMap.LonLat)} coordinate - 地理坐标点。
  53676. * @returns {Array} 长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  53677. */
  53678. }, {
  53679. key: "getLocalXY",
  53680. value: function getLocalXY(coordinate) {
  53681. var resolution = this.layer.map.getResolution();
  53682. var extent = this.layer.map.getExtent();
  53683. if (coordinate instanceof Point_Point || coordinate instanceof GeoText_GeoText) {
  53684. var x = coordinate.x / resolution + -extent.left / resolution;
  53685. var y = extent.top / resolution - coordinate.y / resolution;
  53686. return [x, y];
  53687. } else if (coordinate instanceof LonLat_LonLat) {
  53688. var _x = coordinate.lon / resolution + -extent.left / resolution;
  53689. var _y = extent.top / resolution - coordinate.lat / resolution;
  53690. return [_x, _y];
  53691. } else {
  53692. return null;
  53693. }
  53694. }
  53695. }]);
  53696. return Theme;
  53697. }();
  53698. SuperMap.Feature = SuperMap.Feature || {};
  53699. SuperMap.Feature.Theme = feature_Theme_Theme;
  53700. // CONCATENATED MODULE: ./src/common/overlay/Graph.js
  53701. 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); }
  53702. function Graph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53703. 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); } }
  53704. function Graph_createClass(Constructor, protoProps, staticProps) { if (protoProps) Graph_defineProperties(Constructor.prototype, protoProps); if (staticProps) Graph_defineProperties(Constructor, staticProps); return Constructor; }
  53705. 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); }
  53706. function Graph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Graph_getPrototypeOf(object); if (object === null) break; } return object; }
  53707. 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); }
  53708. function Graph_setPrototypeOf(o, p) { Graph_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Graph_setPrototypeOf(o, p); }
  53709. 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); }; }
  53710. function Graph_possibleConstructorReturn(self, call) { if (call && (Graph_typeof(call) === "object" || typeof call === "function")) { return call; } return Graph_assertThisInitialized(self); }
  53711. function Graph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53712. 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; } }
  53713. function Graph_getPrototypeOf(o) { Graph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Graph_getPrototypeOf(o); }
  53714. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  53715. * This program are made available under the terms of the Apache License, Version 2.0
  53716. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53717. /**
  53718. * @class SuperMap.Feature.Theme.Graph
  53719. * @classdesc 统计专题要素基类。
  53720. * @category Visualization Theme
  53721. * @description 此类定义了统计专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  53722. * 统计专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <SuperMap.Feature.Theme.Graph.setting> 的基础属性只有 7 个,
  53723. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  53724. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  53725. * @extends SuperMap.Feature.Theme
  53726. * @param {SuperMap.Feature.Vector} data - 用户数据。
  53727. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层。
  53728. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  53729. * @param {Object} setting - 图表配置对象。
  53730. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  53731. */
  53732. var Graph_Graph = /*#__PURE__*/function (_Theme) {
  53733. Graph_inherits(Graph, _Theme);
  53734. var _super = Graph_createSuper(Graph);
  53735. function Graph(data, layer, fields, setting, lonlat, options) {
  53736. var _this;
  53737. Graph_classCallCheck(this, Graph);
  53738. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  53739. /**
  53740. * @member {SuperMap.Feature.ShapeFactory} SuperMap.Feature.Theme.Graph.prototype.shapeFactory
  53741. * @description 内置的图形工厂对象,调用其 createShape 方法创建图形。
  53742. */
  53743. _this.shapeFactory = new ShapeFactory_ShapeFactory();
  53744. /**
  53745. * @member {Object} SuperMap.Feature.Theme.Graph.prototype.shapeParameters
  53746. * @description 当前图形参数对象,<SuperMap.Feature.ShapeParameters> 的子类对象。
  53747. */
  53748. _this.shapeParameters = null;
  53749. /**
  53750. * @member {boolean} [SuperMap.Feature.Theme.Graph.prototype.RelativeCoordinate]
  53751. * @description 图形是否已经计算了相对坐标。
  53752. */
  53753. _this.RelativeCoordinate = false;
  53754. /**
  53755. * @member {Object} SuperMap.Feature.Theme.Graph.prototype.setting
  53756. * @description 图表配置对象,该对象控制着图表的可视化显示。
  53757. * @param {number} width - 专题要素(图表)宽度。
  53758. * @param {number} height - 专题要素(图表)高度。
  53759. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  53760. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  53761. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  53762. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox
  53763. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  53764. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。
  53765. * 如果不设置此参数,在取数据值时不对数据做小数位处理。
  53766. *
  53767. */
  53768. _this.setting = null;
  53769. /**
  53770. * @readonly
  53771. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.origonPoint
  53772. * @description 专题要素(图表)原点,图表左上角点像素坐标,是长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  53773. */
  53774. _this.origonPoint = null;
  53775. /**
  53776. * @readonly
  53777. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.chartBox
  53778. * @description 专题要素(图表)区域,即图表框,长度为 4 的一维数组,数组的 4 个元素依次表示图表框左端 x 坐标值、
  53779. * 下端 y坐标值、 右端 x坐标值、 上端 y 坐标值;[left, bottom, right, top]。
  53780. */
  53781. _this.chartBox = null;
  53782. /**
  53783. * @readonly
  53784. * @member {SuperMap.Bounds} SuperMap.Feature.Theme.Graph.prototype.chartBounds
  53785. * @description 图表 Bounds 随着 lonlat、XOffset、YOffset 更新,注意 chartBounds 是图表像素范围,不是地理范围。
  53786. */
  53787. _this.chartBounds = null;
  53788. /**
  53789. * @readonly
  53790. * @member {number} SuperMap.Feature.Theme.Graph.prototype.width
  53791. * @description 专题要素(图表)宽度 。
  53792. */
  53793. _this.width = null;
  53794. /**
  53795. * @readonly
  53796. * @member {number} SuperMap.Feature.Theme.Graph.prototype.height
  53797. * @description 专题要素(图表)高度 。
  53798. */
  53799. _this.height = null;
  53800. /**
  53801. * @readonly
  53802. * @member {number} SuperMap.Feature.Theme.Graph.prototype.XOffset
  53803. * @description 专题要素(图表)在 X 方向上的偏移值,单位像素。
  53804. */
  53805. _this.XOffset = 0;
  53806. /**
  53807. * @readonly
  53808. * @member {number} SuperMap.Feature.Theme.Graph.prototype.YOffset
  53809. * @description 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  53810. */
  53811. _this.YOffset = 0;
  53812. /**
  53813. * @readonly
  53814. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBParameter
  53815. * @description 数据视图框参数,长度为 4 的一维数组(数组元素值 >= 0),[leftOffset, bottomOffset, rightOffset, topOffset],chartBox 内偏距值。
  53816. * 此属性用于指定数据视图框 dataViewBox 的范围。
  53817. */
  53818. _this.DVBParameter = null;
  53819. /**
  53820. * @readonly
  53821. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.dataViewBox
  53822. * @description 数据视图框,长度为 4 的一维数组,[left, bottom, right, top]。
  53823. * dataViewBox 是统计专题要素最核心的内容,它负责解释数据在一个像素区域里的数据可视化含义,
  53824. * 这种含义用可视化图形表达出来,这些表示数据的图形和一些辅助图形组合在一起构成统计专题图表。
  53825. */
  53826. _this.dataViewBox = null;
  53827. /**
  53828. * @readonly
  53829. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBCodomain
  53830. * @description 数据视图框的内允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  53831. * dataViewBox 中允许的数据范围,对数据溢出值域范围情况的处理需要在 assembleShapes 中进行。
  53832. */
  53833. _this.DVBCodomain = null;
  53834. /**
  53835. * @readonly
  53836. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBCenterPoint
  53837. * @description 数据视图框中心点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  53838. */
  53839. _this.DVBCenterPoint = null;
  53840. /**
  53841. * @readonly
  53842. * @member {string} SuperMap.Feature.Theme.Graph.prototype.DVBUnitValue
  53843. * @description 单位值。在 assembleShapes() 中初始化其具体意义,例如:饼图的 DVBUnitValue 可以定义为"360/数据总和",
  53844. * 折线图的 DVBUnitValue 可以定义为 "DVBCodomain/DVBHeight"。
  53845. */
  53846. _this.DVBUnitValue = null;
  53847. /**
  53848. * @readonly
  53849. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBOrigonPoint
  53850. * @description 数据视图框原点,数据视图框左上角点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  53851. */
  53852. _this.DVBOrigonPoint = null;
  53853. /**
  53854. * @readonly
  53855. * @member {number} SuperMap.Feature.Theme.Graph.prototype.DVBWidth
  53856. * @description 数据视图框宽度。
  53857. */
  53858. _this.DVBWidth = null;
  53859. /**
  53860. * @readonly
  53861. * @member {number} SuperMap.Feature.Theme.Graph.prototype.DVBHeight
  53862. * @description 数据视图框高度。
  53863. */
  53864. _this.DVBHeight = null;
  53865. /**
  53866. * @readonly
  53867. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.origonPointOffset
  53868. * @description 数据视图框原点相对于图表框的原点偏移量,长度为 2 的一维数组,第一个元素表示 x 偏移量,第二个元素表示 y 偏移量。
  53869. */
  53870. _this.origonPointOffset = null;
  53871. /**
  53872. * @readonly
  53873. * @member {Array.<string>} SuperMap.Feature.Theme.Graph.prototype.fields
  53874. * @description 数据{SuperMap.Feature.Vector}属性字段。
  53875. */
  53876. _this.fields = fields || [];
  53877. /**
  53878. * @readonly
  53879. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.dataValues
  53880. * @description 图表展示的数据值,通过 fields 从数据 feature 属性中获得。
  53881. */
  53882. _this.dataValues = null; // 图表位置
  53883. if (lonlat) {
  53884. _this.lonlat = lonlat;
  53885. } else {
  53886. // 默认使用 bounds 中心
  53887. _this.lonlat = _this.data.geometry.getBounds().getCenterLonLat();
  53888. } // 配置项检测与赋值
  53889. if (setting && setting.width && setting.height && setting.codomain) {
  53890. _this.setting = setting;
  53891. }
  53892. _this.CLASS_NAME = "SuperMap.Feature.Theme.Graph";
  53893. return _this;
  53894. }
  53895. /**
  53896. * @function SuperMap.Feature.Theme.Graph.prototype.destroy
  53897. * @description 销毁专题要素。
  53898. */
  53899. Graph_createClass(Graph, [{
  53900. key: "destroy",
  53901. value: function destroy() {
  53902. this.shapeFactory = null;
  53903. this.shapeParameters = null;
  53904. this.width = null;
  53905. this.height = null;
  53906. this.origonPoint = null;
  53907. this.chartBox = null;
  53908. this.dataViewBox = null;
  53909. this.chartBounds = null;
  53910. this.DVBParameter = null;
  53911. this.DVBOrigonPoint = null;
  53912. this.DVBCenterPoint = null;
  53913. this.DVBWidth = null;
  53914. this.DVBHeight = null;
  53915. this.DVBCodomain = null;
  53916. this.DVBUnitValue = null;
  53917. this.origonPointOffset = null;
  53918. this.XOffset = null;
  53919. this.YOffset = null;
  53920. this.fields = null;
  53921. this.dataValues = null;
  53922. this.setting = null;
  53923. Graph_get(Graph_getPrototypeOf(Graph.prototype), "destroy", this).call(this);
  53924. }
  53925. /**
  53926. * @function SuperMap.Feature.Theme.Graph.prototype.initBaseParameter
  53927. * @description 初始化专题要素(图表)基础参数。在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  53928. * 调用此函数关系到 setting 对象的以下属性。
  53929. * @param {number} width - 专题要素(图表)宽度。
  53930. * @param {number} height - 专题要素(图表)高度。
  53931. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  53932. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  53933. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  53934. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox。
  53935. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  53936. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  53937. * @returns {boolean} 初始化参数是否成功。
  53938. */
  53939. }, {
  53940. key: "initBaseParameter",
  53941. value: function initBaseParameter() {
  53942. // 参数初始化是否成功
  53943. var isSuccess = true; // setting 属性是否已成功赋值
  53944. if (!this.setting) {
  53945. return false;
  53946. }
  53947. var sets = this.setting; // 检测 setting 的必设参数
  53948. if (!(sets.width && sets.height && sets.codomain)) {
  53949. return false;
  53950. } // 数据
  53951. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  53952. var dataEffective = feature_Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  53953. this.dataValues = dataEffective ? dataEffective : []; // 基础参数 width, height, codomain
  53954. this.width = parseFloat(sets.width);
  53955. this.height = parseFloat(sets.height);
  53956. this.DVBCodomain = sets.codomain; // 图表偏移
  53957. // if(sets.XOffset) {this.XOffset = sets.XOffset};
  53958. // if(sets.YOffset) {this.YOffset = sets.YOffset};
  53959. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  53960. this.YOffset = sets.YOffset ? sets.YOffset : 0; // 其他默认值
  53961. this.origonPoint = [];
  53962. this.chartBox = [];
  53963. this.dataViewBox = [];
  53964. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  53965. this.DVBOrigonPoint = [];
  53966. this.DVBCenterPoint = [];
  53967. this.origonPointOffset = []; // 图表位置
  53968. this.resetLocation(); // 专题要素宽度 w
  53969. var w = this.width; // 专题要素高度 h
  53970. var h = this.height; // 专题要素像素位置 loc
  53971. var loc = this.location; // 专题要素像素位置 loc
  53972. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2]; // 专题要素原点(左上角)
  53973. var op = this.origonPoint; // 图表框([left, bottom, right, top])
  53974. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]]; // 图表框
  53975. var cb = this.chartBox; // 数据视图框参数,它是图表框各方向对应的内偏距
  53976. var dbbP = this.DVBParameter; // 数据视图框 ([left, bottom, right, top])
  53977. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]]; // 数据视图框
  53978. var dvb = this.dataViewBox; //检查数据视图框是否合法
  53979. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  53980. return false;
  53981. } // 数据视图框原点
  53982. this.DVBOrigonPoint = [dvb[0], dvb[3]]; // 数据视图框宽度
  53983. this.DVBWidth = Math.abs(dvb[2] - dvb[0]); // 数据视图框高度
  53984. this.DVBHeight = Math.abs(dvb[1] - dvb[3]); // 数据视图框中心点
  53985. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2]; // 数据视图框原点与图表框的原点偏移量
  53986. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  53987. return isSuccess;
  53988. }
  53989. /**
  53990. * @function SuperMap.Feature.Theme.Graph.prototype.resetLocation
  53991. * @description 根据地理位置 lonlat 重置专题要素(图表)位置。
  53992. * @param {SuperMap.LonLat} lonlat - 专题要素新的像素中心位置。
  53993. * @returns {Array.<number>} - 新专题要素像素参考位置。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  53994. */
  53995. }, {
  53996. key: "resetLocation",
  53997. value: function resetLocation(lonlat) {
  53998. if (lonlat) {
  53999. this.lonlat = lonlat;
  54000. } // 获取地理位置对应的像素坐标 newLocalLX
  54001. var newLocalLX = this.getLocalXY(this.lonlat); // 处理偏移量 XOffset, YOffset
  54002. newLocalLX[0] += this.XOffset;
  54003. newLocalLX[1] += this.YOffset; // 将图形位置赋予 location 属性(注意 location 属性表示的是专题要素中心位置)
  54004. this.location = newLocalLX; // 更新图表像素 Bounds
  54005. var w = this.width;
  54006. var h = this.height;
  54007. var loc = this.location;
  54008. this.chartBounds = new Bounds_Bounds(loc[0] - w / 2, loc[1] + h / 2, loc[0] + w / 2, loc[1] - h / 2); //重新计算当前渐变色
  54009. this.resetLinearGradient();
  54010. return loc;
  54011. }
  54012. /**
  54013. * @function SuperMap.Feature.Theme.Graph.prototype.resetLinearGradient
  54014. * @description resetLocation 中调用 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图渐变色 所以子类实现此方法)。
  54015. */
  54016. }, {
  54017. key: "resetLinearGradient",
  54018. value: function resetLinearGradient() {//子类实现此方法
  54019. }
  54020. /**
  54021. * @function SuperMap.Feature.Theme.Graph.prototype.shapesConvertToRelativeCoordinate
  54022. * @description 将(构成图表)图形的节点转为相对坐标表示,此函数必须且只能在 assembleShapes() 结束时调用。
  54023. */
  54024. }, {
  54025. key: "shapesConvertToRelativeCoordinate",
  54026. value: function shapesConvertToRelativeCoordinate() {
  54027. var shapes = this.shapes;
  54028. var shapeROP = this.location;
  54029. for (var i = 0, len = shapes.length; i < len; i++) {
  54030. shapes[i].refOriginalPosition = shapeROP;
  54031. var style = shapes[i].style;
  54032. for (var sty in style) {
  54033. switch (sty) {
  54034. case "pointList":
  54035. var pl = style[sty];
  54036. for (var j = 0, len2 = pl.length; j < len2; j++) {
  54037. pl[j][0] -= shapeROP[0];
  54038. pl[j][1] -= shapeROP[1];
  54039. }
  54040. break;
  54041. case "x":
  54042. style[sty] -= shapeROP[0];
  54043. break;
  54044. case "y":
  54045. style[sty] -= shapeROP[1];
  54046. break;
  54047. default:
  54048. break;
  54049. }
  54050. }
  54051. }
  54052. this.RelativeCoordinate = true;
  54053. }
  54054. /**
  54055. * @function SuperMap.Feature.Theme.Graph.prototype.assembleShapes
  54056. * @description 图形装配函数。抽象方法,可视化子类必须实现此方法。<br>
  54057. * 重写此方法的步骤:<br>
  54058. * 1. 图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。<br>
  54059. * 2. 调用 initBaseParameter() 方法初始化模型属性值,此步骤必须执行,只有当 initBaseParameter 返回 true 时才可以允许进行后续步骤。<br>
  54060. * 3. 计算图形参数,制作图形,图形组合。在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。<br>
  54061. * 4. 调用 shapesConvertToRelativeCoordinate() 方法,将图形的坐标值转为相对坐标,此步骤必须执行。
  54062. * @example
  54063. * //子类实现 assembleShapes() 接口的步骤示例:
  54064. * assembleShapes: function(){
  54065. * // 第一步:图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。此步骤是非必须过程。
  54066. *
  54067. * // 图表配置对象
  54068. * var sets = this.setting;
  54069. * // 默认数据视图框,这里展示在使用坐标轴和不使用坐标轴情况下对数据视图框参数赋予不同的默认值
  54070. * if(!sets.dataViewBoxParameter){
  54071. * if(typeof(sets.useAxis) === "undefined" || sets.useAxis){
  54072. * sets.dataViewBoxParameter = [45, 15, 15, 15];
  54073. * }
  54074. * else{
  54075. * sets.dataViewBoxParameter = [5, 5, 5, 5];
  54076. * }
  54077. * }
  54078. *
  54079. * // 第二步:初始化图表模型基本参数,只有在图表模型基本参数初始化成功时才可模型相关属性,如 this.dataViewBox、 this.DVBCodomain等。此步骤是必须过程。
  54080. * if(!this.initBaseParameter()) return;
  54081. *
  54082. * // 第三步:用图形组装图表,在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。
  54083. * // 定义图表数据视图框中单位值的含义,下面行代码表示将数据视图框单位值定义为数据视图框高度上每像素代表的数据值
  54084. * this.DVBUnitValue = (this.codomain[1] - this.codomain[0])/this.DVBHeight;
  54085. * var uv = this.DVBUnitValue;
  54086. *
  54087. * // 图形参数计算代码......
  54088. *
  54089. * // 关于图形装配,实际上就是利用图形工程对象 this.shapeFactory 的 createShape() 方法通过图形参数对象创建可视化的图形对象,并把这些图形对象按序添加到模型的图形库(his.shapes)中。下面的代码演示创建一个面图形参数对象,并允许通过图形配置对象设置图形的 style 和 highlightStyle,
  54090. * var barParams = new SuperMap.Feature.ShapeParameters.Polygon(poiLists);
  54091. * barParams.style = sets.barStyle? sets.barStyle:{fillColor: "lightblue"};
  54092. * barParams.highlightStyle = sets.barHoverStyle? sets.barHoverStyle:{fillColor: "blue"};
  54093. * // 图形携带数据ID信息
  54094. * barParams.refDataID = this.data.id;
  54095. * // 创建图形并添加到图表图形数组中
  54096. * this.shapes.push(this.shapeFactory.createShape(barParams));
  54097. *
  54098. * // 第四步:调用 shapesConvertToRelativeCoordinate() 方法,将图形库(his.shapes)中的图形转为由相对坐标表示的图形,客户端统计专题图模块从结构上要求可视化图形使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数。此步骤是必须过程。
  54099. * this.shapesConvertToRelativeCoordinate();
  54100. * },
  54101. */
  54102. }, {
  54103. key: "assembleShapes",
  54104. value: function assembleShapes() {//子类必须实现此方法
  54105. }
  54106. /**
  54107. * @function SuperMap.Feature.Theme.Graph.prototype.getLocalXY
  54108. * @description 地理坐标转为像素坐标。
  54109. * @param {SuperMap.Lonlat} lonlat - 带转换的地理坐标。
  54110. * @returns 屏幕像素坐标。
  54111. */
  54112. }, {
  54113. key: "getLocalXY",
  54114. value: function getLocalXY(lonlat) {
  54115. return this.layer.getLocalXY(lonlat);
  54116. }
  54117. }]);
  54118. return Graph;
  54119. }(feature_Theme_Theme);
  54120. /**
  54121. * @function SuperMap.Feature.Theme.getDataValues
  54122. * @description 根据字段名数组获取指定数据(feature)的属性值数组。属性值类型必须为 Number。
  54123. * @param {SuperMap.Feature.Vector} data - 数据。
  54124. * @param {Array.<string>} [fields] - 字段名数组。
  54125. * @param {number} [decimalNumber] - 小数位处理参数,对获取到的属性数据值进行小数位处理。
  54126. * @returns {Array.<string>} 字段名数组对应的属性数据值数组。
  54127. */
  54128. feature_Theme_Theme.getDataValues = function (data, fields, decimalNumber) {
  54129. if (!data.attributes) {
  54130. return false;
  54131. }
  54132. var fieldsValue = [];
  54133. var attrs = data.attributes;
  54134. for (var i = 0; i < fields.length; i++) {
  54135. for (var field in attrs) {
  54136. if (field !== fields[i]) {
  54137. continue;
  54138. } // 数字转换判断
  54139. try {
  54140. if (!isNaN(decimalNumber) && decimalNumber >= 0) {
  54141. fieldsValue.push(parseFloat(attrs[field].toString()).toFixed(decimalNumber));
  54142. } else {
  54143. fieldsValue.push(parseFloat(attrs[field].toString()));
  54144. }
  54145. } catch (e) {
  54146. throw new Error("not a number");
  54147. }
  54148. }
  54149. }
  54150. if (fieldsValue.length === fields.length) {
  54151. return fieldsValue;
  54152. } else {
  54153. return false;
  54154. }
  54155. };
  54156. SuperMap.Feature.Theme.Graph = Graph_Graph;
  54157. // CONCATENATED MODULE: ./src/common/overlay/Bar.js
  54158. 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); }
  54159. function Bar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54160. 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); } }
  54161. function Bar_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar_defineProperties(Constructor, staticProps); return Constructor; }
  54162. 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); }
  54163. function Bar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar_getPrototypeOf(object); if (object === null) break; } return object; }
  54164. 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); }
  54165. function Bar_setPrototypeOf(o, p) { Bar_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar_setPrototypeOf(o, p); }
  54166. 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); }; }
  54167. function Bar_possibleConstructorReturn(self, call) { if (call && (Bar_typeof(call) === "object" || typeof call === "function")) { return call; } return Bar_assertThisInitialized(self); }
  54168. function Bar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54169. 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; } }
  54170. function Bar_getPrototypeOf(o) { Bar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar_getPrototypeOf(o); }
  54171. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  54172. * This program are made available under the terms of the Apache License, Version 2.0
  54173. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54174. /**
  54175. * @class SuperMap.Feature.Theme.Bar
  54176. * @classdesc 柱状图 。
  54177. * @category Visualization Theme
  54178. * @example
  54179. * // barStyleByCodomain参数用法如下:
  54180. * // barStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  54181. * // start: 值域值下限(包含);
  54182. * // end: 值域值上限(不包含);
  54183. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
  54184. * // barStyleByCodomain 数组形如:
  54185. * [
  54186. * {
  54187. * start:0,
  54188. * end:250,
  54189. * style:{
  54190. * fillColor:"#00CD00"
  54191. * }
  54192. * },
  54193. * {
  54194. * start:250,
  54195. * end:500,
  54196. * style:{
  54197. * fillColor:"#00EE00"
  54198. * }
  54199. * },
  54200. * {
  54201. * start:500,
  54202. * end:750,
  54203. * style:{
  54204. * fillColor:"#00FF7F"
  54205. * }
  54206. * },
  54207. * {
  54208. * start:750,
  54209. * end:1500,
  54210. * style:{
  54211. * fillColor:"#00FF00"
  54212. * }
  54213. * }
  54214. * ]
  54215. * @extends SuperMap.Feature.Theme.Graph
  54216. * @param {SuperMap.Feature.Vector} data - 用户数据。
  54217. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  54218. * @param {Array.<string>} fields - data 属性中的参与此图表生成的属性字段名称。
  54219. * @param {SuperMap.Feature.Theme.Bar.setting} setting - 图表配置对象。
  54220. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  54221. */
  54222. var Bar_Bar = /*#__PURE__*/function (_Graph) {
  54223. Bar_inherits(Bar, _Graph);
  54224. var _super = Bar_createSuper(Bar);
  54225. function Bar(data, layer, fields, setting, lonlat) {
  54226. var _this;
  54227. Bar_classCallCheck(this, Bar);
  54228. _this = _super.call(this, data, layer, fields, setting, lonlat);
  54229. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar";
  54230. return _this;
  54231. }
  54232. /**
  54233. * @function SuperMap.Feature.Theme.Bar.prototype.destroy
  54234. * @override
  54235. */
  54236. Bar_createClass(Bar, [{
  54237. key: "destroy",
  54238. value: function destroy() {
  54239. Bar_get(Bar_getPrototypeOf(Bar.prototype), "destroy", this).call(this);
  54240. }
  54241. /**
  54242. * @function SuperMap.Feature.Theme.Bar.prototype.assembleShapes
  54243. * @description 图表图形装配函数。
  54244. */
  54245. }, {
  54246. key: "assembleShapes",
  54247. value: function assembleShapes() {
  54248. //默认渐变颜色数组
  54249. var deafaultColors = [["#00FF00", "#00CD00"], ["#00CCFF", "#5E87A2"], ["#00FF66", "#669985"], ["#CCFF00", "#94A25E"], ["#FF9900", "#A2945E"]]; //默认阴影
  54250. var deafaultShawdow = {
  54251. showShadow: true,
  54252. shadowBlur: 8,
  54253. shadowColor: "rgba(100,100,100,0.8)",
  54254. shadowOffsetX: 2,
  54255. shadowOffsetY: 2
  54256. }; // 图表配置对象
  54257. var sets = this.setting;
  54258. if (!sets.barLinearGradient) {
  54259. sets.barLinearGradient = deafaultColors;
  54260. } // 默认数据视图框
  54261. if (!sets.dataViewBoxParameter) {
  54262. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  54263. sets.dataViewBoxParameter = [45, 15, 15, 15];
  54264. } else {
  54265. sets.dataViewBoxParameter = [5, 5, 5, 5];
  54266. }
  54267. } // 重要步骤:初始化参数
  54268. if (!this.initBaseParameter()) {
  54269. return;
  54270. } // 值域
  54271. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  54272. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight; // 数据视图域
  54273. var dvb = this.dataViewBox; // 用户数据值
  54274. var fv = this.dataValues;
  54275. if (fv.length < 1) {
  54276. return;
  54277. } // 没有数据
  54278. // 数据溢出值域范围处理
  54279. for (var _i = 0, fvLen = fv.length; _i < fvLen; _i++) {
  54280. if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
  54281. return;
  54282. }
  54283. } // 获取 x 轴上的图形信息
  54284. var xShapeInfo = this.calculateXShapeInfo();
  54285. if (!xShapeInfo) {
  54286. return;
  54287. } // 每个柱条 x 位置
  54288. var xsLoc = xShapeInfo.xPositions; // 柱条宽度
  54289. var xsWdith = xShapeInfo.width; // 背景框,默认启用
  54290. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  54291. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  54292. this.shapes.push(ShapeFactory_ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  54293. } // 坐标轴, 默认启用
  54294. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  54295. // 添加坐标轴图形数组
  54296. this.shapes = this.shapes.concat(ShapeFactory_ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  54297. }
  54298. for (var i = 0; i < fv.length; i++) {
  54299. // 计算柱条 top 边的 y 轴坐标值
  54300. var yPx = dvb[1] - (fv[i] - codomain[0]) / this.DVBUnitValue; // 柱条节点数组
  54301. 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]]; // 柱条参数对象(一个面参数对象)
  54302. var barParams = new Polygon_Polygon(poiLists); // 柱条 阴影 style
  54303. if (typeof sets.showShadow === "undefined" || sets.showShadow) {
  54304. if (sets.barShadowStyle) {
  54305. var sss = sets.barShadowStyle;
  54306. if (sss.shadowBlur) {
  54307. deafaultShawdow.shadowBlur = sss.shadowBlur;
  54308. }
  54309. if (sss.shadowColor) {
  54310. deafaultShawdow.shadowColor = sss.shadowColor;
  54311. }
  54312. if (sss.shadowOffsetX) {
  54313. deafaultShawdow.shadowOffsetX = sss.shadowOffsetX;
  54314. }
  54315. if (sss.shadowOffsetY) {
  54316. deafaultShawdow.shadowOffsetY = sss.shadowOffsetY;
  54317. }
  54318. }
  54319. barParams.style = {};
  54320. Util_Util.copyAttributesWithClip(barParams.style, deafaultShawdow);
  54321. } // 图形携带的数据信息
  54322. barParams.refDataID = this.data.id;
  54323. barParams.dataInfo = {
  54324. field: this.fields[i],
  54325. value: fv[i]
  54326. }; // 柱条 hover click
  54327. if (typeof sets.barHoverAble !== "undefined") {
  54328. barParams.hoverable = sets.barHoverAble;
  54329. }
  54330. if (typeof sets.barClickAble !== "undefined") {
  54331. barParams.clickable = sets.barClickAble;
  54332. } // 创建柱条并添加到图表图形数组中
  54333. this.shapes.push(this.shapeFactory.createShape(barParams));
  54334. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  54335. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  54336. this.shapesConvertToRelativeCoordinate();
  54337. }
  54338. /**
  54339. * @function SuperMap.Feature.Theme.Bar.prototype.calculateXShapeInfo
  54340. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  54341. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  54342. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  54343. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  54344. * 本函数中图形配置对象 setting 可设属性:
  54345. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  54346. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  54347. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  54348. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  54349. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  54350. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  54351. *
  54352. */
  54353. }, {
  54354. key: "calculateXShapeInfo",
  54355. value: function calculateXShapeInfo() {
  54356. var dvb = this.dataViewBox; // 数据视图框
  54357. var sets = this.setting; // 图表配置对象
  54358. var fvc = this.dataValues.length; // 数组值个数
  54359. if (fvc < 1) {
  54360. return null;
  54361. }
  54362. var xBlank; // x 轴空白间隔参数
  54363. var xShapePositions = []; // x 轴上图形的位置
  54364. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  54365. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  54366. // x 轴空白间隔参数处理
  54367. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  54368. xBlank = sets.xShapeBlank;
  54369. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  54370. if (xsLen <= fvc) {
  54371. return null;
  54372. }
  54373. xShapeWidth = xsLen / fvc;
  54374. } else {
  54375. // 默认使用等距离空白间隔,空白间隔为图形宽度
  54376. xShapeWidth = dvbWidth / (2 * fvc + 1);
  54377. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  54378. } // 图形 x 轴上的位置计算
  54379. var xOffset = 0;
  54380. for (var i = 0; i < fvc; i++) {
  54381. if (i == 0) {
  54382. xOffset = xBlank[0] + xShapeWidth / 2;
  54383. } else {
  54384. xOffset += xShapeWidth + xBlank[1];
  54385. }
  54386. xShapePositions.push(dvb[0] + xOffset);
  54387. }
  54388. return {
  54389. "xPositions": xShapePositions,
  54390. "width": xShapeWidth
  54391. };
  54392. }
  54393. /**
  54394. * @function SuperMap.Feature.Theme.Bar.prototype.resetLinearGradient
  54395. * @description 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图 所以子类实现此方法)。
  54396. */
  54397. }, {
  54398. key: "resetLinearGradient",
  54399. value: function resetLinearGradient() {
  54400. if (this.RelativeCoordinate) {
  54401. var shpelength = this.shapes.length;
  54402. var barLinearGradient = this.setting.barLinearGradient;
  54403. var index = -1;
  54404. for (var i = 0; i < shpelength; i++) {
  54405. var shape = this.shapes[i];
  54406. if (shape.CLASS_NAME === "SuperMap.LevelRenderer.Shape.SmicPolygon") {
  54407. var style = shape.style; //计算出当前的绝对 x y
  54408. var x1 = this.location[0] + style.pointList[0][0];
  54409. var x2 = this.location[0] + style.pointList[1][0]; //渐变颜色
  54410. index++; //以防定义的颜色数组不够用
  54411. if (index >= barLinearGradient.length) {
  54412. index = index % barLinearGradient.length;
  54413. }
  54414. var color1 = barLinearGradient[index][0];
  54415. var color2 = barLinearGradient[index][1]; //颜色
  54416. var zcolor = new Color_Color();
  54417. var linearGradient = zcolor.getLinearGradient(x1, 0, x2, 0, [[0, color1], [1, color2]]); //赋值
  54418. shape.style.color = linearGradient;
  54419. }
  54420. }
  54421. }
  54422. }
  54423. }]);
  54424. return Bar;
  54425. }(Graph_Graph);
  54426. /**
  54427. * @typedef {Object} SuperMap.Feature.Theme.Bar.setting
  54428. * @property {number} width - 专题要素(图表)宽度。
  54429. * @property {number} height - 专题要素(图表)高度。
  54430. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  54431. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  54432. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  54433. * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)
  54434. * 在左、下,右,上四个方向上的内偏距值。当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];
  54435. * 不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  54436. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  54437. * @property {boolean} [useBackground=true] - 是否使用图表背景框。
  54438. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式。
  54439. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
  54440. * 则 backgroundRadius 为 [r1、r2、r3、r4]。
  54441. * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  54442. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  54443. * @property {boolean} [showShadow=true] - 阴影开关。
  54444. * @property {Object} [barShadowStyle] - 阴影样式,如:{shadowBlur : 8, shadowOffsetX: 2 , shadowOffsetY : 2,shadowColor : "rgba(100,100,100,0.8)"}
  54445. * @property {Array.<string>} [barLinearGradient] - 按字段设置柱条样式[渐变开始颜色,渐变终止颜色] 与 themeLayer.themeFields 中的字段一一对应),
  54446. * 如:[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]
  54447. * @property {boolean} [useAxis=true] - 是否使用坐标轴。</br>
  54448. * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
  54449. * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
  54450. * @property {number} [axisYTick=0] - y 轴刻度数量。
  54451. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  54452. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  54453. * @property {Array.<number>} [axisYLabelsOffset=[0,0]] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  54454. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,否则沿数据视图框下面条边等距排布标签。
  54455. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
  54456. * @property {Array.<number>} [axisXLabelsOffset=[0,0]] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正。
  54457. * @property {boolean} [useXReferenceLine] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  54458. * @property {SuperMap.Feature.ShapeParameters.Line.style} xReferenceLineStyle - 水平参考线样式。
  54459. * @property {Object} barStyle - 柱状图柱条基础 style,此参数控制柱条基础样式,优先级低于 barStyleByFields 和 barStyleByCodomain。
  54460. * @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。
  54461. * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} barStyleByCodomain - 按柱条代表的数据值所在值域范围控制柱条样式,优先级高于 barStyle 和 barStyleByFields。
  54462. * @property {Object} [barHoverStyle] - 柱条 hover 状态时的样式,barHoverAble 为 true 时有效。
  54463. * @property {Object} [barHoverAble] - 是否允许柱条使用 hover 状态,默认允许。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  54464. * @property {Object} [barClickAble] - 是否允许柱条被点击,默认允许。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  54465. */
  54466. SuperMap.Feature.Theme.Bar = Bar_Bar;
  54467. // CONCATENATED MODULE: ./src/common/overlay/Bar3D.js
  54468. 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); }
  54469. function Bar3D_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54470. 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); } }
  54471. function Bar3D_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar3D_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar3D_defineProperties(Constructor, staticProps); return Constructor; }
  54472. 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); }
  54473. function Bar3D_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar3D_getPrototypeOf(object); if (object === null) break; } return object; }
  54474. 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); }
  54475. function Bar3D_setPrototypeOf(o, p) { Bar3D_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar3D_setPrototypeOf(o, p); }
  54476. 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); }; }
  54477. function Bar3D_possibleConstructorReturn(self, call) { if (call && (Bar3D_typeof(call) === "object" || typeof call === "function")) { return call; } return Bar3D_assertThisInitialized(self); }
  54478. function Bar3D_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54479. 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; } }
  54480. function Bar3D_getPrototypeOf(o) { Bar3D_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar3D_getPrototypeOf(o); }
  54481. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  54482. * This program are made available under the terms of the Apache License, Version 2.0
  54483. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54484. /**
  54485. * @class SuperMap.Feature.Theme.Bar3D
  54486. * @classdesc 三维柱状图 。
  54487. * @category Visualization Theme
  54488. * @extends SuperMap.Feature.Theme.Graph
  54489. * @param {SuperMap.Feature.Vector} data - 用户数据。
  54490. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  54491. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  54492. * @param {SuperMap.Feature.Theme.Bar3D.setting} setting - 图表配置对象。
  54493. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  54494. *
  54495. *
  54496. * @example
  54497. * // barFaceStyleByCodomain 用法示例如下:
  54498. * // barFaceStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  54499. * // start: 值域值下限(包含);
  54500. * // end: 值域值上限(不包含);
  54501. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
  54502. * // barFaceStyleByCodomain 数组形如:
  54503. * [
  54504. * {
  54505. * start:0,
  54506. * end:250,
  54507. * style:{
  54508. * fillColor:"#00CD00"
  54509. * }
  54510. * },
  54511. * {
  54512. * start:250,
  54513. * end:500,
  54514. * style:{
  54515. * fillColor:"#00EE00"
  54516. * }
  54517. * },
  54518. * {
  54519. * start:500,
  54520. * end:750,
  54521. * style:{
  54522. * fillColor:"#00FF7F"
  54523. * }
  54524. * },
  54525. * {
  54526. * start:750,
  54527. * end:1500,
  54528. * style:{
  54529. * fillColor:"#00FF00"
  54530. * }
  54531. * }
  54532. * ]
  54533. *
  54534. * @example
  54535. * // barSideStyleByCodomain 用法示例如下:
  54536. * // barSideStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  54537. * // start: 值域值下限(包含);
  54538. * // end: 值域值上限(不包含);
  54539. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
  54540. * // barSideStyleByCodomain 数组形如:
  54541. * [
  54542. * {
  54543. * start:0,
  54544. * end:250,
  54545. * style:{
  54546. * fillColor:"#00CD00"
  54547. * }
  54548. * },
  54549. * {
  54550. * start:250,
  54551. * end:500,
  54552. * style:{
  54553. * fillColor:"#00EE00"
  54554. * }
  54555. * },
  54556. * {
  54557. * start:500,
  54558. * end:750,
  54559. * style:{
  54560. * fillColor:"#00FF7F"
  54561. * }
  54562. * },
  54563. * {
  54564. * start:750,
  54565. * end:1500,
  54566. * style:{
  54567. * fillColor:"#00FF00"
  54568. * }
  54569. * }
  54570. * ]
  54571. *
  54572. * @example
  54573. * // barTopStyleByCodomain 用法示例如下:
  54574. * // barTopStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  54575. * // start: 值域值下限(包含);
  54576. * // end: 值域值上限(不包含);
  54577. * // style: 数据可视化图形的 style,这个样式对象的可设属性:<SuperMap.Feature.ShapeParameters.Polygon.style> 。
  54578. * // barTopStyleByCodomain 数组形如:
  54579. * [
  54580. * {
  54581. * start:0,
  54582. * end:250,
  54583. * style:{
  54584. * fillColor:"#00CD00"
  54585. * }
  54586. * },
  54587. * {
  54588. * start:250,
  54589. * end:500,
  54590. * style:{
  54591. * fillColor:"#00EE00"
  54592. * }
  54593. * },
  54594. * {
  54595. * start:500,
  54596. * end:750,
  54597. * style:{
  54598. * fillColor:"#00FF7F"
  54599. * }
  54600. * },
  54601. * {
  54602. * start:750,
  54603. * end:1500,
  54604. * style:{
  54605. * fillColor:"#00FF00"
  54606. * }
  54607. * }
  54608. * ]
  54609. */
  54610. var Bar3D_Bar3D = /*#__PURE__*/function (_Graph) {
  54611. Bar3D_inherits(Bar3D, _Graph);
  54612. var _super = Bar3D_createSuper(Bar3D);
  54613. function Bar3D(data, layer, fields, setting, lonlat) {
  54614. var _this;
  54615. Bar3D_classCallCheck(this, Bar3D);
  54616. _this = _super.call(this, data, layer, fields, setting, lonlat);
  54617. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar3D";
  54618. return _this;
  54619. }
  54620. /**
  54621. * @function SuperMap.Feature.Theme.Bar3D.prototype.destroy
  54622. * @override
  54623. */
  54624. Bar3D_createClass(Bar3D, [{
  54625. key: "destroy",
  54626. value: function destroy() {
  54627. Bar3D_get(Bar3D_getPrototypeOf(Bar3D.prototype), "destroy", this).call(this);
  54628. }
  54629. /**
  54630. * @function SuperMap.Feature.Theme.Bar3D.prototype.assembleShapes
  54631. * @description 图形装配实现(扩展接口)。
  54632. */
  54633. }, {
  54634. key: "assembleShapes",
  54635. value: function assembleShapes() {
  54636. // 图表配置对象
  54637. var sets = this.setting; // 默认数据视图框
  54638. if (!sets.dataViewBoxParameter) {
  54639. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  54640. sets.dataViewBoxParameter = [45, 25, 20, 20];
  54641. } else {
  54642. sets.dataViewBoxParameter = [5, 5, 5, 5];
  54643. }
  54644. } // 3d 柱图的坐标轴默认使用坐标轴箭头
  54645. sets.axisUseArrow = typeof sets.axisUseArrow !== "undefined" ? sets.axisUseArrow : true;
  54646. sets.axisXLabelsOffset = typeof sets.axisXLabelsOffset !== "undefined" ? sets.axisXLabelsOffset : [-10, 10]; // 重要步骤:初始化参数
  54647. if (!this.initBaseParameter()) {
  54648. return;
  54649. } // 值域
  54650. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  54651. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight; // 数据视图域
  54652. var dvb = this.dataViewBox; // 用户数据值
  54653. var fv = this.dataValues;
  54654. if (fv.length < 1) {
  54655. return;
  54656. } // 没有数据
  54657. // 数据溢出值域范围处理
  54658. for (var i = 0, fvLen = fv.length; i < fvLen; i++) {
  54659. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  54660. return;
  54661. }
  54662. } // 获取 x 轴上的图形信息
  54663. var xShapeInfo = this.calculateXShapeInfo();
  54664. if (!xShapeInfo) {
  54665. return;
  54666. } // 每个柱条 x 位置
  54667. var xsLoc = xShapeInfo.xPositions; // 柱条宽度
  54668. var xsWdith = xShapeInfo.width; // 坐标轴, 默认启用
  54669. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  54670. this.shapes.push(ShapeFactory_ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  54671. } // 坐标轴
  54672. if (!sets.axis3DParameter || isNaN(sets.axis3DParameter) || sets.axis3DParameter < 15) {
  54673. sets.axis3DParameter = 20;
  54674. }
  54675. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  54676. this.shapes = this.shapes.concat(ShapeFactory_ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  54677. } // 3d 偏移量, 默认值 10;
  54678. var offset3d = sets.bar3DParameter && !isNaN(sets.bar3DParameter) ? sets.bar3DParameter : 10;
  54679. for (var _i = 0; _i < fv.length; _i++) {
  54680. // 无 3d 偏移量时的柱面顶部 y 坐标
  54681. var yPx = dvb[1] - (fv[_i] - codomain[0]) / this.DVBUnitValue; // 无 3d 偏移量时的柱面的左、右端 x 坐标
  54682. var iPoiL = xsLoc[_i] - xsWdith / 2;
  54683. var iPoiR = xsLoc[_i] + xsWdith / 2; // 3d 柱顶面节点
  54684. var bar3DTopPois = [[iPoiL, yPx], [iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]]; // 3d 柱侧面节点
  54685. var bar3DSidePois = [[iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR, dvb[1]]]; // 3d 柱正面节点
  54686. var bar3DFacePois = [[iPoiL - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]];
  54687. if (offset3d <= 0) {
  54688. // offset3d <= 0 时正面不偏移
  54689. bar3DFacePois = [[iPoiL, dvb[1]], [iPoiR, dvb[1]], [iPoiR, yPx], [iPoiL, yPx]];
  54690. } // 新建 3d 柱面顶面、侧面、正面图形参数对象
  54691. var polyTopSP = new Polygon_Polygon(bar3DTopPois);
  54692. var polySideSP = new Polygon_Polygon(bar3DSidePois);
  54693. var polyFaceSP = new Polygon_Polygon(bar3DFacePois); // 侧面、正面图形 style 默认值
  54694. sets.barSideStyle = sets.barSideStyle ? sets.barSideStyle : sets.barFaceStyle;
  54695. sets.barSideStyleByFields = sets.barSideStyleByFields ? sets.barSideStyleByFields : sets.barFaceStyleByFields;
  54696. sets.barSideStyleByCodomain = sets.barSideStyleByCodomain ? sets.barSideStyleByCodomain : sets.barFaceStyleByCodomain;
  54697. sets.barTopStyle = sets.barTopStyle ? sets.barTopStyle : sets.barFaceStyle;
  54698. sets.barTopStyleByFields = sets.barTopStyleByFields ? sets.barTopStyleByFields : sets.barFaceStyleByFields;
  54699. sets.barTopStyleByCodomain = sets.barTopStyleByCodomain ? sets.barTopStyleByCodomain : sets.barFaceStyleByCodomain; // 顶面、侧面、正面图形 style
  54700. polyFaceSP.style = ShapeFactory_ShapeFactory.ShapeStyleTool({
  54701. stroke: true,
  54702. strokeColor: "#ffffff",
  54703. fillColor: "#ee9900"
  54704. }, sets.barFaceStyle, sets.barFaceStyleByFields, sets.barFaceStyleByCodomain, _i, fv[_i]);
  54705. polySideSP.style = ShapeFactory_ShapeFactory.ShapeStyleTool({
  54706. stroke: true,
  54707. strokeColor: "#ffffff",
  54708. fillColor: "#ee9900"
  54709. }, sets.barSideStyle, sets.barSideStyleByFields, sets.barSideStyleByCodomain, _i, fv[_i]);
  54710. polyTopSP.style = ShapeFactory_ShapeFactory.ShapeStyleTool({
  54711. stroke: true,
  54712. strokeColor: "#ffffff",
  54713. fillColor: "#ee9900"
  54714. }, sets.barTopStyle, sets.barTopStyleByFields, sets.barTopStyleByCodomain, _i, fv[_i]); // 3d 柱条高亮样式
  54715. sets.barSideHoverStyle = sets.barSideHoverStyle ? sets.barSideHoverStyle : sets.barFaceHoverStyle;
  54716. sets.barTopHoverStyle = sets.barTopHoverStyle ? sets.barTopHoverStyle : sets.barFaceHoverStyle;
  54717. polyFaceSP.highlightStyle = ShapeFactory_ShapeFactory.ShapeStyleTool({
  54718. stroke: true
  54719. }, sets.barFaceHoverStyle);
  54720. polySideSP.highlightStyle = ShapeFactory_ShapeFactory.ShapeStyleTool({
  54721. stroke: true
  54722. }, sets.barSideHoverStyle);
  54723. polyTopSP.highlightStyle = ShapeFactory_ShapeFactory.ShapeStyleTool({
  54724. stroke: true
  54725. }, sets.barTopHoverStyle); // 图形携带的数据 id 信息 & 高亮模式
  54726. polyTopSP.refDataID = polySideSP.refDataID = polyFaceSP.refDataID = this.data.id; // hover 模式(组合)
  54727. polyTopSP.isHoverByRefDataID = polySideSP.isHoverByRefDataID = polyFaceSP.isHoverByRefDataID = true; // 高亮组(当鼠标 hover 到组内任何一个图形,整个组的图形都会高亮。refDataHoverGroup 在 isHoverByRefDataID 为 true 时有效)
  54728. polyTopSP.refDataHoverGroup = polySideSP.refDataHoverGroup = polyFaceSP.refDataHoverGroup = Util_Util.createUniqueID("lr_shg"); // 图形携带的数据信息
  54729. polyTopSP.dataInfo = polySideSP.dataInfo = polyFaceSP.dataInfo = {
  54730. field: this.fields[_i],
  54731. value: fv[_i]
  54732. }; // 3d 柱条顶面、侧面、正面图形 hover click 设置
  54733. if (typeof sets.barHoverAble !== "undefined") {
  54734. polyTopSP.hoverable = polySideSP.hoverable = polyFaceSP.hoverable = sets.barHoverAble;
  54735. }
  54736. if (typeof sets.barClickAble !== "undefined") {
  54737. polyTopSP.clickable = polySideSP.clickable = polyFaceSP.clickable = sets.barClickAble;
  54738. } // 创建3d 柱条的顶面、侧面、正面图形并添加到图表的图形列表数组
  54739. this.shapes.push(this.shapeFactory.createShape(polySideSP));
  54740. this.shapes.push(this.shapeFactory.createShape(polyTopSP));
  54741. this.shapes.push(this.shapeFactory.createShape(polyFaceSP));
  54742. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  54743. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  54744. this.shapesConvertToRelativeCoordinate();
  54745. }
  54746. /**
  54747. * @function SuperMap.Feature.Theme.Bar3D.prototype.calculateXShapeInfo
  54748. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  54749. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  54750. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  54751. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  54752. * 本函数中图形配置对象 setting 可设属性:
  54753. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  54754. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  54755. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  54756. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  54757. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  54758. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  54759. */
  54760. }, {
  54761. key: "calculateXShapeInfo",
  54762. value: function calculateXShapeInfo() {
  54763. var dvb = this.dataViewBox; // 数据视图框
  54764. var sets = this.setting; // 图表配置对象
  54765. var fvc = this.dataValues.length; // 数组值个数
  54766. if (fvc < 1) {
  54767. return null;
  54768. }
  54769. var xBlank; // x 轴空白间隔参数
  54770. var xShapePositions = []; // x 轴上图形的位置
  54771. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  54772. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  54773. // x 轴空白间隔参数处理
  54774. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  54775. xBlank = sets.xShapeBlank;
  54776. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  54777. if (xsLen <= fvc) {
  54778. return null;
  54779. }
  54780. xShapeWidth = xsLen / fvc;
  54781. } else {
  54782. // 默认使用等距离空白间隔,空白间隔为图形宽度
  54783. xShapeWidth = dvbWidth / (2 * fvc + 1);
  54784. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  54785. } // 图形 x 轴上的位置计算
  54786. var xOffset = 0;
  54787. for (var i = 0; i < fvc; i++) {
  54788. if (i == 0) {
  54789. xOffset = xBlank[0] + xShapeWidth / 2;
  54790. } else {
  54791. xOffset += xShapeWidth + xBlank[1];
  54792. }
  54793. xShapePositions.push(dvb[0] + xOffset);
  54794. }
  54795. return {
  54796. "xPositions": xShapePositions,
  54797. "width": xShapeWidth
  54798. };
  54799. }
  54800. }]);
  54801. return Bar3D;
  54802. }(Graph_Graph);
  54803. /**
  54804. * @typedef {Object} SuperMap.Feature.Theme.Bar3D.setting
  54805. * @property {number} width - 专题要素(图表)宽度。
  54806. * @property {number} height - 专题要素(图表)高度。
  54807. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  54808. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  54809. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  54810. * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 25, 20, 20];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  54811. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  54812. * @property {boolean} [useBackground=true] - 是否使用图表背景框。
  54813. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式。
  54814. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  54815. * @property {Array.<number>} [xShapeBlank] - 水平方向上的图形空白间隔参数。长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  54816. * @property {number} [bar3DParameter=10] - 3D 柱状参数,3d柱形正面相对于背面向 x 轴和 y 轴负方向偏移的绝对值。
  54817. * @property {boolean} [useAxis=true] - 是否使用坐标轴。
  54818. * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
  54819. * @property {boolean} [axisUseArrow=true] -坐标轴是否使用箭头。
  54820. * @property {number} [axisYTick=0] - y 轴刻度数量。
  54821. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  54822. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  54823. * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  54824. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,否则沿数据视图框下面条边等距排布标签。
  54825. * @property {SuperMap.Feature.ShapeParameters.Label.style} axisXLabelsStyle - x 轴上的标签组样式。
  54826. * @property {Array.<number>} axisXLabelsOffset - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,默认值:-10;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正,默认值:10。
  54827. * @property {boolean} [useXReferenceLine] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  54828. * @property {SuperMap.Feature.ShapeParameters.Line.style} [xReferenceLineStyle] - 水平参考线样式。
  54829. * @property {number} [axis3DParameter=20] - 3D 坐标轴参数,此属性值在大于等于 15 时有效。
  54830. * @property {SuperMap.Feature.ShapeParameters.Polygon.style} barFaceStyle - 3d 柱状图柱条正面基础 style,此参数控制柱条正面基础样式,优先级低于 barFaceStyleByFields 和 barFaceStyleByCodomain。
  54831. * @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。
  54832. * @property {Array.<Object>} [barFaceStyleByCodomain] - 按柱条正面代表的数据值所在值域范围控制柱条正面样式,优先级高于 barFaceStyle 和 barFaceStyleByFields。
  54833. * @property {SuperMap.Feature.ShapeParameters.Polygon.style} [barSideStyle=barFaceStyle] - 3d 柱状图柱条侧面基础 style,此参数控制柱条侧面基础样式,优先级低于 barSideStyleByFields 和 barSideStyleByCodomain。
  54834. * @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。
  54835. * @property {Array.<Object>} [barSideStyleByCodomain=barFaceStyleByCodomain] - 按柱条侧面代表的数据值所在值域范围控制柱条侧面样式,优先级高于 barSideStyle 和 barSideStyleByFields。
  54836. * @property {Object} [barFaceHoverStyle] - 3d 柱条正面 hover 状态时的样式,barHoverAble 为 true 时有效。
  54837. * @property {Object} [barSideHoverStyle=barFaceHoverStyle] - 3d 柱条侧面 hover 状态时的样式,barHoverAble 为 true 时有效。
  54838. * @property {Object} [barTopHoverStyle=barFaceHoverStyle] - 3d 柱条顶面 hover 状态时的样式,barHoverAble 为 true 时有效。
  54839. * @property {boolean} [barHoverAble=true] - 是否允许柱条使用 hover 状态。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  54840. * @property {boolean} [barClickAble=true] - 是否允许柱条被点击。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  54841. * @property {SuperMap.Feature.ShapeParameters.Polygon.style} [barTopStyle=barFaceStyle] - 3d 柱状图柱条顶面基础 style,此参数控制柱条顶面基础样式,优先级低于 barTopStyleByFields 和 barTopStyleByCodomain。
  54842. * @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。
  54843. * @property {Array.<Object>} [barTopStyleByCodomain=barFaceStyleByCodomain] - 按柱条顶面代表的数据值所在值域范围控制柱条顶面样式,优先级高于 barTopStyle 和 barTopStyleByFields。
  54844. */
  54845. SuperMap.Feature.Theme.Bar3D = Bar3D_Bar3D;
  54846. // CONCATENATED MODULE: ./src/common/overlay/RankSymbol.js
  54847. 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); }
  54848. function RankSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54849. 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); } }
  54850. function RankSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) RankSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) RankSymbol_defineProperties(Constructor, staticProps); return Constructor; }
  54851. 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); }
  54852. function RankSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RankSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  54853. 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); }
  54854. function RankSymbol_setPrototypeOf(o, p) { RankSymbol_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RankSymbol_setPrototypeOf(o, p); }
  54855. 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); }; }
  54856. function RankSymbol_possibleConstructorReturn(self, call) { if (call && (RankSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } return RankSymbol_assertThisInitialized(self); }
  54857. function RankSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54858. 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; } }
  54859. function RankSymbol_getPrototypeOf(o) { RankSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RankSymbol_getPrototypeOf(o); }
  54860. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  54861. * This program are made available under the terms of the Apache License, Version 2.0
  54862. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54863. /**
  54864. * @class SuperMap.Feature.Theme.RankSymbol
  54865. * @classdesc 符号专题要素基类。
  54866. * @category Visualization Theme
  54867. * @description 此类定义了符号专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  54868. * 符号专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <SuperMap.Feature.Theme.RankSymbol.setting> 的基础属性只有 5 个,
  54869. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  54870. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  54871. * @param {SuperMap.Feature.Vector} data - 用户数据。
  54872. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  54873. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  54874. * @param {Object} setting - 图表配置对象。
  54875. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  54876. *
  54877. * @extends SuperMap.Feature.Theme.Graph
  54878. *
  54879. */
  54880. var RankSymbol_RankSymbol = /*#__PURE__*/function (_Graph) {
  54881. RankSymbol_inherits(RankSymbol, _Graph);
  54882. var _super = RankSymbol_createSuper(RankSymbol);
  54883. function RankSymbol(data, layer, fields, setting, lonlat, options) {
  54884. var _this;
  54885. RankSymbol_classCallCheck(this, RankSymbol);
  54886. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  54887. /**
  54888. * @member SuperMap.Feature.Theme.RankSymbol.prototype.setting -{Object}
  54889. * @description 符号配置对象,该对象控制着图表的可视化显示。
  54890. * 下面是此配置对象的 5 个基础可设属性:<br>
  54891. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  54892. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  54893. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  54894. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  54895. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  54896. * 除了以上 5 个基础属性,此对象的可设属性在不同子类中有较大差异,不同子类中对同一属性的解释也可能不同。
  54897. * 请在此类的子类中查看 setting 对象的可设属性和属性含义。
  54898. */
  54899. _this.setting = null; // 配置项检测与赋值
  54900. if (setting && setting.codomain) {
  54901. _this.setting = setting;
  54902. _this.DVBCodomain = _this.setting.codomain;
  54903. }
  54904. _this.CLASS_NAME = "SuperMap.Feature.Theme.RankSymbol";
  54905. return _this;
  54906. }
  54907. /**
  54908. * @function SuperMap.Feature.Theme.RankSymbol.prototype.destroy
  54909. * @description 销毁专题要素。
  54910. */
  54911. RankSymbol_createClass(RankSymbol, [{
  54912. key: "destroy",
  54913. value: function destroy() {
  54914. this.setting = null;
  54915. RankSymbol_get(RankSymbol_getPrototypeOf(RankSymbol.prototype), "destroy", this).call(this);
  54916. }
  54917. /**
  54918. * @function SuperMap.Feature.Theme.RankSymbol.prototype.initBaseParameter
  54919. * @description 初始化专题要素(图形)基础参数。
  54920. * 在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  54921. * 调用此函数关系到 setting 对象的以下属性。
  54922. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  54923. * @param {number} [XOffset] - 专题要素(图形)在 X 方向上的偏移值,单位像素。
  54924. * @param {number} [YOffset] - 专题要素(图形)在 Y 方向上的偏移值,单位像素。
  54925. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图形框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  54926. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  54927. * @returns {boolean} 初始化参数是否成功。
  54928. */
  54929. }, {
  54930. key: "initBaseParameter",
  54931. value: function initBaseParameter() {
  54932. // 参数初始化是否成功
  54933. var isSuccess = true; // setting 属性是否已成功赋值
  54934. if (!this.setting) {
  54935. return false;
  54936. }
  54937. var sets = this.setting; // 图表偏移
  54938. if (sets.XOffset) {
  54939. this.XOffset = sets.XOffset;
  54940. }
  54941. if (sets.YOffset) {
  54942. this.YOffset = sets.YOffset;
  54943. }
  54944. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  54945. this.YOffset = sets.YOffset ? sets.YOffset : 0; // 其他默认值
  54946. this.origonPoint = [];
  54947. this.chartBox = [];
  54948. this.dataViewBox = [];
  54949. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  54950. this.DVBOrigonPoint = [];
  54951. this.DVBCenterPoint = [];
  54952. this.origonPointOffset = []; // 图表位置
  54953. this.resetLocation(); // 专题要素宽度 w
  54954. var w = this.width; // 专题要素高度 h
  54955. var h = this.height; // 专题要素像素位置 loc
  54956. var loc = this.location; // 专题要素像素位置 loc
  54957. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2]; // 专题要素原点(左上角)
  54958. var op = this.origonPoint; // 图表框([left, bottom, right, top])
  54959. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]]; // 图表框
  54960. var cb = this.chartBox; // 数据视图框参数,它是图表框各方向对应的内偏距
  54961. var dbbP = this.DVBParameter; // 数据视图框 ([left, bottom, right, top])
  54962. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]]; // 数据视图框
  54963. var dvb = this.dataViewBox; //检查数据视图框是否合法
  54964. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  54965. return false;
  54966. } // 数据视图框原点
  54967. this.DVBOrigonPoint = [dvb[0], dvb[3]]; // 数据视图框宽度
  54968. this.DVBWidth = Math.abs(dvb[2] - dvb[0]); // 数据视图框高度
  54969. this.DVBHeight = Math.abs(dvb[1] - dvb[3]); // 数据视图框中心点
  54970. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2]; // 数据视图框原点与图表框的原点偏移量
  54971. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  54972. return isSuccess;
  54973. }
  54974. }]);
  54975. return RankSymbol;
  54976. }(Graph_Graph);
  54977. SuperMap.Feature.Theme.RankSymbol = RankSymbol_RankSymbol;
  54978. // CONCATENATED MODULE: ./src/common/overlay/Circle.js
  54979. 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); }
  54980. function overlay_Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54981. 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); } }
  54982. function overlay_Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Circle_defineProperties(Constructor, staticProps); return Constructor; }
  54983. 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); }
  54984. function overlay_Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  54985. 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); }
  54986. 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); }
  54987. 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); }; }
  54988. function overlay_Circle_possibleConstructorReturn(self, call) { if (call && (overlay_Circle_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Circle_assertThisInitialized(self); }
  54989. function overlay_Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54990. 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; } }
  54991. 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); }
  54992. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  54993. * This program are made available under the terms of the Apache License, Version 2.0
  54994. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54995. /**
  54996. * @class SuperMap.Feature.Theme.Circle
  54997. * @classdesc 圆类。
  54998. * @category Visualization Theme
  54999. * @extends SuperMap.Feature.Theme.RankSymbol
  55000. * @param {SuperMap.Feature.Vector} data - 用户数据。
  55001. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  55002. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  55003. * @param {SuperMap.Feature.Theme.Circle.setting} setting - 图表配置对象。
  55004. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  55005. */
  55006. var overlay_Circle_Circle = /*#__PURE__*/function (_RankSymbol) {
  55007. overlay_Circle_inherits(Circle, _RankSymbol);
  55008. var _super = overlay_Circle_createSuper(Circle);
  55009. function Circle(data, layer, fields, setting, lonlat) {
  55010. var _this;
  55011. overlay_Circle_classCallCheck(this, Circle);
  55012. _this = _super.call(this, data, layer, fields, setting, lonlat);
  55013. _this.CLASS_NAME = "SuperMap.Feature.Theme.Circle";
  55014. return _this;
  55015. }
  55016. /**
  55017. * @function SuperMap.Feature.Theme.Circle.prototype.destroy
  55018. * @override
  55019. */
  55020. overlay_Circle_createClass(Circle, [{
  55021. key: "destroy",
  55022. value: function destroy() {
  55023. overlay_Circle_get(overlay_Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  55024. }
  55025. /**
  55026. * @function SuperMap.Feature.Theme.Circle.prototype.assembleShapes
  55027. * @description 装配图形(扩展接口)。
  55028. */
  55029. }, {
  55030. key: "assembleShapes",
  55031. value: function assembleShapes() {
  55032. //默认填充颜色
  55033. var defaultFillColor = "#ff9277"; // setting 属性是否已成功赋值
  55034. if (!this.setting) {
  55035. return false;
  55036. }
  55037. var sets = this.setting; // 检测 setting 的必设参数
  55038. if (!sets.codomain) {
  55039. return false;
  55040. } // 数据
  55041. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  55042. var dataEffective = feature_Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  55043. this.dataValues = dataEffective ? dataEffective : []; // 数据值数组
  55044. var fv = this.dataValues; //if(fv.length != 1) return; // 没有数据 或者数据不唯一
  55045. //if(fv[0] < 0) return; //数据为负值
  55046. //用户应该定义最大 最小半径 默认最大半径MaxR:100 最小半径MinR:0;
  55047. if (!sets.maxR) {
  55048. sets.maxR = 100;
  55049. }
  55050. if (!sets.minR) {
  55051. sets.minR = 0;
  55052. } // 值域范围
  55053. var codomain = this.DVBCodomain; // 重要步骤:定义Circle数据视图框中单位值的含义,单位值:1所代表的长度
  55054. // 用户定义了值域范围
  55055. if (codomain && codomain[1] - codomain[0] > 0) {
  55056. this.DVBUnitValue = sets.maxR / (codomain[1] - codomain[0]);
  55057. } else {
  55058. //this.DVBUnitValue = sets.maxR / maxValue;
  55059. this.DVBUnitValue = sets.maxR;
  55060. }
  55061. var uv = this.DVBUnitValue; //圆半径
  55062. var r = fv[0] * uv + sets.minR;
  55063. this.width = 2 * r;
  55064. this.height = 2 * r; // 重要步骤:初始化参数
  55065. if (!this.initBaseParameter()) {
  55066. return;
  55067. } //假如用户设置了值域范围 没有在值域范围直接返回
  55068. if (codomain) {
  55069. if (fv[0] < codomain[0] || fv[0] > codomain[1]) {
  55070. return;
  55071. }
  55072. }
  55073. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为圆心
  55074. //圆形对象参数
  55075. var circleSP = new Circle_Circle(dvbCenter[0], dvbCenter[1], r); //circleSP.sytle 初始化
  55076. circleSP.style = ShapeFactory_ShapeFactory.ShapeStyleTool(null, sets.circleStyle, null, null, 0); //图形的填充颜色
  55077. if (typeof sets.fillColor !== "undefined") {
  55078. //用户自定义
  55079. circleSP.style.fillColor = sets.fillColor;
  55080. } else {
  55081. //当前默认
  55082. circleSP.style.fillColor = defaultFillColor;
  55083. } //圆形 Hover样式
  55084. circleSP.highlightStyle = ShapeFactory_ShapeFactory.ShapeStyleTool(null, sets.circleHoverStyle); //圆形 Hover 与 click 设置
  55085. if (typeof sets.circleHoverAble !== "undefined") {
  55086. circleSP.hoverable = sets.circleHoverAble;
  55087. }
  55088. if (typeof sets.circleClickAble !== "undefined") {
  55089. circleSP.clickable = sets.circleClickAble;
  55090. } //图形携带的数据信息
  55091. circleSP.refDataID = this.data.id;
  55092. circleSP.dataInfo = {
  55093. field: this.fields[0],
  55094. r: r,
  55095. value: fv[0]
  55096. }; // 创建扇形并把此扇形添加到图表图形数组
  55097. this.shapes.push(this.shapeFactory.createShape(circleSP)); // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  55098. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  55099. this.shapesConvertToRelativeCoordinate();
  55100. }
  55101. }]);
  55102. return Circle;
  55103. }(RankSymbol_RankSymbol);
  55104. /**
  55105. * @typedef {Object} SuperMap.Feature.Theme.Circle.setting
  55106. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  55107. * @property {number} [maxR] - 圆形的最大半径。
  55108. * @property {number} [minR] - 圆形的最小半径。
  55109. * @property {string} [fillColor] - 圆形的填充色,如:fillColor: "#FFB980"。
  55110. * @property {Object} [circleStyle] - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
  55111. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  55112. * @property {Object} [circleHoverStyle] - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
  55113. * @property {boolean} [circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  55114. * @property {boolean} [circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  55115. *
  55116. */
  55117. SuperMap.Feature.Theme.Circle = overlay_Circle_Circle;
  55118. // CONCATENATED MODULE: ./src/common/overlay/Line.js
  55119. 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); }
  55120. function overlay_Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55121. 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); } }
  55122. function overlay_Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Line_defineProperties(Constructor, staticProps); return Constructor; }
  55123. 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); }
  55124. function overlay_Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Line_getPrototypeOf(object); if (object === null) break; } return object; }
  55125. 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); }
  55126. 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); }
  55127. 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); }; }
  55128. function overlay_Line_possibleConstructorReturn(self, call) { if (call && (overlay_Line_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Line_assertThisInitialized(self); }
  55129. function overlay_Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55130. 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; } }
  55131. 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); }
  55132. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  55133. * This program are made available under the terms of the Apache License, Version 2.0
  55134. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55135. /**
  55136. * @class SuperMap.Feature.Theme.Line
  55137. * @classdesc 折线图。
  55138. * @category Visualization Theme
  55139. * @example
  55140. * // pointStyleByCodomain 参数用法示例
  55141. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  55142. * // start: 值域值下限(包含);
  55143. * // end: 值域值上限(不包含);
  55144. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Point.style> 。
  55145. * // pointStyleByCodomain 数组形如:
  55146. * [
  55147. * {
  55148. * start:0,
  55149. * end:250,
  55150. * style:{
  55151. * fillColor:"#00CD00"
  55152. * }
  55153. * },
  55154. * {
  55155. * start:250,
  55156. * end:500,
  55157. * style:{
  55158. * fillColor:"#00EE00"
  55159. * }
  55160. * },
  55161. * {
  55162. * start:500,
  55163. * end:750,
  55164. * style:{
  55165. * fillColor:"#00FF7F"
  55166. * }
  55167. * },
  55168. * {
  55169. * start:750,
  55170. * end:1500,
  55171. * style:{
  55172. * fillColor:"#00FF00"
  55173. * }
  55174. * }
  55175. * ]
  55176. *
  55177. * @extends SuperMap.Feature.Theme.Graph
  55178. * @param {SuperMap.Feature.Vector} data - 用户数据。
  55179. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  55180. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  55181. * @param {SuperMap.Feature.Theme.Line.setting} setting - 图表配置对象。
  55182. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  55183. */
  55184. var overlay_Line_Line = /*#__PURE__*/function (_Graph) {
  55185. overlay_Line_inherits(Line, _Graph);
  55186. var _super = overlay_Line_createSuper(Line);
  55187. function Line(data, layer, fields, setting, lonlat, options) {
  55188. var _this;
  55189. overlay_Line_classCallCheck(this, Line);
  55190. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  55191. _this.CLASS_NAME = "SuperMap.Feature.Theme.Line";
  55192. return _this;
  55193. }
  55194. /**
  55195. * @function SuperMap.Feature.Theme.Line.prototype.destroy
  55196. * @override
  55197. */
  55198. overlay_Line_createClass(Line, [{
  55199. key: "destroy",
  55200. value: function destroy() {
  55201. overlay_Line_get(overlay_Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  55202. }
  55203. /**
  55204. * @function SuperMap.Feature.Theme.Line.prototype.assembleShapes
  55205. * @description 装配图形(扩展接口)。
  55206. */
  55207. }, {
  55208. key: "assembleShapes",
  55209. value: function assembleShapes() {
  55210. // 图表配置对象
  55211. var sets = this.setting; // 默认数据视图框
  55212. if (!sets.dataViewBoxParameter) {
  55213. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  55214. sets.dataViewBoxParameter = [45, 15, 15, 15];
  55215. } else {
  55216. sets.dataViewBoxParameter = [5, 5, 5, 5];
  55217. }
  55218. } // 重要步骤:初始化参数
  55219. if (!this.initBaseParameter()) {
  55220. return;
  55221. }
  55222. var dvb = this.dataViewBox; // 值域
  55223. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  55224. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  55225. var uv = this.DVBUnitValue; // 数据值数组
  55226. var fv = this.dataValues;
  55227. if (fv.length < 1) {
  55228. return;
  55229. } // 没有数据
  55230. // 获取 x 轴上的图形信息
  55231. var xShapeInfo = this.calculateXShapeInfo();
  55232. if (!xShapeInfo) {
  55233. return;
  55234. } // 折线每个节点的 x 位置
  55235. var xsLoc = xShapeInfo.xPositions; // 背景框,默认启用
  55236. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  55237. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  55238. this.shapes.push(ShapeFactory_ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  55239. } // 折线图必须使用坐标轴
  55240. this.shapes = this.shapes.concat(ShapeFactory_ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo)); // var isDataEffective = true;
  55241. var xPx; // 折线节点 x 坐标
  55242. var yPx; // 折线节点 y 坐标
  55243. var poiLists = []; // 折线节点数组
  55244. var shapePois = []; // 折线节点图形数组
  55245. for (var i = 0, len = fv.length; i < len; i++) {
  55246. // 数据溢出值域检查
  55247. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  55248. // isDataEffective = false;
  55249. return null;
  55250. }
  55251. xPx = xsLoc[i];
  55252. yPx = dvb[1] - (fv[i] - codomain[0]) / uv; // 折线节点参数对象
  55253. var poiSP = new feature_Point_Point(xPx, yPx); // 折线节点 style
  55254. poiSP.style = ShapeFactory_ShapeFactory.ShapeStyleTool({
  55255. fillColor: "#ee9900"
  55256. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]); // 折线节点 hover 样式
  55257. poiSP.highlightStyle = ShapeFactory_ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle); // 折线节点 hover click
  55258. if (typeof sets.pointHoverAble !== "undefined") {
  55259. poiSP.hoverable = sets.pointHoverAble;
  55260. }
  55261. if (typeof sets.pointClickAble !== "undefined") {
  55262. poiSP.clickable = sets.pointClickAble;
  55263. } // 图形携带的数据信息
  55264. poiSP.refDataID = this.data.id;
  55265. poiSP.dataInfo = {
  55266. field: this.fields[i],
  55267. value: fv[i]
  55268. }; // 创建图形并把此图形添加到折线节点图形数组
  55269. shapePois.push(this.shapeFactory.createShape(poiSP)); // 添加折线节点到折线节点数组
  55270. var poi = [xPx, yPx];
  55271. poiLists.push(poi);
  55272. } // 折线参数对象
  55273. var lineSP = new Line_Line(poiLists);
  55274. lineSP.style = ShapeFactory_ShapeFactory.ShapeStyleTool({
  55275. strokeColor: "#ee9900"
  55276. }, sets.lineStyle); // 禁止事件响应
  55277. lineSP.clickable = false;
  55278. lineSP.hoverable = false;
  55279. var shapeLine = this.shapeFactory.createShape(lineSP);
  55280. this.shapes.push(shapeLine); // 添加节点到图表图形数组
  55281. this.shapes = this.shapes.concat(shapePois); // // 数据范围检测未通过,清空图形
  55282. // if (isDataEffective === false) {
  55283. // this.shapes = [];
  55284. // }
  55285. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  55286. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  55287. this.shapesConvertToRelativeCoordinate();
  55288. }
  55289. /**
  55290. * @function SuperMap.Feature.Theme.Line.prototype.calculateXShapeInfo
  55291. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  55292. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  55293. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  55294. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  55295. * 本函数中图形配置对象 setting 可设属性:<br>
  55296. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  55297. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  55298. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  55299. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。<br>
  55300. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  55301. */
  55302. }, {
  55303. key: "calculateXShapeInfo",
  55304. value: function calculateXShapeInfo() {
  55305. var dvb = this.dataViewBox; // 数据视图框
  55306. var sets = this.setting; // 图表配置对象
  55307. var fvc = this.dataValues.length; // 数组值个数
  55308. if (fvc < 1) {
  55309. return null;
  55310. }
  55311. var xBlank; // x 轴空白间隔参数
  55312. var xShapePositions = []; // x 轴上图形的位置
  55313. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  55314. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  55315. var unitOffset = 0; // 单位偏移量
  55316. // x 轴空白间隔参数处理
  55317. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  55318. xBlank = sets.xShapeBlank;
  55319. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  55320. if (xsLen <= fvc) {
  55321. return null;
  55322. }
  55323. unitOffset = xsLen / (fvc - 1);
  55324. } else {
  55325. // 默认使用等距离空白间隔,空白间隔为图形宽度
  55326. unitOffset = dvbWidth / (fvc + 1);
  55327. xBlank = [unitOffset, unitOffset, unitOffset];
  55328. } // 图形 x 轴上的位置计算
  55329. var xOffset = 0;
  55330. for (var i = 0; i < fvc; i++) {
  55331. if (i == 0) {
  55332. xOffset = xBlank[0];
  55333. } else {
  55334. xOffset += unitOffset;
  55335. }
  55336. xShapePositions.push(dvb[0] + xOffset);
  55337. }
  55338. return {
  55339. "xPositions": xShapePositions,
  55340. "width": xShapeWidth
  55341. };
  55342. }
  55343. }]);
  55344. return Line;
  55345. }(Graph_Graph);
  55346. /**
  55347. * @typedef {Object} SuperMap.Feature.Theme.Line.setting
  55348. * @property {number} width - 专题要素(图表)宽度。
  55349. * @property {number} height - 专题要素(图表)高度。
  55350. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  55351. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  55352. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  55353. * @property {Array.<number>} [dataViewBoxParameter] - {Array.<number>} 数据视图框 dataViewBox 参数,
  55354. * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  55355. * 当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  55356. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  55357. * @property {boolean} [useBackground] - 是否使用图表背景框。
  55358. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
  55359. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
  55360. * 则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  55361. * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。长度为 2 的数组,第一元素表示折线左端点与数据视图框左端的空白间距,
  55362. * 第二个元素表示折线右端点右端与数据视图框右端端的空白间距。
  55363. * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
  55364. * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
  55365. * @property {number} [axisYTick=0] - y 轴刻度数量。
  55366. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  55367. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  55368. * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正。
  55369. * 数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  55370. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  55371. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,
  55372. * 否则沿数据视图框下面条边等距排布标签。
  55373. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
  55374. * @property {Array.<number>} [axisXLabelsOffset=0] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正;
  55375. * 数组第二项表示 x 轴标签组纵向上的偏移量,向下为正;
  55376. * @property {boolean} [useXReferenceLine=true] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  55377. * @property {SuperMap.Feature.ShapeParameters.Line.style} ]xReferenceLineStyle] - 水平参考线样式。
  55378. * @property {SuperMap.Feature.ShapeParameters.Line.style} [lineStyle] - 折线图中折线 style。
  55379. * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyle] - 折线图中折线节点基础 style,此参数控制折线节点基础样式,优先级低于 pointStyleByFields 和 pointStyleByCodomain。
  55380. * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为折线节点赋 style,此参数按字段控制折线节点样式,
  55381. * 优先级低于 pointStyleByCodomain,高于 pointStyle。此数组中的元素是样式对象。
  55382. * 此参数中的 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"],
  55383. * pointStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的折线节点使用 style1,字段 POP_1995 对应的折线节点使用 style2 ,字段 POP_1999 对应的折线节点使用 style3。
  55384. * @property {Array.<Object>} pointStyleByCodomain - 按折线节点代表的数据值所在值域范围控制折线节点样式,优先级高于 pointStyle 和 pointStyleByFields。
  55385. * @property {Object} [pointHoverStyle=true] - 折线节点 hover 状态时的样式,pointHoverAble 为 true 时有效。
  55386. * @property {boolean} [pointHoverAble=true] - 是否允许折线节点使用 hover 状态。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽折线节点对专题图层事件的响应。
  55387. * @property {boolean} [pointClickAble=true] - 是否允许折线节点被点击。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽折线节点对专题图层事件的响应。
  55388. */
  55389. SuperMap.Feature.Theme.Line = overlay_Line_Line;
  55390. // CONCATENATED MODULE: ./src/common/overlay/Pie.js
  55391. 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); }
  55392. function Pie_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55393. 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); } }
  55394. function Pie_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pie_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pie_defineProperties(Constructor, staticProps); return Constructor; }
  55395. 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); }
  55396. function Pie_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Pie_getPrototypeOf(object); if (object === null) break; } return object; }
  55397. 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); }
  55398. function Pie_setPrototypeOf(o, p) { Pie_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Pie_setPrototypeOf(o, p); }
  55399. 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); }; }
  55400. function Pie_possibleConstructorReturn(self, call) { if (call && (Pie_typeof(call) === "object" || typeof call === "function")) { return call; } return Pie_assertThisInitialized(self); }
  55401. function Pie_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55402. 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; } }
  55403. function Pie_getPrototypeOf(o) { Pie_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Pie_getPrototypeOf(o); }
  55404. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  55405. * This program are made available under the terms of the Apache License, Version 2.0
  55406. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55407. /**
  55408. * @class SuperMap.Feature.Theme.Pie
  55409. * @classdesc 饼图。
  55410. * @category Visualization Theme
  55411. * @param {SuperMap.Feature.Vector} data - 用户数据。
  55412. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  55413. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  55414. * @param {SuperMap.Feature.Theme.Point.setting} setting - 图表配置对象。
  55415. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  55416. * @extends SuperMap.Feature.Theme.Graph
  55417. * @example
  55418. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  55419. * // start: 值域值下限(包含);
  55420. * // end: 值域值上限(不包含);
  55421. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Sector.style> 。
  55422. * // sectorStyleByCodomain 数组形如:
  55423. * [
  55424. * {
  55425. * start:0,
  55426. * end:250,
  55427. * style:{
  55428. * fillColor:"#00CD00"
  55429. * }
  55430. * },
  55431. * {
  55432. * start:250,
  55433. * end:500,
  55434. * style:{
  55435. * fillColor:"#00EE00"
  55436. * }
  55437. * },
  55438. * {
  55439. * start:500,
  55440. * end:750,
  55441. * style:{
  55442. * fillColor:"#00FF7F"
  55443. * }
  55444. * },
  55445. * {
  55446. * start:750,
  55447. * end:1500,
  55448. * style:{
  55449. * fillColor:"#00FF00"
  55450. * }
  55451. * }
  55452. * ]
  55453. * @extends {SuperMap.Feature.Theme.Graph}
  55454. */
  55455. var Pie_Pie = /*#__PURE__*/function (_Graph) {
  55456. Pie_inherits(Pie, _Graph);
  55457. var _super = Pie_createSuper(Pie);
  55458. function Pie(data, layer, fields, setting, lonlat) {
  55459. var _this;
  55460. Pie_classCallCheck(this, Pie);
  55461. _this = _super.call(this, data, layer, fields, setting, lonlat);
  55462. _this.CLASS_NAME = "SuperMap.Feature.Theme.Pie";
  55463. return _this;
  55464. }
  55465. /**
  55466. * @function SuperMap.Feature.Theme.Pie.prototype.destroy
  55467. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  55468. */
  55469. Pie_createClass(Pie, [{
  55470. key: "destroy",
  55471. value: function destroy() {
  55472. Pie_get(Pie_getPrototypeOf(Pie.prototype), "destroy", this).call(this);
  55473. }
  55474. /**
  55475. * @function SuperMap.Feature.Theme.Pie.prototype.assembleShapes
  55476. * @description 装配图形(扩展接口)。
  55477. */
  55478. }, {
  55479. key: "assembleShapes",
  55480. value: function assembleShapes() {
  55481. // 图表配置对象
  55482. var sets = this.setting; // 一个默认 style 组
  55483. var defaultStyleGroup = [{
  55484. fillColor: "#ff9277"
  55485. }, {
  55486. fillColor: "#dddd00"
  55487. }, {
  55488. fillColor: "#ffc877"
  55489. }, {
  55490. fillColor: "#bbe3ff"
  55491. }, {
  55492. fillColor: "#d5ffbb"
  55493. }, {
  55494. fillColor: "#bbbbff"
  55495. }, {
  55496. fillColor: "#ddb000"
  55497. }, {
  55498. fillColor: "#b0dd00"
  55499. }, {
  55500. fillColor: "#e2bbff"
  55501. }, {
  55502. fillColor: "#ffbbe3"
  55503. }, {
  55504. fillColor: "#ff7777"
  55505. }, {
  55506. fillColor: "#ff9900"
  55507. }, {
  55508. fillColor: "#83dd00"
  55509. }, {
  55510. fillColor: "#77e3ff"
  55511. }, {
  55512. fillColor: "#778fff"
  55513. }, {
  55514. fillColor: "#c877ff"
  55515. }, {
  55516. fillColor: "#ff77ab"
  55517. }, {
  55518. fillColor: "#ff6600"
  55519. }, {
  55520. fillColor: "#aa8800"
  55521. }, {
  55522. fillColor: "#77c7ff"
  55523. }, {
  55524. fillColor: "#ad77ff"
  55525. }, {
  55526. fillColor: "#ff77ff"
  55527. }, {
  55528. fillColor: "#dd0083"
  55529. }, {
  55530. fillColor: "#777700"
  55531. }, {
  55532. fillColor: "#00aa00"
  55533. }, {
  55534. fillColor: "#0088aa"
  55535. }, {
  55536. fillColor: "#8400dd"
  55537. }, {
  55538. fillColor: "#aa0088"
  55539. }, {
  55540. fillColor: "#dd0000"
  55541. }, {
  55542. fillColor: "#772e00"
  55543. }]; // 重要步骤:初始化参数
  55544. if (!this.initBaseParameter()) {
  55545. return;
  55546. } // 背景框,默认不启用
  55547. if (sets.useBackground) {
  55548. this.shapes.push(ShapeFactory_ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  55549. } // 数据值数组
  55550. var fv = this.dataValues;
  55551. if (fv.length < 1) {
  55552. return;
  55553. } // 没有数据
  55554. // 值域范围
  55555. var codomain = this.DVBCodomain; // 值域范围检测
  55556. for (var _i = 0; _i < fv.length; _i++) {
  55557. if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
  55558. return;
  55559. }
  55560. } // 值的绝对值总和
  55561. var valueSum = 0;
  55562. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  55563. valueSum += Math.abs(fv[_i2]);
  55564. } // 重要步骤:定义图表 Pie 数据视图框中单位值的含义,单位值:每度代表的数值
  55565. this.DVBUnitValue = 360 / valueSum;
  55566. var uv = this.DVBUnitValue;
  55567. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  55568. var startAngle = 0; // 扇形起始边角度
  55569. var endAngle = 0; // 扇形终止边角度
  55570. var startAngleTmp = startAngle; // 扇形临时起始边角度
  55571. // 扇形(自适应)半径
  55572. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2;
  55573. for (var i = 0; i < fv.length; i++) {
  55574. var fvi = Math.abs(fv[i]); //计算终止角
  55575. if (i === 0) {
  55576. endAngle = startAngle + fvi * uv;
  55577. } else if (i === fvi.length - 1) {
  55578. endAngle = startAngleTmp;
  55579. } else {
  55580. endAngle = startAngle + fvi * uv;
  55581. } //矫正误差计算
  55582. if (endAngle - startAngle >= 360) {
  55583. endAngle = 359.9999999;
  55584. } // 扇形参数对象
  55585. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle); // 扇形样式
  55586. if (typeof sets.sectorStyleByFields === "undefined") {
  55587. // 使用默认 style 组
  55588. var colorIndex = i % defaultStyleGroup.length;
  55589. sectorSP.style = ShapeFactory_ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  55590. } else {
  55591. sectorSP.style = ShapeFactory_ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  55592. } // 扇形 hover 样式
  55593. sectorSP.highlightStyle = ShapeFactory_ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle); // 扇形 hover 与 click 设置
  55594. if (typeof sets.sectorHoverAble !== "undefined") {
  55595. sectorSP.hoverable = sets.sectorHoverAble;
  55596. }
  55597. if (typeof sets.sectorClickAble !== "undefined") {
  55598. sectorSP.clickable = sets.sectorClickAble;
  55599. } // 图形携带的数据信息
  55600. sectorSP.refDataID = this.data.id;
  55601. sectorSP.dataInfo = {
  55602. field: this.fields[i],
  55603. value: fv[i]
  55604. }; // 创建扇形并把此扇形添加到图表图形数组
  55605. this.shapes.push(this.shapeFactory.createShape(sectorSP)); // 把上一次的结束角度作为下一次的起始角度
  55606. startAngle = endAngle;
  55607. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  55608. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  55609. this.shapesConvertToRelativeCoordinate();
  55610. }
  55611. }]);
  55612. return Pie;
  55613. }(Graph_Graph);
  55614. /**
  55615. * @typedef {Object} SuperMap.Feature.Theme.Pie.setting
  55616. * @property {number} width - 专题要素(图表)宽度。
  55617. * @property {number} height - 专题要素(图表)高度。
  55618. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  55619. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  55620. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  55621. * @property {Array.<number>} [dataViewBoxParameter=[0, 0, 0, 0]] - 数据视图框 dataViewBox 参数,
  55622. * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  55623. * @property {Array.<number>} decimalNumber - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  55624. * @property {boolean} [useBackground=false] - 是否使用图表背景框。
  55625. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
  55626. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  55627. * @property {SuperMap.Feature.ShapeParameters.Sector.style} sectorStyle - 饼图中扇形的基础 style,此参数控制饼图扇形基础样式,优先级低于 sectorStyleByFields 和 sectorStyleByCodomain。
  55628. * @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"],
  55629. * sectorStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的饼图扇形使用 style1,字段 POP_1995 对应的饼图扇形使用 style2 ,字段 POP_1999 对应的饼图扇形使用 style3。
  55630. * @property {Array.<Object>} sectorStyleByCodomain - 按饼图扇形代表的数据值所在值域范围控制饼图扇形样式,优先级高于 sectorStyle 和 sectorStyleByFields。
  55631. * @property {Object} [sectorHoverStyle] 饼图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。
  55632. * @property {boolean} [sectorHoverAble=true] 是否允许饼图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽饼图扇形对专题图层事件的响应。
  55633. * @property {boolean} [sectorClickAble=true] 是否允许饼图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽饼图扇形对专题图层事件的响应。
  55634. */
  55635. SuperMap.Feature.Theme.Pie = Pie_Pie;
  55636. // CONCATENATED MODULE: ./src/common/overlay/Point.js
  55637. 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); }
  55638. function overlay_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55639. 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); } }
  55640. function overlay_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Point_defineProperties(Constructor, staticProps); return Constructor; }
  55641. 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); }
  55642. function overlay_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Point_getPrototypeOf(object); if (object === null) break; } return object; }
  55643. 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); }
  55644. 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); }
  55645. 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); }; }
  55646. function overlay_Point_possibleConstructorReturn(self, call) { if (call && (overlay_Point_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Point_assertThisInitialized(self); }
  55647. function overlay_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55648. 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; } }
  55649. 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); }
  55650. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  55651. * This program are made available under the terms of the Apache License, Version 2.0
  55652. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55653. /**
  55654. * @class SuperMap.Feature.Theme.Point
  55655. * @classdesc 点状图。
  55656. * @category Visualization Theme
  55657. * @param {SuperMap.Feature.Vector} data - 用户数据。
  55658. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  55659. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  55660. * @param {SuperMap.Feature.Theme.Point.setting} setting - 图表配置对象。
  55661. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  55662. * @example
  55663. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  55664. * // start: 值域值下限(包含);
  55665. * // end: 值域值上限(不包含);
  55666. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Point.style> 。
  55667. * // pointStyleByCodomain 数组形如:
  55668. * [
  55669. * {
  55670. * start:0,
  55671. * end:250,
  55672. * style:{
  55673. * fillColor:"#00CD00"
  55674. * }
  55675. * },
  55676. * {
  55677. * start:250,
  55678. * end:500,
  55679. * style:{
  55680. * fillColor:"#00EE00"
  55681. * }
  55682. * },
  55683. * {
  55684. * start:500,
  55685. * end:750,
  55686. * style:{
  55687. * fillColor:"#00FF7F"
  55688. * }
  55689. * },
  55690. * {
  55691. * start:750,
  55692. * end:1500,
  55693. * style:{
  55694. * fillColor:"#00FF00"
  55695. * }
  55696. * }
  55697. * ]
  55698. *@extends {SuperMap.Feature.Theme.Graph}
  55699. */
  55700. var overlay_Point_Point = /*#__PURE__*/function (_Graph) {
  55701. overlay_Point_inherits(Point, _Graph);
  55702. var _super = overlay_Point_createSuper(Point);
  55703. function Point(data, layer, fields, setting, lonlat, options) {
  55704. var _this;
  55705. overlay_Point_classCallCheck(this, Point);
  55706. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  55707. _this.CLASS_NAME = "SuperMap.Feature.Theme.Point";
  55708. return _this;
  55709. }
  55710. /**
  55711. * @function SuperMap.Feature.Theme.Point.prototype.destroy
  55712. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  55713. */
  55714. overlay_Point_createClass(Point, [{
  55715. key: "destroy",
  55716. value: function destroy() {
  55717. overlay_Point_get(overlay_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  55718. }
  55719. /**
  55720. * @function SuperMap.Feature.Theme.prototype.Point.assembleShapes
  55721. * @description 装配图形(扩展接口)。
  55722. */
  55723. }, {
  55724. key: "assembleShapes",
  55725. value: function assembleShapes() {
  55726. // 图表配置对象
  55727. var sets = this.setting; // 默认数据视图框
  55728. if (!sets.dataViewBoxParameter) {
  55729. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  55730. sets.dataViewBoxParameter = [45, 15, 15, 15];
  55731. } else {
  55732. sets.dataViewBoxParameter = [5, 5, 5, 5];
  55733. }
  55734. } // 重要步骤:初始化参数
  55735. if (!this.initBaseParameter()) {
  55736. return;
  55737. }
  55738. var dvb = this.dataViewBox; // 值域
  55739. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  55740. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  55741. var uv = this.DVBUnitValue;
  55742. var fv = this.dataValues; // 获取 x 轴上的图形信息
  55743. var xShapeInfo = this.calculateXShapeInfo();
  55744. if (!xShapeInfo) {
  55745. return;
  55746. } // 折线每个节点的 x 位置
  55747. var xsLoc = xShapeInfo.xPositions; // 背景框,默认启用
  55748. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  55749. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  55750. this.shapes.push(ShapeFactory_ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  55751. } // 点状图必须使用坐标轴
  55752. this.shapes = this.shapes.concat(ShapeFactory_ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  55753. var xPx; // 图形点 x 坐标
  55754. var yPx; // 图形点 y 坐标
  55755. for (var i = 0, len = fv.length; i < len; i++) {
  55756. // 数据溢出值域检查
  55757. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  55758. //isDataEffective = false;
  55759. return null;
  55760. }
  55761. xPx = xsLoc[i];
  55762. yPx = dvb[1] - (fv[i] - codomain[0]) / uv; // 图形点参数对象
  55763. var poiSP = new feature_Point_Point(xPx, yPx); // 图形点 style
  55764. poiSP.style = ShapeFactory_ShapeFactory.ShapeStyleTool({
  55765. fillColor: "#ee9900"
  55766. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]); // 图形点 hover 样式
  55767. poiSP.highlightStyle = ShapeFactory_ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle); // 图形点 hover click
  55768. if (typeof sets.pointHoverAble !== "undefined") {
  55769. poiSP.hoverable = sets.pointHoverAble;
  55770. }
  55771. if (typeof sets.pointClickAble !== "undefined") {
  55772. poiSP.clickable = sets.pointClickAble;
  55773. } // 图形携带的数据信息
  55774. poiSP.refDataID = this.data.id;
  55775. poiSP.dataInfo = {
  55776. field: this.fields[i],
  55777. value: fv[i]
  55778. }; // 创建图形点并把此图形添加到图表图形数组
  55779. this.shapes.push(this.shapeFactory.createShape(poiSP));
  55780. } // 数据范围检测未通过,清空图形
  55781. // if (isDataEffective === false) {
  55782. // this.shapes = [];
  55783. // }
  55784. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  55785. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  55786. this.shapesConvertToRelativeCoordinate();
  55787. }
  55788. /**
  55789. * @function SuperMap.Feature.Theme.Point.prototype.calculateXShapeInfo
  55790. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  55791. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  55792. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  55793. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  55794. * 本函数中图形配置对象 setting 可设属性:<br>
  55795. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  55796. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  55797. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  55798. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  55799. * width - {number}表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  55800. */
  55801. }, {
  55802. key: "calculateXShapeInfo",
  55803. value: function calculateXShapeInfo() {
  55804. var dvb = this.dataViewBox; // 数据视图框
  55805. var sets = this.setting; // 图表配置对象
  55806. var fvc = this.dataValues.length; // 数组值个数
  55807. if (fvc < 1) {
  55808. return null;
  55809. }
  55810. var xBlank; // x 轴空白间隔参数
  55811. var xShapePositions = []; // x 轴上图形的位置
  55812. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  55813. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  55814. var unitOffset = 0; // 单位偏移量
  55815. // x 轴空白间隔参数处理
  55816. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  55817. xBlank = sets.xShapeBlank;
  55818. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  55819. if (xsLen <= fvc) {
  55820. return null;
  55821. }
  55822. unitOffset = xsLen / (fvc - 1);
  55823. } else {
  55824. // 默认使用等距离空白间隔,空白间隔为图形宽度
  55825. unitOffset = dvbWidth / (fvc + 1);
  55826. xBlank = [unitOffset, unitOffset, unitOffset];
  55827. } // 图形 x 轴上的位置计算
  55828. var xOffset = 0;
  55829. for (var i = 0; i < fvc; i++) {
  55830. if (i == 0) {
  55831. xOffset = xBlank[0];
  55832. } else {
  55833. xOffset += unitOffset;
  55834. }
  55835. xShapePositions.push(dvb[0] + xOffset);
  55836. }
  55837. return {
  55838. "xPositions": xShapePositions,
  55839. "width": xShapeWidth
  55840. };
  55841. }
  55842. }]);
  55843. return Point;
  55844. }(Graph_Graph);
  55845. /**
  55846. * @typedef {Object} SuperMap.Feature.Theme.Point.setting
  55847. * @property {number} width - 专题要素(图表)宽度。
  55848. * @property {number} height - 专题要素(图表)高度。
  55849. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  55850. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  55851. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  55852. * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,
  55853. * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  55854. * 当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  55855. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  55856. * @property {boolean} [useBackground] - 是否使用图表背景框。
  55857. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
  55858. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
  55859. * 则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  55860. * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。
  55861. * 长度为 2 的数组,第一个元素表示第一个(沿 x 轴方向)图形点与数据视图框左端的空白间距,第二个元素表示最后一个(沿 x 轴方向)图形点与数据视图框右端端的空白间距 。
  55862. * @property {Object} axisStyle - 坐标轴样式。
  55863. * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
  55864. * @property {number} [axisYTick=0] - y 轴刻度数量。
  55865. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  55866. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  55867. * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正;
  55868. * 数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  55869. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  55870. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,
  55871. * 否则沿数据视图框下面条边等距排布标签。
  55872. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
  55873. * @property {Array.<number>} [axisXLabelsOffset=0] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,
  55874. * 数组第二项表示 x 轴标签组纵向上的偏移量,向下为正。
  55875. * @property {boolean} [useXReferenceLine=true] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  55876. * @property {SuperMap.Feature.ShapeParameters.Line.style} [xReferenceLineStyle] - 水平参考线样式。
  55877. * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyle] - 点状图中图形点基础 style,此参数控制图形点基础样式,优先级低于 pointStyleByFields 和 pointStyleByCodomain。
  55878. * @property {Array.<SuperMap.Feature.ShapeParameters.Point.style>} [pointStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为图形点赋 style,此参数按字段控制图形点样式,
  55879. * 优先级低于 pointStyleByCodomain,高于 pointStyle。此数组中的元素是样式对象。
  55880. * 此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],
  55881. * pointStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的图形点使用 style1,字段 POP_1995 对应的图形点使用 style2 ,字段 POP_1999 对应的图形点使用 style3。
  55882. * @property {Array.<Object>} pointStyleByCodomain - 按图形点代表的数据值所在值域范围控制图形点样式,优先级高于 pointStyle 和 pointStyleByFields。
  55883. * @property {Object} [pointHoverStyle] - 图形点 hover 状态时的样式,pointHoverAble 为 true 时有效。
  55884. * @property {Object} [pointHoverAble=true] - 是否允许图形点使用 hover 状态。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽图形点对专题图层事件的响应。
  55885. * @property {Object} [pointClickAble=true] - 是否允许图形点被点击。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽图形点对专题图层事件的响应。
  55886. */
  55887. SuperMap.Feature.Theme.Point = overlay_Point_Point;
  55888. // CONCATENATED MODULE: ./src/common/overlay/Ring.js
  55889. 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); }
  55890. function Ring_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55891. 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); } }
  55892. function Ring_createClass(Constructor, protoProps, staticProps) { if (protoProps) Ring_defineProperties(Constructor.prototype, protoProps); if (staticProps) Ring_defineProperties(Constructor, staticProps); return Constructor; }
  55893. 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); }
  55894. function Ring_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Ring_getPrototypeOf(object); if (object === null) break; } return object; }
  55895. 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); }
  55896. function Ring_setPrototypeOf(o, p) { Ring_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Ring_setPrototypeOf(o, p); }
  55897. 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); }; }
  55898. function Ring_possibleConstructorReturn(self, call) { if (call && (Ring_typeof(call) === "object" || typeof call === "function")) { return call; } return Ring_assertThisInitialized(self); }
  55899. function Ring_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55900. 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; } }
  55901. function Ring_getPrototypeOf(o) { Ring_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Ring_getPrototypeOf(o); }
  55902. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  55903. * This program are made available under the terms of the Apache License, Version 2.0
  55904. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55905. /**
  55906. * @class SuperMap.Feature.Theme.Ring
  55907. * @classdesc 环状图。
  55908. * @category Visualization Theme
  55909. * @description 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  55910. * @param {SuperMap.Feature.Vector} data - 用户数据。
  55911. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  55912. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  55913. * @param {SuperMap.Feature.Theme.Ring.setting} setting - 图表配置对象。
  55914. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  55915. * @example
  55916. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  55917. * // start: 值域值下限(包含);
  55918. * // end: 值域值上限(不包含);
  55919. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Sector.style> 。
  55920. * // sectorStyleByCodomain 数组形如:
  55921. * [
  55922. * {
  55923. * start:0,
  55924. * end:250,
  55925. * style:{
  55926. * fillColor:"#00CD00"
  55927. * }
  55928. * },
  55929. * {
  55930. * start:250,
  55931. * end:500,
  55932. * style:{
  55933. * fillColor:"#00EE00"
  55934. * }
  55935. * },
  55936. * {
  55937. * start:500,
  55938. * end:750,
  55939. * style:{
  55940. * fillColor:"#00FF7F"
  55941. * }
  55942. * },
  55943. * {
  55944. * start:750,
  55945. * end:1500,
  55946. * style:{
  55947. * fillColor:"#00FF00"
  55948. * }
  55949. * }
  55950. * ]
  55951. * @param {Object} [sectorHoverStyle=true] - 环状图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。
  55952. * @param {boolean} [sectorHoverAble=true] - 是否允许环状图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  55953. * @param {boolean} [sectorClickAble=true] - 是否允许环状图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  55954. *
  55955. * @extends {SuperMap.Feature.Theme.Graph}
  55956. */
  55957. var Ring_Ring = /*#__PURE__*/function (_Graph) {
  55958. Ring_inherits(Ring, _Graph);
  55959. var _super = Ring_createSuper(Ring);
  55960. function Ring(data, layer, fields, setting, lonlat) {
  55961. var _this;
  55962. Ring_classCallCheck(this, Ring);
  55963. _this = _super.call(this, data, layer, fields, setting, lonlat);
  55964. _this.CLASS_NAME = "SuperMap.Feature.Theme.Ring";
  55965. return _this;
  55966. }
  55967. /**
  55968. * @function SuperMap.Feature.Theme.Ring.prototype.destroy
  55969. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  55970. */
  55971. Ring_createClass(Ring, [{
  55972. key: "destroy",
  55973. value: function destroy() {
  55974. Ring_get(Ring_getPrototypeOf(Ring.prototype), "destroy", this).call(this);
  55975. }
  55976. /**
  55977. * @function SuperMap.Feature.Theme.Ring.prototype.assembleShapes
  55978. * @description 装配图形(扩展接口)。
  55979. */
  55980. }, {
  55981. key: "assembleShapes",
  55982. value: function assembleShapes() {
  55983. // 重要步骤:初始化参数
  55984. if (!this.initBaseParameter()) {
  55985. return;
  55986. } // 一个默认 style 组
  55987. var defaultStyleGroup = [{
  55988. fillColor: "#ff9277"
  55989. }, {
  55990. fillColor: "#dddd00"
  55991. }, {
  55992. fillColor: "#ffc877"
  55993. }, {
  55994. fillColor: "#bbe3ff"
  55995. }, {
  55996. fillColor: "#d5ffbb"
  55997. }, {
  55998. fillColor: "#bbbbff"
  55999. }, {
  56000. fillColor: "#ddb000"
  56001. }, {
  56002. fillColor: "#b0dd00"
  56003. }, {
  56004. fillColor: "#e2bbff"
  56005. }, {
  56006. fillColor: "#ffbbe3"
  56007. }, {
  56008. fillColor: "#ff7777"
  56009. }, {
  56010. fillColor: "#ff9900"
  56011. }, {
  56012. fillColor: "#83dd00"
  56013. }, {
  56014. fillColor: "#77e3ff"
  56015. }, {
  56016. fillColor: "#778fff"
  56017. }, {
  56018. fillColor: "#c877ff"
  56019. }, {
  56020. fillColor: "#ff77ab"
  56021. }, {
  56022. fillColor: "#ff6600"
  56023. }, {
  56024. fillColor: "#aa8800"
  56025. }, {
  56026. fillColor: "#77c7ff"
  56027. }, {
  56028. fillColor: "#ad77ff"
  56029. }, {
  56030. fillColor: "#ff77ff"
  56031. }, {
  56032. fillColor: "#dd0083"
  56033. }, {
  56034. fillColor: "#777700"
  56035. }, {
  56036. fillColor: "#00aa00"
  56037. }, {
  56038. fillColor: "#0088aa"
  56039. }, {
  56040. fillColor: "#8400dd"
  56041. }, {
  56042. fillColor: "#aa0088"
  56043. }, {
  56044. fillColor: "#dd0000"
  56045. }, {
  56046. fillColor: "#772e00"
  56047. }]; // 图表配置对象
  56048. var sets = this.setting; // 背景框,默认不启用
  56049. if (sets.useBackground) {
  56050. this.shapes.push(ShapeFactory_ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  56051. } // 数据值数组
  56052. var fv = this.dataValues;
  56053. if (fv.length < 1) {
  56054. return;
  56055. } // 没有数据
  56056. // 值域范围
  56057. var codomain = this.DVBCodomain; // 值域范围检测
  56058. for (var _i = 0; _i < fv.length; _i++) {
  56059. if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
  56060. return;
  56061. }
  56062. } // 值的绝对值总和
  56063. var valueSum = 0;
  56064. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  56065. valueSum += Math.abs(fv[_i2]);
  56066. } // 重要步骤:定义图表 Ring 数据视图框中单位值的含义,单位值:每度代表的数值
  56067. this.DVBUnitValue = 360 / valueSum;
  56068. var uv = this.DVBUnitValue;
  56069. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  56070. var startAngle = 0; // 扇形起始边角度
  56071. var endAngle = 0; // 扇形终止边角度
  56072. var startAngleTmp = startAngle; // 扇形临时起始边角度
  56073. // 扇形外环(自适应)半径
  56074. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2; // 扇形内环(自适应)半径
  56075. var isInRange = sets.innerRingRadius >= 0 && sets.innerRingRadius < r;
  56076. var r0 = typeof sets.innerRingRadius !== "undefined" && !isNaN(sets.innerRingRadius) && isInRange ? sets.innerRingRadius : 0;
  56077. for (var i = 0; i < fv.length; i++) {
  56078. var fvi = Math.abs(fv[i]); // 计算结束角度
  56079. if (i === 0) {
  56080. endAngle = startAngle + fvi * uv;
  56081. } else if (i === fvi.length - 1) {
  56082. endAngle = startAngleTmp;
  56083. } else {
  56084. endAngle = startAngle + fvi * uv;
  56085. } // 扇形参数对象
  56086. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle, r0); // 扇形样式
  56087. if (typeof sets.sectorStyleByFields === "undefined") {
  56088. // 使用默认 style 组
  56089. var colorIndex = i % defaultStyleGroup.length;
  56090. sectorSP.style = ShapeFactory_ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  56091. } else {
  56092. sectorSP.style = ShapeFactory_ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  56093. } // 扇形 hover 样式
  56094. sectorSP.highlightStyle = ShapeFactory_ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle); // 扇形 hover 与 click 设置
  56095. if (typeof sets.sectorHoverAble !== "undefined") {
  56096. sectorSP.hoverable = sets.sectorHoverAble;
  56097. }
  56098. if (typeof sets.sectorClickAble !== "undefined") {
  56099. sectorSP.clickable = sets.sectorClickAble;
  56100. } // 图形携带的数据信息
  56101. sectorSP.refDataID = this.data.id;
  56102. sectorSP.dataInfo = {
  56103. field: this.fields[i],
  56104. value: fv[i]
  56105. }; // 创建扇形并把此扇形添加到图表图形数组
  56106. this.shapes.push(this.shapeFactory.createShape(sectorSP)); // 把上一次的结束角度作为下一次的起始角度
  56107. startAngle = endAngle;
  56108. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  56109. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  56110. this.shapesConvertToRelativeCoordinate();
  56111. }
  56112. }]);
  56113. return Ring;
  56114. }(Graph_Graph);
  56115. /**
  56116. * @typedef {Object} SuperMap.Feature.Theme.Ring.setting
  56117. * @property {number} width - 专题要素(图表)宽度。
  56118. * @property {number} height - 专题要素(图表)高度。
  56119. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  56120. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  56121. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  56122. * @property {Array.<number>} [dataViewBoxParameter=[0, 0, 0, 0]] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  56123. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  56124. * @property {boolean} [useBackground=false] - 是否使用图表背景框。
  56125. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式,此样式对象对象可设属性。
  56126. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  56127. * @property {number} [innerRingRadius=0] - 环状图内环半径,取值范围大于 0,小于外环半径(外环半径:数据视图框长和宽中较小值的二分之一)。
  56128. * @property {SuperMap.Feature.ShapeParameters.Sector.style} [sectorStyle] - 环状图中扇形的基础 style,此参数控制环状图扇形基础样式,优先级低于 sectorStyleByFields 和 sectorStyleByCodomain。
  56129. * @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。
  56130. * @property {Array.<SuperMap.Feature.ShapeParameters.Sector.style>} [sectorStyleByCodomain] - 按环状图扇形代表的数据值所在值域范围控制环状图扇形样式,优先级高于 sectorStyle 和 sectorStyleByFields。
  56131. */
  56132. SuperMap.Feature.Theme.Ring = Ring_Ring;
  56133. // CONCATENATED MODULE: ./src/common/overlay/ThemeVector.js
  56134. 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); }
  56135. function ThemeVector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56136. 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); } }
  56137. function ThemeVector_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeVector_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeVector_defineProperties(Constructor, staticProps); return Constructor; }
  56138. 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); }
  56139. function ThemeVector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeVector_getPrototypeOf(object); if (object === null) break; } return object; }
  56140. 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); }
  56141. function ThemeVector_setPrototypeOf(o, p) { ThemeVector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeVector_setPrototypeOf(o, p); }
  56142. 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); }; }
  56143. function ThemeVector_possibleConstructorReturn(self, call) { if (call && (ThemeVector_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeVector_assertThisInitialized(self); }
  56144. function ThemeVector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  56145. 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; } }
  56146. function ThemeVector_getPrototypeOf(o) { ThemeVector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeVector_getPrototypeOf(o); }
  56147. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  56148. * This program are made available under the terms of the Apache License, Version 2.0
  56149. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56150. /**
  56151. * @class SuperMap.Feature.Theme.Vector
  56152. * @classdesc 矢量专题要素类。
  56153. * @category Visualization Theme
  56154. * @extends SuperMap.Feature.Theme
  56155. * @param {SuperMap.Feature.Vector} data - 用户数据,的类型为矢量数据 feature。
  56156. * @param {SuperMap.Layer} layer - 此专题要素所在图层。
  56157. * @param {Object} style - 样式。
  56158. * @param {Object} options - 创建专题要素时的可选参数。
  56159. * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离, 单位:像素。
  56160. * @param {boolean} [options.isHoverAble=true] - 图形是否可 hover。
  56161. * @param {boolean} [options.isMultiHover=true] - 是否使用多图形高亮,isHoverAble 为 true 时生效。
  56162. * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
  56163. * @param {Object} [options.highlightStyle] - 高亮样式。
  56164. */
  56165. var ThemeVector_ThemeVector = /*#__PURE__*/function (_Theme) {
  56166. ThemeVector_inherits(ThemeVector, _Theme);
  56167. var _super = ThemeVector_createSuper(ThemeVector);
  56168. function ThemeVector(data, layer, style, options, shapeOptions) {
  56169. var _this;
  56170. ThemeVector_classCallCheck(this, ThemeVector);
  56171. _this = _super.call(this, data, layer); //数据的 geometry 属性必须存在且类型是 SuperMap.Geometry 或其子类的类型
  56172. if (!data.geometry) {
  56173. return ThemeVector_possibleConstructorReturn(_this);
  56174. }
  56175. if (!(data.geometry instanceof Geometry_Geometry)) {
  56176. return ThemeVector_possibleConstructorReturn(_this);
  56177. }
  56178. /**
  56179. * @member {SuperMap.Bounds} [SuperMap.Feature.Theme.Vector.prototype.dataBounds]
  56180. * @description 用户数据的(feature.geometry)地理范围。
  56181. */
  56182. _this.dataBounds = data.geometry.getBounds();
  56183. /**
  56184. * @member {number} [SuperMap.Feature.Theme.Vector.prototype.nodesClipPixel=2]
  56185. * @description 节点抽稀像素距离。
  56186. */
  56187. _this.nodesClipPixel = 2;
  56188. /**
  56189. * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isHoverAble=true]
  56190. * @description 图形是否可 hover。
  56191. */
  56192. _this.isHoverAble = true;
  56193. /**
  56194. * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isMultiHover=true]
  56195. * @description 是否使用多图形高亮,isHoverAble 为 true 时生效。
  56196. */
  56197. _this.isMultiHover = true;
  56198. /**
  56199. * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isClickAble=true]
  56200. * @description 图形是否可点击。
  56201. */
  56202. _this.isClickAble = true;
  56203. /**
  56204. * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.highlightStyle]
  56205. * @description 高亮样式。
  56206. */
  56207. _this.highlightStyle = null;
  56208. /**
  56209. * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.shapeOptions]
  56210. * @description 添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做。
  56211. */
  56212. _this.shapeOptions = {};
  56213. /**
  56214. * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.style]
  56215. * @description 可视化图形的 style。在子类中规定其对象结构和默认属性值。
  56216. */
  56217. _this.style = style || {};
  56218. _this.CLASS_NAME = "SuperMap.Feature.Theme.Vector";
  56219. _this.style = style ? style : {};
  56220. if (options) {
  56221. Util_Util.copyAttributesWithClip(ThemeVector_assertThisInitialized(_this), options, ["shapeOptions", "dataBounds"]);
  56222. }
  56223. if (shapeOptions) {
  56224. Util_Util.copyAttributesWithClip(_this.shapeOptions, shapeOptions);
  56225. } //设置基础参数 dataBounds、lonlat、location
  56226. var geometry = data.geometry;
  56227. _this.lonlat = _this.dataBounds.getCenterLonLat();
  56228. _this.location = _this.getLocalXY(_this.lonlat); //将地理要素转为专题要素
  56229. if (geometry instanceof LinearRing) {
  56230. _this.lineToTF(geometry);
  56231. } else if (geometry instanceof LineString_LineString) {
  56232. _this.lineToTF(geometry);
  56233. } else if (geometry instanceof Curve_Curve) {//独立几何体
  56234. } else if (geometry instanceof MultiPoint) {
  56235. _this.multiPointToTF(geometry);
  56236. } else if (geometry instanceof MultiLineString) {
  56237. _this.multiLineStringToTF(geometry);
  56238. } else if (geometry instanceof MultiPolygon) {
  56239. _this.multiPolygonToTF(geometry);
  56240. } else if (geometry instanceof Polygon) {
  56241. _this.polygonToTF(geometry);
  56242. } else if (geometry instanceof Collection_Collection) {//独立几何体
  56243. } else if (geometry instanceof Point_Point) {
  56244. _this.pointToTF(geometry);
  56245. } else if (geometry instanceof Rectangle_Rectangle) {
  56246. _this.rectangleToTF(geometry);
  56247. } else if (geometry instanceof GeoText_GeoText) {
  56248. _this.geoTextToTF(geometry);
  56249. }
  56250. return _this;
  56251. }
  56252. /**
  56253. * @function SuperMap.Feature.Theme.Vector.prototype.destroy
  56254. * @override
  56255. */
  56256. ThemeVector_createClass(ThemeVector, [{
  56257. key: "destroy",
  56258. value: function destroy() {
  56259. this.style = null;
  56260. this.dataBounds = null;
  56261. this.nodesClipPixel = null;
  56262. this.isHoverAble = null;
  56263. this.isMultiHover = null;
  56264. this.isClickAble = null;
  56265. this.highlightStyle = null;
  56266. this.shapeOptions = null;
  56267. ThemeVector_get(ThemeVector_getPrototypeOf(ThemeVector.prototype), "destroy", this).call(this);
  56268. }
  56269. /**
  56270. * @function SuperMap.Feature.Theme.Vector.prototype.lineToTF
  56271. * @description 转换线和线环要素。
  56272. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 LineString 或 LineRing。
  56273. */
  56274. }, {
  56275. key: "lineToTF",
  56276. value: function lineToTF(geometry) {
  56277. var components = geometry.components; //节点像素坐标
  56278. var localLX = []; //参考位置,参考中心为
  56279. var refLocal = [];
  56280. var location = this.location;
  56281. var pointList = []; //节点抽稀距离
  56282. var nCPx = this.nodesClipPixel;
  56283. for (var i = 0; i < components.length; i++) {
  56284. var components_i = components[i];
  56285. refLocal = [];
  56286. localLX = this.getLocalXY(components_i);
  56287. refLocal[0] = localLX[0] - location[0];
  56288. refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
  56289. if (pointList.length > 0) {
  56290. var lastLocalXY = pointList[pointList.length - 1];
  56291. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  56292. continue;
  56293. }
  56294. } //使用参考点
  56295. pointList.push(refLocal);
  56296. }
  56297. if (pointList.length < 2) {
  56298. return null;
  56299. } //赋 style
  56300. var style = new Object();
  56301. style = Util_Util.copyAttributesWithClip(style, this.style, ['pointList']);
  56302. style.pointList = pointList; //创建图形
  56303. var shape = new SmicBrokenLine_SmicBrokenLine({
  56304. style: style,
  56305. clickable: this.isClickAble,
  56306. hoverable: this.isHoverAble
  56307. }); //设置高亮样式
  56308. if (this.highlightStyle) {
  56309. shape.highlightStyle = this.highlightStyle;
  56310. } //设置参考中心,指定图形位置
  56311. shape.refOriginalPosition = this.location; //储存数据 id 属性,用于事件
  56312. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  56313. shape.isHoverByRefDataID = this.isMultiHover; //添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做
  56314. if (this.shapeOptions) {
  56315. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  56316. }
  56317. this.shapes.push(shape);
  56318. }
  56319. /**
  56320. * @function SuperMap.Feature.Theme.Vector.prototype.multiPointToTF
  56321. * @description 转多点要素。
  56322. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPoint。
  56323. */
  56324. }, {
  56325. key: "multiPointToTF",
  56326. value: function multiPointToTF(geometry) {
  56327. /* //-- 不抽稀
  56328. var components = geometry.components;
  56329. for(var i = 0; i < components.length; i++){
  56330. var components_i = components[i];
  56331. this.pointToTF(components_i);
  56332. }
  56333. */
  56334. var components = geometry.components; //节点像素坐标
  56335. var localLX = []; //参考位置,参考中心为
  56336. var refLocal = [];
  56337. var location = this.location;
  56338. var pointList = []; //节点抽稀距离
  56339. var nCPx = this.nodesClipPixel;
  56340. for (var i = 0; i < components.length; i++) {
  56341. var components_i = components[i];
  56342. refLocal = [];
  56343. localLX = this.getLocalXY(components_i);
  56344. refLocal[0] = localLX[0] - location[0];
  56345. refLocal[1] = localLX[1] - location[1]; //抽稀
  56346. if (pointList.length > 0) {
  56347. var lastLocalXY = pointList[pointList.length - 1];
  56348. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  56349. continue;
  56350. }
  56351. } //使用参考点
  56352. pointList.push(refLocal); //赋 style
  56353. var style = new Object();
  56354. style.r = 6; //防止漏设此参数,默认 6 像素
  56355. style = Util_Util.copyAttributesWithClip(style, this.style);
  56356. style.x = refLocal[0];
  56357. style.y = refLocal[1]; //创建图形
  56358. var shape = new SmicPoint({
  56359. style: style,
  56360. clickable: this.isClickAble,
  56361. hoverable: this.isHoverAble
  56362. }); //设置高亮样式
  56363. if (this.highlightStyle) {
  56364. shape.highlightStyle = this.highlightStyle;
  56365. } //设置参考中心,指定图形位置
  56366. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  56367. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  56368. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  56369. if (this.shapeOptions) {
  56370. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  56371. }
  56372. this.shapes.push(shape);
  56373. }
  56374. }
  56375. /**
  56376. * @function SuperMap.Feature.Theme.Vector.prototype.multiLineStringToTF
  56377. * @description 转换多线要素。
  56378. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiLineString。
  56379. */
  56380. }, {
  56381. key: "multiLineStringToTF",
  56382. value: function multiLineStringToTF(geometry) {
  56383. var components = geometry.components;
  56384. for (var i = 0; i < components.length; i++) {
  56385. var components_i = components[i];
  56386. this.lineToTF(components_i);
  56387. }
  56388. }
  56389. /**
  56390. * @function SuperMap.Feature.Theme.Vector.prototype.multiPolygonToTF
  56391. * @description 转换多面要素。
  56392. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPolygon。
  56393. */
  56394. }, {
  56395. key: "multiPolygonToTF",
  56396. value: function multiPolygonToTF(geometry) {
  56397. var components = geometry.components;
  56398. for (var i = 0; i < components.length; i++) {
  56399. var components_i = components[i];
  56400. this.polygonToTF(components_i);
  56401. }
  56402. }
  56403. /**
  56404. * @function SuperMap.Feature.Theme.Vector.prototype.pointToTF
  56405. * @description 转换点要素。
  56406. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Point。
  56407. */
  56408. }, {
  56409. key: "pointToTF",
  56410. value: function pointToTF(geometry) {
  56411. //参考位置,参考中心为
  56412. var location = this.location; //geometry 像素坐标
  56413. var localLX = this.getLocalXY(geometry); //赋 style
  56414. var style = new Object();
  56415. style.r = 6; //防止漏设此参数,默认 6 像素
  56416. style = Util_Util.copyAttributesWithClip(style, this.style);
  56417. style.x = localLX[0] - location[0];
  56418. style.y = localLX[1] - location[1]; //创建图形
  56419. var shape = new SmicPoint({
  56420. style: style,
  56421. clickable: this.isClickAble,
  56422. hoverable: this.isHoverAble
  56423. }); //设置高亮样式
  56424. if (this.highlightStyle) {
  56425. shape.highlightStyle = this.highlightStyle;
  56426. } //设置参考中心,指定图形位置
  56427. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  56428. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  56429. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  56430. if (this.shapeOptions) {
  56431. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  56432. }
  56433. this.shapes.push(shape);
  56434. }
  56435. /**
  56436. * @function SuperMap.Feature.Theme.Vector.prototype.polygonToThemeFeature
  56437. * @description 转换面要素。
  56438. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Polygon。
  56439. */
  56440. }, {
  56441. key: "polygonToTF",
  56442. value: function polygonToTF(geometry) {
  56443. var components = geometry.components; //节点像素坐标
  56444. var localLX = []; //参考位置,参考中心为
  56445. var refLocal = [];
  56446. var location = this.location;
  56447. var pointList = []; //岛洞
  56448. var holePolygonPointList = [];
  56449. var holePolygonPointLists = []; //节点抽稀距离
  56450. var nCPx = this.nodesClipPixel;
  56451. for (var i = 0; i < components.length; i++) {
  56452. var components_i = components[i].components;
  56453. if (i === 0) {
  56454. // 第一个 component 正常绘制
  56455. pointList = [];
  56456. for (var j = 0; j < components_i.length; j++) {
  56457. refLocal = [];
  56458. localLX = this.getLocalXY(components_i[j]);
  56459. refLocal[0] = localLX[0] - location[0];
  56460. refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
  56461. if (pointList.length > 0) {
  56462. var lastLocalXY = pointList[pointList.length - 1];
  56463. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  56464. continue;
  56465. }
  56466. } //使用参考点
  56467. pointList.push(refLocal);
  56468. }
  56469. } else {
  56470. // 其它 component 作为岛洞
  56471. holePolygonPointList = [];
  56472. for (var k = 0; k < components_i.length; k++) {
  56473. refLocal = [];
  56474. localLX = this.getLocalXY(components_i[k]);
  56475. refLocal[0] = localLX[0] - location[0];
  56476. refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
  56477. if (holePolygonPointList.length > 0) {
  56478. var lastXY = holePolygonPointList[holePolygonPointList.length - 1];
  56479. if (Math.abs(lastXY[0] - refLocal[0]) <= nCPx && Math.abs(lastXY[1] - refLocal[1]) <= nCPx) {
  56480. continue;
  56481. }
  56482. } //使用参考点
  56483. holePolygonPointList.push(refLocal);
  56484. }
  56485. }
  56486. if (holePolygonPointList.length < 2) {
  56487. continue;
  56488. }
  56489. holePolygonPointLists.push(holePolygonPointList);
  56490. }
  56491. if (pointList.length < 2) {
  56492. return;
  56493. } //赋 style
  56494. var style = {};
  56495. style = Util_Util.copyAttributesWithClip(style, this.style, ['pointList']);
  56496. style.pointList = pointList; //创建图形
  56497. var shape = new SmicPolygon_SmicPolygon({
  56498. style: style,
  56499. clickable: this.isClickAble,
  56500. hoverable: this.isHoverAble
  56501. }); //设置高亮样式
  56502. if (this.highlightStyle) {
  56503. shape.highlightStyle = this.highlightStyle;
  56504. } //设置参考中心,指定图形位置
  56505. shape.refOriginalPosition = this.location; //储存数据 id 属性,用于事件
  56506. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  56507. shape.isHoverByRefDataID = this.isMultiHover; //岛洞面
  56508. if (holePolygonPointLists.length > 0) {
  56509. shape.holePolygonPointLists = holePolygonPointLists;
  56510. } //修改一些 shape 可选属性,通常不需要这么做
  56511. if (this.shapeOptions) {
  56512. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  56513. }
  56514. this.shapes.push(shape);
  56515. }
  56516. /**
  56517. * @function SuperMap.Feature.Theme.Vector.prototype.rectangleToTF
  56518. * @description 转换矩形要素。
  56519. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Rectangle。
  56520. */
  56521. }, {
  56522. key: "rectangleToTF",
  56523. value: function rectangleToTF(geometry) {
  56524. //参考位置,参考中心为
  56525. var location = this.location;
  56526. var ll = new LonLat_LonLat(geometry.x, geometry.y); //地图分辨率
  56527. var res = this.layer.map.getResolution(); //geometry 像素坐标
  56528. var localLX = this.getLocalXY(ll); //赋 style
  56529. var style = new Object();
  56530. style.r = 6; //防止漏设此参数,默认 6 像素
  56531. style = Util_Util.copyAttributesWithClip(style, this.style);
  56532. style.x = localLX[0] - location[0]; // SuperMap.Geometry.Rectangle 使用左下角定位, SmicRectangle 使用左上角定位,需要转换
  56533. style.y = localLX[1] - location[1] - 2 * geometry.width / res;
  56534. style.width = geometry.width / res;
  56535. style.height = geometry.height / res; //创建图形
  56536. var shape = new SmicRectangle({
  56537. style: style,
  56538. clickable: this.isClickAble,
  56539. hoverable: this.isHoverAble
  56540. }); //设置高亮样式
  56541. if (this.highlightStyle) {
  56542. shape.highlightStyle = this.highlightStyle;
  56543. } //设置参考中心,指定图形位置
  56544. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  56545. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  56546. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  56547. if (this.shapeOptions) {
  56548. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  56549. }
  56550. this.shapes.push(shape);
  56551. }
  56552. /**
  56553. * @function SuperMap.Feature.Theme.Vector.prototype.geoTextToTF
  56554. * @description 转换文本要素。
  56555. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 GeoText。
  56556. */
  56557. }, {
  56558. key: "geoTextToTF",
  56559. value: function geoTextToTF(geometry) {
  56560. //参考位置,参考中心为
  56561. var location = this.location; //geometry 像素坐标
  56562. var localLX = this.getLocalXY(geometry); //赋 style
  56563. var style = new Object();
  56564. style.r = 6; //防止漏设此参数,默认 6 像素
  56565. style = Util_Util.copyAttributesWithClip(style, this.style, ["x", "y", "text"]);
  56566. style.x = localLX[0] - location[0];
  56567. style.y = localLX[1] - location[1];
  56568. style.text = geometry.text; //创建图形
  56569. var shape = new SmicText_SmicText({
  56570. style: style,
  56571. clickable: this.isClickAble,
  56572. hoverable: this.isHoverAble
  56573. }); //设置高亮样式
  56574. if (this.highlightStyle) {
  56575. shape.highlightStyle = this.highlightStyle;
  56576. } //设置参考中心,指定图形位置
  56577. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  56578. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  56579. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  56580. if (this.shapeOptions) {
  56581. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  56582. }
  56583. this.shapes.push(shape);
  56584. }
  56585. /**
  56586. * @function SuperMap.Feature.Theme.Vector.prototype.updateAndAddShapes
  56587. * @description 修改位置,针对地图平移操作,地图漫游操作后调用此函数。
  56588. */
  56589. }, {
  56590. key: "updateAndAddShapes",
  56591. value: function updateAndAddShapes() {
  56592. var newLocalLX = this.getLocalXY(this.lonlat);
  56593. this.location = newLocalLX;
  56594. var render = this.layer.renderer;
  56595. for (var i = 0, len = this.shapes.length; i < len; i++) {
  56596. var shape = this.shapes[i]; //设置参考中心,指定图形位置
  56597. shape.refOriginalPosition = newLocalLX;
  56598. render.addShape(shape);
  56599. }
  56600. }
  56601. /**
  56602. * @function SuperMap.Feature.Theme.Vector.prototype.getShapesCount
  56603. * @description 获得专题要素中可视化图形的数量。
  56604. * @returns {number} 可视化图形的数量。
  56605. */
  56606. }, {
  56607. key: "getShapesCount",
  56608. value: function getShapesCount() {
  56609. return this.shapes.length;
  56610. }
  56611. /**
  56612. * @function SuperMap.Feature.Theme.Vector.prototype.getLocalXY
  56613. * @description 地理坐标转为像素坐标。
  56614. * @param {SuperMap.LonLat} lonlat - 专题要素地理位置。
  56615. */
  56616. }, {
  56617. key: "getLocalXY",
  56618. value: function getLocalXY(lonlat) {
  56619. return this.layer.getLocalXY(lonlat);
  56620. }
  56621. }]);
  56622. return ThemeVector;
  56623. }(feature_Theme_Theme);
  56624. SuperMap.Feature.Theme.ThemeVector = ThemeVector_ThemeVector;
  56625. // CONCATENATED MODULE: ./src/common/overlay/feature/index.js
  56626. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  56627. * This program are made available under the terms of the Apache License, Version 2.0
  56628. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56629. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Group.js
  56630. 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); }
  56631. function Group_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56632. 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); } }
  56633. function Group_createClass(Constructor, protoProps, staticProps) { if (protoProps) Group_defineProperties(Constructor.prototype, protoProps); if (staticProps) Group_defineProperties(Constructor, staticProps); return Constructor; }
  56634. 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); }
  56635. function Group_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Group_getPrototypeOf(object); if (object === null) break; } return object; }
  56636. 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); }
  56637. function Group_setPrototypeOf(o, p) { Group_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Group_setPrototypeOf(o, p); }
  56638. 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); }; }
  56639. function Group_possibleConstructorReturn(self, call) { if (call && (Group_typeof(call) === "object" || typeof call === "function")) { return call; } return Group_assertThisInitialized(self); }
  56640. function Group_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  56641. 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; } }
  56642. function Group_getPrototypeOf(o) { Group_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Group_getPrototypeOf(o); }
  56643. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  56644. * This program are made available under the terms of the Apache License, Version 2.0
  56645. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56646. /**
  56647. * @class SuperMap.LevelRenderer.Group
  56648. * @category Visualization Theme
  56649. * @private
  56650. * @classdesc Group 是一个容器,可以插入子节点,Group 的变换也会被应用到子节点上。
  56651. * @extends {SuperMap.LevelRenderer.Transformable}
  56652. * (code)
  56653. * var g = new SuperMap.LevelRenderer.Group();
  56654. * var Circle = new SuperMap.LevelRenderer.Shape.Circle();
  56655. * g.position[0] = 100;
  56656. * g.position[1] = 100;
  56657. * g.addChild(new Circle({
  56658. * style: {
  56659. * x: 100,
  56660. * y: 100,
  56661. * r: 20,
  56662. * brushType: 'fill'
  56663. * }
  56664. * }));
  56665. * LR.addGroup(g);
  56666. * (end)
  56667. */
  56668. var Group_Group = /*#__PURE__*/function (_SuperMap$mixin) {
  56669. Group_inherits(Group, _SuperMap$mixin);
  56670. var _super = Group_createSuper(Group);
  56671. /**
  56672. * @function SuperMap.LevelRenderer.Group.prototype.constructor
  56673. * @description 构造函数。
  56674. * @param {Array} options - Group 的配置(options)项,可以是 Group 的自有属性,也可以是自定义的属性。
  56675. */
  56676. function Group(options) {
  56677. var _this;
  56678. Group_classCallCheck(this, Group);
  56679. _this = _super.call(this, options);
  56680. options = options || {};
  56681. /**
  56682. * @member {string} SuperMap.LevelRenderer.Group.prototype.id
  56683. * @description Group 的唯一标识。
  56684. */
  56685. _this.id = null;
  56686. /**
  56687. * @readonly
  56688. * @member {string} [SuperMap.LevelRenderer.Group.prototype.type='group']
  56689. * @description 类型。
  56690. */
  56691. _this.type = 'group'; //http://www.w3.org/TR/2dcontext/#clipping-region
  56692. /**
  56693. * @member {string} SuperMap.LevelRenderer.Group.prototype.clipShape
  56694. * @description 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪,该图形会继承 Group 的变换。
  56695. */
  56696. _this.clipShape = null;
  56697. /**
  56698. * @member {Array} SuperMap.LevelRenderer.Group.prototype._children
  56699. * @description _children。
  56700. */
  56701. _this._children = [];
  56702. /**
  56703. * @member {Array} SuperMap.LevelRenderer.Group.prototype._storage
  56704. * @description _storage。
  56705. */
  56706. _this._storage = null;
  56707. /**
  56708. * @member {boolean} [SuperMap.LevelRenderer.Group.prototype.__dirty=true]
  56709. * @description __dirty。
  56710. */
  56711. _this.__dirty = true;
  56712. /**
  56713. * @member {boolean} [SuperMap.LevelRenderer.Group.prototype.ignore=false]
  56714. * @description 是否忽略该 Group 及其所有子节点。
  56715. */
  56716. _this.ignore = false;
  56717. Util_Util.extend(Group_assertThisInitialized(_this), options);
  56718. _this.id = _this.id || Util_Util.createUniqueID("smShapeGroup_");
  56719. _this.CLASS_NAME = "SuperMap.LevelRenderer.Group";
  56720. return _this;
  56721. }
  56722. /**
  56723. * @function SuperMap.LevelRenderer.Group.prototype.destroy
  56724. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  56725. */
  56726. Group_createClass(Group, [{
  56727. key: "destroy",
  56728. value: function destroy() {
  56729. this.id = null;
  56730. this.type = null;
  56731. this.clipShape = null;
  56732. this._children = null;
  56733. this._storage = null;
  56734. this.__dirty = null;
  56735. this.ignore = null;
  56736. Group_get(Group_getPrototypeOf(Group.prototype), "destroy", this).call(this);
  56737. }
  56738. /**
  56739. * @function SuperMap.LevelRenderer.Group.prototype.children
  56740. * @description 复制并返回一份新的包含所有儿子节点的数组。
  56741. * @returns {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
  56742. */
  56743. }, {
  56744. key: "children",
  56745. value: function children() {
  56746. return this._children.slice();
  56747. }
  56748. /**
  56749. * @function SuperMap.LevelRenderer.Group.prototype.childAt
  56750. * @description 获取指定 index 的儿子节点
  56751. * @param {number} idx - 节点索引。
  56752. * @returns {SuperMap.LevelRenderer.Shape} 图形。
  56753. */
  56754. }, {
  56755. key: "childAt",
  56756. value: function childAt(idx) {
  56757. return this._children[idx];
  56758. }
  56759. /**
  56760. * @function SuperMap.LevelRenderer.Group.prototype.addChild
  56761. * @description 添加子节点,可以是 Shape 或者 Group。
  56762. * @param {(SuperMap.LevelRenderer.Shape|SuperMap.LevelRenderer.Group)} child - 节点图形。
  56763. */
  56764. // TODO Type Check
  56765. }, {
  56766. key: "addChild",
  56767. value: function addChild(child) {
  56768. if (child == this) {
  56769. return;
  56770. }
  56771. if (child.parent == this) {
  56772. return;
  56773. }
  56774. if (child.parent) {
  56775. child.parent.removeChild(child);
  56776. }
  56777. this._children.push(child);
  56778. child.parent = this;
  56779. if (this._storage && this._storage !== child._storage) {
  56780. this._storage.addToMap(child);
  56781. if (child instanceof Group) {
  56782. child.addChildrenToStorage(this._storage);
  56783. }
  56784. }
  56785. }
  56786. /**
  56787. * @function SuperMap.LevelRenderer.Group.prototype.removeChild
  56788. * @description 移除子节点。
  56789. * @param {SuperMap.LevelRenderer.Shape} child - 需要移除的子节点图形。
  56790. */
  56791. }, {
  56792. key: "removeChild",
  56793. value: function removeChild(child) {
  56794. var idx = Util_Util.indexOf(this._children, child);
  56795. this._children.splice(idx, 1);
  56796. child.parent = null;
  56797. if (this._storage) {
  56798. this._storage.delFromMap(child.id);
  56799. if (child instanceof Group) {
  56800. child.delChildrenFromStorage(this._storage);
  56801. }
  56802. }
  56803. }
  56804. /**
  56805. * @function SuperMap.LevelRenderer.Group.prototype.eachChild
  56806. * @description 遍历所有子节点。
  56807. * @param {function} cb - 回调函数。
  56808. * @param {Object} context - 上下文。
  56809. */
  56810. }, {
  56811. key: "eachChild",
  56812. value: function eachChild(cb, context) {
  56813. var haveContext = !!context;
  56814. for (var i = 0; i < this._children.length; i++) {
  56815. var child = this._children[i];
  56816. if (haveContext) {
  56817. cb.call(context, child);
  56818. } else {
  56819. cb(child);
  56820. }
  56821. }
  56822. }
  56823. /**
  56824. * @function SuperMap.LevelRenderer.Group.prototype.traverse
  56825. * @description 深度优先遍历所有子孙节点。
  56826. * @param {function} cb - 回调函数。
  56827. * @param {Object} context - 上下文。
  56828. */
  56829. }, {
  56830. key: "traverse",
  56831. value: function traverse(cb, context) {
  56832. var haveContext = !!context;
  56833. for (var i = 0; i < this._children.length; i++) {
  56834. var child = this._children[i];
  56835. if (haveContext) {
  56836. cb.call(context, child);
  56837. } else {
  56838. cb(child);
  56839. }
  56840. if (child.type === 'group') {
  56841. child.traverse(cb, context);
  56842. }
  56843. }
  56844. }
  56845. /**
  56846. * @function SuperMap.LevelRenderer.Group.prototype.addChildrenToStorage
  56847. * @description 把子图形添加到仓库。
  56848. * @param {SuperMap.LevelRenderer.Storage} storage - 图形仓库。
  56849. */
  56850. }, {
  56851. key: "addChildrenToStorage",
  56852. value: function addChildrenToStorage(storage) {
  56853. for (var i = 0; i < this._children.length; i++) {
  56854. var child = this._children[i];
  56855. storage.addToMap(child);
  56856. if (child.type === 'group') {
  56857. child.addChildrenToStorage(storage);
  56858. }
  56859. }
  56860. }
  56861. /**
  56862. * @function SuperMap.LevelRenderer.Group.prototype.delChildrenFromStorage
  56863. * @description 从仓库把子图形删除。
  56864. * @param {SuperMap.LevelRenderer.Storage} storage - 图形仓库。
  56865. */
  56866. }, {
  56867. key: "delChildrenFromStorage",
  56868. value: function delChildrenFromStorage(storage) {
  56869. for (var i = 0; i < this._children.length; i++) {
  56870. var child = this._children[i];
  56871. storage.delFromMap(child.id);
  56872. if (child.type === 'group') {
  56873. child.delChildrenFromStorage(storage);
  56874. }
  56875. }
  56876. }
  56877. /**
  56878. * @function SuperMap.LevelRenderer.Group.prototype.modSelf
  56879. * @description 是否修改。
  56880. */
  56881. }, {
  56882. key: "modSelf",
  56883. value: function modSelf() {
  56884. this.__dirty = true;
  56885. }
  56886. }]);
  56887. return Group;
  56888. }(SuperMap.mixin(Eventful, Transformable_Transformable));
  56889. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Storage.js
  56890. function Storage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56891. 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); } }
  56892. function Storage_createClass(Constructor, protoProps, staticProps) { if (protoProps) Storage_defineProperties(Constructor.prototype, protoProps); if (staticProps) Storage_defineProperties(Constructor, staticProps); return Constructor; }
  56893. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  56894. * This program are made available under the terms of the Apache License, Version 2.0
  56895. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56896. /**
  56897. * @private
  56898. * @class SuperMap.LevelRenderer.Storage
  56899. * @category Visualization Theme
  56900. * @classdesc 内容(图像)仓库 (M) 。
  56901. */
  56902. var Storage_Storage = /*#__PURE__*/function () {
  56903. /**
  56904. * @function SuperMap.LevelRenderer.Storage.constructor
  56905. * @description 构造函数。
  56906. */
  56907. function Storage() {
  56908. Storage_classCallCheck(this, Storage);
  56909. /**
  56910. * @member {Object} SuperMap.LevelRenderer.Storage.prototype._elements
  56911. * @description 所有常规形状,id 索引的 map。
  56912. */
  56913. this._elements = {};
  56914. /**
  56915. * @member {Array} SuperMap.LevelRenderer.Storage.prototype._hoverElements
  56916. * @description 高亮层形状,不稳定,动态增删,数组位置也是 z 轴方向,靠前显示在下方。
  56917. *
  56918. */
  56919. this._hoverElements = [];
  56920. /**
  56921. * @member {Array} SuperMap.LevelRenderer.Storage.prototype._roots
  56922. * @description _roots。
  56923. *
  56924. */
  56925. this._roots = [];
  56926. /**
  56927. * @member {Array} SuperMap.LevelRenderer.Storage.prototype._shapeList
  56928. * @description _shapeList。
  56929. *
  56930. */
  56931. this._shapeList = [];
  56932. /**
  56933. * @member {number} SuperMap.LevelRenderer.Storage.prototype._shapeListOffset
  56934. * @description _shapeListOffset。默认值:0。
  56935. *
  56936. */
  56937. this._shapeListOffset = 0;
  56938. this.CLASS_NAME = "SuperMap.LevelRenderer.Storage";
  56939. }
  56940. /**
  56941. * @function SuperMap.LevelRenderer.Storage.prototype.destroy
  56942. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  56943. */
  56944. Storage_createClass(Storage, [{
  56945. key: "destroy",
  56946. value: function destroy() {
  56947. this.dispose();
  56948. this._shapeList = null;
  56949. this._shapeListOffset = null;
  56950. }
  56951. /**
  56952. * @function SuperMap.LevelRenderer.Storage.prototype.iterShape
  56953. * @description 遍历迭代器。
  56954. *
  56955. * @param {Function} fun - 迭代回调函数,return true终止迭代。
  56956. * @param {Object} option - 迭代参数,缺省为仅降序遍历普通层图形。
  56957. * @param {boolean} [hover=true] - 是否是高亮层图形。
  56958. * @param {string} [normal='down'] - 是否是普通层图形,迭代时是否指定及z轴顺序。可设值:'down' ,'up'。
  56959. * @param {boolean} [update=false] - 是否在迭代前更新形状列表。
  56960. * @return {SuperMap.LevelRenderer.Storage} this。
  56961. */
  56962. }, {
  56963. key: "iterShape",
  56964. value: function iterShape(fun, option) {
  56965. if (!option) {
  56966. var defaultIterateOption = {
  56967. hover: false,
  56968. normal: 'down',
  56969. update: false
  56970. };
  56971. option = defaultIterateOption;
  56972. }
  56973. if (option.hover) {
  56974. // 高亮层数据遍历
  56975. for (var i = 0, l = this._hoverElements.length; i < l; i++) {
  56976. var el = this._hoverElements[i];
  56977. el.updateTransform();
  56978. if (fun(el)) {
  56979. return this;
  56980. }
  56981. }
  56982. }
  56983. if (option.update) {
  56984. this.updateShapeList();
  56985. } // 遍历: 'down' | 'up'
  56986. switch (option.normal) {
  56987. case 'down':
  56988. {
  56989. // 降序遍历,高层优先
  56990. var _l = this._shapeList.length;
  56991. while (_l--) {
  56992. if (fun(this._shapeList[_l])) {
  56993. return this;
  56994. }
  56995. }
  56996. break;
  56997. }
  56998. // case 'up':
  56999. default:
  57000. {
  57001. // 升序遍历,底层优先
  57002. for (var _i = 0, _l2 = this._shapeList.length; _i < _l2; _i++) {
  57003. if (fun(this._shapeList[_i])) {
  57004. return this;
  57005. }
  57006. }
  57007. break;
  57008. }
  57009. }
  57010. return this;
  57011. }
  57012. /**
  57013. * @function SuperMap.LevelRenderer.Storage.prototype.getHoverShapes
  57014. * @param {boolean} [update=false] - 是否在返回前更新图形的变换。
  57015. * @return {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
  57016. */
  57017. }, {
  57018. key: "getHoverShapes",
  57019. value: function getHoverShapes(update) {
  57020. // hoverConnect
  57021. var hoverElements = [],
  57022. len = this._hoverElements.length;
  57023. for (var i = 0; i < len; i++) {
  57024. hoverElements.push(this._hoverElements[i]);
  57025. var target = this._hoverElements[i].hoverConnect;
  57026. if (target) {
  57027. var shape;
  57028. target = target instanceof Array ? target : [target];
  57029. for (var j = 0, k = target.length; j < k; j++) {
  57030. shape = target[j].id ? target[j] : this.get(target[j]);
  57031. if (shape) {
  57032. hoverElements.push(shape);
  57033. }
  57034. }
  57035. }
  57036. }
  57037. hoverElements.sort(Storage.shapeCompareFunc);
  57038. if (update) {
  57039. for (var _i2 = 0, l = hoverElements.length; _i2 < l; _i2++) {
  57040. hoverElements[_i2].updateTransform();
  57041. }
  57042. }
  57043. return hoverElements;
  57044. }
  57045. /**
  57046. * @function SuperMap.LevelRenderer.Storage.prototype.getShapeList
  57047. * @description 返回所有图形的绘制队列。
  57048. *
  57049. * @param {boolean} [update=false] - 是否在返回前更新该数组。 详见:<SuperMap.LevelRenderer.Shape> updateShapeList。
  57050. * @return {SuperMap.LevelRenderer.Shape} 图形。
  57051. */
  57052. }, {
  57053. key: "getShapeList",
  57054. value: function getShapeList(update) {
  57055. if (update) {
  57056. this.updateShapeList();
  57057. }
  57058. return this._shapeList;
  57059. }
  57060. /**
  57061. * @function SuperMap.LevelRenderer.Storage.prototype.updateShapeList
  57062. * @description 更新图形的绘制队列。每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中,最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列。
  57063. */
  57064. }, {
  57065. key: "updateShapeList",
  57066. value: function updateShapeList() {
  57067. this._shapeListOffset = 0;
  57068. var rootsLen = this._roots.length;
  57069. for (var i = 0; i < rootsLen; i++) {
  57070. var root = this._roots[i];
  57071. this._updateAndAddShape(root);
  57072. }
  57073. this._shapeList.length = this._shapeListOffset;
  57074. var shapeListLen = this._shapeList.length;
  57075. for (var _i3 = 0; _i3 < shapeListLen; _i3++) {
  57076. this._shapeList[_i3].__renderidx = _i3;
  57077. }
  57078. this._shapeList.sort(Storage.shapeCompareFunc);
  57079. }
  57080. /**
  57081. * @function SuperMap.LevelRenderer.Storage.prototype._updateAndAddShape
  57082. * @description 更新并添加图形。
  57083. *
  57084. */
  57085. }, {
  57086. key: "_updateAndAddShape",
  57087. value: function _updateAndAddShape(el, clipShapes) {
  57088. if (el.ignore) {
  57089. return;
  57090. }
  57091. el.updateTransform();
  57092. if (el.type == 'group') {
  57093. if (el.clipShape) {
  57094. // clipShape 的变换是基于 group 的变换
  57095. el.clipShape.parent = el;
  57096. el.clipShape.updateTransform(); // PENDING 效率影响
  57097. if (clipShapes) {
  57098. clipShapes = clipShapes.slice();
  57099. clipShapes.push(el.clipShape);
  57100. } else {
  57101. clipShapes = [el.clipShape];
  57102. }
  57103. }
  57104. for (var i = 0; i < el._children.length; i++) {
  57105. var child = el._children[i]; // Force to mark as dirty if group is dirty
  57106. child.__dirty = el.__dirty || child.__dirty;
  57107. this._updateAndAddShape(child, clipShapes);
  57108. } // Mark group clean here
  57109. el.__dirty = false;
  57110. } else {
  57111. el.__clipShapes = clipShapes;
  57112. this._shapeList[this._shapeListOffset++] = el;
  57113. }
  57114. }
  57115. /**
  57116. * @function SuperMap.LevelRenderer.Storage.prototype.mod
  57117. * @description 修改图形(Shape)或者组(Group)。
  57118. *
  57119. * @param {string} elId - 唯一标识。
  57120. * @param {Object} params - 参数。
  57121. * @return {SuperMap.LevelRenderer.Storage} this。
  57122. */
  57123. }, {
  57124. key: "mod",
  57125. value: function mod(elId, params) {
  57126. var el = this._elements[elId];
  57127. if (el) {
  57128. el.modSelf();
  57129. if (params) {
  57130. // 如果第二个参数直接使用 shape
  57131. // parent, _storage, __startClip 三个属性会有循环引用
  57132. // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数
  57133. if (params.parent || params._storage || params.__startClip) {
  57134. var target = {};
  57135. for (var name in params) {
  57136. if (name == 'parent' || name == '_storage' || name == '__startClip') {
  57137. continue;
  57138. }
  57139. if (params.hasOwnProperty(name)) {
  57140. target[name] = params[name];
  57141. }
  57142. }
  57143. new levelRenderer_Util_Util().merge(el, target, true);
  57144. } else {
  57145. new levelRenderer_Util_Util().merge(el, params, true);
  57146. }
  57147. }
  57148. }
  57149. return this;
  57150. }
  57151. /**
  57152. * @function SuperMap.LevelRenderer.Storage.prototype.drift
  57153. * @description 移动指定的图形(Shape)的位置。
  57154. * @param {string} shapeId - 唯一标识。
  57155. * @param {number} dx
  57156. * @param {number} dy
  57157. * @return {SuperMap.LevelRenderer.Storage} this。
  57158. */
  57159. }, {
  57160. key: "drift",
  57161. value: function drift(shapeId, dx, dy) {
  57162. var shape = this._elements[shapeId];
  57163. if (shape) {
  57164. shape.needTransform = true;
  57165. if (shape.draggable === 'horizontal') {
  57166. dy = 0;
  57167. } else if (shape.draggable === 'vertical') {
  57168. dx = 0;
  57169. }
  57170. if (!shape.ondrift // ondrift
  57171. // 有onbrush并且调用执行返回false或undefined则继续
  57172. || shape.ondrift && !shape.ondrift(dx, dy)) {
  57173. shape.drift(dx, dy);
  57174. }
  57175. }
  57176. return this;
  57177. }
  57178. /**
  57179. * @function SuperMap.LevelRenderer.Storage.prototype.addHover
  57180. * @description 添加高亮层数据。
  57181. * @param {SuperMap.LevelRenderer.Shape} shape - 图形。
  57182. * @return {SuperMap.LevelRenderer.Storage} this。
  57183. */
  57184. }, {
  57185. key: "addHover",
  57186. value: function addHover(shape) {
  57187. shape.updateNeedTransform();
  57188. this._hoverElements.push(shape);
  57189. return this;
  57190. }
  57191. /**
  57192. * @function SuperMap.LevelRenderer.Storage.prototype.delHover
  57193. * @description 清空高亮层数据。
  57194. * @return {SuperMap.LevelRenderer.Storage} this。
  57195. */
  57196. }, {
  57197. key: "delHover",
  57198. value: function delHover() {
  57199. this._hoverElements = [];
  57200. return this;
  57201. }
  57202. /**
  57203. * @function SuperMap.LevelRenderer.Storage.prototype.hasHoverShape
  57204. * @description 是否有图形在高亮层里。
  57205. * @return {boolean} 是否有图形在高亮层里。
  57206. */
  57207. }, {
  57208. key: "hasHoverShape",
  57209. value: function hasHoverShape() {
  57210. return this._hoverElements.length > 0;
  57211. }
  57212. /**
  57213. * @function SuperMap.LevelRenderer.Storage.prototype.addRoot
  57214. * @description 添加图形(Shape)或者组(Group)到根节点。
  57215. *
  57216. * @param {(SuperMap.LevelRenderer.Shape/SuperMap.LevelRenderer.Group)} el - 图形。
  57217. *
  57218. */
  57219. }, {
  57220. key: "addRoot",
  57221. value: function addRoot(el) {
  57222. if (el instanceof Group_Group) {
  57223. el.addChildrenToStorage(this);
  57224. }
  57225. this.addToMap(el);
  57226. this._roots.push(el);
  57227. }
  57228. /**
  57229. * @function SuperMap.LevelRenderer.Storage.prototype.delRoot
  57230. * @description 删除指定的图形(Shape)或者组(Group)。
  57231. *
  57232. * @param {Array.<string>} elId - 删除图形(Shape)或者组(Group)的 id 数组。如果为空清空整个Storage。
  57233. *
  57234. */
  57235. }, {
  57236. key: "delRoot",
  57237. value: function delRoot(elId) {
  57238. if (typeof elId == 'undefined') {
  57239. // 不指定elId清空
  57240. for (var i = 0; i < this._roots.length; i++) {
  57241. var root = this._roots[i];
  57242. if (root instanceof Group_Group) {
  57243. root.delChildrenFromStorage(this);
  57244. }
  57245. }
  57246. this._elements = {};
  57247. this._hoverElements = [];
  57248. this._roots = [];
  57249. return;
  57250. }
  57251. if (elId instanceof Array) {
  57252. var elIdLen = elId.length;
  57253. for (var _i4 = 0; _i4 < elIdLen; _i4++) {
  57254. this.delRoot(elId[_i4]);
  57255. }
  57256. return;
  57257. }
  57258. var el;
  57259. if (typeof elId == 'string') {
  57260. el = this._elements[elId];
  57261. } else {
  57262. el = elId;
  57263. }
  57264. var idx = new levelRenderer_Util_Util().indexOf(this._roots, el);
  57265. if (idx >= 0) {
  57266. this.delFromMap(el.id);
  57267. this._roots.splice(idx, 1);
  57268. if (el instanceof Group_Group) {
  57269. el.delChildrenFromStorage(this);
  57270. }
  57271. }
  57272. }
  57273. /**
  57274. * @function SuperMap.LevelRenderer.Storage.prototype.addToMap
  57275. * @description 添加图形到 map。
  57276. *
  57277. * @param {SuperMap.LevelRenderer.Shape} el - 图形。
  57278. * @return {SuperMap.LevelRenderer.Storage} this。
  57279. */
  57280. }, {
  57281. key: "addToMap",
  57282. value: function addToMap(el) {
  57283. if (el instanceof Group_Group) {
  57284. el._storage = this;
  57285. }
  57286. el.modSelf();
  57287. this._elements[el.id] = el;
  57288. return this;
  57289. }
  57290. /**
  57291. * @function SuperMap.LevelRenderer.Storage.prototype.get
  57292. * @description 获取指定图形。
  57293. *
  57294. * @param {string} elId - 图形 id。
  57295. * @return {SuperMap.LevelRenderer.Shape} 图形。
  57296. */
  57297. }, {
  57298. key: "get",
  57299. value: function get(elId) {
  57300. return this._elements[elId];
  57301. }
  57302. /**
  57303. * @function SuperMap.LevelRenderer.Storage.prototype.delFromMap
  57304. * @description 从 map 中删除指定图形。
  57305. *
  57306. * @param {string} elId - 图形id。
  57307. * @return {SuperMap.LevelRenderer.Storage} this。
  57308. */
  57309. }, {
  57310. key: "delFromMap",
  57311. value: function delFromMap(elId) {
  57312. var el = this._elements[elId];
  57313. if (el) {
  57314. delete this._elements[elId];
  57315. if (el instanceof Group_Group) {
  57316. el._storage = null;
  57317. }
  57318. }
  57319. return this;
  57320. }
  57321. /**
  57322. * @function SuperMap.LevelRenderer.Storage.prototype.dispose
  57323. * @description 清空并且释放 Storage。
  57324. */
  57325. }, {
  57326. key: "dispose",
  57327. value: function dispose() {
  57328. this._elements = null; // this._renderList = null;
  57329. this._roots = null;
  57330. this._hoverElements = null;
  57331. }
  57332. }], [{
  57333. key: "shapeCompareFunc",
  57334. value: function shapeCompareFunc(a, b) {
  57335. if (a.zlevel == b.zlevel) {
  57336. if (a.z == b.z) {
  57337. return a.__renderidx - b.__renderidx;
  57338. }
  57339. return a.z - b.z;
  57340. }
  57341. return a.zlevel - b.zlevel;
  57342. }
  57343. }]);
  57344. return Storage;
  57345. }();
  57346. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Painter.js
  57347. 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); }
  57348. 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); }
  57349. function Painter_setPrototypeOf(o, p) { Painter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Painter_setPrototypeOf(o, p); }
  57350. 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); }; }
  57351. function Painter_possibleConstructorReturn(self, call) { if (call && (Painter_typeof(call) === "object" || typeof call === "function")) { return call; } return Painter_assertThisInitialized(self); }
  57352. function Painter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  57353. 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; } }
  57354. function Painter_getPrototypeOf(o) { Painter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Painter_getPrototypeOf(o); }
  57355. function Painter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57356. 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); } }
  57357. function Painter_createClass(Constructor, protoProps, staticProps) { if (protoProps) Painter_defineProperties(Constructor.prototype, protoProps); if (staticProps) Painter_defineProperties(Constructor, staticProps); return Constructor; }
  57358. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  57359. * This program are made available under the terms of the Apache License, Version 2.0
  57360. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57361. /**
  57362. * @private
  57363. * @class SuperMap.LevelRenderer.Painter
  57364. * @category Visualization Theme
  57365. * @classdesc Painter 绘图模块。
  57366. */
  57367. var Painter_Painter = /*#__PURE__*/function () {
  57368. /**
  57369. * @function SuperMap.LevelRenderer.Painter.constructor
  57370. * @description 构造函数。
  57371. *
  57372. * @param {HTMLElement} root - 绘图区域(DIV)。
  57373. * @param {SuperMap.LevelRenderer.Storage} storage - Storage 实例。
  57374. *
  57375. */
  57376. function Painter(root, storage) {
  57377. Painter_classCallCheck(this, Painter);
  57378. /**
  57379. * @member {HTMLElement} SuperMap.LevelRenderer.Painter.prototype.root
  57380. * @description 绘图容器。
  57381. *
  57382. */
  57383. this.root = root;
  57384. /**
  57385. * @member {Array} SuperMap.LevelRenderer.Painter.prototype.storage
  57386. * @description 图形仓库。
  57387. *
  57388. */
  57389. this.storage = storage;
  57390. /**
  57391. * @member {HTMLElement} SuperMap.LevelRenderer.Painter.prototype._domRoot
  57392. * @description 容器根 dom 对象。
  57393. *
  57394. */
  57395. this._domRoot = null;
  57396. /**
  57397. * @member {Object} SuperMap.LevelRenderer.Painter.prototype._layers
  57398. * @description 绘制层对象。
  57399. *
  57400. */
  57401. this._layers = {};
  57402. /**
  57403. * @member {Array} SuperMap.LevelRenderer.Painter.prototype._zlevelList
  57404. * @description 层列表。
  57405. *
  57406. */
  57407. this._zlevelList = [];
  57408. /**
  57409. * @member {Object} SuperMap.LevelRenderer.Painter.prototype._layerConfig
  57410. * @description 绘制层配置对象。
  57411. *
  57412. */
  57413. this._layerConfig = {};
  57414. /**
  57415. * @member {Object} SuperMap.LevelRenderer.Painter.prototype._bgDom
  57416. * @description 背景层 Canvas (Dom)。
  57417. *
  57418. */
  57419. this._bgDom = null;
  57420. /**
  57421. * @member {Function} SuperMap.LevelRenderer.Painter.prototype.shapeToImage
  57422. * @description 形状转图像函数。
  57423. *
  57424. */
  57425. this.shapeToImage = null; // retina 屏幕优化
  57426. Painter.devicePixelRatio = Math.max(window.devicePixelRatio || 1, 1);
  57427. this.CLASS_NAME = "SuperMap.LevelRenderer.Painter";
  57428. this.root.innerHTML = '';
  57429. this._width = this._getWidth(); // 宽,缓存记录
  57430. this._height = this._getHeight(); // 高,缓存记录
  57431. var domRoot = document.createElement('div');
  57432. this._domRoot = domRoot; // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬
  57433. domRoot.style.position = 'relative';
  57434. domRoot.style.overflow = 'hidden';
  57435. domRoot.style.width = this._width + 'px';
  57436. domRoot.style.height = this._height + 'px';
  57437. this.root.appendChild(domRoot);
  57438. this.shapeToImage = this._createShapeToImageProcessor(); // 创建各层canvas
  57439. // 背景
  57440. //this._bgDom = Painter.createDom('bg', 'div', this);
  57441. this._bgDom = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme_background_"), 'div', this);
  57442. domRoot.appendChild(this._bgDom);
  57443. this._bgDom.onselectstart = returnFalse;
  57444. this._bgDom.style['-webkit-user-select'] = 'none';
  57445. this._bgDom.style['user-select'] = 'none';
  57446. this._bgDom.style['-webkit-touch-callout'] = 'none'; // 高亮
  57447. //var hoverLayer = new PaintLayer('_hoverLayer_', this);
  57448. var hoverLayer = new Painter_PaintLayer(Util_Util.createUniqueID("_highLightLayer_"), this);
  57449. this._layers['hover'] = hoverLayer;
  57450. domRoot.appendChild(hoverLayer.dom);
  57451. hoverLayer.initContext();
  57452. hoverLayer.dom.onselectstart = returnFalse;
  57453. hoverLayer.dom.style['-webkit-user-select'] = 'none';
  57454. hoverLayer.dom.style['user-select'] = 'none';
  57455. hoverLayer.dom.style['-webkit-touch-callout'] = 'none';
  57456. var me = this;
  57457. this.updatePainter = function (shapeList, callback) {
  57458. me.refreshShapes(shapeList, callback);
  57459. }; // 返回false的方法,用于避免页面被选中
  57460. function returnFalse() {
  57461. return false;
  57462. }
  57463. /* eslint-disable */
  57464. // 什么都不干的空方法
  57465. function doNothing() {//NOSONAR
  57466. }
  57467. /* eslint-enable */
  57468. }
  57469. /**
  57470. * @function SuperMap.LevelRenderer.Painter.prototype.destroy
  57471. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  57472. */
  57473. Painter_createClass(Painter, [{
  57474. key: "destroy",
  57475. value: function destroy() {
  57476. this.dispose();
  57477. this._zlevelList = null;
  57478. this._layerConfig = null;
  57479. this._bgDom = null;
  57480. this.shapeToImage = null;
  57481. }
  57482. /**
  57483. * @function SuperMap.LevelRenderer.Painter.prototype.render
  57484. * @description 渲染。首次绘图,创建各种 dom 和 context。
  57485. *
  57486. * @param {Function} callback - 绘画结束后的回调函数。
  57487. * @return {SuperMap.LevelRenderer.Painter} this。
  57488. */
  57489. }, {
  57490. key: "render",
  57491. value: function render(callback) {
  57492. // TODO
  57493. this.refresh(callback, true);
  57494. return this;
  57495. }
  57496. /**
  57497. * @function SuperMap.LevelRenderer.Painter.prototype.refresh
  57498. * @description 刷新。
  57499. *
  57500. * @param {Function} callback - 刷新结束后的回调函数。
  57501. * @param {boolean} paintAll - 强制绘制所有 shape。
  57502. * @return {SuperMap.LevelRenderer.Painter} this。
  57503. */
  57504. }, {
  57505. key: "refresh",
  57506. value: function refresh(callback, paintAll) {
  57507. var list = this.storage.getShapeList(true);
  57508. this._paintList(list, paintAll);
  57509. if (typeof callback == 'function') {
  57510. callback();
  57511. }
  57512. return this;
  57513. }
  57514. /**
  57515. * Method: _paintList
  57516. * 按列表绘制图形。
  57517. */
  57518. }, {
  57519. key: "_paintList",
  57520. value: function _paintList(list, paintAll) {
  57521. if (typeof paintAll == 'undefined') {
  57522. paintAll = false;
  57523. }
  57524. this._updateLayerStatus(list);
  57525. var currentLayer;
  57526. var currentZLevel;
  57527. var ctx;
  57528. for (var id in this._layers) {
  57529. if (id !== 'hover') {
  57530. this._layers[id].unusedCount++;
  57531. this._layers[id].updateTransform();
  57532. }
  57533. }
  57534. var invTransform = [];
  57535. for (var i = 0, l = list.length; i < l; i++) {
  57536. var shape = list[i];
  57537. if (currentZLevel !== shape.zlevel) {
  57538. if (currentLayer && currentLayer.needTransform) {
  57539. ctx.restore();
  57540. }
  57541. currentLayer = this.getLayer(shape.zlevel);
  57542. ctx = currentLayer.ctx;
  57543. currentZLevel = shape.zlevel; // Reset the count
  57544. currentLayer.unusedCount = 0;
  57545. if (currentLayer.dirty || paintAll) {
  57546. currentLayer.clear();
  57547. }
  57548. if (currentLayer.needTransform) {
  57549. ctx.save();
  57550. currentLayer.setTransform(ctx);
  57551. }
  57552. } // Start group clipping
  57553. if (ctx && shape.__startClip) {
  57554. var clipShape = shape.__startClip;
  57555. ctx.save(); // Set transform
  57556. if (clipShape.needTransform) {
  57557. var m = clipShape.transform;
  57558. SUtil.Util_matrix.invert(invTransform, m);
  57559. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  57560. }
  57561. ctx.beginPath();
  57562. clipShape.buildPath(ctx, clipShape.style);
  57563. ctx.clip(); // Transform back
  57564. if (clipShape.needTransform) {
  57565. var _m = invTransform;
  57566. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  57567. }
  57568. }
  57569. if ((currentLayer && currentLayer.dirty || paintAll) && !shape.invisible) {
  57570. if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, false)) {
  57571. if (Config.catchBrushException) {
  57572. try {
  57573. shape.brush(ctx, false, this.updatePainter);
  57574. } catch (error) {
  57575. SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  57576. }
  57577. } else {
  57578. shape.brush(ctx, false, this.updatePainter);
  57579. }
  57580. }
  57581. } // Stop group clipping
  57582. if (ctx && shape.__stopClip) {
  57583. ctx.restore();
  57584. }
  57585. shape.__dirty = false;
  57586. }
  57587. if (ctx && currentLayer && currentLayer.needTransform) {
  57588. ctx.restore();
  57589. }
  57590. for (var _id in this._layers) {
  57591. if (_id !== 'hover') {
  57592. var layer = this._layers[_id];
  57593. layer.dirty = false; // 删除过期的层
  57594. // PENDING
  57595. // if (layer.unusedCount >= 500) {
  57596. // this.delLayer(id);
  57597. // }
  57598. if (layer.unusedCount == 1) {
  57599. layer.clear();
  57600. }
  57601. }
  57602. }
  57603. }
  57604. /**
  57605. * @function SuperMap.LevelRenderer.Painter.prototype.getLayer
  57606. * @description 获取 zlevel 所在层,如果不存在则会创建一个新的层。
  57607. *
  57608. * @param {number} zlevel - zlevel。
  57609. * @return {SuperMap.LevelRenderer.Painter} this。
  57610. */
  57611. }, {
  57612. key: "getLayer",
  57613. value: function getLayer(zlevel) {
  57614. // Change draw layer
  57615. var currentLayer = this._layers[zlevel];
  57616. if (!currentLayer) {
  57617. var len = this._zlevelList.length;
  57618. var prevLayer = null;
  57619. var i = -1;
  57620. if (len > 0 && zlevel > this._zlevelList[0]) {
  57621. for (i = 0; i < len - 1; i++) {
  57622. if (this._zlevelList[i] < zlevel && this._zlevelList[i + 1] > zlevel) {
  57623. break;
  57624. }
  57625. }
  57626. prevLayer = this._layers[this._zlevelList[i]];
  57627. }
  57628. this._zlevelList.splice(i + 1, 0, zlevel); // Create a new layer
  57629. //currentLayer = new PaintLayer(zlevel, this);
  57630. currentLayer = new Painter_PaintLayer(Util_Util.createUniqueID("_levelLayer_" + zlevel), this);
  57631. var prevDom = prevLayer ? prevLayer.dom : this._bgDom;
  57632. if (prevDom.nextSibling) {
  57633. prevDom.parentNode.insertBefore(currentLayer.dom, prevDom.nextSibling);
  57634. } else {
  57635. prevDom.parentNode.appendChild(currentLayer.dom);
  57636. }
  57637. currentLayer.initContext();
  57638. this._layers[zlevel] = currentLayer;
  57639. if (this._layerConfig[zlevel]) {
  57640. new levelRenderer_Util_Util().merge(currentLayer, this._layerConfig[zlevel], true);
  57641. }
  57642. currentLayer.updateTransform();
  57643. }
  57644. return currentLayer;
  57645. }
  57646. /**
  57647. * @function SuperMap.LevelRenderer.Painter.prototype.getLayers
  57648. * @description 获取所有已创建的层。
  57649. * @return {Array.<Painter.Layer>} 已创建的层
  57650. */
  57651. }, {
  57652. key: "getLayers",
  57653. value: function getLayers() {
  57654. return this._layers;
  57655. }
  57656. /**
  57657. * Method: _updateLayerStatus
  57658. * 更新绘制层状态。
  57659. */
  57660. }, {
  57661. key: "_updateLayerStatus",
  57662. value: function _updateLayerStatus(list) {
  57663. var layers = this._layers;
  57664. var elCounts = {};
  57665. for (var z in layers) {
  57666. if (z !== 'hover') {
  57667. elCounts[z] = layers[z].elCount;
  57668. layers[z].elCount = 0;
  57669. }
  57670. }
  57671. for (var i = 0; i < list.length; i++) {
  57672. var shape = list[i];
  57673. var zlevel = shape.zlevel;
  57674. var layer = layers[zlevel];
  57675. if (layer) {
  57676. layer.elCount++; // 已经被标记为需要刷新
  57677. if (layer.dirty) {
  57678. continue;
  57679. }
  57680. layer.dirty = shape.__dirty;
  57681. }
  57682. } // 层中的元素数量有发生变化
  57683. for (var _z in layers) {
  57684. if (_z !== 'hover') {
  57685. if (elCounts[_z] !== layers[_z].elCount) {
  57686. layers[_z].dirty = true;
  57687. }
  57688. }
  57689. }
  57690. }
  57691. /**
  57692. * @function SuperMap.LevelRenderer.Painter.prototype.refreshShapes
  57693. * @description 更新的图形元素列表。
  57694. *
  57695. * @param {number} shapeList - 需要更新的图形元素列表。
  57696. * @param {number} callback - 视图更新后回调函数。
  57697. * @return {SuperMap.LevelRenderer.Painter} this。
  57698. */
  57699. }, {
  57700. key: "refreshShapes",
  57701. value: function refreshShapes(shapeList, callback) {
  57702. for (var i = 0, l = shapeList.length; i < l; i++) {
  57703. var shape = shapeList[i];
  57704. this.storage.mod(shape.id);
  57705. }
  57706. this.refresh(callback);
  57707. return this;
  57708. }
  57709. /**
  57710. * @function SuperMap.LevelRenderer.Painter.prototype.clear
  57711. * @description 清除 hover 层外所有内容。
  57712. * @return {SuperMap.LevelRenderer.Painter} this。
  57713. */
  57714. }, {
  57715. key: "clear",
  57716. value: function clear() {
  57717. for (var k in this._layers) {
  57718. if (k == 'hover') {
  57719. continue;
  57720. }
  57721. this._layers[k].clear();
  57722. }
  57723. return this;
  57724. }
  57725. /**
  57726. * @function SuperMap.LevelRenderer.Painter.prototype.modLayer
  57727. * @description 修改指定 zlevel 的绘制参数。
  57728. *
  57729. * @param {string} zlevel - zlevel。
  57730. * @param {Object} config - 配置对象。
  57731. * @param {string} [config.clearColor=0] - 每次清空画布的颜色。
  57732. * @param {boolean} [config.motionBlur=false] - 是否开启动态模糊。
  57733. * @param {number} [config.lastFrameAlpha=0.7] - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  57734. * @param {Array.<number>} config.position - 层的平移。
  57735. * @param {Array.<number>} config.rotation - 层的旋转。
  57736. * @param {Array.<number>} config.scale - 层的缩放。
  57737. * @param {boolean} config.zoomable - 层是否支持鼠标缩放操作。默认值:false。
  57738. * @param {boolean} config.panable - 层是否支持鼠标平移操作。默认值:false。
  57739. *
  57740. */
  57741. }, {
  57742. key: "modLayer",
  57743. value: function modLayer(zlevel, config) {
  57744. if (config) {
  57745. if (!this._layerConfig[zlevel]) {
  57746. this._layerConfig[zlevel] = config;
  57747. } else {
  57748. new levelRenderer_Util_Util().merge(this._layerConfig[zlevel], config, true);
  57749. }
  57750. var layer = this._layers[zlevel];
  57751. if (layer) {
  57752. new levelRenderer_Util_Util().merge(layer, this._layerConfig[zlevel], true);
  57753. }
  57754. }
  57755. }
  57756. /**
  57757. * @function SuperMap.LevelRenderer.Painter.prototype.delLayer
  57758. * @description 删除指定层。
  57759. *
  57760. * @param {string} zlevel - 层所在的 zlevel。
  57761. */
  57762. }, {
  57763. key: "delLayer",
  57764. value: function delLayer(zlevel) {
  57765. var layer = this._layers[zlevel];
  57766. if (!layer) {
  57767. return;
  57768. } // Save config
  57769. this.modLayer(zlevel, {
  57770. position: layer.position,
  57771. rotation: layer.rotation,
  57772. scale: layer.scale
  57773. });
  57774. layer.dom.parentNode.removeChild(layer.dom);
  57775. delete this._layers[zlevel];
  57776. this._zlevelList.splice(new levelRenderer_Util_Util().indexOf(this._zlevelList, zlevel), 1);
  57777. }
  57778. /**
  57779. * @function SuperMap.LevelRenderer.Painter.prototype.refreshHover
  57780. * @description 刷新 hover 层。
  57781. * @return {SuperMap.LevelRenderer.Painter} this。
  57782. */
  57783. }, {
  57784. key: "refreshHover",
  57785. value: function refreshHover() {
  57786. this.clearHover();
  57787. var list = this.storage.getHoverShapes(true);
  57788. for (var i = 0, l = list.length; i < l; i++) {
  57789. this._brushHover(list[i]);
  57790. }
  57791. this.storage.delHover();
  57792. return this;
  57793. }
  57794. /**
  57795. * @function SuperMap.LevelRenderer.Painter.prototype.clearHover
  57796. * @description 清除 hover 层所有内容。
  57797. * @return {SuperMap.LevelRenderer.Painter} this。
  57798. */
  57799. }, {
  57800. key: "clearHover",
  57801. value: function clearHover() {
  57802. var hover = this._layers.hover;
  57803. hover && hover.clear();
  57804. return this;
  57805. }
  57806. /**
  57807. * @function SuperMap.LevelRenderer.Painter.prototype.resize
  57808. * @description 区域大小变化后重绘。
  57809. * @return {SuperMap.LevelRenderer.Painter} this。
  57810. */
  57811. }, {
  57812. key: "resize",
  57813. value: function resize() {
  57814. var domRoot = this._domRoot;
  57815. domRoot.style.display = 'none';
  57816. var width = this._getWidth();
  57817. var height = this._getHeight();
  57818. domRoot.style.display = ''; // 优化没有实际改变的resize
  57819. if (this._width != width || height != this._height) {
  57820. this._width = width;
  57821. this._height = height;
  57822. domRoot.style.width = width + 'px';
  57823. domRoot.style.height = height + 'px';
  57824. for (var id in this._layers) {
  57825. this._layers[id].resize(width, height);
  57826. }
  57827. this.refresh(null, true);
  57828. }
  57829. return this;
  57830. }
  57831. /**
  57832. * @function SuperMap.LevelRenderer.Painter.prototype.clearLayer
  57833. * @description 清除指定的一个层。
  57834. * @param {number} zLevel - 层。
  57835. */
  57836. }, {
  57837. key: "clearLayer",
  57838. value: function clearLayer(zLevel) {
  57839. var layer = this._layers[zLevel];
  57840. if (layer) {
  57841. layer.clear();
  57842. }
  57843. }
  57844. /**
  57845. * @function SuperMap.LevelRenderer.Painter.prototype.dispose
  57846. * @description 释放。
  57847. *
  57848. */
  57849. }, {
  57850. key: "dispose",
  57851. value: function dispose() {
  57852. this.root.innerHTML = '';
  57853. this.root = null;
  57854. this.storage = null;
  57855. this._domRoot = null;
  57856. this._layers = null;
  57857. }
  57858. /**
  57859. * @function SuperMap.LevelRenderer.Painter.prototype.getDomHover
  57860. * @description 获取 Hover 层的 Dom。
  57861. */
  57862. }, {
  57863. key: "getDomHover",
  57864. value: function getDomHover() {
  57865. return this._layers.hover.dom;
  57866. }
  57867. /**
  57868. * @function SuperMap.LevelRenderer.Painter.prototype.toDataURL
  57869. * @description 图像导出。
  57870. * @param {string} type - 图片类型。
  57871. * @param {string} backgroundColor - 背景色。默认值:'#fff'。
  57872. * @param {Object} args
  57873. * @return {string} 图片的Base64 url。
  57874. */
  57875. }, {
  57876. key: "toDataURL",
  57877. value: function toDataURL(type, backgroundColor, args) {
  57878. //var imageDom = Painter.createDom('image', 'canvas', this);
  57879. var imageDom = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme.image_"), 'canvas', this);
  57880. this._bgDom.appendChild(imageDom);
  57881. var ctx = imageDom.getContext('2d');
  57882. Painter.devicePixelRatio != 1 && ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  57883. ctx.fillStyle = backgroundColor || '#fff';
  57884. ctx.rect(0, 0, this._width * Painter.devicePixelRatio, this._height * Painter.devicePixelRatio);
  57885. ctx.fill();
  57886. var self = this; // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠
  57887. this.storage.iterShape(function (shape) {
  57888. if (!shape.invisible) {
  57889. if (!shape.onbrush // 没有onbrush
  57890. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  57891. || shape.onbrush && !shape.onbrush(ctx, false)) {
  57892. if (Config.catchBrushException) {
  57893. try {
  57894. shape.brush(ctx, false, self.updatePainter);
  57895. } catch (error) {
  57896. SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  57897. }
  57898. } else {
  57899. shape.brush(ctx, false, self.updatePainter);
  57900. }
  57901. }
  57902. }
  57903. }, {
  57904. normal: 'up',
  57905. update: true
  57906. });
  57907. var image = imageDom.toDataURL(type, args);
  57908. ctx = null;
  57909. this._bgDom.removeChild(imageDom);
  57910. return image;
  57911. }
  57912. /**
  57913. * @function SuperMap.LevelRenderer.Painter.prototype.getWidth
  57914. * @description 获取绘图区域宽度。
  57915. * @return {number} 绘图区域宽度。
  57916. */
  57917. }, {
  57918. key: "getWidth",
  57919. value: function getWidth() {
  57920. return this._width;
  57921. }
  57922. /**
  57923. * @function SuperMap.LevelRenderer.Painter.prototype.getHeight
  57924. * @description 获取绘图区域高度。
  57925. * @return {number} 绘图区域高度。
  57926. */
  57927. }, {
  57928. key: "getHeight",
  57929. value: function getHeight() {
  57930. return this._height;
  57931. }
  57932. /**
  57933. * Method: _getWidth
  57934. *
  57935. */
  57936. }, {
  57937. key: "_getWidth",
  57938. value: function _getWidth() {
  57939. var root = this.root;
  57940. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  57941. return ((root.clientWidth || parseInt(stl.width, 10)) - parseInt(stl.paddingLeft, 10) // 请原谅我这比较粗暴
  57942. - parseInt(stl.paddingRight, 10)).toFixed(0) - 0;
  57943. }
  57944. /**
  57945. * Method: _getHeight
  57946. *
  57947. */
  57948. }, {
  57949. key: "_getHeight",
  57950. value: function _getHeight() {
  57951. var root = this.root;
  57952. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  57953. return ((root.clientHeight || parseInt(stl.height, 10)) - parseInt(stl.paddingTop, 10) // 请原谅我这比较粗暴
  57954. - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0;
  57955. }
  57956. /**
  57957. * Method: _brushHover
  57958. *
  57959. */
  57960. }, {
  57961. key: "_brushHover",
  57962. value: function _brushHover(shape) {
  57963. var ctx = this._layers.hover.ctx;
  57964. if (!shape.onbrush // 没有onbrush
  57965. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  57966. || shape.onbrush && !shape.onbrush(ctx, true)) {
  57967. var layer = this.getLayer(shape.zlevel);
  57968. if (layer.needTransform) {
  57969. ctx.save();
  57970. layer.setTransform(ctx);
  57971. } // Retina 优化
  57972. if (Config.catchBrushException) {
  57973. try {
  57974. shape.brush(ctx, true, this.updatePainter);
  57975. } catch (error) {
  57976. SUtil.Util_log(error, 'hoverBrush error of ' + shape.type, shape);
  57977. }
  57978. } else {
  57979. shape.brush(ctx, true, this.updatePainter);
  57980. }
  57981. if (layer.needTransform) {
  57982. ctx.restore();
  57983. }
  57984. }
  57985. }
  57986. /**
  57987. * Method: _shapeToImage
  57988. *
  57989. */
  57990. }, {
  57991. key: "_shapeToImage",
  57992. value: function _shapeToImage(id, shape, width, height, devicePixelRatio) {
  57993. var canvas = document.createElement('canvas');
  57994. var ctx = canvas.getContext('2d');
  57995. var _devicePixelRatio = devicePixelRatio || window.devicePixelRatio || 1;
  57996. canvas.style.width = width + 'px';
  57997. canvas.style.height = height + 'px';
  57998. canvas.setAttribute('width', width * _devicePixelRatio);
  57999. canvas.setAttribute('height', height * _devicePixelRatio);
  58000. ctx.clearRect(0, 0, width * _devicePixelRatio, height * _devicePixelRatio);
  58001. var shapeTransform = {
  58002. position: shape.position,
  58003. rotation: shape.rotation,
  58004. scale: shape.scale
  58005. };
  58006. shape.position = [0, 0, 0];
  58007. shape.rotation = 0;
  58008. shape.scale = [1, 1];
  58009. if (shape) {
  58010. shape.brush(ctx, false);
  58011. }
  58012. var imgShape = new SmicImage({
  58013. id: id,
  58014. style: {
  58015. x: 0,
  58016. y: 0,
  58017. image: canvas
  58018. }
  58019. });
  58020. if (shapeTransform.position != null) {
  58021. imgShape.position = shape.position = shapeTransform.position;
  58022. }
  58023. if (shapeTransform.rotation != null) {
  58024. imgShape.rotation = shape.rotation = shapeTransform.rotation;
  58025. }
  58026. if (shapeTransform.scale != null) {
  58027. imgShape.scale = shape.scale = shapeTransform.scale;
  58028. }
  58029. return imgShape;
  58030. }
  58031. /**
  58032. * Method: _createShapeToImageProcessor
  58033. *
  58034. */
  58035. }, {
  58036. key: "_createShapeToImageProcessor",
  58037. value: function _createShapeToImageProcessor() {
  58038. var me = this;
  58039. return function (id, e, width, height) {
  58040. return me._shapeToImage(id, e, width, height, Painter.devicePixelRatio);
  58041. };
  58042. } // SMIC-方法扩展 - start
  58043. /**
  58044. * @function SuperMap.LevelRenderer.Painter.prototype.updateHoverLayer
  58045. * @description 更新设置显示高亮图层。
  58046. * @param {Array} shapes - 图形数组。
  58047. */
  58048. }, {
  58049. key: "updateHoverLayer",
  58050. value: function updateHoverLayer(shapes) {
  58051. if (!(shapes instanceof Array)) {
  58052. return this;
  58053. } //清除高亮
  58054. this.clearHover();
  58055. this.storage.delHover();
  58056. for (var i = 0; i < shapes.length; i++) {
  58057. this.storage.addHover(shapes[i]);
  58058. this._brushHover(shapes[i]);
  58059. }
  58060. }
  58061. /**
  58062. * @function SuperMap.LevelRenderer.Painter.prototype.createDom
  58063. * @description 创建 Dom。
  58064. *
  58065. * @param {string} id - Dom id
  58066. * @param {string} type - Dom type
  58067. * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
  58068. * @return {Object} Dom
  58069. */
  58070. }], [{
  58071. key: "createDom",
  58072. value: function createDom(id, type, painter) {
  58073. var newDom = document.createElement(type);
  58074. var width = painter._width;
  58075. var height = painter._height; // 没append呢,请原谅我这样写,清晰~
  58076. newDom.style.position = 'absolute';
  58077. newDom.style.left = 0;
  58078. newDom.style.top = 0;
  58079. newDom.style.width = width + 'px';
  58080. newDom.style.height = height + 'px';
  58081. newDom.setAttribute('width', width * Painter.devicePixelRatio);
  58082. newDom.setAttribute('height', height * Painter.devicePixelRatio); // id不作为索引用,避免可能造成的重名,定义为私有属性
  58083. //newDom.setAttribute('data-zr-dom-id', id);
  58084. newDom.setAttribute('id', id);
  58085. return newDom;
  58086. }
  58087. }]);
  58088. return Painter;
  58089. }();
  58090. /**
  58091. * @private
  58092. * @class Painter.Layer
  58093. * @classdesc 绘制层类。
  58094. * @extends SuperMap.LevelRenderer.Transformable
  58095. */
  58096. var Painter_PaintLayer = /*#__PURE__*/function (_Transformable) {
  58097. Painter_inherits(PaintLayer, _Transformable);
  58098. var _super = Painter_createSuper(PaintLayer);
  58099. /**
  58100. * @function Painter.Layer.constructor
  58101. * @description 构造函数。
  58102. *
  58103. * @param {string} id - id。
  58104. * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
  58105. *
  58106. */
  58107. function PaintLayer(id, painter) {
  58108. var _this;
  58109. Painter_classCallCheck(this, PaintLayer);
  58110. _this = _super.call(this, id, painter);
  58111. /**
  58112. * @member {Object} Painter.Layer.prototype.dom
  58113. * @description dom。
  58114. */
  58115. _this.dom = null;
  58116. /**
  58117. * @member {Object} Painter.Layer.prototype.domBack
  58118. * @description domBack。
  58119. */
  58120. _this.domBack = null;
  58121. /**
  58122. * @member {Object} Painter.Layer.prototype.ctxBack
  58123. * @description ctxBack。
  58124. */
  58125. _this.ctxBack = null;
  58126. /**
  58127. * @member {SuperMap.LevelRenderer.Painter} Painter.Layer.prototype.painter
  58128. * @description painter。
  58129. */
  58130. _this.painter = painter;
  58131. /**
  58132. * @member {number} Painter.Layer.prototype.unusedCount
  58133. * @description unusedCount。
  58134. */
  58135. _this.unusedCount = 0;
  58136. /**
  58137. * @member {Object} Painter.Layer.prototype.config
  58138. * @description config。
  58139. */
  58140. _this.config = null;
  58141. /**
  58142. * @member {boolean} Painter.Layer.prototype.dirty
  58143. * @description dirty。
  58144. */
  58145. _this.dirty = true;
  58146. /**
  58147. * @member {number} Painter.Layer.prototype.elCount
  58148. * @description elCount。
  58149. */
  58150. _this.elCount = 0; // Configs
  58151. /**
  58152. * @member {string} Painter.Layer.prototype.clearColor
  58153. * @description 每次清空画布的颜色。默认值:0;
  58154. */
  58155. _this.clearColor = 0;
  58156. /**
  58157. * @member {boolean} Painter.Layer.prototype.motionBlur
  58158. * @description 是否开启动态模糊。默认值:false;
  58159. */
  58160. _this.motionBlur = false;
  58161. /**
  58162. * @member {number} Painter.Layer.prototype.lastFrameAlpha
  58163. * @description 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显
  58164. */
  58165. _this.lastFrameAlpha = 0.7;
  58166. /**
  58167. * @member {boolean} Painter.Layer.prototype.zoomable
  58168. * @description 层是否支持鼠标平移操作。默认值:false;
  58169. */
  58170. _this.zoomable = false;
  58171. /**
  58172. * @member {boolean} Painter.Layer.prototype.panable
  58173. * @description 层是否支持鼠标缩放操作。默认值:false;
  58174. */
  58175. _this.panable = false;
  58176. /**
  58177. * @member {number} Painter.Layer.prototype.maxZoom
  58178. * @description maxZoom。默认值:Infinity。
  58179. */
  58180. _this.maxZoom = Infinity;
  58181. /**
  58182. * @member {number} Painter.Layer.prototype.minZoom
  58183. * @description minZoom。默认值:0。
  58184. */
  58185. _this.minZoom = 0;
  58186. /**
  58187. * @member {number} Painter.Layer.prototype.ctx
  58188. * @description Canvas 上下文。
  58189. */
  58190. _this.ctx = null;
  58191. _this.dom = Painter_Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme" + id), 'canvas', painter);
  58192. _this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬
  58193. _this.dom.style['-webkit-user-select'] = 'none';
  58194. _this.dom.style['user-select'] = 'none';
  58195. _this.dom.style['-webkit-touch-callout'] = 'none'; // Function
  58196. // 返回false的方法,用于避免页面被选中
  58197. function returnFalse() {
  58198. return false;
  58199. }
  58200. _this.CLASS_NAME = "SuperMap.LevelRenderer.Painter.Layer";
  58201. return _this;
  58202. }
  58203. /**
  58204. * @function Painter.Layer.prototype.destroy
  58205. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  58206. */
  58207. Painter_createClass(PaintLayer, [{
  58208. key: "destroy",
  58209. value: function destroy() {
  58210. this.dom = null;
  58211. this.domBack = null;
  58212. this.ctxBack = null;
  58213. this.painter = null;
  58214. this.unusedCount = null;
  58215. this.config = null;
  58216. this.dirty = null;
  58217. this.elCount = null;
  58218. this.clearColor = null;
  58219. this.motionBlur = null;
  58220. this.lastFrameAlpha = null;
  58221. this.zoomable = null;
  58222. this.panable = null;
  58223. this.maxZoom = null;
  58224. this.minZoom = null;
  58225. this.ctx = null;
  58226. Transformable_Transformable.destroy.apply(this, arguments);
  58227. }
  58228. /**
  58229. * @function Painter.Layer.prototype.initContext
  58230. * @description 初始化 Canvan 2D 上下文。
  58231. */
  58232. }, {
  58233. key: "initContext",
  58234. value: function initContext() {
  58235. this.ctx = this.dom.getContext('2d');
  58236. if (Painter_Painter.devicePixelRatio != 1) {
  58237. this.ctx.scale(Painter_Painter.devicePixelRatio, Painter_Painter.devicePixelRatio);
  58238. }
  58239. }
  58240. /**
  58241. * @function Painter.Layer.prototype.createBackBuffer
  58242. * @description 创建备份缓冲。
  58243. */
  58244. }, {
  58245. key: "createBackBuffer",
  58246. value: function createBackBuffer() {
  58247. this.domBack = Painter_Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme.back-" + this.id), 'canvas', this.painter);
  58248. this.ctxBack = this.domBack.getContext('2d');
  58249. if (Painter_Painter.devicePixelRatio != 1) {
  58250. this.ctxBack.scale(Painter_Painter.devicePixelRatio, Painter_Painter.devicePixelRatio);
  58251. }
  58252. }
  58253. /**
  58254. * @function Painter.Layer.prototype.resize
  58255. * @description 改变大小。
  58256. *
  58257. * @param {number} width - 宽。
  58258. * @param {number} height - 高。
  58259. */
  58260. }, {
  58261. key: "resize",
  58262. value: function resize(width, height) {
  58263. this.dom.style.width = width + 'px';
  58264. this.dom.style.height = height + 'px';
  58265. this.dom.setAttribute('width', width * Painter_Painter.devicePixelRatio);
  58266. this.dom.setAttribute('height', height * Painter_Painter.devicePixelRatio);
  58267. if (Painter_Painter.devicePixelRatio != 1) {
  58268. this.ctx.scale(Painter_Painter.devicePixelRatio, Painter_Painter.devicePixelRatio);
  58269. }
  58270. if (this.domBack) {
  58271. this.domBack.setAttribute('width', width * Painter_Painter.devicePixelRatio);
  58272. this.domBack.setAttribute('height', height * Painter_Painter.devicePixelRatio);
  58273. if (Painter_Painter.devicePixelRatio != 1) {
  58274. this.ctxBack.scale(Painter_Painter.devicePixelRatio, Painter_Painter.devicePixelRatio);
  58275. }
  58276. }
  58277. }
  58278. /**
  58279. * @function Painter.Layer.prototype.clear
  58280. * @description 清空该层画布。
  58281. */
  58282. }, {
  58283. key: "clear",
  58284. value: function clear() {
  58285. var dom = this.dom;
  58286. var ctx = this.ctx;
  58287. var width = dom.width;
  58288. var height = dom.height;
  58289. var haveClearColor = this.clearColor;
  58290. var haveMotionBLur = this.motionBlur;
  58291. var lastFrameAlpha = this.lastFrameAlpha;
  58292. if (haveMotionBLur) {
  58293. if (!this.domBack) {
  58294. this.createBackBuffer();
  58295. }
  58296. this.ctxBack.globalCompositeOperation = 'copy';
  58297. this.ctxBack.drawImage(dom, 0, 0, width / Painter_Painter.devicePixelRatio, height / Painter_Painter.devicePixelRatio);
  58298. }
  58299. if (haveClearColor) {
  58300. ctx.save();
  58301. ctx.fillStyle = this.config.clearColor;
  58302. ctx.fillRect(0, 0, width / Painter_Painter.devicePixelRatio, height / Painter_Painter.devicePixelRatio);
  58303. ctx.restore();
  58304. } else {
  58305. ctx.clearRect(0, 0, width / Painter_Painter.devicePixelRatio, height / Painter_Painter.devicePixelRatio);
  58306. }
  58307. if (haveMotionBLur) {
  58308. var domBack = this.domBack;
  58309. ctx.save();
  58310. ctx.globalAlpha = lastFrameAlpha;
  58311. ctx.drawImage(domBack, 0, 0, width / Painter_Painter.devicePixelRatio, height / Painter_Painter.devicePixelRatio);
  58312. ctx.restore();
  58313. }
  58314. }
  58315. }]);
  58316. return PaintLayer;
  58317. }(Transformable_Transformable);
  58318. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Handler.js
  58319. 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); }
  58320. function Handler_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58321. 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); } }
  58322. function Handler_createClass(Constructor, protoProps, staticProps) { if (protoProps) Handler_defineProperties(Constructor.prototype, protoProps); if (staticProps) Handler_defineProperties(Constructor, staticProps); return Constructor; }
  58323. 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); }
  58324. function Handler_setPrototypeOf(o, p) { Handler_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Handler_setPrototypeOf(o, p); }
  58325. 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); }; }
  58326. function Handler_possibleConstructorReturn(self, call) { if (call && (Handler_typeof(call) === "object" || typeof call === "function")) { return call; } return Handler_assertThisInitialized(self); }
  58327. function Handler_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  58328. 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; } }
  58329. function Handler_getPrototypeOf(o) { Handler_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Handler_getPrototypeOf(o); }
  58330. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  58331. * This program are made available under the terms of the Apache License, Version 2.0
  58332. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58333. /**
  58334. * @private
  58335. * @class SuperMap.LevelRenderer.Handler
  58336. * @category Visualization Theme
  58337. * @classdesc Handler控制模块。
  58338. * @extends {SuperMap.LevelRenderer.Eventful}
  58339. */
  58340. var Handler_Handler = /*#__PURE__*/function (_Eventful) {
  58341. Handler_inherits(Handler, _Eventful);
  58342. var _super = Handler_createSuper(Handler);
  58343. /**
  58344. * @function SuperMap.LevelRenderer.Handler.constructor
  58345. * @description 构造函数。
  58346. * @param {HTMLElement} root - 绘图区域。
  58347. * @param {SuperMap.LevelRenderer.Storage} storage - Storage 实例。
  58348. * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
  58349. */
  58350. function Handler(root, storage, painter) {
  58351. var _this;
  58352. Handler_classCallCheck(this, Handler);
  58353. _this = _super.call(this, root, storage, painter);
  58354. /**
  58355. * @member {HTMLElement} SuperMap.LevelRenderer.Handler.prototype.root
  58356. * @description 绘图区域
  58357. */
  58358. _this.root = root;
  58359. /**
  58360. * @member {SuperMap.LevelRenderer.Storage} SuperMap.LevelRenderer.Handler.prototype.storage
  58361. * @description Storage 实例
  58362. */
  58363. _this.storage = storage;
  58364. /**
  58365. * @member {SuperMap.LevelRenderer.Painter} SuperMap.LevelRenderer.Handler.prototype.Painter
  58366. * @description Painter 实例
  58367. */
  58368. _this.painter = painter;
  58369. /**
  58370. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._lastX=0]
  58371. * @description 上一次鼠标位置x坐标值
  58372. */
  58373. _this._lastX = 0;
  58374. /**
  58375. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._lastY=0]
  58376. * @description 上一次鼠标位置y坐标值
  58377. */
  58378. _this._lastY = 0;
  58379. /**
  58380. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._mouseX=0]
  58381. * @description 当前鼠标位置x坐标值
  58382. */
  58383. _this._mouseX = 0;
  58384. /**
  58385. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._mouseY=0]
  58386. * @description 当前鼠标位置y坐标值
  58387. */
  58388. _this._mouseY = 0;
  58389. /**
  58390. * @member {Function} SuperMap.LevelRenderer.Handler.prototype._findHover
  58391. * @description 查找 Hover 图形
  58392. */
  58393. _this._findHover = null;
  58394. /**
  58395. * @member {Object} SuperMap.LevelRenderer.Handler.prototype._domHover
  58396. * @description 高亮 DOM
  58397. */
  58398. _this._domHover = null; // 各种事件标识的私有变量
  58399. // this._hasfound = false; // 是否找到 hover 图形元素
  58400. // this._lastHover = null; // 最后一个 hover 图形元素
  58401. // this._mouseDownTarget = null;
  58402. // this._draggingTarget = null; // 当前被拖拽的图形元素
  58403. // this._isMouseDown = false;
  58404. // this._isDragging = false;
  58405. // this._lastMouseDownMoment;
  58406. // this._lastTouchMoment;
  58407. // this._lastDownButton;
  58408. _this._findHover = bind3Arg(findHover, Handler_assertThisInitialized(_this));
  58409. _this._domHover = painter.getDomHover();
  58410. _this.CLASS_NAME = "SuperMap.LevelRenderer.Handler";
  58411. var domHandlers = {
  58412. /**
  58413. * Method: resize
  58414. * 窗口大小改变响应函数。
  58415. *
  58416. * Parameters:
  58417. * event - {Event} event。
  58418. *
  58419. */
  58420. resize: function resize(event) {
  58421. event = event || window.event;
  58422. this._lastHover = null;
  58423. this._isMouseDown = 0; // 分发SuperMap.LevelRenderer.Config.EVENT.RESIZE事件,global
  58424. this.dispatch(Config.EVENT.RESIZE, event);
  58425. },
  58426. /**
  58427. * Method: click
  58428. * 点击响应函数。
  58429. *
  58430. * Parameters:
  58431. * event - {Event} event。
  58432. *
  58433. */
  58434. click: function click(event) {
  58435. event = this._zrenderEventFixed(event); // 分发SuperMap.LevelRenderer.Config.EVENT.CLICK事件
  58436. var _lastHover = this._lastHover;
  58437. if (_lastHover && _lastHover.clickable || !_lastHover) {
  58438. // 判断没有发生拖拽才触发click事件
  58439. if (this._clickThreshold < 10) {
  58440. this._dispatchAgency(_lastHover, Config.EVENT.CLICK, event);
  58441. }
  58442. }
  58443. this._mousemoveHandler(event);
  58444. },
  58445. /**
  58446. * Method: dblclick
  58447. * 双击响应函数。
  58448. *
  58449. * Parameters:
  58450. * event - {Event} event。
  58451. *
  58452. */
  58453. dblclick: function dblclick(event) {
  58454. event = event || window.event;
  58455. event = this._zrenderEventFixed(event); // 分发SuperMap.LevelRenderer.Config.EVENT.DBLCLICK事件
  58456. var _lastHover = this._lastHover;
  58457. if (_lastHover && _lastHover.clickable || !_lastHover) {
  58458. // 判断没有发生拖拽才触发dblclick事件
  58459. if (this._clickThreshold < 5) {
  58460. this._dispatchAgency(_lastHover, Config.EVENT.DBLCLICK, event);
  58461. }
  58462. }
  58463. this._mousemoveHandler(event);
  58464. },
  58465. /**
  58466. * Method: mousewheel
  58467. * 鼠标滚轮响应函数。
  58468. *
  58469. * Parameters:
  58470. * event - {Event} event。
  58471. *
  58472. */
  58473. mousewheel: function mousewheel(event) {
  58474. event = this._zrenderEventFixed(event); // http://www.sitepoint.com/html5-javascript-mouse-wheel/
  58475. // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel
  58476. var delta = event.wheelDelta // Webkit
  58477. || -event.detail; // Firefox
  58478. var scale = delta > 0 ? 1.1 : 1 / 1.1;
  58479. var layers = this.painter.getLayers();
  58480. var needsRefresh = false;
  58481. for (var z in layers) {
  58482. if (z !== 'hover') {
  58483. var layer = layers[z];
  58484. var pos = layer.position;
  58485. if (layer.zoomable) {
  58486. layer.__zoom = layer.__zoom || 1;
  58487. var newZoom = layer.__zoom;
  58488. newZoom *= scale;
  58489. newZoom = Math.max(Math.min(layer.maxZoom, newZoom), layer.minZoom);
  58490. scale = newZoom / layer.__zoom;
  58491. layer.__zoom = newZoom; // Keep the mouse center when scaling
  58492. pos[0] -= (this._mouseX - pos[0]) * (scale - 1);
  58493. pos[1] -= (this._mouseY - pos[1]) * (scale - 1);
  58494. layer.scale[0] *= scale;
  58495. layer.scale[1] *= scale;
  58496. layer.dirty = true;
  58497. needsRefresh = true;
  58498. }
  58499. }
  58500. }
  58501. if (needsRefresh) {
  58502. this.painter.refresh();
  58503. } // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEWHEEL事件
  58504. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEWHEEL, event);
  58505. this._mousemoveHandler(event);
  58506. },
  58507. /**
  58508. * Method: mousemove
  58509. * 鼠标(手指)移动响应函数。
  58510. *
  58511. * Parameters:
  58512. * event - {Event} event。
  58513. *
  58514. */
  58515. mousemove: function mousemove(event) {
  58516. // 拖拽不触发click事件
  58517. this._clickThreshold++;
  58518. event = this._zrenderEventFixed(event);
  58519. this._lastX = this._mouseX;
  58520. this._lastY = this._mouseY;
  58521. this._mouseX = SUtil.Util_event.getX(event);
  58522. this._mouseY = SUtil.Util_event.getY(event);
  58523. var dx = this._mouseX - this._lastX;
  58524. var dy = this._mouseY - this._lastY; // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGSTART事件
  58525. // 避免手抖点击误认为拖拽
  58526. // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) {
  58527. this._processDragStart(event); // }
  58528. this._hasfound = 0;
  58529. this._event = event;
  58530. this._iterateAndFindHover(); // 找到的在迭代函数里做了处理,没找到得在迭代完后处理
  58531. if (!this._hasfound) {
  58532. // 过滤首次拖拽产生的mouseout和dragLeave
  58533. if (!this._draggingTarget || this._lastHover && this._lastHover != this._draggingTarget) {
  58534. // 可能出现SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  58535. this._processOutShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  58536. this._processDragLeave(event);
  58537. }
  58538. this._lastHover = null;
  58539. this.storage.delHover();
  58540. this.painter.clearHover();
  58541. } // set cursor for root element
  58542. var cursor = ''; // 如果存在拖拽中元素,被拖拽的图形元素最后addHover
  58543. if (this._draggingTarget) {
  58544. this.storage.drift(this._draggingTarget.id, dx, dy);
  58545. this._draggingTarget.modSelf();
  58546. this.storage.addHover(this._draggingTarget);
  58547. } else if (this._isMouseDown) {
  58548. // Layer dragging
  58549. var layers = this.painter.getLayers();
  58550. var needsRefresh = false;
  58551. for (var z in layers) {
  58552. if (z !== 'hover') {
  58553. var layer = layers[z];
  58554. if (layer.panable) {
  58555. // PENDING
  58556. cursor = 'move'; // Keep the mouse center when scaling
  58557. layer.position[0] += dx;
  58558. layer.position[1] += dy;
  58559. needsRefresh = true;
  58560. layer.dirty = true;
  58561. }
  58562. }
  58563. }
  58564. if (needsRefresh) {
  58565. this.painter.refresh();
  58566. }
  58567. }
  58568. if (this._draggingTarget || this._hasfound && this._lastHover.draggable) {
  58569. cursor = 'move';
  58570. } else if (this._hasfound && this._lastHover.clickable) {
  58571. cursor = 'pointer';
  58572. }
  58573. this.root.style.cursor = cursor; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEMOVE事件
  58574. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEMOVE, event);
  58575. if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) {
  58576. this.painter.refreshHover();
  58577. }
  58578. },
  58579. /**
  58580. * Method: mouseout
  58581. * 鼠标(手指)离开响应函数。
  58582. *
  58583. * Parameters:
  58584. * event - {Event} event。
  58585. *
  58586. */
  58587. mouseout: function mouseout(event) {
  58588. event = this._zrenderEventFixed(event);
  58589. var element = event.toElement || event.relatedTarget;
  58590. if (element != this.root) {
  58591. while (element && element.nodeType != 9) {
  58592. // 忽略包含在root中的dom引起的mouseOut
  58593. if (element == this.root) {
  58594. this._mousemoveHandler(event);
  58595. return;
  58596. }
  58597. element = element.parentNode;
  58598. }
  58599. }
  58600. event.zrenderX = this._lastX;
  58601. event.zrenderY = this._lastY;
  58602. this.root.style.cursor = '';
  58603. this._isMouseDown = 0;
  58604. this._processOutShape(event);
  58605. this._processDrop(event);
  58606. this._processDragEnd(event);
  58607. this.painter.refreshHover();
  58608. this.dispatch(Config.EVENT.GLOBALOUT, event);
  58609. },
  58610. /**
  58611. * Method: mousedown
  58612. * 鼠标(手指)按下响应函数。
  58613. *
  58614. * Parameters:
  58615. * event - {Event} event。
  58616. *
  58617. */
  58618. mousedown: function mousedown(event) {
  58619. // 重置 clickThreshold
  58620. this._clickThreshold = 0;
  58621. if (this._lastDownButton == 2) {
  58622. this._lastDownButton = event.button;
  58623. this._mouseDownTarget = null; // 仅作为关闭右键菜单使用
  58624. return;
  58625. }
  58626. this._lastMouseDownMoment = new Date();
  58627. event = this._zrenderEventFixed(event);
  58628. this._isMouseDown = 1; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEDOWN事件
  58629. this._mouseDownTarget = this._lastHover;
  58630. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEDOWN, event);
  58631. this._lastDownButton = event.button;
  58632. },
  58633. /**
  58634. * Method: mouseup
  58635. * 鼠标(手指)抬起响应函数。
  58636. *
  58637. * Parameters:
  58638. * event - {Event} event。
  58639. *
  58640. */
  58641. mouseup: function mouseup(event) {
  58642. event = this._zrenderEventFixed(event);
  58643. this.root.style.cursor = '';
  58644. this._isMouseDown = 0;
  58645. this._mouseDownTarget = null; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEUP事件
  58646. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEUP, event);
  58647. this._processDrop(event);
  58648. this._processDragEnd(event);
  58649. },
  58650. /**
  58651. * Method: touchstart
  58652. * Touch 开始响应函数。
  58653. *
  58654. * Parameters:
  58655. * event - {Event} event。
  58656. *
  58657. */
  58658. touchstart: function touchstart(event) {
  58659. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  58660. event = this._zrenderEventFixed(event, true);
  58661. this._lastTouchMoment = new Date(); // 平板补充一次findHover
  58662. this._mobildFindFixed(event);
  58663. this._mousedownHandler(event);
  58664. },
  58665. /**
  58666. * Method: touchmove
  58667. * Touch 移动响应函数。
  58668. *
  58669. * Parameters:
  58670. * event - {Event} event。
  58671. *
  58672. */
  58673. touchmove: function touchmove(event) {
  58674. event = this._zrenderEventFixed(event, true);
  58675. this._mousemoveHandler(event);
  58676. if (this._isDragging) {
  58677. SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  58678. }
  58679. },
  58680. /**
  58681. * Method: touchend
  58682. * Touch 结束响应函数。
  58683. *
  58684. * Parameters:
  58685. * event - {Event} event。
  58686. *
  58687. */
  58688. touchend: function touchend(event) {
  58689. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  58690. event = this._zrenderEventFixed(event, true);
  58691. this._mouseupHandler(event);
  58692. var now = new Date();
  58693. if (now - this._lastTouchMoment < Config.EVENT.touchClickDelay) {
  58694. this._mobildFindFixed(event);
  58695. this._clickHandler(event);
  58696. if (now - this._lastClickMoment < Config.EVENT.touchClickDelay / 2) {
  58697. this._dblclickHandler(event);
  58698. if (this._lastHover && this._lastHover.clickable) {
  58699. SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  58700. }
  58701. }
  58702. this._lastClickMoment = now;
  58703. }
  58704. this.painter.clearHover();
  58705. }
  58706. };
  58707. initDomHandler(Handler_assertThisInitialized(_this)); // 初始化,事件绑定,支持的所有事件都由如下原生事件计算得来
  58708. if (window.addEventListener) {
  58709. window.addEventListener('resize', _this._resizeHandler);
  58710. if (SUtil.Util_env.os.tablet || SUtil.Util_env.os.phone) {
  58711. // mobile支持
  58712. root.addEventListener('touchstart', _this._touchstartHandler);
  58713. root.addEventListener('touchmove', _this._touchmoveHandler);
  58714. root.addEventListener('touchend', _this._touchendHandler);
  58715. } else {
  58716. // mobile的click/move/up/down自己模拟
  58717. root.addEventListener('click', _this._clickHandler);
  58718. root.addEventListener('dblclick', _this._dblclickHandler);
  58719. root.addEventListener('mousewheel', _this._mousewheelHandler);
  58720. root.addEventListener('mousemove', _this._mousemoveHandler);
  58721. root.addEventListener('mousedown', _this._mousedownHandler);
  58722. root.addEventListener('mouseup', _this._mouseupHandler);
  58723. }
  58724. root.addEventListener('DOMMouseScroll', _this._mousewheelHandler);
  58725. root.addEventListener('mouseout', _this._mouseoutHandler);
  58726. } else {
  58727. window.attachEvent('onresize', _this._resizeHandler);
  58728. root.attachEvent('onclick', _this._clickHandler); //root.attachEvent('ondblclick ', this._dblclickHandler);
  58729. root.ondblclick = _this._dblclickHandler;
  58730. root.attachEvent('onmousewheel', _this._mousewheelHandler);
  58731. root.attachEvent('onmousemove', _this._mousemoveHandler);
  58732. root.attachEvent('onmouseout', _this._mouseoutHandler);
  58733. root.attachEvent('onmousedown', _this._mousedownHandler);
  58734. root.attachEvent('onmouseup', _this._mouseupHandler);
  58735. } // 辅助函数 start
  58736. /**
  58737. * Method: bind1Arg
  58738. * bind 一个参数的 function。
  58739. *
  58740. * Parameters:
  58741. * handler - {Function} 要 bind 的 function。
  58742. * context - {Object} 运行时 this 环境。
  58743. *
  58744. * Returns:
  58745. * {Function}
  58746. */
  58747. function bind1Arg(handler, context) {
  58748. return function (e) {
  58749. return handler.call(context, e);
  58750. };
  58751. }
  58752. /*
  58753. // bind 两个参数的 function
  58754. function bind2Arg(handler, context) {
  58755. return function (arg1, arg2) {
  58756. return handler.call(context, arg1, arg2);
  58757. };
  58758. }
  58759. */
  58760. // bind 三个参数的 function
  58761. function bind3Arg(handler, context) {
  58762. return function (arg1, arg2, arg3) {
  58763. return handler.call(context, arg1, arg2, arg3);
  58764. };
  58765. }
  58766. /**
  58767. * Method: initDomHandler
  58768. * 为控制类实例初始化 dom 事件处理函数。
  58769. *
  58770. * Parameters:
  58771. * instance - {<SuperMap.LevelRenderer.Handler>} 控制类实例 。
  58772. *
  58773. * Returns:
  58774. * {Function}
  58775. */
  58776. function initDomHandler(instance) {
  58777. var domHandlerNames = ['resize', 'click', 'dblclick', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove'];
  58778. var len = domHandlerNames.length;
  58779. while (len--) {
  58780. var name = domHandlerNames[len];
  58781. instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance);
  58782. }
  58783. }
  58784. /**
  58785. * Method: findHover
  58786. * 迭代函数,查找 hover 到的图形元素并即时做些事件分发。
  58787. *
  58788. * Parameters:
  58789. * shape - {Object} 图形。
  58790. * x - {number} 鼠标 x。
  58791. * y - {number} 鼠标 y。
  58792. *
  58793. * Returns:
  58794. * {boolean} 是否找到图形。
  58795. *
  58796. */
  58797. function findHover(shape, x, y) {
  58798. var me = this;
  58799. if (me._draggingTarget && me._draggingTarget.id == shape.id || // 迭代到当前拖拽的图形上
  58800. shape.isSilent() // 打酱油的路过,啥都不响应的shape~
  58801. ) {
  58802. return false;
  58803. }
  58804. var event = me._event;
  58805. if (shape.isCover(x, y)) {
  58806. if (shape.hoverable) {
  58807. // SMIC-修改 - start
  58808. if (shape.isHoverByRefDataID && shape.isHoverByRefDataID === true) {
  58809. if (shape.refDataID) {
  58810. var fid = shape.refDataID; //me.painter.clearHover();
  58811. //me.storage.delHover();
  58812. var hoverGroup = null;
  58813. if (shape.refDataHoverGroup) {
  58814. hoverGroup = shape.refDataHoverGroup;
  58815. } //查找同一个用户数据 feature 的所有图形
  58816. var shapeList = me.storage._shapeList;
  58817. for (var i = 0, len = shapeList.length; i < len; i++) {
  58818. var si = shapeList[i];
  58819. if (si.refDataID && fid === si.refDataID) {
  58820. if (hoverGroup) {
  58821. if (si.refDataHoverGroup && hoverGroup === si.refDataHoverGroup) {
  58822. me.storage.addHover(si);
  58823. }
  58824. } else {
  58825. me.storage.addHover(si);
  58826. }
  58827. }
  58828. }
  58829. }
  58830. } else {
  58831. me.storage.addHover(shape);
  58832. } //初始代码:
  58833. // me.storage.addHover(shape);
  58834. // SMIC-修改 - end
  58835. } // 查找是否在 clipShape 中
  58836. var p = shape.parent;
  58837. while (p) {
  58838. if (p.clipShape && !p.clipShape.isCover(me._mouseX, me._mouseY)) {
  58839. // 已经被祖先 clip 掉了
  58840. return false;
  58841. }
  58842. p = p.parent;
  58843. }
  58844. if (me._lastHover != shape) {
  58845. me._processOutShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  58846. me._processDragLeave(event);
  58847. me._lastHover = shape; // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  58848. me._processDragEnter(event);
  58849. }
  58850. me._processOverShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGOVER
  58851. me._processDragOver(event);
  58852. me._hasfound = 1;
  58853. return true; // 找到则中断迭代查找
  58854. }
  58855. return false;
  58856. } // 辅助函数 end
  58857. return _this;
  58858. }
  58859. /**
  58860. * @function SuperMap.LevelRenderer.Handler.prototype.destroy
  58861. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  58862. */
  58863. Handler_createClass(Handler, [{
  58864. key: "destroy",
  58865. value: function destroy() {
  58866. this.dispose();
  58867. this._lastX = null;
  58868. this._lastY = null;
  58869. this._mouseX = null;
  58870. this._mouseY = null;
  58871. this._findHover = null;
  58872. Eventful.prototype.destroy.apply(this, arguments);
  58873. }
  58874. /**
  58875. * @function SuperMap.LevelRenderer.Handler.prototype.on
  58876. * @description 自定义事件绑定。
  58877. * @param {string} eventName - 事件名称,resize、hover、drag等。
  58878. * @param {function} handler - 响应函数。
  58879. * @returns {SuperMap.LevelRenderer.Handler} this。
  58880. */
  58881. }, {
  58882. key: "on",
  58883. value: function on(eventName, handler) {
  58884. this.bind(eventName, handler);
  58885. return this;
  58886. }
  58887. /**
  58888. * @function SuperMap.LevelRenderer.Handler.prototype.un
  58889. * @description 自定义事件解除绑定。
  58890. * @param {string} eventName - 事件名称,resize、hover、drag等。
  58891. * @param {function} handler - 响应函数。
  58892. * @returns {SuperMap.LevelRenderer.Handler} this。
  58893. */
  58894. }, {
  58895. key: "un",
  58896. value: function un(eventName, handler) {
  58897. this.unbind(eventName, handler);
  58898. return this;
  58899. }
  58900. /**
  58901. * @function SuperMap.LevelRenderer.Handler.prototype.trigger
  58902. * @description 事件触发。
  58903. * @param {string} eventName - 事件名称,resize、hover、drag等。
  58904. * @param {event} eventArgs - dom事件对象。
  58905. */
  58906. }, {
  58907. key: "trigger",
  58908. value: function trigger(eventName, eventArgs) {
  58909. var EVENT = Config.EVENT;
  58910. switch (eventName) {
  58911. case EVENT.RESIZE:
  58912. case EVENT.CLICK:
  58913. case EVENT.DBLCLICK:
  58914. case EVENT.MOUSEWHEEL:
  58915. case EVENT.MOUSEMOVE:
  58916. case EVENT.MOUSEDOWN:
  58917. case EVENT.MOUSEUP:
  58918. case EVENT.MOUSEOUT:
  58919. this['_' + eventName + 'Handler'](eventArgs);
  58920. break;
  58921. }
  58922. }
  58923. /**
  58924. * @function SuperMap.LevelRenderer.Handler.prototype.dispose
  58925. * @description 释放,解绑所有事件。
  58926. */
  58927. }, {
  58928. key: "dispose",
  58929. value: function dispose() {
  58930. var root = this.root;
  58931. if (window.removeEventListener) {
  58932. window.removeEventListener('resize', this._resizeHandler);
  58933. if (SUtil.Util_env.os.tablet || SUtil.Util_env.os.phone) {
  58934. // mobile支持
  58935. root.removeEventListener('touchstart', this._touchstartHandler);
  58936. root.removeEventListener('touchmove', this._touchmoveHandler);
  58937. root.removeEventListener('touchend', this._touchendHandler);
  58938. } else {
  58939. // mobile的click自己模拟
  58940. root.removeEventListener('click', this._clickHandler);
  58941. root.removeEventListener('dblclick', this._dblclickHandler);
  58942. root.removeEventListener('mousewheel', this._mousewheelHandler);
  58943. root.removeEventListener('mousemove', this._mousemoveHandler);
  58944. root.removeEventListener('mousedown', this._mousedownHandler);
  58945. root.removeEventListener('mouseup', this._mouseupHandler);
  58946. }
  58947. root.removeEventListener('DOMMouseScroll', this._mousewheelHandler);
  58948. root.removeEventListener('mouseout', this._mouseoutHandler);
  58949. } else {
  58950. window.detachEvent('onresize', this._resizeHandler);
  58951. root.detachEvent('onclick', this._clickHandler);
  58952. root.detachEvent('dblclick', this._dblclickHandler);
  58953. root.detachEvent('onmousewheel', this._mousewheelHandler);
  58954. root.detachEvent('onmousemove', this._mousemoveHandler);
  58955. root.detachEvent('onmouseout', this._mouseoutHandler);
  58956. root.detachEvent('onmousedown', this._mousedownHandler);
  58957. root.detachEvent('onmouseup', this._mouseupHandler);
  58958. }
  58959. this.root = null;
  58960. this._domHover = null;
  58961. this.storage = null;
  58962. this.painter = null;
  58963. this.un();
  58964. }
  58965. /**
  58966. * Method: _processDragStart
  58967. * 拖拽开始。
  58968. *
  58969. * Parameters:
  58970. * event - {Object} 事件对象。
  58971. *
  58972. */
  58973. }, {
  58974. key: "_processDragStart",
  58975. value: function _processDragStart(event) {
  58976. var _lastHover = this._lastHover;
  58977. if (this._isMouseDown && _lastHover && _lastHover.draggable && !this._draggingTarget && this._mouseDownTarget == _lastHover) {
  58978. // 拖拽点击生效时长阀门,某些场景需要降低拖拽敏感度
  58979. if (_lastHover.dragEnableTime && new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime) {
  58980. return;
  58981. }
  58982. var _draggingTarget = _lastHover;
  58983. this._draggingTarget = _draggingTarget;
  58984. this._isDragging = 1;
  58985. _draggingTarget.invisible = true;
  58986. this.storage.mod(_draggingTarget.id); // 分发 Config.EVENT.DRAGSTART事件
  58987. this._dispatchAgency(_draggingTarget, Config.EVENT.DRAGSTART, event);
  58988. this.painter.refresh();
  58989. }
  58990. }
  58991. /**
  58992. * Method: _processDragEnter
  58993. * 拖拽进入目标元素。
  58994. *
  58995. * Parameters:
  58996. * event - {Object} 事件对象。
  58997. *
  58998. */
  58999. }, {
  59000. key: "_processDragEnter",
  59001. value: function _processDragEnter(event) {
  59002. if (this._draggingTarget) {
  59003. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  59004. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGENTER, event, this._draggingTarget);
  59005. }
  59006. }
  59007. /**
  59008. * Method: _processDragOver
  59009. * 拖拽在目标元素上移动。
  59010. *
  59011. * Parameters:
  59012. * event - {Object} 事件对象。
  59013. *
  59014. */
  59015. }, {
  59016. key: "_processDragOver",
  59017. value: function _processDragOver(event) {
  59018. if (this._draggingTarget) {
  59019. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGOVER事件
  59020. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGOVER, event, this._draggingTarget);
  59021. }
  59022. }
  59023. /**
  59024. * Method: _processDragLeave
  59025. * 拖拽离开目标元素。
  59026. *
  59027. * Parameters:
  59028. * event - {Object} 事件对象。
  59029. *
  59030. */
  59031. }, {
  59032. key: "_processDragLeave",
  59033. value: function _processDragLeave(event) {
  59034. if (this._draggingTarget) {
  59035. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  59036. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGLEAVE, event, this._draggingTarget);
  59037. }
  59038. }
  59039. /**
  59040. * Method: _processDrop
  59041. * 拖拽在目标元素上完成。
  59042. *
  59043. * Parameters:
  59044. * event - {Object} 事件对象。
  59045. *
  59046. */
  59047. }, {
  59048. key: "_processDrop",
  59049. value: function _processDrop(event) {
  59050. if (this._draggingTarget) {
  59051. this._draggingTarget.invisible = false;
  59052. this.storage.mod(this._draggingTarget.id);
  59053. this.painter.refresh(); // 分发SuperMap.LevelRenderer.Config.EVENT.DROP事件
  59054. this._dispatchAgency(this._lastHover, Config.EVENT.DROP, event, this._draggingTarget);
  59055. }
  59056. }
  59057. /**
  59058. * Method: _processDragEnd
  59059. * 拖拽结束。
  59060. *
  59061. * Parameters:
  59062. * event - {Object} 事件对象。
  59063. *
  59064. */
  59065. }, {
  59066. key: "_processDragEnd",
  59067. value: function _processDragEnd(event) {
  59068. if (this._draggingTarget) {
  59069. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGEND事件
  59070. this._dispatchAgency(this._draggingTarget, Config.EVENT.DRAGEND, event);
  59071. this._lastHover = null;
  59072. }
  59073. this._isDragging = 0;
  59074. this._draggingTarget = null;
  59075. }
  59076. /**
  59077. * Method: _processOverShape
  59078. * 鼠标在某个图形元素上移动。
  59079. *
  59080. * Parameters:
  59081. * event - {Object} 事件对象。
  59082. *
  59083. */
  59084. }, {
  59085. key: "_processOverShape",
  59086. value: function _processOverShape(event) {
  59087. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOVER事件
  59088. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOVER, event);
  59089. }
  59090. /**
  59091. * Method: _processOutShape
  59092. * 鼠标离开某个图形元素。
  59093. *
  59094. * Parameters:
  59095. * event - {Object} 事件对象。
  59096. *
  59097. */
  59098. }, {
  59099. key: "_processOutShape",
  59100. value: function _processOutShape(event) {
  59101. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  59102. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOUT, event);
  59103. }
  59104. /**
  59105. * Method: _dispatchAgency
  59106. * 鼠标离开某个图形元素。
  59107. *
  59108. * Parameters:
  59109. * targetShape - {Object} 目标图形元素。
  59110. * eventName - {Object} 事件名称。
  59111. * event - {Object} 事件对象。
  59112. * draggedShape - {Object} 拖拽事件特有,当前被拖拽图形元素。
  59113. *
  59114. */
  59115. }, {
  59116. key: "_dispatchAgency",
  59117. value: function _dispatchAgency(targetShape, eventName, event, draggedShape) {
  59118. var eventHandler = 'on' + eventName;
  59119. var eventPacket = {
  59120. type: eventName,
  59121. event: event,
  59122. target: targetShape,
  59123. cancelBubble: false
  59124. };
  59125. var el = targetShape;
  59126. if (draggedShape) {
  59127. eventPacket.dragged = draggedShape;
  59128. }
  59129. while (el) {
  59130. el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler](eventPacket));
  59131. el.dispatch(eventName, eventPacket);
  59132. el = el.parent;
  59133. if (eventPacket.cancelBubble) {
  59134. break;
  59135. }
  59136. }
  59137. if (targetShape) {
  59138. // 冒泡到顶级 zrender 对象
  59139. if (!eventPacket.cancelBubble) {
  59140. this.dispatch(eventName, eventPacket);
  59141. }
  59142. } else if (!draggedShape) {
  59143. // 无hover目标,无拖拽对象,原生事件分发
  59144. this.dispatch(eventName, {
  59145. type: eventName,
  59146. event: event
  59147. });
  59148. }
  59149. }
  59150. /**
  59151. * Method: _iterateAndFindHover
  59152. * 迭代寻找 hover shape。
  59153. *
  59154. */
  59155. }, {
  59156. key: "_iterateAndFindHover",
  59157. value: function _iterateAndFindHover() {
  59158. var invTransform = SUtil.Util_matrix.create();
  59159. var list = this.storage.getShapeList();
  59160. var currentZLevel;
  59161. var currentLayer;
  59162. var tmp = [0, 0];
  59163. for (var i = list.length - 1; i >= 0; i--) {
  59164. var shape = list[i];
  59165. if (currentZLevel !== shape.zlevel) {
  59166. currentLayer = this.painter.getLayer(shape.zlevel, currentLayer);
  59167. tmp[0] = this._mouseX;
  59168. tmp[1] = this._mouseY;
  59169. if (currentLayer.needTransform) {
  59170. SUtil.Util_matrix.invert(invTransform, currentLayer.transform);
  59171. SUtil.Util_vector.applyTransform(tmp, tmp, invTransform);
  59172. }
  59173. }
  59174. if (this._findHover(shape, tmp[0], tmp[1])) {
  59175. break;
  59176. }
  59177. }
  59178. }
  59179. /**
  59180. * Method: _mobildFindFixed
  59181. * touch 有指尖错觉,四向尝试,让touch上的点击更好触发事件。
  59182. *
  59183. * Parameters:
  59184. * event - {Object} 事件对象。
  59185. *
  59186. */
  59187. }, {
  59188. key: "_mobildFindFixed",
  59189. value: function _mobildFindFixed(event) {
  59190. // touch指尖错觉的尝试偏移量配置
  59191. var MOBILE_TOUCH_OFFSETS = [{
  59192. x: 10
  59193. }, {
  59194. x: -20
  59195. }, {
  59196. x: 10,
  59197. y: 10
  59198. }, {
  59199. y: -20
  59200. }];
  59201. this._lastHover = null;
  59202. this._mouseX = event.zrenderX;
  59203. this._mouseY = event.zrenderY;
  59204. this._event = event;
  59205. this._iterateAndFindHover();
  59206. for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length; i++) {
  59207. var offset = MOBILE_TOUCH_OFFSETS[i];
  59208. offset.x && (this._mouseX += offset.x);
  59209. offset.y && (this._mouseX += offset.y);
  59210. this._iterateAndFindHover();
  59211. }
  59212. if (this._lastHover) {
  59213. event.zrenderX = this._mouseX;
  59214. event.zrenderY = this._mouseY;
  59215. }
  59216. }
  59217. /**
  59218. * Method: _zrenderEventFixed
  59219. * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标 。
  59220. *
  59221. * Parameters:
  59222. * event - {Object} 事件。
  59223. * isTouch - {boolean} 是否触摸。
  59224. *
  59225. */
  59226. }, {
  59227. key: "_zrenderEventFixed",
  59228. value: function _zrenderEventFixed(event, isTouch) {
  59229. if (event.zrenderFixed) {
  59230. return event;
  59231. }
  59232. if (!isTouch) {
  59233. event = event || window.event; // 进入对象优先~
  59234. var target = event.toElement || event.relatedTarget || event.srcElement || event.target;
  59235. if (target && target != this._domHover) {
  59236. event.zrenderX = (typeof event.offsetX != 'undefined' ? event.offsetX : event.layerX) + target.offsetLeft;
  59237. event.zrenderY = (typeof event.offsetY != 'undefined' ? event.offsetY : event.layerY) + target.offsetTop;
  59238. }
  59239. } else {
  59240. var touch = event.type != 'touchend' ? event.targetTouches[0] : event.changedTouches[0];
  59241. if (touch) {
  59242. var rBounding = this.root.getBoundingClientRect(); // touch事件坐标是全屏的~
  59243. event.zrenderX = touch.clientX - rBounding.left;
  59244. event.zrenderY = touch.clientY - rBounding.top;
  59245. }
  59246. }
  59247. event.zrenderFixed = 1;
  59248. return event;
  59249. } // SMIC-方法扩展 - start
  59250. /**
  59251. * @function SuperMap.LevelRenderer.Handler.prototype.getLastHoverOne
  59252. * @description 获取单个高亮图形
  59253. */
  59254. }, {
  59255. key: "getLastHoverOne",
  59256. value: function getLastHoverOne() {
  59257. if (this._lastHover) {
  59258. return this._lastHover;
  59259. }
  59260. return null;
  59261. } // SMIC-方法扩展 - end
  59262. }]);
  59263. return Handler;
  59264. }(Eventful);
  59265. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Easing.js
  59266. function Easing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59267. 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); } }
  59268. function Easing_createClass(Constructor, protoProps, staticProps) { if (protoProps) Easing_defineProperties(Constructor.prototype, protoProps); if (staticProps) Easing_defineProperties(Constructor, staticProps); return Constructor; }
  59269. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  59270. * This program are made available under the terms of the Apache License, Version 2.0
  59271. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59272. /**
  59273. * @class SuperMap.LevelRenderer.Animation.easing
  59274. * @category Visualization Theme
  59275. * @classdesc 缓动
  59276. * @private
  59277. */
  59278. // 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js
  59279. // http://sole.github.io/tween.js/examples/03_graphs.html
  59280. var Easing = /*#__PURE__*/function () {
  59281. /**
  59282. * @function SuperMap.LevelRenderer.Animation.easing.constructor
  59283. * @description 构造函数。
  59284. */
  59285. function Easing() {
  59286. Easing_classCallCheck(this, Easing);
  59287. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.easing";
  59288. }
  59289. /**
  59290. * @function SuperMap.LevelRenderer.Animation.easing.destroy
  59291. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  59292. */
  59293. Easing_createClass(Easing, [{
  59294. key: "destroy",
  59295. value: function destroy() {}
  59296. /**
  59297. * @function SuperMap.LevelRenderer.Animation.easing.Linear
  59298. * @description 线性缓动
  59299. * @param {number} k - 参数
  59300. * @return {number} 输入值
  59301. */
  59302. }, {
  59303. key: "Linear",
  59304. value: function Linear(k) {
  59305. return k;
  59306. }
  59307. /**
  59308. * @function SuperMap.LevelRenderer.Animation.easing.QuadraticIn
  59309. * @description 二次方的缓动(t^2)
  59310. * @param {number} k - 参数
  59311. * @return {number} 二次方的缓动的值
  59312. */
  59313. }, {
  59314. key: "QuadraticIn",
  59315. value: function QuadraticIn(k) {
  59316. return k * k;
  59317. }
  59318. /**
  59319. * @function SuperMap.LevelRenderer.Animation.easing.QuadraticOut
  59320. * @description 返回按二次方缓动退出的值
  59321. * @param {number} k - 参数
  59322. * @return {number} 按二次方缓动退出的值
  59323. */
  59324. }, {
  59325. key: "QuadraticOut",
  59326. value: function QuadraticOut(k) {
  59327. return k * (2 - k);
  59328. }
  59329. /**
  59330. * @function SuperMap.LevelRenderer.Animation.easing.QuadraticInOut
  59331. * @description 返回按二次方缓动进入和退出的值
  59332. * @param {number} k - 参数
  59333. * @return {number} 按二次方缓动进入和退出的值
  59334. */
  59335. }, {
  59336. key: "QuadraticInOut",
  59337. value: function QuadraticInOut(k) {
  59338. if ((k *= 2) < 1) {
  59339. return 0.5 * k * k;
  59340. }
  59341. return -0.5 * (--k * (k - 2) - 1);
  59342. }
  59343. /**
  59344. * @function SuperMap.LevelRenderer.Animation.easing.CubicIn
  59345. * @description 三次方的缓动(t^3)
  59346. * @param {number} k - 参数
  59347. * @return {number} 按三次方缓动的值
  59348. */
  59349. }, {
  59350. key: "CubicIn",
  59351. value: function CubicIn(k) {
  59352. return k * k * k;
  59353. }
  59354. /**
  59355. * @function SuperMap.LevelRenderer.Animation.easing.CubicOut
  59356. * @description 返回按三次方缓动退出的值
  59357. * @param {number} k - 参数
  59358. * @return {number} 按三次方缓动退出的值
  59359. */
  59360. }, {
  59361. key: "CubicOut",
  59362. value: function CubicOut(k) {
  59363. return --k * k * k + 1;
  59364. }
  59365. /**
  59366. * @function SuperMap.LevelRenderer.Animation.easing.CubicInOut
  59367. * @description 返回按三次方缓动进入退出的值
  59368. * @param {number} k - 参数
  59369. * @return {number} 按三次方缓动进入退出的值
  59370. */
  59371. }, {
  59372. key: "CubicInOut",
  59373. value: function CubicInOut(k) {
  59374. if ((k *= 2) < 1) {
  59375. return 0.5 * k * k * k;
  59376. }
  59377. return 0.5 * ((k -= 2) * k * k + 2);
  59378. }
  59379. /**
  59380. * @function SuperMap.LevelRenderer.Animation.easing.QuarticIn
  59381. * @description 返回按四次方缓动进入的值
  59382. * @param {number} k - 参数
  59383. * @return {number} 按四次方缓动进入的值
  59384. */
  59385. }, {
  59386. key: "QuarticIn",
  59387. value: function QuarticIn(k) {
  59388. return k * k * k * k;
  59389. }
  59390. /**
  59391. * @function SuperMap.LevelRenderer.Animation.easing.QuarticOut
  59392. * @description 返回按四次方缓动退出的值
  59393. * @param {number} k - 参数
  59394. * @return {number} 按四次方缓动退出的值
  59395. */
  59396. }, {
  59397. key: "QuarticOut",
  59398. value: function QuarticOut(k) {
  59399. return 1 - --k * k * k * k;
  59400. }
  59401. /**
  59402. * @function SuperMap.LevelRenderer.Animation.easing.QuarticInOut
  59403. * @description 返回按四次方缓动进入退出的值
  59404. * @param {number} k - 参数
  59405. * @return {number} 按四次方缓动进入退出的值
  59406. */
  59407. }, {
  59408. key: "QuarticInOut",
  59409. value: function QuarticInOut(k) {
  59410. if ((k *= 2) < 1) {
  59411. return 0.5 * k * k * k * k;
  59412. }
  59413. return -0.5 * ((k -= 2) * k * k * k - 2);
  59414. } // 五次方的缓动(t^5)
  59415. /**
  59416. * @function SuperMap.LevelRenderer.Animation.easing.QuinticIn
  59417. * @description 返回按五次方缓动的值
  59418. * @param {number} k - 参数
  59419. * @return {number} 按五次方缓动的值
  59420. */
  59421. }, {
  59422. key: "QuinticIn",
  59423. value: function QuinticIn(k) {
  59424. return k * k * k * k * k;
  59425. }
  59426. /**
  59427. * @function SuperMap.LevelRenderer.Animation.easing.QuinticOut
  59428. * @description 返回按五次方缓动退出的值
  59429. * @param {number} k - 参数
  59430. * @return {number} 按五次方缓动退出的值
  59431. */
  59432. }, {
  59433. key: "QuinticOut",
  59434. value: function QuinticOut(k) {
  59435. return --k * k * k * k * k + 1;
  59436. }
  59437. /**
  59438. * @function SuperMap.LevelRenderer.Animation.easing.QuinticInOut
  59439. * @description 返回按五次方缓动进入退出的值
  59440. * @param {number} k - 参数
  59441. * @return {number} 按五次方缓动进入退出的值
  59442. */
  59443. }, {
  59444. key: "QuinticInOut",
  59445. value: function QuinticInOut(k) {
  59446. if ((k *= 2) < 1) {
  59447. return 0.5 * k * k * k * k * k;
  59448. }
  59449. return 0.5 * ((k -= 2) * k * k * k * k + 2);
  59450. } // 正弦曲线的缓动(sin(t))
  59451. /**
  59452. * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalIn
  59453. * @description 返回按正弦曲线的缓动进入的值
  59454. * @param {number} k - 参数
  59455. * @return {number} 按正弦曲线的缓动进入的值
  59456. */
  59457. }, {
  59458. key: "SinusoidalIn",
  59459. value: function SinusoidalIn(k) {
  59460. return 1 - Math.cos(k * Math.PI / 2);
  59461. }
  59462. /**
  59463. * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalOut
  59464. * @description 返回按正弦曲线的缓动退出的值
  59465. * @param {number} k - 参数
  59466. * @return {number} 按正弦曲线的缓动退出的值
  59467. */
  59468. }, {
  59469. key: "SinusoidalOut",
  59470. value: function SinusoidalOut(k) {
  59471. return Math.sin(k * Math.PI / 2);
  59472. }
  59473. /**
  59474. * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalInOut
  59475. * @description 返回按正弦曲线的缓动进入退出的值
  59476. * @param {number} k - 参数
  59477. * @return {number} 按正弦曲线的缓动进入退出的值
  59478. */
  59479. }, {
  59480. key: "SinusoidalInOut",
  59481. value: function SinusoidalInOut(k) {
  59482. return 0.5 * (1 - Math.cos(Math.PI * k));
  59483. } // 指数曲线的缓动(2^t)
  59484. /**
  59485. * @function SuperMap.LevelRenderer.Animation.easing.ExponentialIn
  59486. * @description 返回按指数曲线的缓动进入的值
  59487. * @param {number} k - 参数
  59488. * @return {number} 按指数曲线的缓动进入的值
  59489. */
  59490. }, {
  59491. key: "ExponentialIn",
  59492. value: function ExponentialIn(k) {
  59493. return k === 0 ? 0 : Math.pow(1024, k - 1);
  59494. }
  59495. /**
  59496. * @function SuperMap.LevelRenderer.Animation.easing.ExponentialOut
  59497. * @description 返回按指数曲线的缓动退出的值
  59498. * @param {number} k - 参数
  59499. * @return {number} 按指数曲线的缓动退出的值
  59500. */
  59501. }, {
  59502. key: "ExponentialOut",
  59503. value: function ExponentialOut(k) {
  59504. return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
  59505. }
  59506. /**
  59507. * @function SuperMap.LevelRenderer.Animation.easing.ExponentialInOut
  59508. * @description 返回按指数曲线的缓动进入退出的值
  59509. * @param {number} k - 参数
  59510. * @return {number} 按指数曲线的缓动进入退出的值
  59511. */
  59512. }, {
  59513. key: "ExponentialInOut",
  59514. value: function ExponentialInOut(k) {
  59515. if (k === 0) {
  59516. return 0;
  59517. }
  59518. if (k === 1) {
  59519. return 1;
  59520. }
  59521. if ((k *= 2) < 1) {
  59522. return 0.5 * Math.pow(1024, k - 1);
  59523. }
  59524. return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
  59525. } // 圆形曲线的缓动(sqrt(1-t^2))
  59526. /**
  59527. * @function SuperMap.LevelRenderer.Animation.easing.CircularIn
  59528. * @description 返回按圆形曲线的缓动进入的值
  59529. * @param {number} k - 参数
  59530. * @return {number} 按圆形曲线的缓动进入的值
  59531. */
  59532. }, {
  59533. key: "CircularIn",
  59534. value: function CircularIn(k) {
  59535. return 1 - Math.sqrt(1 - k * k);
  59536. }
  59537. /**
  59538. * @function SuperMap.LevelRenderer.Animation.easing.CircularOut
  59539. * @description 返回按圆形曲线的缓动退出的值
  59540. * @param {number} k - 参数
  59541. * @return {number} 按圆形曲线的缓动退出的值
  59542. */
  59543. }, {
  59544. key: "CircularOut",
  59545. value: function CircularOut(k) {
  59546. return Math.sqrt(1 - --k * k);
  59547. }
  59548. /**
  59549. * @function SuperMap.LevelRenderer.Animation.easing.CircularInOut
  59550. * @description 返回按圆形曲线的缓动进入退出的值
  59551. * @param {number} k - 参数
  59552. * @return {number} 按圆形曲线的缓动进入退出的值
  59553. */
  59554. }, {
  59555. key: "CircularInOut",
  59556. value: function CircularInOut(k) {
  59557. if ((k *= 2) < 1) {
  59558. return -0.5 * (Math.sqrt(1 - k * k) - 1);
  59559. }
  59560. return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
  59561. } // 创建类似于弹簧在停止前来回振荡的动画
  59562. /**
  59563. * @function SuperMap.LevelRenderer.Animation.easing.ElasticIn
  59564. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  59565. * @param {number} k - 参数
  59566. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  59567. */
  59568. }, {
  59569. key: "ElasticIn",
  59570. value: function ElasticIn(k) {
  59571. var s;
  59572. var a = 0.1;
  59573. var p = 0.4;
  59574. if (k === 0) {
  59575. return 0;
  59576. }
  59577. if (k === 1) {
  59578. return 1;
  59579. }
  59580. if (a < 1) {
  59581. a = 1;
  59582. s = p / 4;
  59583. } else {
  59584. s = p * Math.asin(1 / a) / (2 * Math.PI);
  59585. }
  59586. return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  59587. }
  59588. /**
  59589. * @function SuperMap.LevelRenderer.Animation.easing.ElasticOut
  59590. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  59591. * @param {number} k - 参数
  59592. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  59593. */
  59594. }, {
  59595. key: "ElasticOut",
  59596. value: function ElasticOut(k) {
  59597. var s;
  59598. var a = 0.1;
  59599. var p = 0.4;
  59600. if (k === 0) {
  59601. return 0;
  59602. }
  59603. if (k === 1) {
  59604. return 1;
  59605. }
  59606. if (a < 1) {
  59607. a = 1;
  59608. s = p / 4;
  59609. } else {
  59610. s = p * Math.asin(1 / a) / (2 * Math.PI);
  59611. }
  59612. return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;
  59613. }
  59614. /**
  59615. * @function SuperMap.LevelRenderer.Animation.easing.ElasticInOut
  59616. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  59617. * @param {number} k - 参数
  59618. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  59619. */
  59620. }, {
  59621. key: "ElasticInOut",
  59622. value: function ElasticInOut(k) {
  59623. var s;
  59624. var a = 0.1;
  59625. var p = 0.4;
  59626. if (k === 0) {
  59627. return 0;
  59628. }
  59629. if (k === 1) {
  59630. return 1;
  59631. }
  59632. if (a < 1) {
  59633. a = 1;
  59634. s = p / 4;
  59635. } else {
  59636. s = p * Math.asin(1 / a) / (2 * Math.PI);
  59637. }
  59638. if ((k *= 2) < 1) {
  59639. return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  59640. }
  59641. return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
  59642. } // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动
  59643. /**
  59644. * @function SuperMap.LevelRenderer.Animation.easing.BackIn
  59645. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  59646. * @param {number} k - 参数
  59647. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  59648. */
  59649. }, {
  59650. key: "BackIn",
  59651. value: function BackIn(k) {
  59652. var s = 1.70158;
  59653. return k * k * ((s + 1) * k - s);
  59654. }
  59655. /**
  59656. * @function SuperMap.LevelRenderer.Animation.easing.BackOut
  59657. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  59658. * @param {number} k - 参数
  59659. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  59660. */
  59661. }, {
  59662. key: "BackOut",
  59663. value: function BackOut(k) {
  59664. var s = 1.70158;
  59665. return --k * k * ((s + 1) * k + s) + 1;
  59666. }
  59667. /**
  59668. * @function SuperMap.LevelRenderer.Animation.easing.BackInOut
  59669. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  59670. * @param {number} k - 参数
  59671. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  59672. */
  59673. }, {
  59674. key: "BackInOut",
  59675. value: function BackInOut(k) {
  59676. var s = 1.70158 * 1.525;
  59677. if ((k *= 2) < 1) {
  59678. return 0.5 * (k * k * ((s + 1) * k - s));
  59679. }
  59680. return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
  59681. } // 创建弹跳效果
  59682. /**
  59683. * @function SuperMap.LevelRenderer.Animation.easing.BounceIn
  59684. * @description 返回按弹跳效果的缓动进入的值
  59685. * @param {number} k - 参数
  59686. * @return {number} 按弹跳效果的缓动进入的值
  59687. */
  59688. }, {
  59689. key: "BounceIn",
  59690. value: function BounceIn(k) {
  59691. return 1 - this.BounceOut(1 - k);
  59692. }
  59693. /**
  59694. * @function SuperMap.LevelRenderer.Animation.easing.BounceOut
  59695. * @description 返回按弹跳效果的缓动退出的值
  59696. * @param {number} k - 参数
  59697. * @return {number} 按弹跳效果的缓动退出的值
  59698. */
  59699. }, {
  59700. key: "BounceOut",
  59701. value: function BounceOut(k) {
  59702. if (k < 1 / 2.75) {
  59703. return 7.5625 * k * k;
  59704. } else if (k < 2 / 2.75) {
  59705. return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;
  59706. } else if (k < 2.5 / 2.75) {
  59707. return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;
  59708. } else {
  59709. return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;
  59710. }
  59711. }
  59712. /**
  59713. * @function SuperMap.LevelRenderer.Animation.easing.BounceInOut
  59714. * @description 返回按弹跳效果的缓动进入退出的值
  59715. * @param {number} k - 参数
  59716. * @return {number} 按弹跳效果的缓动进入退出的值
  59717. */
  59718. }, {
  59719. key: "BounceInOut",
  59720. value: function BounceInOut(k) {
  59721. if (k < 0.5) {
  59722. return this.BounceIn(k * 2) * 0.5;
  59723. }
  59724. return this.BounceOut(k * 2 - 1) * 0.5 + 0.5;
  59725. }
  59726. }]);
  59727. return Easing;
  59728. }();
  59729. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Clip.js
  59730. function Clip_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59731. 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); } }
  59732. function Clip_createClass(Constructor, protoProps, staticProps) { if (protoProps) Clip_defineProperties(Constructor.prototype, protoProps); if (staticProps) Clip_defineProperties(Constructor, staticProps); return Constructor; }
  59733. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  59734. * This program are made available under the terms of the Apache License, Version 2.0
  59735. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59736. /**
  59737. * @class SuperMap.LevelRenderer.Animation.Clip
  59738. * @category Visualization Theme
  59739. * @classdec 动画片段
  59740. * @private
  59741. */
  59742. var Clip_Clip = /*#__PURE__*/function () {
  59743. /**
  59744. * @function SuperMap.LevelRenderer.Animation.Clip.prototype.constructor
  59745. * @description 构造函数。
  59746. * @param {Object} options - 参数。
  59747. * @param {Object} options.target - 动画对象,可以是数组,如果是数组的话会批量分发 onframe 等事件。
  59748. * @param {number} [options.life=1000] - 动画时长。
  59749. * @param {number} [options.delay=0] - 动画延迟时间。
  59750. * @param {boolean} [options.loop=true] - 是否循环。
  59751. * @param {number} [options.gap=0] - 循环的间隔时间。
  59752. * @param {Object} options.onframe - 帧。
  59753. * @param {boolean} options.easing - 是否消除。
  59754. * @param {boolean} options.ondestroy - 是否销毁。
  59755. * @param {boolean} options.onrestart - 是否重播。
  59756. */
  59757. function Clip(options) {
  59758. Clip_classCallCheck(this, Clip);
  59759. this._targetPool = options.target || {};
  59760. if (!(this._targetPool instanceof Array)) {
  59761. this._targetPool = [this._targetPool];
  59762. } // 生命周期
  59763. this._life = options.life || 1000; // 延时
  59764. this._delay = options.delay || 0; // 开始时间
  59765. this._startTime = new Date().getTime() + this._delay; // 单位毫秒
  59766. // 结束时间
  59767. this._endTime = this._startTime + this._life * 1000; // 是否循环
  59768. this.loop = typeof options.loop == 'undefined' ? false : options.loop;
  59769. this.gap = options.gap || 0;
  59770. this.easing = options.easing || 'Linear';
  59771. this.onframe = options.onframe;
  59772. this.ondestroy = options.ondestroy;
  59773. this.onrestart = options.onrestart;
  59774. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Clip";
  59775. }
  59776. /**
  59777. * @function SuperMap.LevelRenderer.Animation.Clip.prototype.destroy
  59778. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  59779. */
  59780. Clip_createClass(Clip, [{
  59781. key: "destroy",
  59782. value: function destroy() {}
  59783. }, {
  59784. key: "step",
  59785. value: function step(time) {
  59786. var easing = new Easing();
  59787. var percent = (time - this._startTime) / this._life; // 还没开始
  59788. if (percent < 0) {
  59789. return;
  59790. }
  59791. percent = Math.min(percent, 1);
  59792. var easingFunc = typeof this.easing == 'string' ? easing[this.easing] : this.easing;
  59793. var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent;
  59794. this.fire('frame', schedule); // 结束
  59795. if (percent == 1) {
  59796. if (this.loop) {
  59797. this.restart(); // 重新开始周期
  59798. // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件
  59799. return 'restart';
  59800. } // 动画完成将这个控制器标识为待删除
  59801. // 在Animation.update中进行批量删除
  59802. this._needsRemove = true;
  59803. return 'destroy';
  59804. }
  59805. return null;
  59806. }
  59807. }, {
  59808. key: "restart",
  59809. value: function restart() {
  59810. var time = new Date().getTime();
  59811. var remainder = (time - this._startTime) % this._life;
  59812. this._startTime = new Date().getTime() - remainder + this.gap;
  59813. }
  59814. }, {
  59815. key: "fire",
  59816. value: function fire(eventType, arg) {
  59817. for (var i = 0, len = this._targetPool.length; i < len; i++) {
  59818. if (this['on' + eventType]) {
  59819. this['on' + eventType](this._targetPool[i], arg);
  59820. }
  59821. }
  59822. }
  59823. }]);
  59824. return Clip;
  59825. }();
  59826. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Animation.js
  59827. 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); }
  59828. function Animation_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59829. 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); } }
  59830. function Animation_createClass(Constructor, protoProps, staticProps) { if (protoProps) Animation_defineProperties(Constructor.prototype, protoProps); if (staticProps) Animation_defineProperties(Constructor, staticProps); return Constructor; }
  59831. 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); }
  59832. function Animation_setPrototypeOf(o, p) { Animation_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Animation_setPrototypeOf(o, p); }
  59833. 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); }; }
  59834. function Animation_possibleConstructorReturn(self, call) { if (call && (Animation_typeof(call) === "object" || typeof call === "function")) { return call; } return Animation_assertThisInitialized(self); }
  59835. function Animation_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  59836. 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; } }
  59837. function Animation_getPrototypeOf(o) { Animation_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Animation_getPrototypeOf(o); }
  59838. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  59839. * This program are made available under the terms of the Apache License, Version 2.0
  59840. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59841. /**
  59842. * @class SuperMap.LevelRenderer.Animation
  59843. * @classdesc 动画主类, 调度和管理所有动画控制器
  59844. * @category Visualization Theme
  59845. * @extends {SuperMap.LevelRenderer.Eventful}
  59846. * @private
  59847. */
  59848. var Animation_Animation = /*#__PURE__*/function (_Eventful) {
  59849. Animation_inherits(Animation, _Eventful);
  59850. var _super = Animation_createSuper(Animation);
  59851. /**
  59852. * @function SuperMap.LevelRenderer.Animation.prototype.constructor
  59853. * @description 构造函数。
  59854. * @param {Object} options - 动画参数。
  59855. * @param {Object} options.onframe - onframe。
  59856. * @param {Object} options.stage - stage。
  59857. * (start code)
  59858. * var animation = new SuperMap.LevelRenderer.Animation();
  59859. * var obj = {
  59860. * x: 100,
  59861. * y: 100
  59862. * };
  59863. * animation.animate(node.position)
  59864. * .when(1000, {
  59865. * x: 500,
  59866. * y: 500
  59867. * })
  59868. * .when(2000, {
  59869. * x: 100,
  59870. * y: 100
  59871. * })
  59872. * .start('spline');
  59873. * (end)
  59874. */
  59875. function Animation(options) {
  59876. var _this;
  59877. Animation_classCallCheck(this, Animation);
  59878. _this = _super.call(this, options);
  59879. options = options || {};
  59880. /**
  59881. * @member {Object} SuperMap.LevelRenderer.Animation.prototype.stage
  59882. * @description stage。
  59883. */
  59884. _this.stage = {};
  59885. /**
  59886. * @member {Object} SuperMap.LevelRenderer.Animation.prototype.onframe
  59887. * @description onframe。
  59888. */
  59889. _this.onframe = function () {};
  59890. /**
  59891. * @member {Array} SuperMap.LevelRenderer.Animation.prototype._clips
  59892. * @description _clips。
  59893. */
  59894. _this._clips = [];
  59895. /**
  59896. * @member {boolean} SuperMap.LevelRenderer.Animation.prototype._running
  59897. * @description _running。
  59898. */
  59899. _this._running = false;
  59900. /**
  59901. * @member {number} SuperMap.LevelRenderer.Animation.prototype._time
  59902. * @description _time。
  59903. */
  59904. _this._time = 0;
  59905. Util_Util.extend(Animation_assertThisInitialized(_this), options);
  59906. _this.CLASS_NAME = "SuperMap.LevelRenderer.Animation";
  59907. return _this;
  59908. }
  59909. /**
  59910. * @function SuperMap.LevelRenderer.Animation.prototype.add
  59911. * @description 添加动画片段。
  59912. * @param {SuperMap.LevelRenderer.Animation.Clip} clip - 动画片段。
  59913. */
  59914. Animation_createClass(Animation, [{
  59915. key: "add",
  59916. value: function add(clip) {
  59917. this._clips.push(clip);
  59918. }
  59919. /**
  59920. * @function SuperMap.LevelRenderer.Animation.prototype.remove
  59921. * @description 删除动画片段。
  59922. * @param {SuperMap.LevelRenderer.Animation.Clip} clip - 动画片段。
  59923. */
  59924. }, {
  59925. key: "remove",
  59926. value: function remove(clip) {
  59927. var idx = new levelRenderer_Util_Util().indexOf(this._clips, clip);
  59928. if (idx >= 0) {
  59929. this._clips.splice(idx, 1);
  59930. }
  59931. }
  59932. /**
  59933. * @function SuperMap.LevelRenderer.Animation.prototype.update
  59934. * @description 更新动画片段。
  59935. */
  59936. }, {
  59937. key: "_update",
  59938. value: function _update() {
  59939. var time = new Date().getTime();
  59940. var delta = time - this._time;
  59941. var clips = this._clips;
  59942. var len = clips.length;
  59943. var deferredEvents = [];
  59944. var deferredClips = [];
  59945. for (var i = 0; i < len; i++) {
  59946. var clip = clips[i];
  59947. var e = clip.step(time); // Throw out the events need to be called after
  59948. // stage.update, like destroy
  59949. if (e) {
  59950. deferredEvents.push(e);
  59951. deferredClips.push(clip);
  59952. }
  59953. }
  59954. if (this.stage.update) {
  59955. this.stage.update();
  59956. } // Remove the finished clip
  59957. for (var _i = 0; _i < len;) {
  59958. if (clips[_i]._needsRemove) {
  59959. clips[_i] = clips[len - 1];
  59960. clips.pop();
  59961. len--;
  59962. } else {
  59963. _i++;
  59964. }
  59965. }
  59966. len = deferredEvents.length;
  59967. for (var _i2 = 0; _i2 < len; _i2++) {
  59968. deferredClips[_i2].fire(deferredEvents[_i2]);
  59969. }
  59970. this._time = time;
  59971. this.onframe(delta);
  59972. this.dispatch('frame', delta);
  59973. }
  59974. /**
  59975. * @function SuperMap.LevelRenderer.Animation.prototype.start
  59976. * @description 开始运行动画。
  59977. */
  59978. }, {
  59979. key: "start",
  59980. value: function start() {
  59981. var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (func) {
  59982. setTimeout(func, 16);
  59983. };
  59984. var self = this;
  59985. this._running = true;
  59986. function step() {
  59987. if (self._running) {
  59988. self._update();
  59989. requestAnimationFrame(step);
  59990. }
  59991. }
  59992. this._time = new Date().getTime();
  59993. requestAnimationFrame(step);
  59994. }
  59995. /**
  59996. * @function SuperMap.LevelRenderer.Animation.prototype.stop
  59997. * @description 停止运行动画。
  59998. */
  59999. }, {
  60000. key: "stop",
  60001. value: function stop() {
  60002. this._running = false;
  60003. }
  60004. /**
  60005. * @function SuperMap.LevelRenderer.Animation.prototype.clear
  60006. * @description 清除所有动画片段。
  60007. */
  60008. }, {
  60009. key: "clear",
  60010. value: function clear() {
  60011. this._clips = [];
  60012. }
  60013. /**
  60014. * @function SuperMap.LevelRenderer.Animation.prototype.animate
  60015. * @description 对一个目标创建一个animator对象,可以指定目标中的属性使用动画。
  60016. * @param {Object} target - 目标对象。
  60017. * @param {Object} options - 动画参数选项。
  60018. * @param {boolean} [options.loop=false] - 是否循环播放动画。
  60019. * @param {function} [options.getter] - 如果指定getter函数,会通过getter函数取属性值。
  60020. * @param {function} [options.setter] - 如果指定setter函数,会通过setter函数设置属性值。
  60021. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator。
  60022. */
  60023. }, {
  60024. key: "animate",
  60025. value: function animate(target, options) {
  60026. options = options || {};
  60027. var deferred = new Animation_Animator(target, options.loop, options.getter, options.setter);
  60028. deferred.animation = this;
  60029. return deferred;
  60030. }
  60031. }], [{
  60032. key: "_interpolateNumber",
  60033. value: function _interpolateNumber(p0, p1, percent) {
  60034. return (p1 - p0) * percent + p0;
  60035. }
  60036. }, {
  60037. key: "_interpolateArray",
  60038. value: function _interpolateArray(p0, p1, percent, out, arrDim) {
  60039. var len = p0.length;
  60040. if (arrDim == 1) {
  60041. for (var i = 0; i < len; i++) {
  60042. out[i] = Animation._interpolateNumber(p0[i], p1[i], percent);
  60043. }
  60044. } else {
  60045. var len2 = p0[0].length;
  60046. for (var _i3 = 0; _i3 < len; _i3++) {
  60047. for (var j = 0; j < len2; j++) {
  60048. out[_i3][j] = Animation._interpolateNumber(p0[_i3][j], p1[_i3][j], percent);
  60049. }
  60050. }
  60051. }
  60052. }
  60053. }, {
  60054. key: "_isArrayLike",
  60055. value: function _isArrayLike(data) {
  60056. switch (Animation_typeof(data)) {
  60057. case 'undefined':
  60058. case 'string':
  60059. return false;
  60060. }
  60061. return typeof data.length !== 'undefined';
  60062. }
  60063. }, {
  60064. key: "_catmullRomInterpolateArray",
  60065. value: function _catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) {
  60066. var len = p0.length;
  60067. if (arrDim == 1) {
  60068. for (var i = 0; i < len; i++) {
  60069. out[i] = Animation._catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);
  60070. }
  60071. } else {
  60072. var len2 = p0[0].length;
  60073. for (var _i4 = 0; _i4 < len; _i4++) {
  60074. for (var j = 0; j < len2; j++) {
  60075. out[_i4][j] = Animation._catmullRomInterpolate(p0[_i4][j], p1[_i4][j], p2[_i4][j], p3[_i4][j], t, t2, t3);
  60076. }
  60077. }
  60078. }
  60079. }
  60080. }, {
  60081. key: "_catmullRomInterpolate",
  60082. value: function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {
  60083. var v0 = (p2 - p0) * 0.5;
  60084. var v1 = (p3 - p1) * 0.5;
  60085. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  60086. }
  60087. }, {
  60088. key: "_cloneValue",
  60089. value: function _cloneValue(value) {
  60090. var arraySlice = Array.prototype.slice;
  60091. if (Animation._isArrayLike(value)) {
  60092. var len = value.length;
  60093. if (Animation._isArrayLike(value[0])) {
  60094. var ret = [];
  60095. for (var i = 0; i < len; i++) {
  60096. ret.push(arraySlice.call(value[i]));
  60097. }
  60098. return ret;
  60099. } else {
  60100. return arraySlice.call(value);
  60101. }
  60102. } else {
  60103. return value;
  60104. }
  60105. }
  60106. }, {
  60107. key: "rgba2String",
  60108. value: function rgba2String(rgba) {
  60109. rgba[0] = Math.floor(rgba[0]);
  60110. rgba[1] = Math.floor(rgba[1]);
  60111. rgba[2] = Math.floor(rgba[2]);
  60112. return 'rgba(' + rgba.join(',') + ')';
  60113. }
  60114. }]);
  60115. return Animation;
  60116. }(Eventful);
  60117. /**
  60118. * @class SuperMap.LevelRenderer.Animation.Animator
  60119. */
  60120. var Animation_Animator = /*#__PURE__*/function () {
  60121. /**
  60122. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.animate
  60123. * @description 构造函数
  60124. * @param {Object} target - 目标对象。
  60125. * @param {Object} options - 动画参数选项。
  60126. * @param {boolean} [loop=false] - 是否循环播放动画。
  60127. * @param {function} [getterl] - 如果指定getter函数,会通过getter函数取属性值。
  60128. * @param {function} [setter] - 如果指定setter函数,会通过setter函数设置属性值。
  60129. */
  60130. function Animator(target, loop, getter, setter) {
  60131. Animation_classCallCheck(this, Animator);
  60132. /**
  60133. * @member {Object} SuperMap.LevelRenderer.Animation.Animator.prototype._tracks
  60134. * @description _tracks。
  60135. */
  60136. this._tracks = {};
  60137. /**
  60138. * @member {Object} SuperMap.LevelRenderer.Animation.Animator.prototype._target
  60139. * @description _target。
  60140. */
  60141. this._target = target;
  60142. /**
  60143. * @member {boolean} SuperMap.LevelRenderer.Animation.Animator.prototype._loop
  60144. * @description _loop。
  60145. */
  60146. this._loop = loop || false;
  60147. /**
  60148. * @member {function} SuperMap.LevelRenderer.Animation.Animator.prototype._getter
  60149. * @description _getter。
  60150. */
  60151. this._getter = getter || _defaultGetter;
  60152. /**
  60153. * @member {function} SuperMap.LevelRenderer.Animation.Animator.prototype._setter
  60154. * @description _setter。
  60155. */
  60156. this._setter = setter || _defaultSetter;
  60157. /**
  60158. * @member {number} SuperMap.LevelRenderer.Animation.Animator.prototype._clipCount
  60159. * @description _clipCount。
  60160. */
  60161. this._clipCount = 0;
  60162. /**
  60163. * @member {number} SuperMap.LevelRenderer.Animation.Animator.prototype._delay
  60164. * @description _delay。
  60165. */
  60166. this._delay = 0;
  60167. /**
  60168. * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._doneList
  60169. * @description _doneList。
  60170. */
  60171. this._doneList = [];
  60172. /**
  60173. * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._onframeList
  60174. * @description _onframeList。
  60175. */
  60176. this._onframeList = [];
  60177. /**
  60178. * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._clipList
  60179. * @description _clipList。
  60180. */
  60181. this._clipList = [];
  60182. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Animator"; //Function
  60183. function _defaultGetter(target, key) {
  60184. return target[key];
  60185. }
  60186. function _defaultSetter(target, key, value) {
  60187. target[key] = value;
  60188. }
  60189. }
  60190. /**
  60191. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.when
  60192. * @description 设置动画关键帧
  60193. * @param {number} time - 关键帧时间,单位是ms
  60194. * @param {Object} props - 关键帧的属性值,key-value表示
  60195. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  60196. */
  60197. Animation_createClass(Animator, [{
  60198. key: "when",
  60199. value: function when(time
  60200. /* ms */
  60201. , props) {
  60202. for (var propName in props) {
  60203. if (!this._tracks[propName]) {
  60204. this._tracks[propName] = []; // If time is 0
  60205. // Then props is given initialize value
  60206. // Else
  60207. // Initialize value from current prop value
  60208. if (time !== 0) {
  60209. this._tracks[propName].push({
  60210. time: 0,
  60211. value: Animation_Animation._cloneValue(this._getter(this._target, propName))
  60212. });
  60213. }
  60214. }
  60215. this._tracks[propName].push({
  60216. time: parseInt(time, 10),
  60217. value: props[propName]
  60218. });
  60219. }
  60220. return this;
  60221. }
  60222. /**
  60223. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.during
  60224. * @description 添加动画每一帧的回调函数
  60225. * @param {RequestCallback} callback - 回调函数
  60226. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  60227. */
  60228. }, {
  60229. key: "during",
  60230. value: function during(callback) {
  60231. this._onframeList.push(callback);
  60232. return this;
  60233. }
  60234. /**
  60235. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.start
  60236. * @description 开始执行动画
  60237. * @param {(string|function)} easing - 动画缓动函数。详见:<{@link SuperMap.LevelRenderer.Animation.easing}>。
  60238. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  60239. */
  60240. }, {
  60241. key: "start",
  60242. value: function start(easing) {
  60243. var self = this;
  60244. var setter = this._setter;
  60245. var getter = this._getter;
  60246. var onFrameListLen = self._onframeList.length;
  60247. var useSpline = easing === 'spline';
  60248. var ondestroy = function ondestroy() {
  60249. self._clipCount--;
  60250. if (self._clipCount === 0) {
  60251. // Clear all tracks
  60252. self._tracks = {};
  60253. var len = self._doneList.length;
  60254. for (var i = 0; i < len; i++) {
  60255. self._doneList[i].call(self);
  60256. }
  60257. }
  60258. };
  60259. var createTrackClip = function createTrackClip(keyframes, propName) {
  60260. var trackLen = keyframes.length;
  60261. if (!trackLen) {
  60262. return;
  60263. } // Guess data type
  60264. var firstVal = keyframes[0].value;
  60265. var isValueArray = Animation_Animation._isArrayLike(firstVal);
  60266. var isValueColor = false; // For vertices morphing
  60267. var arrDim = isValueArray && Animation_Animation._isArrayLike(firstVal[0]) ? 2 : 1; // Sort keyframe as ascending
  60268. keyframes.sort(function (a, b) {
  60269. return a.time - b.time;
  60270. });
  60271. var trackMaxTime = keyframes[trackLen - 1].time; // Percents of each keyframe
  60272. var kfPercents = []; // Value of each keyframe
  60273. var kfValues = [];
  60274. for (var _i5 = 0; _i5 < trackLen; _i5++) {
  60275. kfPercents.push(keyframes[_i5].time / trackMaxTime); // Assume value is a color when it is a string
  60276. var value = keyframes[_i5].value;
  60277. if (typeof value == 'string') {
  60278. value = SUtil.Util_color.toArray(value);
  60279. if (value.length === 0) {
  60280. // Invalid color
  60281. value[0] = value[1] = value[2] = 0;
  60282. value[3] = 1;
  60283. }
  60284. isValueColor = true;
  60285. }
  60286. kfValues.push(value);
  60287. } // Cache the key of last frame to speed up when
  60288. // animation playback is sequency
  60289. var cacheKey = 0;
  60290. var cachePercent = 0;
  60291. var start;
  60292. var i;
  60293. var w;
  60294. var p0;
  60295. var p1;
  60296. var p2;
  60297. var p3;
  60298. if (isValueColor) {
  60299. var rgba = [0, 0, 0, 0];
  60300. }
  60301. var onframe = function onframe(target, percent) {
  60302. // Find the range keyframes
  60303. // kf1-----kf2---------current--------kf3
  60304. // find kf2 and kf3 and do interpolation
  60305. if (percent < cachePercent) {
  60306. // Start from next key
  60307. start = Math.min(cacheKey + 1, trackLen - 1);
  60308. for (i = start; i >= 0; i--) {
  60309. if (kfPercents[i] <= percent) {
  60310. break;
  60311. }
  60312. }
  60313. i = Math.min(i, trackLen - 2);
  60314. } else {
  60315. for (i = cacheKey; i < trackLen; i++) {
  60316. if (kfPercents[i] > percent) {
  60317. break;
  60318. }
  60319. }
  60320. i = Math.min(i - 1, trackLen - 2);
  60321. }
  60322. cacheKey = i;
  60323. cachePercent = percent;
  60324. var range = kfPercents[i + 1] - kfPercents[i];
  60325. if (range === 0) {
  60326. return;
  60327. } else {
  60328. w = (percent - kfPercents[i]) / range;
  60329. }
  60330. if (useSpline) {
  60331. p1 = kfValues[i];
  60332. p0 = kfValues[i === 0 ? i : i - 1];
  60333. p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1];
  60334. p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2];
  60335. if (isValueArray) {
  60336. Animation_Animation._catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim);
  60337. } else {
  60338. var _value;
  60339. if (isValueColor) {
  60340. // value = SuperMap.LevelRenderer.Animation._catmullRomInterpolateArray(
  60341. // p0, p1, p2, p3, w, w * w, w * w * w,
  60342. // rgba, 1
  60343. // );
  60344. _value = Animation_Animation.rgba2String(rgba);
  60345. } else {
  60346. _value = Animation_Animation._catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);
  60347. }
  60348. setter(target, propName, _value);
  60349. }
  60350. } else {
  60351. if (isValueArray) {
  60352. Animation_Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim);
  60353. } else {
  60354. var _value2;
  60355. if (isValueColor) {
  60356. Animation_Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, rgba, 1);
  60357. _value2 = Animation_Animation.rgba2String(rgba);
  60358. } else {
  60359. _value2 = Animation_Animation._interpolateNumber(kfValues[i], kfValues[i + 1], w);
  60360. }
  60361. setter(target, propName, _value2);
  60362. }
  60363. }
  60364. for (i = 0; i < onFrameListLen; i++) {
  60365. self._onframeList[i](target, percent);
  60366. }
  60367. };
  60368. var clip = new Clip_Clip({
  60369. target: self._target,
  60370. life: trackMaxTime,
  60371. loop: self._loop,
  60372. delay: self._delay,
  60373. onframe: onframe,
  60374. ondestroy: ondestroy
  60375. });
  60376. if (easing && easing !== 'spline') {
  60377. clip.easing = easing;
  60378. }
  60379. self._clipList.push(clip);
  60380. self._clipCount++;
  60381. self.animation.add(clip);
  60382. };
  60383. for (var propName in this._tracks) {
  60384. createTrackClip(this._tracks[propName], propName);
  60385. }
  60386. return this;
  60387. }
  60388. /**
  60389. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.stop
  60390. * @description 停止动画
  60391. */
  60392. }, {
  60393. key: "stop",
  60394. value: function stop() {
  60395. for (var i = 0; i < this._clipList.length; i++) {
  60396. var clip = this._clipList[i];
  60397. this.animation.remove(clip);
  60398. }
  60399. this._clipList = [];
  60400. }
  60401. /**
  60402. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.delay
  60403. * @description 设置动画延迟开始的时间
  60404. * @param {number} time - 时间,单位ms
  60405. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  60406. */
  60407. }, {
  60408. key: "delay",
  60409. value: function delay(time) {
  60410. this._delay = time;
  60411. return this;
  60412. }
  60413. /**
  60414. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.done
  60415. * @description 添加动画结束的回调
  60416. * @param {function} cb - Function
  60417. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  60418. */
  60419. }, {
  60420. key: "done",
  60421. value: function done(cb) {
  60422. if (cb) {
  60423. this._doneList.push(cb);
  60424. }
  60425. return this;
  60426. }
  60427. }]);
  60428. return Animator;
  60429. }();
  60430. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Render.js
  60431. function Render_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60432. 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); } }
  60433. function Render_createClass(Constructor, protoProps, staticProps) { if (protoProps) Render_defineProperties(Constructor.prototype, protoProps); if (staticProps) Render_defineProperties(Constructor, staticProps); return Constructor; }
  60434. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  60435. * This program are made available under the terms of the Apache License, Version 2.0
  60436. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60437. /**
  60438. * @private
  60439. * @class SuperMap.LevelRenderer.Render
  60440. * @category Visualization Theme
  60441. * @classdesc Render 接口类,对外可用的所有接口都在这里。内部使用非 get 接口统一返回 this 对象,支持链式调用。
  60442. */
  60443. var Render_Render = /*#__PURE__*/function () {
  60444. /**
  60445. * @function SuperMap.LevelRenderer.Render.constructor
  60446. * @description 构造函数。
  60447. *
  60448. * @param {string} id - 唯一标识。
  60449. * @param {HTMLElement} dom - Dom 对象。
  60450. */
  60451. function Render(id, dom) {
  60452. Render_classCallCheck(this, Render);
  60453. /**
  60454. * @member {string} SuperMap.LevelRenderer.Render.prototype.id
  60455. * @description 唯一标识。
  60456. */
  60457. this.id = id;
  60458. /**
  60459. * @member {SuperMap.LevelRenderer.Storage} SuperMap.LevelRenderer.Render.prototype.storage
  60460. * @description 图形仓库对象。
  60461. */
  60462. this.storage = new Storage_Storage();
  60463. /**
  60464. * @member {SuperMap.LevelRenderer.Painter} SuperMap.LevelRenderer.Render.prototype.painter
  60465. * @description 绘制器对象。
  60466. *
  60467. */
  60468. this.painter = new Painter_Painter(dom, this.storage);
  60469. /**
  60470. * @member {SuperMap.LevelRenderer.Handler} SuperMap.LevelRenderer.Render.prototype.handler
  60471. * @description 事件处理对象。
  60472. *
  60473. */
  60474. this.handler = new Handler_Handler(dom, this.storage, this.painter);
  60475. /**
  60476. * @member {Array} SuperMap.LevelRenderer.Render.prototype.animatingElements
  60477. * @description 动画控制数组。
  60478. *
  60479. */
  60480. this.animatingElements = [];
  60481. /**
  60482. * @member {SuperMap.LevelRenderer.animation.Animation} SuperMap.LevelRenderer.Render.prototype.animation
  60483. * @description 动画对象。
  60484. *
  60485. */
  60486. this.animation = new Animation_Animation({
  60487. stage: {
  60488. update: Render.getFrameCallback(this)
  60489. }
  60490. });
  60491. /**
  60492. * @member {boolean} SuperMap.LevelRenderer.Render.prototype._needsRefreshNextFrame
  60493. * @description 是否需要刷新下一帧。
  60494. *
  60495. */
  60496. this._needsRefreshNextFrame = false;
  60497. this.animation.start();
  60498. this.CLASS_NAME = "SuperMap.LevelRenderer.Render";
  60499. }
  60500. /**
  60501. * @function SuperMap.LevelRenderer.Render.prototype.destory
  60502. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  60503. */
  60504. Render_createClass(Render, [{
  60505. key: "destroy",
  60506. value: function destroy() {
  60507. this.id = null;
  60508. this.storage = null;
  60509. this.painter = null;
  60510. this.handler = null;
  60511. this.animatingElements = null;
  60512. this.animation = null;
  60513. this._needsRefreshNextFrame = null;
  60514. }
  60515. /**
  60516. * @function SuperMap.LevelRenderer.Render.prototype.getId
  60517. * @description 获取实例唯一标识。
  60518. * @return {string} 实例唯一标识。
  60519. */
  60520. }, {
  60521. key: "getId",
  60522. value: function getId() {
  60523. return this.id;
  60524. }
  60525. /**
  60526. * @function SuperMap.LevelRenderer.Render.prototype.addShape
  60527. * @description 添加图形形状到根节点。
  60528. *
  60529. * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象,可用属性全集,详见各 shape。
  60530. * @return {SuperMap.LevelRenderer.Render} this。
  60531. */
  60532. }, {
  60533. key: "addShape",
  60534. value: function addShape(shape) {
  60535. this.storage.addRoot(shape);
  60536. return this;
  60537. }
  60538. /**
  60539. * @function SuperMap.LevelRenderer.Render.prototype.addGroup
  60540. * @description 添加组到根节点。
  60541. *
  60542. * (code)
  60543. * //添加组到根节点例子
  60544. * var render = new SuperMap.LevelRenderer.Render("Render",document.getElementById('lRendertest'));
  60545. * render.clear();
  60546. * var g = new SuperMap.LevelRenderer.Group();
  60547. * g.addChild(new SuperMap.LevelRenderer.Shape.Circle({
  60548. * style: {
  60549. * x: 100,
  60550. * y: 100,
  60551. * r: 20,
  60552. * brushType: 'fill'
  60553. * }
  60554. * }));
  60555. * render.addGroup(g);
  60556. * render.render();
  60557. * (end)
  60558. *
  60559. * @param {SuperMap.LevelRenderer.Group} group - 组对象。
  60560. * @return {SuperMap.LevelRenderer.Render} this。
  60561. */
  60562. }, {
  60563. key: "addGroup",
  60564. value: function addGroup(group) {
  60565. this.storage.addRoot(group);
  60566. return this;
  60567. }
  60568. /**
  60569. * @function SuperMap.LevelRenderer.Render.prototype.delShape
  60570. * @description 从根节点删除图形形状。
  60571. *
  60572. * @param {string} shapeId - 图形对象唯一标识。
  60573. * @return {SuperMap.LevelRenderer.Render} this。
  60574. */
  60575. }, {
  60576. key: "delShape",
  60577. value: function delShape(shapeId) {
  60578. this.storage.delRoot(shapeId);
  60579. return this;
  60580. }
  60581. /**
  60582. * @function SuperMap.LevelRenderer.Render.prototype.delGroup
  60583. * @description 从根节点删除组。
  60584. *
  60585. * @param {string} groupId - 组对象唯一标识。
  60586. * @return {SuperMap.LevelRenderer.Render} this。
  60587. */
  60588. }, {
  60589. key: "delGroup",
  60590. value: function delGroup(groupId) {
  60591. this.storage.delRoot(groupId);
  60592. return this;
  60593. }
  60594. /**
  60595. * @function SuperMap.LevelRenderer.Render.prototype.modShape
  60596. * @description 修改图形形状。
  60597. *
  60598. * @param {string} shapeId - 图形对象唯一标识。
  60599. * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象。
  60600. * @return {SuperMap.LevelRenderer.Render} this。
  60601. */
  60602. }, {
  60603. key: "modShape",
  60604. value: function modShape(shapeId, shape) {
  60605. this.storage.mod(shapeId, shape);
  60606. return this;
  60607. }
  60608. /**
  60609. * @function SuperMap.LevelRenderer.Render.prototype.modGroup
  60610. * @description 修改组。
  60611. *
  60612. * @param {string} groupId - 组对象唯一标识。
  60613. * @param {SuperMap.LevelRenderer.Group} group - 组对象。
  60614. * @return {SuperMap.LevelRenderer.Render} this。
  60615. */
  60616. }, {
  60617. key: "modGroup",
  60618. value: function modGroup(groupId, group) {
  60619. this.storage.mod(groupId, group);
  60620. return this;
  60621. }
  60622. /**
  60623. * @function SuperMap.LevelRenderer.Render.prototype.modLayer
  60624. * @description 修改指定 zlevel 的绘制配置项。
  60625. *
  60626. * @param {string} zLevel - 组对象唯一标识。
  60627. * @param {Object} config - 配置对象。
  60628. * @param {string} clearColor - 每次清空画布的颜色。默认值:0。
  60629. * @param {noolean} motionBlur - 是否开启动态模糊。默认值:false。
  60630. * @param {number} lastFrameAlpha - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  60631. * @param {Array.<number>} position - 层的平移。
  60632. * @param {Array.<number>} rotation - 层的旋转。
  60633. * @param {Array.<number>} scale - 层的缩放。
  60634. * @param {boolean} zoomable - 层是否支持鼠标缩放操作。默认值:false。
  60635. * @param {boolean} panable - 层是否支持鼠标平移操作。默认值:false。
  60636. * @return {SuperMap.LevelRenderer.Render} this。
  60637. */
  60638. }, {
  60639. key: "modLayer",
  60640. value: function modLayer(zLevel, config) {
  60641. this.painter.modLayer(zLevel, config);
  60642. return this;
  60643. }
  60644. /**
  60645. * @function SuperMap.LevelRenderer.Render.prototype.addHoverShape
  60646. * @description 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空。
  60647. *
  60648. * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象。
  60649. * @return {SuperMap.LevelRenderer.Render} this。
  60650. */
  60651. }, {
  60652. key: "addHoverShape",
  60653. value: function addHoverShape(shape) {
  60654. this.storage.addHover(shape);
  60655. return this;
  60656. }
  60657. /**
  60658. * @function SuperMap.LevelRenderer.Render.prototype.render
  60659. * @description 渲染。
  60660. *
  60661. * @callback {Function} callback - 渲染结束后回调函数。
  60662. * @return {SuperMap.LevelRenderer.Render} this。
  60663. */
  60664. }, {
  60665. key: "render",
  60666. value: function render(callback) {
  60667. this.painter.render(callback);
  60668. this._needsRefreshNextFrame = false;
  60669. return this;
  60670. }
  60671. /**
  60672. * @function SuperMap.LevelRenderer.Render.prototype.refresh
  60673. * @description 视图更新。
  60674. *
  60675. * @callback {Function} callback - 视图更新后回调函数。
  60676. * @return {SuperMap.LevelRenderer.Render} this。
  60677. */
  60678. }, {
  60679. key: "refresh",
  60680. value: function refresh(callback) {
  60681. this.painter.refresh(callback);
  60682. this._needsRefreshNextFrame = false;
  60683. return this;
  60684. }
  60685. /**
  60686. * @function SuperMap.LevelRenderer.Render.prototype.refreshNextFrame
  60687. * @description 标记视图在浏览器下一帧需要绘制。
  60688. * @return {SuperMap.LevelRenderer.Render} this。
  60689. */
  60690. }, {
  60691. key: "refreshNextFrame",
  60692. value: function refreshNextFrame() {
  60693. this._needsRefreshNextFrame = true;
  60694. return this;
  60695. }
  60696. /**
  60697. * @function SuperMap.LevelRenderer.Render.prototype.refreshHover
  60698. * @description 绘制(视图更新)高亮层。
  60699. * @callback {Function} callback - 视图更新后回调函数。
  60700. * @return {SuperMap.LevelRenderer.Render} this。
  60701. */
  60702. }, {
  60703. key: "refreshHover",
  60704. value: function refreshHover(callback) {
  60705. this.painter.refreshHover(callback);
  60706. return this;
  60707. }
  60708. /**
  60709. * @function SuperMap.LevelRenderer.Render.prototype.refreshShapes
  60710. * @description 视图更新。
  60711. *
  60712. * @param {Array.<SuperMap.LevelRenderer.Shape>} shapeList - 需要更新的图形列表。
  60713. * @callback {Function} callback - 视图更新后回调函数。
  60714. * @return {SuperMap.LevelRenderer.Render} this。
  60715. */
  60716. }, {
  60717. key: "refreshShapes",
  60718. value: function refreshShapes(shapeList, callback) {
  60719. this.painter.refreshShapes(shapeList, callback);
  60720. return this;
  60721. }
  60722. /**
  60723. * @function SuperMap.LevelRenderer.Render.prototype.resize
  60724. * @description 调整视图大小。
  60725. * @return {SuperMap.LevelRenderer.Render} this。
  60726. */
  60727. }, {
  60728. key: "resize",
  60729. value: function resize() {
  60730. this.painter.resize();
  60731. return this;
  60732. }
  60733. /**
  60734. * @function SuperMap.LevelRenderer.Render.prototype.animate
  60735. * @description 动画。
  60736. *
  60737. * @example
  60738. * zr.animate(circle.id, 'style', false)
  60739. * .when(1000, {x: 10} )
  60740. * .done(function(){ // Animation done })
  60741. * .start()
  60742. *
  60743. *
  60744. * @param {Array.<(SuperMap.LevelRenderer.Shape/SuperMap.LevelRenderer.Group)>} el - 动画对象。
  60745. * @param {string} path - 需要添加动画的属性获取路径,可以通过 a.b.c 来获取深层的属性。若传入对象为<SuperMap.LevelRenderer.Group>,path需为空字符串。
  60746. * @param {Function} loop - 动画是否循环。
  60747. * @return {SuperMap.LevelRenderer.animation.Animator} Animator。
  60748. */
  60749. }, {
  60750. key: "animate",
  60751. value: function animate(el, path, loop) {
  60752. if (typeof el === 'string') {
  60753. el = this.storage.get(el);
  60754. }
  60755. if (el) {
  60756. var target;
  60757. if (path) {
  60758. var pathSplitted = path.split('.');
  60759. var prop = el;
  60760. for (var i = 0, l = pathSplitted.length; i < l; i++) {
  60761. if (!prop) {
  60762. continue;
  60763. }
  60764. prop = prop[pathSplitted[i]];
  60765. }
  60766. if (prop) {
  60767. target = prop;
  60768. }
  60769. } else {
  60770. target = el;
  60771. }
  60772. if (!target) {
  60773. SUtil.Util_log('Property "' + path + '" is not existed in element ' + el.id);
  60774. return;
  60775. }
  60776. var animatingElements = this.animatingElements;
  60777. if (typeof el.__aniCount === 'undefined') {
  60778. // 正在进行的动画记数
  60779. el.__aniCount = 0;
  60780. }
  60781. if (el.__aniCount === 0) {
  60782. animatingElements.push(el);
  60783. }
  60784. el.__aniCount++;
  60785. return this.animation.animate(target, {
  60786. loop: loop
  60787. }).done(function () {
  60788. el.__aniCount--;
  60789. if (el.__aniCount === 0) {
  60790. // 从animatingElements里移除
  60791. var idx = new levelRenderer_Util_Util().indexOf(animatingElements, el);
  60792. animatingElements.splice(idx, 1);
  60793. }
  60794. });
  60795. } else {
  60796. SUtil.Util_log('Element not existed');
  60797. }
  60798. }
  60799. /**
  60800. * @function SuperMap.LevelRenderer.Render.prototype.clearAnimation
  60801. * @description 停止所有动画。
  60802. *
  60803. */
  60804. }, {
  60805. key: "clearAnimation",
  60806. value: function clearAnimation() {
  60807. this.animation.clear();
  60808. }
  60809. /**
  60810. * @function SuperMap.LevelRenderer.Render.prototype.getWidth
  60811. * @description 获取视图宽度。
  60812. * @return {number} 视图宽度。
  60813. */
  60814. }, {
  60815. key: "getWidth",
  60816. value: function getWidth() {
  60817. return this.painter.getWidth();
  60818. }
  60819. /**
  60820. * @function SuperMap.LevelRenderer.Render.prototype.getHeight
  60821. * @description 获取视图高度。
  60822. * @return {number} 视图高度。
  60823. */
  60824. }, {
  60825. key: "getHeight",
  60826. value: function getHeight() {
  60827. return this.painter.getHeight();
  60828. }
  60829. /**
  60830. * @function SuperMap.LevelRenderer.Render.prototype.toDataURL
  60831. * @description 图像导出。
  60832. *
  60833. * @param {string} type - 类型。
  60834. * @param {string} backgroundColor - 背景色,默认值:"#FFFFFF"。
  60835. * @param {string} args - 参数。
  60836. * @return {string} 图片的 Base64 url。
  60837. */
  60838. }, {
  60839. key: "toDataURL",
  60840. value: function toDataURL(type, backgroundColor, args) {
  60841. return this.painter.toDataURL(type, backgroundColor, args);
  60842. }
  60843. /**
  60844. * @function SuperMap.LevelRenderer.Render.prototype.shapeToImage
  60845. * @description 将常规 shape 转成 image shape。
  60846. *
  60847. * @param {SuperMap.LevelRenderer.Shape} e - 图形。
  60848. * @param {number} width - 宽度。
  60849. * @param {number} height - 高度。
  60850. * @return {Object} image shape。
  60851. */
  60852. }, {
  60853. key: "shapeToImage",
  60854. value: function shapeToImage(e, width, height) {
  60855. var id = Util_Util.createUniqueID("SuperMap.LevelRenderer.ToImage_");
  60856. return this.painter.shapeToImage(id, e, width, height);
  60857. }
  60858. /**
  60859. * @function SuperMap.LevelRenderer.Render.prototype.on
  60860. * @description 事件绑定。
  60861. *
  60862. * @param {string} eventName - 事件名称。
  60863. * @param {Function} eventHandler - 响应函数。
  60864. * @return {SuperMap.LevelRenderer.Render} this。
  60865. */
  60866. }, {
  60867. key: "on",
  60868. value: function on(eventName, eventHandler) {
  60869. this.handler.on(eventName, eventHandler);
  60870. return this;
  60871. }
  60872. /**
  60873. * @function SuperMap.LevelRenderer.Render.prototype.un
  60874. * @description 事件解绑定,参数为空则解绑所有自定义事件。
  60875. *
  60876. * @param {string} eventName - 事件名称。
  60877. * @param {Function} eventHandler - 响应函数。
  60878. * @return {SuperMap.LevelRenderer.Render} this。
  60879. */
  60880. }, {
  60881. key: "un",
  60882. value: function un(eventName, eventHandler) {
  60883. this.handler.un(eventName, eventHandler);
  60884. return this;
  60885. }
  60886. /**
  60887. * @function SuperMap.LevelRenderer.Render.prototype.trigger
  60888. * @description 事件触发。
  60889. *
  60890. * @param {string} eventName - 事件名称,resize,hover,drag,etc。
  60891. * @param {event} event - event dom事件对象。
  60892. * @return {SuperMap.LevelRenderer.Render} this。
  60893. */
  60894. }, {
  60895. key: "trigger",
  60896. value: function trigger(eventName, event) {
  60897. this.handler.trigger(eventName, event);
  60898. this.handler.dispatch(eventName, event);
  60899. return this;
  60900. }
  60901. /**
  60902. * @function SuperMap.LevelRenderer.Render.prototype.clear
  60903. * @description 清除当前 Render 下所有类图的数据和显示,clear 后 MVC 和已绑定事件均还存在在,Render 可用。
  60904. * @return {SuperMap.LevelRenderer.Render} this。
  60905. */
  60906. }, {
  60907. key: "clear",
  60908. value: function clear() {
  60909. this.storage.delRoot();
  60910. this.painter.clear();
  60911. return this;
  60912. }
  60913. /**
  60914. * @function SuperMap.LevelRenderer.Render.prototype.dispose
  60915. * @description 释放当前 Render 实例(删除包括 dom,数据、显示和事件绑定),dispose后 Render 不可用。
  60916. */
  60917. }, {
  60918. key: "dispose",
  60919. value: function dispose() {
  60920. this.animation.stop();
  60921. this.clear();
  60922. this.storage.dispose();
  60923. this.painter.dispose();
  60924. this.handler.dispose();
  60925. this.animation = null;
  60926. this.animatingElements = null;
  60927. this.storage = null;
  60928. this.painter = null;
  60929. this.handler = null; // 释放后告诉全局删除对自己的索引,没想到啥好方法
  60930. // zrender.delInstance(this.id);
  60931. } // SMIC-方法扩展 - start
  60932. /**
  60933. * @function SuperMap.LevelRenderer.Render.prototype.updateHoverShapes
  60934. * @description 更新设置显示高亮图层。
  60935. *
  60936. * @param {Array.<SuperMap.LevelRenderer.Shape>} shapes - 图形数组。
  60937. * @return {SuperMap.LevelRenderer.Render} this。
  60938. */
  60939. }, {
  60940. key: "updateHoverShapes",
  60941. value: function updateHoverShapes(shapes) {
  60942. this.painter.updateHoverLayer(shapes);
  60943. return this;
  60944. }
  60945. /**
  60946. * @function SuperMap.LevelRenderer.Render.prototype.getAllShapes
  60947. * @description 获取所有图形。
  60948. * @return {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
  60949. */
  60950. }, {
  60951. key: "getAllShapes",
  60952. value: function getAllShapes() {
  60953. return this.storage._shapeList;
  60954. }
  60955. /**
  60956. * @function SuperMap.LevelRenderer.Render.prototype.clearAll
  60957. * @description 清除高亮和图形图层。
  60958. * @return {SuperMap.LevelRenderer.Render} this。
  60959. */
  60960. }, {
  60961. key: "clearAll",
  60962. value: function clearAll() {
  60963. this.clear();
  60964. this.painter.clearHover();
  60965. return this;
  60966. }
  60967. /**
  60968. * @function SuperMap.LevelRenderer.Render.prototype.getHoverOne
  60969. * @description 获取单个高亮图形,当前鼠标对应。
  60970. * @return {SuperMap.LevelRenderer.Shape} 高亮图形。
  60971. */
  60972. }, {
  60973. key: "getHoverOne",
  60974. value: function getHoverOne() {
  60975. return this.handler.getLastHoverOne();
  60976. }
  60977. }], [{
  60978. key: "getFrameCallback",
  60979. value: function getFrameCallback(renderInstance) {
  60980. return function () {
  60981. var animatingElements = renderInstance.animatingElements; //animatingElements instanceof Array 临时解决 destory 报错
  60982. if (animatingElements instanceof Array) {
  60983. for (var i = 0, l = animatingElements.length; i < l; i++) {
  60984. renderInstance.storage.mod(animatingElements[i].id);
  60985. }
  60986. if (animatingElements.length || renderInstance._needsRefreshNextFrame) {
  60987. renderInstance.refresh();
  60988. }
  60989. }
  60990. };
  60991. } // SMIC-方法扩展 - end
  60992. }]);
  60993. return Render;
  60994. }();
  60995. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/LevelRenderer.js
  60996. function LevelRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60997. 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); } }
  60998. function LevelRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) LevelRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) LevelRenderer_defineProperties(Constructor, staticProps); return Constructor; }
  60999. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  61000. * This program are made available under the terms of the Apache License, Version 2.0
  61001. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61002. /**
  61003. * @class SuperMap.LevelRenderer
  61004. * @category Visualization Theme
  61005. * @classdesc LevelRenderer 渲染器
  61006. * @private
  61007. */
  61008. var LevelRenderer_LevelRenderer = /*#__PURE__*/function () {
  61009. /**
  61010. * @function SuperMap.LevelRenderer.constructor
  61011. * @description 构造函数。
  61012. * @example
  61013. * //在渲染器上加上图形
  61014. * var levelRenderer = new SuperMap.LevelRenderer();
  61015. * var zr = levelRenderer.init(document.getElementById('lRendertest'));
  61016. * zr.clear();
  61017. * zr.addShape(new SuperMap.LevelRenderer.Shape.Circle({
  61018. * style:{
  61019. * x : 100,
  61020. * y : 100,
  61021. * r : 50,
  61022. * brushType: 'fill'
  61023. * }
  61024. * }));
  61025. * zr.render();
  61026. */
  61027. function LevelRenderer() {
  61028. LevelRenderer_classCallCheck(this, LevelRenderer);
  61029. /**
  61030. * @member {Object} SuperMap.LevelRenderer.prototype._instances
  61031. * @description LevelRenderer 实例 map 索引
  61032. */
  61033. LevelRenderer._instances = {}; // 工具
  61034. LevelRenderer.Tool = {};
  61035. /**
  61036. * @member {string} SuperMap.LevelRenderer.prototype.version
  61037. * @description 版本。zRender(Baidu)的版本号
  61038. * 记录当前 LevelRenderer 是在 zRender 的那个版本上构建而来。
  61039. * 在每次完整评判和实施由 zRender(Baidu)升级带来的 LevelRenderer 升级后修改。
  61040. */
  61041. this.version = '2.0.4';
  61042. this.CLASS_NAME = "SuperMap.LevelRenderer";
  61043. }
  61044. /**
  61045. * @function SuperMap.LevelRenderer.prototype.destroy
  61046. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  61047. */
  61048. LevelRenderer_createClass(LevelRenderer, [{
  61049. key: "destroy",
  61050. value: function destroy() {
  61051. this.dispose();
  61052. this.version = null;
  61053. }
  61054. /**
  61055. * @function SuperMap.LevelRenderer.prototype.init
  61056. * @description 创建 LevelRenderer 实例。
  61057. * @param {HTMLElement} dom - 绘图容器。
  61058. * @returns {SuperMap.LevelRenderer} LevelRenderer 实例。
  61059. */
  61060. }, {
  61061. key: "init",
  61062. value: function init(dom) {
  61063. var zr = new Render_Render(Util_Util.createUniqueID("LRenderer_"), dom);
  61064. LevelRenderer._instances[zr.id] = zr;
  61065. return zr;
  61066. }
  61067. /**
  61068. * @function SuperMap.LevelRenderer.prototype.dispose
  61069. * @description LevelRenderer 实例销毁。
  61070. * 可以通过 zrender.dispose(zr) 销毁指定 SuperMap.LevelRenderer.Render 实例。
  61071. * 也可以通过 zr.dispose() 直接销毁
  61072. * @param {SuperMap.LevelRenderer.Render} zr - ZRender对象,不传此参数则销毁全部。
  61073. * @returns {SuperMap.LevelRenderer} this。
  61074. */
  61075. }, {
  61076. key: "dispose",
  61077. value: function dispose(zr) {
  61078. if (zr) {
  61079. zr.dispose();
  61080. this.delInstance(zr.id);
  61081. } else {
  61082. for (var key in LevelRenderer._instances) {
  61083. LevelRenderer._instances[key].dispose();
  61084. }
  61085. LevelRenderer._instances = {};
  61086. }
  61087. return this;
  61088. }
  61089. /**
  61090. * @function SuperMap.LevelRenderer.prototype.getInstance
  61091. * @description 获取 SuperMap.LevelRenderer.Render 实例。
  61092. * @param {string} id - ZRender对象索引。
  61093. * @returns {SuperMap.LevelRenderer.Render} SuperMap.LevelRenderer.Render 实例。
  61094. */
  61095. }, {
  61096. key: "getInstance",
  61097. value: function getInstance(id) {
  61098. return LevelRenderer._instances[id];
  61099. }
  61100. /**
  61101. * @function SuperMap.LevelRenderer.prototype.delInstance
  61102. * @description 删除 zrender 实例,SuperMap.LevelRenderer.Render 实例 dispose 时会调用,删除后 getInstance 则返回 undefined
  61103. * @param {string} id - ZRender对象索引。
  61104. * @param {string} id - SuperMap.LevelRenderer.Render 对象索引。
  61105. * @returns {SuperMap.LevelRenderer} this。
  61106. */
  61107. }, {
  61108. key: "delInstance",
  61109. value: function delInstance(id) {
  61110. delete LevelRenderer._instances[id];
  61111. return this;
  61112. }
  61113. }]);
  61114. return LevelRenderer;
  61115. }();
  61116. SuperMap.LevelRenderer = LevelRenderer_LevelRenderer;
  61117. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicEllipse.js
  61118. 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); }
  61119. function SmicEllipse_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61120. 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); } }
  61121. function SmicEllipse_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicEllipse_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicEllipse_defineProperties(Constructor, staticProps); return Constructor; }
  61122. 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); }
  61123. function SmicEllipse_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicEllipse_getPrototypeOf(object); if (object === null) break; } return object; }
  61124. 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); }
  61125. function SmicEllipse_setPrototypeOf(o, p) { SmicEllipse_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicEllipse_setPrototypeOf(o, p); }
  61126. 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); }; }
  61127. function SmicEllipse_possibleConstructorReturn(self, call) { if (call && (SmicEllipse_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicEllipse_assertThisInitialized(self); }
  61128. function SmicEllipse_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  61129. 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; } }
  61130. function SmicEllipse_getPrototypeOf(o) { SmicEllipse_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicEllipse_getPrototypeOf(o); }
  61131. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  61132. * This program are made available under the terms of the Apache License, Version 2.0
  61133. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61134. /**
  61135. * @private
  61136. * @class SuperMap.LevelRenderer.Shape.SmicEllipse
  61137. * @category Visualization Theme
  61138. * @classdesc 椭圆。
  61139. * @extends SuperMap.LevelRenderer.Shape
  61140. * @example
  61141. * var shape = new SuperMap.LevelRenderer.Shape.SmicEllipse({
  61142. * style: {
  61143. * x: 100,
  61144. * y: 100,
  61145. * a: 40,
  61146. * b: 20,
  61147. * brushType: 'both',
  61148. * color: 'blue',
  61149. * strokeColor: 'red',
  61150. * lineWidth: 3,
  61151. * text: 'SmicEllipse'
  61152. * }
  61153. * });
  61154. * levelRenderer.addShape(shape);
  61155. *
  61156. *
  61157. */
  61158. var SmicEllipse = /*#__PURE__*/function (_Shape) {
  61159. SmicEllipse_inherits(SmicEllipse, _Shape);
  61160. var _super = SmicEllipse_createSuper(SmicEllipse);
  61161. /**
  61162. * @member {Object} SuperMap.LevelRenderer.Shape.SmicEllipse.style
  61163. * @description 绘制样式。
  61164. *
  61165. * @param {number} style.x - 圆心 x 坐标,必设参数。
  61166. * @param {number} style.y - 圆心 y 坐标,必设参数。
  61167. * @param {number} style.a - 横轴半径,必设参数。
  61168. * @param {number} style.b - 纵轴半径,必设参数。
  61169. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  61170. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  61171. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  61172. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  61173. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  61174. * @param {number} style.opacity - 绘制透明度。默认值:1。
  61175. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  61176. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  61177. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  61178. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  61179. * @param {string} style.text - 图形中的附加文本。默认值:""。
  61180. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  61181. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  61182. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  61183. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  61184. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  61185. */
  61186. //打开接口 style
  61187. /**
  61188. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.constructor
  61189. * @description 构造函数。
  61190. *
  61191. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  61192. *
  61193. */
  61194. function SmicEllipse(options) {
  61195. var _this;
  61196. SmicEllipse_classCallCheck(this, SmicEllipse);
  61197. _this = _super.call(this, options);
  61198. /**
  61199. * @member {string} SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.type
  61200. * @description 图形类型。
  61201. */
  61202. _this.type = 'smicellipse';
  61203. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  61204. _this.refOriginalPosition = [0, 0];
  61205. }
  61206. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicEllipse";
  61207. return _this;
  61208. }
  61209. /**
  61210. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.destroy
  61211. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  61212. */
  61213. SmicEllipse_createClass(SmicEllipse, [{
  61214. key: "destroy",
  61215. value: function destroy() {
  61216. this.type = null;
  61217. SmicEllipse_get(SmicEllipse_getPrototypeOf(SmicEllipse.prototype), "destroy", this).call(this);
  61218. }
  61219. /**
  61220. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.buildPath
  61221. * @description 构建椭圆的 Path。
  61222. *
  61223. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  61224. * @param {Object} style - style。
  61225. *
  61226. */
  61227. }, {
  61228. key: "buildPath",
  61229. value: function buildPath(ctx, style) {
  61230. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  61231. this.refOriginalPosition = [0, 0];
  61232. }
  61233. var __OP = this.refOriginalPosition;
  61234. var k = 0.5522848;
  61235. var x = style.x + __OP[0];
  61236. var y = style.y + __OP[1];
  61237. var a = style.a;
  61238. var b = style.b;
  61239. var ox = a * k; // 水平控制点偏移量
  61240. var oy = b * k; // 垂直控制点偏移量
  61241. // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线
  61242. ctx.moveTo(x - a, y);
  61243. ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);
  61244. ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);
  61245. ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);
  61246. ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);
  61247. ctx.closePath();
  61248. }
  61249. /**
  61250. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.getRect
  61251. * @description 计算返回椭圆包围盒矩形
  61252. *
  61253. * @param {Object} style - style
  61254. * @return {Object} 边框对象。包含属性:x,y,width,height。
  61255. *
  61256. */
  61257. }, {
  61258. key: "getRect",
  61259. value: function getRect(style) {
  61260. if (style.__rect) {
  61261. return style.__rect;
  61262. }
  61263. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  61264. this.refOriginalPosition = [0, 0];
  61265. }
  61266. var __OP = this.refOriginalPosition;
  61267. var lineWidth;
  61268. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  61269. lineWidth = style.lineWidth || 1;
  61270. } else {
  61271. lineWidth = 0;
  61272. }
  61273. style.__rect = {
  61274. x: Math.round(style.x + __OP[0] - style.a - lineWidth / 2),
  61275. y: Math.round(style.x + __OP[1] - style.b - lineWidth / 2),
  61276. width: style.a * 2 + lineWidth,
  61277. height: style.b * 2 + lineWidth
  61278. };
  61279. return style.__rect;
  61280. }
  61281. }]);
  61282. return SmicEllipse;
  61283. }(Shape_Shape);
  61284. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicIsogon.js
  61285. 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); }
  61286. function SmicIsogon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61287. 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); } }
  61288. function SmicIsogon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicIsogon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicIsogon_defineProperties(Constructor, staticProps); return Constructor; }
  61289. 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); }
  61290. function SmicIsogon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicIsogon_getPrototypeOf(object); if (object === null) break; } return object; }
  61291. 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); }
  61292. function SmicIsogon_setPrototypeOf(o, p) { SmicIsogon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicIsogon_setPrototypeOf(o, p); }
  61293. 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); }; }
  61294. function SmicIsogon_possibleConstructorReturn(self, call) { if (call && (SmicIsogon_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicIsogon_assertThisInitialized(self); }
  61295. function SmicIsogon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  61296. 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; } }
  61297. function SmicIsogon_getPrototypeOf(o) { SmicIsogon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicIsogon_getPrototypeOf(o); }
  61298. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  61299. * This program are made available under the terms of the Apache License, Version 2.0
  61300. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61301. /**
  61302. * @private
  61303. * @class SuperMap.LevelRenderer.Shape.SmicIsogon
  61304. * @category Visualization Theme
  61305. * @classdesc 正多边形。
  61306. * @extends SuperMap.LevelRenderer.Shape
  61307. */
  61308. var SmicIsogon_SmicIsogon = /*#__PURE__*/function (_Shape) {
  61309. SmicIsogon_inherits(SmicIsogon, _Shape);
  61310. var _super = SmicIsogon_createSuper(SmicIsogon);
  61311. /**
  61312. * @member {Object} SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.style
  61313. * @description 绘制样式。
  61314. *
  61315. * @param {number} x - 正 n 边形外接圆心 x 坐标,必设参数。
  61316. * @param {number} y - 正 n 边形外接圆心 y 坐标,必设参数。
  61317. * @param {number} r - 正n边形外接圆半径,必设参数。
  61318. * @param {number} n - 指明正几边形,必设参数(n>=3)。
  61319. * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  61320. * @param {string} color - 填充颜色。默认值:"#000000'"。
  61321. * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
  61322. * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  61323. * @param {number} lineWidth - 描边宽度。默认值:1。
  61324. * @param {number} opacity - 绘制透明度。默认值:1。
  61325. * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  61326. * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  61327. * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  61328. * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  61329. * @param {string} text - 图形中的附加文本。默认值:""。
  61330. * @param {string} textColor -文本颜色。默认值:"#000000'"。
  61331. * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
  61332. * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  61333. * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  61334. * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  61335. */
  61336. //打开接口 style
  61337. /**
  61338. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.constructor
  61339. * @description 构造函数。
  61340. *
  61341. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  61342. *
  61343. */
  61344. function SmicIsogon(options) {
  61345. var _this;
  61346. SmicIsogon_classCallCheck(this, SmicIsogon);
  61347. _this = _super.call(this, options);
  61348. /**
  61349. * @member {string} SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.type
  61350. * @description 图形类型。
  61351. */
  61352. _this.type = 'smicisogon';
  61353. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  61354. _this.refOriginalPosition = [0, 0];
  61355. }
  61356. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicIsogon";
  61357. return _this;
  61358. }
  61359. /**
  61360. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.destroy
  61361. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  61362. */
  61363. SmicIsogon_createClass(SmicIsogon, [{
  61364. key: "destroy",
  61365. value: function destroy() {
  61366. this.type = null;
  61367. SmicIsogon_get(SmicIsogon_getPrototypeOf(SmicIsogon.prototype), "destroy", this).call(this);
  61368. }
  61369. /**
  61370. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.buildPath
  61371. * @description 创建n角星(n>=3)路径。
  61372. *
  61373. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  61374. * @param {Object} style - style。
  61375. *
  61376. */
  61377. }, {
  61378. key: "buildPath",
  61379. value: function buildPath(ctx, style) {
  61380. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  61381. this.refOriginalPosition = [0, 0];
  61382. }
  61383. var __OP = this.refOriginalPosition;
  61384. var sin = SUtil.Util_math.sin;
  61385. var cos = SUtil.Util_math.cos;
  61386. var PI = Math.PI;
  61387. var n = style.n;
  61388. if (!n || n < 2) {
  61389. return;
  61390. }
  61391. var x = style.x + __OP[0];
  61392. var y = style.y + __OP[1];
  61393. var r = style.r;
  61394. var dStep = 2 * PI / n;
  61395. var deg = -PI / 2;
  61396. var xStart = x + r * cos(deg);
  61397. var yStart = y + r * sin(deg);
  61398. deg += dStep; // 记录边界点,用于判断insight
  61399. var pointList = style.pointList = [];
  61400. pointList.push([xStart, yStart]);
  61401. for (var i = 0, end = n - 1; i < end; i++) {
  61402. pointList.push([x + r * cos(deg), y + r * sin(deg)]);
  61403. deg += dStep;
  61404. }
  61405. pointList.push([xStart, yStart]); // 绘制
  61406. ctx.moveTo(pointList[0][0], pointList[0][1]);
  61407. for (var _i = 0; _i < pointList.length; _i++) {
  61408. ctx.lineTo(pointList[_i][0], pointList[_i][1]);
  61409. }
  61410. ctx.closePath();
  61411. return;
  61412. }
  61413. /**
  61414. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.getRect
  61415. * @description 计算返回正多边形的包围盒矩形。
  61416. *
  61417. * @param {Object} style - style
  61418. * @return {Object} 边框对象。包含属性:x,y,width,height。
  61419. */
  61420. }, {
  61421. key: "getRect",
  61422. value: function getRect(style) {
  61423. if (style.__rect) {
  61424. return style.__rect;
  61425. }
  61426. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  61427. this.refOriginalPosition = [0, 0];
  61428. }
  61429. var __OP = this.refOriginalPosition;
  61430. var lineWidth;
  61431. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  61432. lineWidth = style.lineWidth || 1;
  61433. } else {
  61434. lineWidth = 0;
  61435. }
  61436. style.__rect = {
  61437. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  61438. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  61439. width: style.r * 2 + lineWidth,
  61440. height: style.r * 2 + lineWidth
  61441. };
  61442. return style.__rect;
  61443. }
  61444. }]);
  61445. return SmicIsogon;
  61446. }(Shape_Shape);
  61447. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRing.js
  61448. 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); }
  61449. function SmicRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61450. 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); } }
  61451. function SmicRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRing_defineProperties(Constructor, staticProps); return Constructor; }
  61452. 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); }
  61453. function SmicRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRing_getPrototypeOf(object); if (object === null) break; } return object; }
  61454. 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); }
  61455. function SmicRing_setPrototypeOf(o, p) { SmicRing_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRing_setPrototypeOf(o, p); }
  61456. 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); }; }
  61457. function SmicRing_possibleConstructorReturn(self, call) { if (call && (SmicRing_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicRing_assertThisInitialized(self); }
  61458. function SmicRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  61459. 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; } }
  61460. function SmicRing_getPrototypeOf(o) { SmicRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRing_getPrototypeOf(o); }
  61461. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  61462. * This program are made available under the terms of the Apache License, Version 2.0
  61463. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61464. /**
  61465. * @private
  61466. * @class SuperMap.LevelRenderer.Shape.SmicRing
  61467. * @category Visualization Theme
  61468. * @classdesc 圆环。
  61469. * @extends SuperMap.LevelRenderer.Shape
  61470. * @example
  61471. * var shape = new SuperMap.LevelRenderer.Shape.SmicRing({
  61472. * style: {
  61473. * x: 100,
  61474. * y: 100,
  61475. * r0: 30,
  61476. * r: 50
  61477. * }
  61478. * });
  61479. * levelRenderer.addShape(shape);
  61480. *
  61481. */
  61482. var SmicRing = /*#__PURE__*/function (_Shape) {
  61483. SmicRing_inherits(SmicRing, _Shape);
  61484. var _super = SmicRing_createSuper(SmicRing);
  61485. /**
  61486. * @member {Object} SuperMap.LevelRenderer.Shape.SmicRing.prototype.style
  61487. * @description 绘制样式。
  61488. *
  61489. * @param {number} x - 圆心 x 坐标,必设参数。
  61490. * @param {number} y - 圆心 y 坐标,必设参数。
  61491. * @param {number} r - 外圆半径,必设参数。
  61492. * @param {number} r0 - 内圆半径,必设参数。
  61493. * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  61494. * @param {string} color - 填充颜色。默认值:"#000000'"。
  61495. * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
  61496. * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  61497. * @param {number} lineWidth -描边宽度。默认值:1。
  61498. * @param {number} opacity - 绘制透明度。默认值:1。
  61499. * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  61500. * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  61501. * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  61502. * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  61503. * @param {string} text -图形中的附加文本。默认值:""。
  61504. * @param {string} textColor - 文本颜色。默认值:"#000000'"。
  61505. * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
  61506. * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  61507. * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  61508. * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  61509. */
  61510. //打开接口 style
  61511. /**
  61512. * @function SuperMap.LevelRenderer.Shape.SmicRing.constructor
  61513. * @description 构造函数。
  61514. *
  61515. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  61516. */
  61517. function SmicRing(options) {
  61518. var _this;
  61519. SmicRing_classCallCheck(this, SmicRing);
  61520. _this = _super.call(this, options);
  61521. /**
  61522. * @member {string} SuperMap.LevelRenderer.Shape.SmicRing.prototype.type
  61523. * @description 图形类型。
  61524. */
  61525. _this.type = 'smicring';
  61526. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  61527. _this.refOriginalPosition = [0, 0];
  61528. }
  61529. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRing";
  61530. return _this;
  61531. }
  61532. /**
  61533. * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.destroy
  61534. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  61535. */
  61536. SmicRing_createClass(SmicRing, [{
  61537. key: "destroy",
  61538. value: function destroy() {
  61539. this.type = null;
  61540. SmicRing_get(SmicRing_getPrototypeOf(SmicRing.prototype), "destroy", this).call(this);
  61541. }
  61542. /**
  61543. * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.buildPath
  61544. * @description 创建圆环路径。
  61545. *
  61546. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  61547. * @param {Object} style - style。
  61548. *
  61549. */
  61550. }, {
  61551. key: "buildPath",
  61552. value: function buildPath(ctx, style) {
  61553. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  61554. this.refOriginalPosition = [0, 0];
  61555. }
  61556. var __OP = this.refOriginalPosition; // 非零环绕填充优化
  61557. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, false);
  61558. ctx.moveTo(style.x + __OP[0] + style.r0, style.y + __OP[1]);
  61559. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r0, 0, Math.PI * 2, true);
  61560. return;
  61561. }
  61562. /**
  61563. * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.getRect
  61564. * @description 计算返回圆环包围盒矩阵
  61565. *
  61566. * @param {Object} style - style
  61567. * @return {Object} 边框对象。包含属性:x,y,width,height。
  61568. */
  61569. }, {
  61570. key: "getRect",
  61571. value: function getRect(style) {
  61572. if (style.__rect) {
  61573. return style.__rect;
  61574. }
  61575. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  61576. this.refOriginalPosition = [0, 0];
  61577. }
  61578. var __OP = this.refOriginalPosition;
  61579. var lineWidth;
  61580. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  61581. lineWidth = style.lineWidth || 1;
  61582. } else {
  61583. lineWidth = 0;
  61584. }
  61585. style.__rect = {
  61586. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  61587. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  61588. width: style.r * 2 + lineWidth,
  61589. height: style.r * 2 + lineWidth
  61590. };
  61591. return style.__rect;
  61592. }
  61593. }]);
  61594. return SmicRing;
  61595. }(Shape_Shape);
  61596. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicStar.js
  61597. 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); }
  61598. function SmicStar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61599. 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); } }
  61600. function SmicStar_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicStar_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicStar_defineProperties(Constructor, staticProps); return Constructor; }
  61601. 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); }
  61602. function SmicStar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicStar_getPrototypeOf(object); if (object === null) break; } return object; }
  61603. 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); }
  61604. function SmicStar_setPrototypeOf(o, p) { SmicStar_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicStar_setPrototypeOf(o, p); }
  61605. 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); }; }
  61606. function SmicStar_possibleConstructorReturn(self, call) { if (call && (SmicStar_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicStar_assertThisInitialized(self); }
  61607. function SmicStar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  61608. 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; } }
  61609. function SmicStar_getPrototypeOf(o) { SmicStar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicStar_getPrototypeOf(o); }
  61610. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  61611. * This program are made available under the terms of the Apache License, Version 2.0
  61612. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61613. /**
  61614. * @private
  61615. * @class SuperMap.LevelRenderer.Shape.SmicStar
  61616. * @category Visualization Theme
  61617. * @classdesc n 角星(n>3)。
  61618. * @extends SuperMap.LevelRenderer.Shape
  61619. * @example
  61620. * var shape = new SuperMap.LevelRenderer.Shape.SmicStar({
  61621. * style: {
  61622. * x: 200,
  61623. * y: 100,
  61624. * r: 150,
  61625. * n: 5,
  61626. * text: '五角星'
  61627. * }
  61628. * });
  61629. * levelRenderer.addShape(shape);
  61630. *
  61631. *
  61632. */
  61633. var SmicStar_SmicStar = /*#__PURE__*/function (_Shape) {
  61634. SmicStar_inherits(SmicStar, _Shape);
  61635. var _super = SmicStar_createSuper(SmicStar);
  61636. /**
  61637. * @member {Object} SuperMap.LevelRenderer.Shape.SmicStar.prototype.style
  61638. * @description 绘制样式。
  61639. *
  61640. * @param {number} style.x - n 角星外接圆心 x 坐标,必设参数。
  61641. * @param {number} style.y - n 角星外接圆心 y 坐标,必设参数。
  61642. * @param {number} style.r - n 角星外接圆半径,必设参数。
  61643. * @param {number} style.r0 - n 角星内部顶点(凹点)的外接圆半径。如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点。
  61644. * @param {number} style.n -指明几角星,必设参数。
  61645. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  61646. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  61647. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  61648. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  61649. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  61650. * @param {number} style.opacity - 绘制透明度。默认值:1。
  61651. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  61652. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  61653. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  61654. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  61655. * @param {string} style.text - 图形中的附加文本。默认值:""。
  61656. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  61657. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  61658. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  61659. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  61660. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  61661. */
  61662. //打开接口 style
  61663. /**
  61664. * @function SuperMap.LevelRenderer.Shape.SmicStar.constructor
  61665. * @description 构造函数。
  61666. *
  61667. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  61668. *
  61669. */
  61670. function SmicStar(options) {
  61671. var _this;
  61672. SmicStar_classCallCheck(this, SmicStar);
  61673. _this = _super.call(this, options);
  61674. /**
  61675. * @member {string} SuperMap.LevelRenderer.Shape.SmicStar.prototype.type
  61676. * @description 图形类型。
  61677. */
  61678. _this.type = 'smicstar';
  61679. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  61680. _this.refOriginalPosition = [0, 0];
  61681. }
  61682. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicStar";
  61683. return _this;
  61684. }
  61685. /**
  61686. * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.destroy
  61687. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  61688. */
  61689. SmicStar_createClass(SmicStar, [{
  61690. key: "destroy",
  61691. value: function destroy() {
  61692. this.type = null;
  61693. SmicStar_get(SmicStar_getPrototypeOf(SmicStar.prototype), "destroy", this).call(this);
  61694. }
  61695. /**
  61696. * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.buildPath
  61697. * @description 创建n 角星(n>3)路径。
  61698. *
  61699. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  61700. * @param {Object} style - style。
  61701. *
  61702. */
  61703. }, {
  61704. key: "buildPath",
  61705. value: function buildPath(ctx, style) {
  61706. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  61707. this.refOriginalPosition = [0, 0];
  61708. }
  61709. var __OP = this.refOriginalPosition;
  61710. var n = style.n;
  61711. if (!n || n < 2) {
  61712. return;
  61713. }
  61714. var sin = SUtil.Util_math.sin;
  61715. var cos = SUtil.Util_math.cos;
  61716. var PI = Math.PI;
  61717. var x = style.x + __OP[0];
  61718. var y = style.y + __OP[1];
  61719. var r = style.r;
  61720. var r0 = style.r0; // 如果未指定内部顶点外接圆半径,则自动计算
  61721. if (r0 == null) {
  61722. r0 = n > 4 // 相隔的外部顶点的连线的交点,
  61723. // 被取为内部交点,以此计算r0
  61724. ? r * cos(2 * PI / n) / cos(PI / n) // 二三四角星的特殊处理
  61725. : r / 3;
  61726. }
  61727. var dStep = PI / n;
  61728. var deg = -PI / 2;
  61729. var xStart = x + r * cos(deg);
  61730. var yStart = y + r * sin(deg);
  61731. deg += dStep; // 记录边界点,用于判断inside
  61732. var pointList = style.pointList = [];
  61733. pointList.push([xStart, yStart]);
  61734. for (var i = 0, end = n * 2 - 1, ri; i < end; i++) {
  61735. ri = i % 2 === 0 ? r0 : r;
  61736. pointList.push([x + ri * cos(deg), y + ri * sin(deg)]);
  61737. deg += dStep;
  61738. }
  61739. pointList.push([xStart, yStart]); // 绘制
  61740. ctx.moveTo(pointList[0][0], pointList[0][1]);
  61741. for (var _i = 0; _i < pointList.length; _i++) {
  61742. ctx.lineTo(pointList[_i][0], pointList[_i][1]);
  61743. }
  61744. ctx.closePath();
  61745. return;
  61746. }
  61747. /**
  61748. * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.getRect
  61749. * @description 返回 n 角星包围盒矩形。
  61750. *
  61751. * @param {Object} style - style
  61752. * @return {Object} 边框对象。包含属性:x,y,width,height。
  61753. */
  61754. }, {
  61755. key: "getRect",
  61756. value: function getRect(style) {
  61757. if (style.__rect) {
  61758. return style.__rect;
  61759. }
  61760. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  61761. this.refOriginalPosition = [0, 0];
  61762. }
  61763. var __OP = this.refOriginalPosition;
  61764. var lineWidth;
  61765. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  61766. lineWidth = style.lineWidth || 1;
  61767. } else {
  61768. lineWidth = 0;
  61769. }
  61770. style.__rect = {
  61771. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  61772. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  61773. width: style.r * 2 + lineWidth,
  61774. height: style.r * 2 + lineWidth
  61775. };
  61776. return style.__rect;
  61777. }
  61778. }]);
  61779. return SmicStar;
  61780. }(Shape_Shape);
  61781. // CONCATENATED MODULE: ./src/common/overlay/levelRenderer/index.js
  61782. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  61783. * This program are made available under the terms of the Apache License, Version 2.0
  61784. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61785. // CONCATENATED MODULE: ./src/common/overlay/index.js
  61786. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  61787. * This program are made available under the terms of the Apache License, Version 2.0
  61788. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61789. // CONCATENATED MODULE: ./src/common/components/CommonTypes.js
  61790. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  61791. * This program are made available under the terms of the Apache License, Version 2.0
  61792. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61793. /**
  61794. * 该文件用于存储一些公用常量
  61795. *
  61796. */
  61797. var FileTypes = {
  61798. EXCEL: "EXCEL",
  61799. CSV: "CSV",
  61800. ISERVER: "ISERVER",
  61801. GEOJSON: "GEOJSON",
  61802. JSON: 'JSON'
  61803. };
  61804. var FileConfig = {
  61805. fileMaxSize: 10 * 1024 * 1024
  61806. };
  61807. // CONCATENATED MODULE: ./src/common/components/openfile/FileModel.js
  61808. function FileModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61809. 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); } }
  61810. function FileModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) FileModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) FileModel_defineProperties(Constructor, staticProps); return Constructor; }
  61811. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  61812. * This program are made available under the terms of the Apache License, Version 2.0
  61813. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61814. /**
  61815. * @class SuperMap.FileModel
  61816. * @description 文件数据组件数据模型,用于存储一些文件数据或状态,todo 结构待完善
  61817. * @category Components OpenFile
  61818. * @private
  61819. */
  61820. var FileModel_FileModel = /*#__PURE__*/function () {
  61821. function FileModel(options) {
  61822. FileModel_classCallCheck(this, FileModel);
  61823. this.FileTypes = FileTypes;
  61824. this.FileConfig = FileConfig;
  61825. this.loadFileObject = options && options.loadFileObject ? options.loadFileObject : [];
  61826. }
  61827. /**
  61828. * @function SuperMap.FileModel.prototype.set
  61829. * @description 设置属性值
  61830. * @param {string} key - 属性名称
  61831. * @param {string|Object} value - 属性值
  61832. */
  61833. FileModel_createClass(FileModel, [{
  61834. key: "set",
  61835. value: function set(key, value) {
  61836. this[key] = value;
  61837. }
  61838. /**
  61839. * @function SuperMap.FileModel.prototype.get
  61840. * @description 获取数据值
  61841. * @param {string} key - 属性名称
  61842. * @returns {string|Object} value - 返回属性值
  61843. */
  61844. }, {
  61845. key: "get",
  61846. value: function get(key) {
  61847. return this[key];
  61848. }
  61849. }]);
  61850. return FileModel;
  61851. }();
  61852. // CONCATENATED MODULE: ./src/common/components/messagebox/MessageBox.js
  61853. function MessageBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61854. 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); } }
  61855. function MessageBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) MessageBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) MessageBox_defineProperties(Constructor, staticProps); return Constructor; }
  61856. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  61857. * This program are made available under the terms of the Apache License, Version 2.0
  61858. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61859. /**
  61860. * @class SuperMap.Components.MessageBox
  61861. * @version 9.1.1
  61862. * @classdesc 组件信息提示框。
  61863. * @category Components Common
  61864. */
  61865. var MessageBox = /*#__PURE__*/function () {
  61866. function MessageBox() {
  61867. MessageBox_classCallCheck(this, MessageBox);
  61868. this._initView();
  61869. }
  61870. MessageBox_createClass(MessageBox, [{
  61871. key: "_initView",
  61872. value: function _initView() {
  61873. //原生js形式
  61874. var messageBoxContainer = document.createElement("div");
  61875. messageBoxContainer.hidden = true;
  61876. messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange"); //图标
  61877. var iconContainer = document.createElement("div");
  61878. iconContainer.setAttribute("class", "icon");
  61879. this.icon = document.createElement("span");
  61880. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  61881. iconContainer.appendChild(this.icon);
  61882. messageBoxContainer.appendChild(iconContainer); //内容:
  61883. var messageBox = document.createElement("div");
  61884. messageBox.setAttribute("class", "component-messagebox");
  61885. messageBox.innerHTML = "";
  61886. messageBoxContainer.appendChild(messageBox);
  61887. this.messageBox = messageBox; //关闭按钮
  61888. var cancelContainer = document.createElement("div");
  61889. cancelContainer.setAttribute("class", "component-messagebox__cancelbtncontainer");
  61890. var cancelBtn = document.createElement("button");
  61891. cancelBtn.setAttribute("class", "component-messagebox__cancelBtn");
  61892. cancelBtn.innerHTML = "x";
  61893. cancelBtn.onclick = this.closeView.bind(this);
  61894. cancelContainer.appendChild(cancelBtn);
  61895. messageBoxContainer.appendChild(cancelContainer);
  61896. this.messageBoxContainer = messageBoxContainer;
  61897. document.body.appendChild(this.messageBoxContainer);
  61898. }
  61899. /**
  61900. * @function SuperMap.Components.MessageBox.prototype.closeView
  61901. * @description 关闭提示框。
  61902. */
  61903. }, {
  61904. key: "closeView",
  61905. value: function closeView() {
  61906. this.messageBoxContainer.hidden = true;
  61907. }
  61908. /**
  61909. * @function SuperMap.Components.MessageBox.prototype.showView
  61910. * @description 显示提示框。
  61911. * @param {string} message - 提示框显示内容。
  61912. * @param {string}[type="warring"] 提示框类型,如 "warring", "failure", "success"。
  61913. */
  61914. }, {
  61915. key: "showView",
  61916. value: function showView(message) {
  61917. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'warring';
  61918. //设置提示框的样式:
  61919. if (type === "success") {
  61920. this.icon.setAttribute("class", "supermapol-icons-message-success");
  61921. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-green");
  61922. } else if (type === "failure") {
  61923. this.icon.setAttribute("class", "supermapol-icons-message-failure");
  61924. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-red");
  61925. } else if (type === "warring") {
  61926. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  61927. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange");
  61928. }
  61929. this.messageBox.innerHTML = message;
  61930. this.messageBoxContainer.hidden = false;
  61931. }
  61932. }]);
  61933. return MessageBox;
  61934. }();
  61935. SuperMap.Components.MessageBox = MessageBox;
  61936. // EXTERNAL MODULE: external "function(){try{return echarts}catch(e){return {}}}()"
  61937. var external_function_try_return_echarts_catch_e_return_ = __webpack_require__(9);
  61938. var external_function_try_return_echarts_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_echarts_catch_e_return_);
  61939. // CONCATENATED MODULE: ./src/common/lang/Lang.js
  61940. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  61941. * This program are made available under the terms of the Apache License, Version 2.0
  61942. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61943. /**
  61944. * @name Lang
  61945. * @memberOf SuperMap
  61946. * @namespace
  61947. * @category BaseTypes
  61948. * @description 国际化的命名空间,包含多种语言和方法库来设置和获取当前的语言。
  61949. */
  61950. var Lang = {
  61951. /**
  61952. * @member {string} SuperMap.Lang.code
  61953. * @description 当前所使用的语言类型。
  61954. */
  61955. code: null,
  61956. /**
  61957. * @member {string} [SuperMap.Lang.defaultCode='en-US']
  61958. * @description 默认使用的语言类型。
  61959. */
  61960. defaultCode: "en-US",
  61961. /**
  61962. * @function SuperMap.Lang.getCode
  61963. * @description 获取当前的语言代码。
  61964. * @returns {string} 当前的语言代码。
  61965. */
  61966. getCode: function getCode() {
  61967. if (!SuperMap.Lang.code) {
  61968. SuperMap.Lang.setCode();
  61969. }
  61970. return SuperMap.Lang.code;
  61971. },
  61972. /**
  61973. * @function SuperMap.Lang.setCode
  61974. * @description 设置语言代码。
  61975. * @param {string} code - 此参数遵循IETF规范。
  61976. */
  61977. setCode: function setCode() {
  61978. var lang = this.getLanguageFromCookie();
  61979. if (lang) {
  61980. SuperMap.Lang.code = lang;
  61981. return;
  61982. }
  61983. lang = SuperMap.Lang.defaultCode;
  61984. if (navigator.appName === 'Netscape') {
  61985. lang = navigator.language;
  61986. } else {
  61987. lang = navigator.browserLanguage;
  61988. }
  61989. if (lang.indexOf('zh') === 0) {
  61990. lang = 'zh-CN';
  61991. }
  61992. if (lang.indexOf('en') === 0) {
  61993. lang = 'en-US';
  61994. }
  61995. SuperMap.Lang.code = lang;
  61996. },
  61997. /**
  61998. * @function SuperMap.Lang.getLanguageFromCookie
  61999. * @description 从 cookie 中获取语言类型。
  62000. */
  62001. getLanguageFromCookie: function getLanguageFromCookie() {
  62002. var name = 'language=';
  62003. var ca = document.cookie.split(';');
  62004. for (var i = 0; i < ca.length; i++) {
  62005. var c = ca[i];
  62006. while (c.charAt(0) === ' ') {
  62007. c = c.substring(1);
  62008. }
  62009. if (c.indexOf(name) !== -1) {
  62010. return c.substring(name.length, c.length);
  62011. }
  62012. }
  62013. return "";
  62014. },
  62015. /**
  62016. * @function SuperMap.Lang.i18n
  62017. * @description 从当前语言字符串的字典查找 key。
  62018. * @param {string} key - 字典中 i18n 字符串值的关键字。
  62019. * @returns {string} 国际化的字符串。
  62020. */
  62021. i18n: function i18n(key) {
  62022. var dictionary = SuperMap.Lang[SuperMap.Lang.getCode()];
  62023. var message = dictionary && dictionary[key];
  62024. if (!message) {
  62025. // Message not found, fall back to message key
  62026. message = key;
  62027. }
  62028. return message;
  62029. }
  62030. };
  62031. SuperMap.Lang = Lang;
  62032. SuperMap.i18n = SuperMap.Lang.i18n;
  62033. // EXTERNAL MODULE: external "function(){try{return XLSX}catch(e){return {}}}()"
  62034. var external_function_try_return_XLSX_catch_e_return_ = __webpack_require__(5);
  62035. var external_function_try_return_XLSX_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_XLSX_catch_e_return_);
  62036. // CONCATENATED MODULE: ./src/common/components/util/FileReaderUtil.js
  62037. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  62038. * This program are made available under the terms of the Apache License, Version 2.0
  62039. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62040. /**
  62041. * @class SuperMap.Components.FileReaderUtil
  62042. * @classdesc 组件读取文件工具类。
  62043. * @version 9.1.1
  62044. * @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(*, *=))}}
  62045. */
  62046. var FileReaderUtil = {
  62047. rABS: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsBinaryString,
  62048. rABF: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsArrayBuffer,
  62049. rAT: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsText,
  62050. /**
  62051. * @function SuperMap.Components.FileReaderUtil.prototype.readFile
  62052. * @description 读取文件
  62053. * @param {string} fileType - 当前读取的文件类型
  62054. *
  62055. * @param {Object} file - 读取回来的文件内容对象
  62056. * @param {function} success - 读取文件成功回调函数
  62057. * @param {function} failed - 读取文件失败回调函数
  62058. * @param {Object} context - 回调重定向对象
  62059. */
  62060. readFile: function readFile(fileType, file, success, failed, context) {
  62061. if (FileTypes.JSON === fileType || FileTypes.GEOJSON === fileType) {
  62062. this.readTextFile(file, success, failed, context);
  62063. } else if (FileTypes.EXCEL === fileType || FileTypes.CSV === fileType) {
  62064. this.readXLSXFile(file, success, failed, context);
  62065. }
  62066. },
  62067. /**
  62068. * 读取文本文件
  62069. * @param file
  62070. * @param success
  62071. * @param failed
  62072. * @param {Object} context - 回调重定向对象
  62073. */
  62074. readTextFile: function readTextFile(file, success, failed, context) {
  62075. var reader = new FileReader();
  62076. reader.onloadend = function (evt) {
  62077. success && success.call(context, evt.target.result);
  62078. };
  62079. reader.onerror = function (error) {
  62080. failed && failed.call(context, error);
  62081. };
  62082. this.rAT ? reader.readAsText(file.file, 'utf-8') : reader.readAsBinaryString(file.file);
  62083. },
  62084. /**
  62085. * 读取excel或csv文件
  62086. * @param file
  62087. * @param success
  62088. * @param failed
  62089. * @param {Object} context - 回调重定向对象
  62090. */
  62091. readXLSXFile: function readXLSXFile(file, success, failed, context) {
  62092. var reader = new FileReader();
  62093. reader.onloadend = function (evt) {
  62094. var xLSXData = new Uint8Array(evt.target.result);
  62095. var workbook = external_function_try_return_XLSX_catch_e_return_default.a.read(xLSXData, {
  62096. type: "array"
  62097. });
  62098. try {
  62099. if (workbook && workbook.SheetNames && workbook.SheetNames.length > 0) {
  62100. //暂时只读取第一个sheets的内容
  62101. var sheetName = workbook.SheetNames[0];
  62102. var xLSXCSVString = external_function_try_return_XLSX_catch_e_return_default.a.utils.sheet_to_csv(workbook.Sheets[sheetName]);
  62103. success && success.call(context, xLSXCSVString);
  62104. }
  62105. } catch (error) {
  62106. failed && failed.call(context, error);
  62107. }
  62108. };
  62109. reader.onerror = function (error) {
  62110. failed && failed.call(context, error);
  62111. };
  62112. this.rABF && reader.readAsArrayBuffer(file.file);
  62113. },
  62114. /**
  62115. * @function SuperMap.Components.FileReaderUtil.prototype.processDataToGeoJson
  62116. * @description 将读取回来得数据统一处理为 GeoJSON 格式
  62117. * @param {string} type - 文件类型
  62118. * @param {Object} data - 读取返回的数据对象
  62119. * @param {function} success - 数据处理成功的回调
  62120. * @param {function} failed - 数据处理失败的回调
  62121. * @param {Object} context - 回调重定向对象
  62122. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据
  62123. * @private
  62124. */
  62125. processDataToGeoJson: function processDataToGeoJson(type, data, success, failed, context) {
  62126. var geojson = null;
  62127. if (type === "EXCEL" || type === "CSV") {
  62128. geojson = this.processExcelDataToGeoJson(data);
  62129. success && success.call(context, geojson);
  62130. } else if (type === 'JSON' || type === 'GEOJSON') {
  62131. var result = data; //geojson、json未知,通过类容来判断
  62132. if (typeof result === "string") {
  62133. result = JSON.parse(result);
  62134. }
  62135. if (result.type === 'ISERVER') {
  62136. geojson = result.data.recordsets[0].features;
  62137. } else if (result.type === 'FeatureCollection') {
  62138. //geojson
  62139. geojson = result;
  62140. } else {
  62141. //不支持数据
  62142. failed && failed.call(context, Lang.i18n('msg_dataInWrongGeoJSONFormat'));
  62143. }
  62144. success && success.call(context, geojson);
  62145. } else {
  62146. failed && failed.call(context, Lang.i18n('msg_dataInWrongFormat'));
  62147. }
  62148. },
  62149. /**
  62150. * @function SuperMap.Components.FileReaderUtil.prototype.processExcelDataToGeoJson
  62151. * @description 表格文件数据处理
  62152. * @param {Object} data - 读取的表格文件数据
  62153. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据
  62154. * @private
  62155. */
  62156. processExcelDataToGeoJson: function processExcelDataToGeoJson(data) {
  62157. //处理为对象格式转化
  62158. var dataContent = this.string2Csv(data);
  62159. var fieldCaptions = dataContent.colTitles; //位置属性处理
  62160. var xfieldIndex = -1,
  62161. yfieldIndex = -1;
  62162. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  62163. if (this.isXField(fieldCaptions[i])) {
  62164. xfieldIndex = i;
  62165. }
  62166. if (this.isYField(fieldCaptions[i])) {
  62167. yfieldIndex = i;
  62168. }
  62169. } // feature 构建后期支持坐标系 4326/3857
  62170. var features = [];
  62171. for (var _i = 0, _len = dataContent.rows.length; _i < _len; _i++) {
  62172. var row = dataContent.rows[_i]; //if (featureFrom === "LonLat") {
  62173. var x = Number(row[xfieldIndex]),
  62174. y = Number(row[yfieldIndex]); //属性信息
  62175. var attributes = {};
  62176. for (var index in dataContent.colTitles) {
  62177. var key = dataContent.colTitles[index];
  62178. attributes[key] = dataContent.rows[_i][index];
  62179. } //目前csv 只支持处理点,所以先生成点类型的 geojson
  62180. var feature = {
  62181. "type": "Feature",
  62182. "geometry": {
  62183. "type": "Point",
  62184. "coordinates": [x, y]
  62185. },
  62186. "properties": attributes
  62187. };
  62188. features.push(feature);
  62189. }
  62190. return features;
  62191. },
  62192. /**
  62193. * 判断是否地理X坐标
  62194. * @param data
  62195. */
  62196. isXField: function isXField(data) {
  62197. var lowerdata = data.toLowerCase();
  62198. return lowerdata === "x" || lowerdata === "smx" || lowerdata === "jd" || lowerdata === "经度" || lowerdata === "东经" || lowerdata === "longitude" || lowerdata === "lot" || lowerdata === "lon" || lowerdata === "lng" || lowerdata === "x坐标";
  62199. },
  62200. /**
  62201. * 判断是否地理Y坐标
  62202. * @param data
  62203. */
  62204. isYField: function isYField(data) {
  62205. var lowerdata = data.toLowerCase();
  62206. return lowerdata === "y" || lowerdata === "smy" || lowerdata === "wd" || lowerdata === "纬度" || lowerdata === "北纬" || lowerdata === "latitude" || lowerdata === "lat" || lowerdata === "y坐标";
  62207. },
  62208. /**
  62209. * 字符串转为dataEditor 支持的csv格式数据
  62210. * @param string
  62211. * @param withoutTitle
  62212. */
  62213. string2Csv: function string2Csv(string, withoutTitle) {
  62214. // let rows = string.split('\r\n');
  62215. var rows = string.split('\n');
  62216. var result = {};
  62217. if (!withoutTitle) {
  62218. result["colTitles"] = rows[0].split(',');
  62219. } else {
  62220. result["colTitles"] = [];
  62221. }
  62222. result['rows'] = [];
  62223. for (var i = withoutTitle ? 0 : 1; i < rows.length; i++) {
  62224. rows[i] && result['rows'].push(rows[i].split(','));
  62225. }
  62226. return result;
  62227. }
  62228. };
  62229. SuperMap.Components.FileReaderUtil = FileReaderUtil;
  62230. // CONCATENATED MODULE: ./src/common/components/chart/ChartModel.js
  62231. function ChartModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62232. 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); } }
  62233. function ChartModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartModel_defineProperties(Constructor, staticProps); return Constructor; }
  62234. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  62235. * This program are made available under the terms of the Apache License, Version 2.0
  62236. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62237. /**
  62238. * @class SuperMap.Components.ChartModel
  62239. * @classdesc 图表组件数据模型
  62240. * @private
  62241. * @param {Object} datasets - 数据来源。
  62242. * @category Components Chart
  62243. * @fires SuperMap.Components.ChartModel#getdatafailed
  62244. */
  62245. var ChartModel_ChartModel = /*#__PURE__*/function () {
  62246. function ChartModel(datasets) {
  62247. ChartModel_classCallCheck(this, ChartModel);
  62248. this.datasets = datasets;
  62249. this.EVENT_TYPES = ['getdatafailed'];
  62250. this.events = new Events_Events(this, null, this.EVENT_TYPES);
  62251. }
  62252. /**
  62253. * @private
  62254. * @function SuperMap.Components.ChartModel.prototype.getDatasetInfo
  62255. * @description 获得数据集数据。
  62256. * @param {string} datasetUrl - 数据集资源地址。
  62257. */
  62258. ChartModel_createClass(ChartModel, [{
  62259. key: "getDatasetInfo",
  62260. value: function getDatasetInfo(success) {
  62261. var datasetUrl = this.datasets.url;
  62262. var me = this;
  62263. FetchRequest.get(datasetUrl).then(function (response) {
  62264. return response.json();
  62265. }).then(function (results) {
  62266. if (results.datasetInfo) {
  62267. var datasetInfo = results.datasetInfo;
  62268. me.datasetsInfo = {
  62269. dataSourceName: datasetInfo.dataSourceName,
  62270. datasetName: datasetInfo.name,
  62271. mapName: results.name
  62272. };
  62273. success({
  62274. result: me.datasetsInfo
  62275. });
  62276. }
  62277. })["catch"](function (error) {
  62278. console.log(error);
  62279. me._fireFailedEvent(error);
  62280. });
  62281. }
  62282. /**
  62283. * @private
  62284. * @function SuperMap.Components.ChartModel.prototype.getDataFeatures
  62285. * @description 请求数据集的数据信息
  62286. * @param {Object} results - 数据集信息。
  62287. * @param {function} success - 成功回调函数。
  62288. */
  62289. }, {
  62290. key: "getDataFeatures",
  62291. value: function getDataFeatures(results, success) {
  62292. var datasetsInfo = results.result;
  62293. var getFeatureParam, getFeatureBySQLParams, getFeatureBySQLService;
  62294. var params = {
  62295. name: datasetsInfo.datasetName + '@' + datasetsInfo.dataSourceName
  62296. };
  62297. Object.assign(params, this.datasets.queryInfo);
  62298. getFeatureParam = new SuperMap.FilterParameter(params);
  62299. getFeatureBySQLParams = new SuperMap.GetFeaturesBySQLParameters({
  62300. queryParameter: getFeatureParam,
  62301. datasetNames: [datasetsInfo.dataSourceName + ':' + datasetsInfo.datasetName],
  62302. fromIndex: 0,
  62303. toIndex: 100000
  62304. });
  62305. getFeatureBySQLService = new SuperMap.GetFeaturesBySQLService(datasetsInfo.dataUrl, {
  62306. eventListeners: {
  62307. processCompleted: success,
  62308. processFailed: function processFailed() {}
  62309. }
  62310. });
  62311. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  62312. }
  62313. /**
  62314. * @private
  62315. * @function SuperMap.Components.ChartModel.prototype.getLayerFeatures
  62316. * @description 请求图层要素的数据信息
  62317. * @param {Object} results - 数据集信息。
  62318. * @param {Callbacks} success - 成功回调函数。
  62319. */
  62320. }, {
  62321. key: "getLayerFeatures",
  62322. value: function getLayerFeatures(results, success) {
  62323. var datasetsInfo = results.result;
  62324. var queryParam, queryBySQLParams, queryBySQLService;
  62325. var params = {
  62326. name: datasetsInfo.mapName
  62327. };
  62328. Object.assign(params, this.datasets.queryInfo);
  62329. queryParam = new SuperMap.FilterParameter(params);
  62330. queryBySQLParams = new SuperMap.QueryBySQLParameters({
  62331. queryParams: [queryParam],
  62332. expectCount: 100000
  62333. });
  62334. queryBySQLService = new SuperMap.QueryBySQLService(datasetsInfo.dataUrl, {
  62335. eventListeners: {
  62336. processCompleted: success,
  62337. processFailed: function processFailed() {}
  62338. }
  62339. });
  62340. queryBySQLService.processAsync(queryBySQLParams);
  62341. }
  62342. /**
  62343. * @private
  62344. * @function SuperMap.Components.ChartModel.prototype.getDataInfoByIptl
  62345. * @description 用dataId获取iportal的数据。
  62346. * @param {Callbacks} success - getdatachart。
  62347. *
  62348. */
  62349. }, {
  62350. key: "getDataInfoByIptl",
  62351. value: function getDataInfoByIptl(success) {
  62352. // success是chart的回调
  62353. this.getServiceInfo(this.datasets.url, success);
  62354. }
  62355. /**
  62356. * @private
  62357. * @function SuperMap.Components.ChartModel.prototype.getServiceInfo
  62358. * @description 用iportal获取dataItemServices。
  62359. * @param {String} url
  62360. * @param {Callbacks} success - getdatachart。
  62361. * */
  62362. }, {
  62363. key: "getServiceInfo",
  62364. value: function getServiceInfo(url, success) {
  62365. var me = this;
  62366. FetchRequest.get(url, null, {
  62367. withCredentials: this.datasets.withCredentials
  62368. }).then(function (response) {
  62369. return response.json();
  62370. }).then(function (data) {
  62371. if (data.succeed === false) {
  62372. //请求失败
  62373. me._fireFailedEvent(data);
  62374. return;
  62375. } // 是否有rest服务
  62376. if (data.dataItemServices && data.dataItemServices.length > 0) {
  62377. var dataItemServices = data.dataItemServices,
  62378. resultData;
  62379. dataItemServices.forEach(function (item) {
  62380. // 如果有restdata并且发布成功,就请求restdata服务
  62381. // 如果有restmap并且发布成功,就请求restmap服务
  62382. // 其他情况就请求iportal/content.json
  62383. if (item.serviceType === 'RESTDATA' && item.serviceStatus === 'PUBLISHED') {
  62384. resultData = item;
  62385. } else if (item.serviceType === 'RESTMAP' && item.serviceStatus === 'PUBLISHED') {
  62386. resultData = item;
  62387. } else {
  62388. me.getDatafromContent(url, success);
  62389. return;
  62390. }
  62391. }); // 如果有服务,获取数据源和数据集, 然后请求rest服务
  62392. resultData && me.getDatafromRest(resultData.serviceType, resultData.address, success);
  62393. } else {
  62394. me.getDatafromContent(url, success);
  62395. return;
  62396. }
  62397. })["catch"](function (error) {
  62398. console.log(error);
  62399. me._fireFailedEvent(error);
  62400. });
  62401. }
  62402. /**
  62403. * @private
  62404. * @function SuperMap.Components.ChartModel.prototype.getDatafromURL
  62405. * @description 用iportal获取数据。(通过固定的url来请求,但是不能请求工作空间的数据)
  62406. * @param {String} url
  62407. * @param {Callbacks} success - getdatachart。
  62408. */
  62409. }, {
  62410. key: "getDatafromContent",
  62411. value: function getDatafromContent(url, success) {
  62412. var _this = this;
  62413. // 成功回调传入的results
  62414. var results = {
  62415. result: {}
  62416. },
  62417. me = this;
  62418. url += '/content.json?pageSize=9999999&currentPage=1'; // 获取图层数据
  62419. FetchRequest.get(url, null, {
  62420. withCredentials: this.datasets.withCredentials
  62421. }).then(function (response) {
  62422. return response.json();
  62423. }).then(function (data) {
  62424. if (data.succeed === false) {
  62425. //请求失败
  62426. me._fireFailedEvent(data);
  62427. return;
  62428. }
  62429. if (data.type) {
  62430. if (data.type === 'JSON' || data.type === 'GEOJSON') {
  62431. // 将字符串转换成json
  62432. data.content = JSON.parse(data.content.trim()); // 如果是json文件 data.content = {type:'fco', features},格式不固定
  62433. if (!data.content.features) {
  62434. //json格式解析失败
  62435. console.log(Lang.i18n('msg_jsonResolveFiled'));
  62436. return;
  62437. }
  62438. var features = _this._formatGeoJSON(data.content);
  62439. results.result.features = {
  62440. type: data.content.type,
  62441. features: features
  62442. };
  62443. } else if (data.type === 'EXCEL' || data.type === 'CSV') {
  62444. var _features = _this._excelData2Feature(data.content);
  62445. results.result.features = {
  62446. type: 'FeatureCollection',
  62447. features: _features
  62448. };
  62449. }
  62450. success(results, 'content');
  62451. }
  62452. }, this)["catch"](function (error) {
  62453. console.log(error);
  62454. me._fireFailedEvent(error);
  62455. });
  62456. }
  62457. /**
  62458. * @private
  62459. * @function SuperMap.Components.ChartModel.prototype._getDataSource
  62460. * @description 获取数据源名和数据集名。
  62461. * @param {string} serviceType 服务类型
  62462. * @param {string} address 地址
  62463. * @param {Callbacks} success - getdatachart。
  62464. * @return{array} [数据源名:数据集名]
  62465. * @return{string} 图层名
  62466. */
  62467. }, {
  62468. key: "getDatafromRest",
  62469. value: function getDatafromRest(serviceType, address, success) {
  62470. var me = this,
  62471. withCredentials = this.datasets.withCredentials;
  62472. if (serviceType === 'RESTDATA') {
  62473. var url = "".concat(address, "/data/datasources"),
  62474. sourceName,
  62475. datasetName; // 请求获取数据源名
  62476. FetchRequest.get(url, null, {
  62477. withCredentials: withCredentials
  62478. }).then(function (response) {
  62479. return response.json();
  62480. }).then(function (data) {
  62481. sourceName = data.datasourceNames[0];
  62482. url = "".concat(address, "/data/datasources/").concat(sourceName, "/datasets"); // 请求获取数据集名
  62483. FetchRequest.get(url, null, {
  62484. withCredentials: withCredentials
  62485. }).then(function (response) {
  62486. return response.json();
  62487. }).then(function (data) {
  62488. datasetName = data.datasetNames[0]; // 请求restdata服务
  62489. me.getDatafromRestData("".concat(address, "/data"), [sourceName + ':' + datasetName], success);
  62490. return [sourceName + ':' + datasetName];
  62491. })["catch"](function (error) {
  62492. me._fireFailedEvent(error);
  62493. });
  62494. })["catch"](function (error) {
  62495. me._fireFailedEvent(error);
  62496. });
  62497. } else {
  62498. // 如果是地图服务
  62499. var _url = "".concat(address, "/maps"),
  62500. mapName,
  62501. layerName,
  62502. path; // 请求获取地图名
  62503. FetchRequest.get(_url, null, {
  62504. withCredentials: withCredentials
  62505. }).then(function (response) {
  62506. return response.json();
  62507. }).then(function (data) {
  62508. mapName = data[0].name;
  62509. path = data[0].path;
  62510. _url = _url = "".concat(address, "/maps/").concat(mapName, "/layers"); // 请求获取图层名
  62511. FetchRequest.get(_url, null, {
  62512. withCredentials: withCredentials
  62513. }).then(function (response) {
  62514. return response.json();
  62515. }).then(function (data) {
  62516. layerName = data[0].subLayers.layers[0].caption; // 请求restmap服务
  62517. me.getDatafromRestMap(layerName, path, success);
  62518. return layerName;
  62519. })["catch"](function (error) {
  62520. me._fireFailedEvent(error);
  62521. });
  62522. })["catch"](function (error) {
  62523. me._fireFailedEvent(error);
  62524. });
  62525. }
  62526. }
  62527. /**
  62528. * @private
  62529. * @function SuperMap.Components.ChartModel.prototype.getDatafromRestData
  62530. * @description 请求restdata服务
  62531. * @param {String} url
  62532. * @param {Array<string>} dataSource [数据源名:数据集名]
  62533. * @param {Callbacks} success - getdatachart。
  62534. */
  62535. }, {
  62536. key: "getDatafromRestData",
  62537. value: function getDatafromRestData(url, dataSource, success) {
  62538. var me = this;
  62539. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'SmID>0';
  62540. this._getFeatureBySQL(url, dataSource, this.datasets.queryInfo, function (results) {
  62541. // 此时的features已经处理成geojson了
  62542. success(results, 'RESTDATA');
  62543. }, function (error) {
  62544. console.log(error);
  62545. me._fireFailedEvent(error);
  62546. });
  62547. }
  62548. /**
  62549. * @private
  62550. * @function SuperMap.Components.ChartModel.prototype.getDatafromRestMap
  62551. * @description 请求restmap服务
  62552. * @param {String} dataSource layerName
  62553. * @param {String} path - map服务地址。
  62554. * @param {Callbacks} success - getdatachart。
  62555. */
  62556. }, {
  62557. key: "getDatafromRestMap",
  62558. value: function getDatafromRestMap(dataSource, path, success) {
  62559. var me = this;
  62560. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'smid=1';
  62561. this._queryFeatureBySQL(path, dataSource, this.datasets.queryInfo, null, null, function (results) {
  62562. // let features = result.result.recordsets[0].features;
  62563. success(results, 'RESTMAP');
  62564. }, function (error) {
  62565. console.log(error);
  62566. me._fireFailedEvent(error);
  62567. });
  62568. }
  62569. /**
  62570. * @private
  62571. * @function SuperMap.Components.ChartModel.prototype._getFeatureBySQL
  62572. * @description 通过 sql 方式查询数据。
  62573. */
  62574. }, {
  62575. key: "_getFeatureBySQL",
  62576. value: function _getFeatureBySQL(url, datasetNames, queryInfo, _processCompleted, processFaild) {
  62577. var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
  62578. var params = {
  62579. name: datasetNames.join().replace(':', '@')
  62580. };
  62581. Object.assign(params, queryInfo);
  62582. getFeatureParam = new FilterParameter_FilterParameter(params);
  62583. getFeatureBySQLParams = new GetFeaturesBySQLParameters_GetFeaturesBySQLParameters({
  62584. queryParameter: getFeatureParam,
  62585. datasetNames: datasetNames,
  62586. fromIndex: 0,
  62587. toIndex: 100000,
  62588. returnContent: true
  62589. });
  62590. var options = {
  62591. eventListeners: {
  62592. processCompleted: function processCompleted(getFeaturesEventArgs) {
  62593. _processCompleted && _processCompleted(getFeaturesEventArgs);
  62594. },
  62595. processFailed: function processFailed(e) {
  62596. processFaild && processFaild(e);
  62597. }
  62598. }
  62599. };
  62600. getFeatureBySQLService = new GetFeaturesBySQLService_GetFeaturesBySQLService(url, options);
  62601. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  62602. }
  62603. /**
  62604. * @private
  62605. * @function SuperMap.Components.ChartModel.prototype._queryFeatureBySQL
  62606. * @description 通过 sql 方式查询数据。
  62607. */
  62608. }, {
  62609. key: "_queryFeatureBySQL",
  62610. value: function _queryFeatureBySQL(url, layerName, queryInfo, fields, epsgCode, processCompleted, processFaild, startRecord, recordLength, onlyAttribute) {
  62611. var queryParam, queryBySQLParams;
  62612. var filterParams = {
  62613. name: layerName
  62614. };
  62615. Object.assign(filterParams, queryInfo);
  62616. queryParam = new FilterParameter_FilterParameter(filterParams);
  62617. if (fields) {
  62618. queryParam.fields = fields;
  62619. }
  62620. var params = {
  62621. queryParams: [queryParam]
  62622. };
  62623. if (onlyAttribute) {
  62624. params.queryOption = QueryOption.ATTRIBUTE;
  62625. }
  62626. startRecord && (params.startRecord = startRecord);
  62627. recordLength && (params.expectCount = recordLength);
  62628. if (epsgCode) {
  62629. params.prjCoordSys = {
  62630. epsgCode: epsgCode
  62631. };
  62632. }
  62633. queryBySQLParams = new QueryBySQLParameters_QueryBySQLParameters(params);
  62634. this._queryBySQL(url, queryBySQLParams, function (data) {
  62635. data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
  62636. });
  62637. }
  62638. /**
  62639. * @function SuperMap.Components.ChartModel.prototype._queryBySQL
  62640. * @description SQL 查询服务。
  62641. * @param {SuperMap.QueryBySQLParameters} params - SQL 查询相关参数类。
  62642. * @param {RequestCallback} callback - 回调函数。
  62643. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  62644. */
  62645. }, {
  62646. key: "_queryBySQL",
  62647. value: function _queryBySQL(url, params, callback, resultFormat) {
  62648. var me = this;
  62649. var queryBySQLService = new QueryBySQLService_QueryBySQLService(url, {
  62650. eventListeners: {
  62651. scope: me,
  62652. processCompleted: callback,
  62653. processFailed: callback
  62654. },
  62655. format: me._processFormat(resultFormat)
  62656. });
  62657. queryBySQLService.processAsync(params);
  62658. }
  62659. /**
  62660. * @function SuperMap.Components.ChartModel.prototype._processFormat
  62661. * @description 将数据转换成geojson。
  62662. * @param {object} resultFormat - 返回结果集。
  62663. * @return {object} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  62664. */
  62665. }, {
  62666. key: "_processFormat",
  62667. value: function _processFormat(resultFormat) {
  62668. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  62669. }
  62670. /**
  62671. * @private
  62672. * @function SuperMap.Components.ChartModel.prototype._formatGeoJSON
  62673. * @description 格式 GeoJSON。
  62674. * @param {GeoJSON} data - GeoJSON 数据。
  62675. */
  62676. }, {
  62677. key: "_formatGeoJSON",
  62678. value: function _formatGeoJSON(data) {
  62679. var features = data.features;
  62680. features.forEach(function (row, index) {
  62681. row.properties['index'] = index;
  62682. });
  62683. return features;
  62684. }
  62685. /**
  62686. * @private
  62687. * @description 将 csv 和 xls 文件内容转换成 geojson
  62688. * @function SuperMap.Components.ChartModel.prototype._excelData2Feature
  62689. * @param content 文件内容
  62690. * @param layerInfo 图层信息
  62691. * @returns {Array} feature的数组集合
  62692. */
  62693. }, {
  62694. key: "_excelData2Feature",
  62695. value: function _excelData2Feature(dataContent) {
  62696. var fieldCaptions = dataContent.colTitles; //位置属性处理
  62697. var xfieldIndex = -1,
  62698. yfieldIndex = -1;
  62699. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  62700. if (FileReaderUtil.isXField(fieldCaptions[i])) {
  62701. xfieldIndex = i;
  62702. }
  62703. if (FileReaderUtil.isYField(fieldCaptions[i])) {
  62704. yfieldIndex = i;
  62705. }
  62706. } // feature 构建后期支持坐标系 4326/3857
  62707. var features = [];
  62708. for (var _i = 0, _len = dataContent.rows.length; _i < _len; _i++) {
  62709. var row = dataContent.rows[_i];
  62710. var x = Number(row[xfieldIndex]),
  62711. y = Number(row[yfieldIndex]); //属性信息
  62712. var attributes = {};
  62713. for (var index in dataContent.colTitles) {
  62714. var key = dataContent.colTitles[index];
  62715. attributes[key] = dataContent.rows[_i][index];
  62716. }
  62717. attributes['index'] = _i + ''; //目前csv 只支持处理点,所以先生成点类型的 geojson
  62718. var feature = {
  62719. type: 'Feature',
  62720. geometry: {
  62721. type: 'Point',
  62722. coordinates: [x, y]
  62723. },
  62724. properties: attributes
  62725. };
  62726. features.push(feature);
  62727. }
  62728. return features;
  62729. }
  62730. /**
  62731. * @private
  62732. * @description 请求数据失败的事件
  62733. * @function SuperMap.Components.ChartModel.prototype._fireFailedEvent
  62734. * @param {object} error 错误信息
  62735. */
  62736. }, {
  62737. key: "_fireFailedEvent",
  62738. value: function _fireFailedEvent(error) {
  62739. var errorData = error ? {
  62740. error: error,
  62741. message: Lang.i18n('msg_getdatafailed')
  62742. } : {
  62743. message: Lang.i18n('msg_getdatafailed')
  62744. };
  62745. /**
  62746. * @event SuperMap.Components.Chart#getdatafailed
  62747. * @description 监听到获取数据失败事件后触发
  62748. * @property {Object} error - 事件对象。
  62749. */
  62750. this.events.triggerEvent('getdatafailed', errorData);
  62751. }
  62752. }]);
  62753. return ChartModel;
  62754. }();
  62755. // CONCATENATED MODULE: ./src/common/components/chart/ChartViewModel.js
  62756. 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; } } }; }
  62757. 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); }
  62758. 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; }
  62759. function ChartViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62760. 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); } }
  62761. function ChartViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartViewModel_defineProperties(Constructor, staticProps); return Constructor; }
  62762. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  62763. * This program are made available under the terms of the Apache License, Version 2.0
  62764. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62765. /**
  62766. * @class SuperMap.Components.ChartViewModel
  62767. * @classdesc 图表组件功能类
  62768. * @category Components Chart
  62769. * @version 10.0.0
  62770. * @param {Object} options - 可选参数。
  62771. * @param {string} options.type - 图表类型。
  62772. * @param {SuperMap.Components.Chart.Datasets} options.datasets - 数据来源。
  62773. * @param {Array.<Object>} options.chartOptions - 图表可选参数。
  62774. * @param {Array.<Object>} options.chartOptions.xAxis - 图表X轴。
  62775. * @param {string} options.chartOptions.xAxis.field - 图表X轴字段名。
  62776. * @param {string} options.chartOptions.xAxis.name - 图表X轴名称。
  62777. * @param {Array.<Object>} options.chartOptions.yAxis - 图表Y轴。
  62778. * @param {string} options.chartOptions.yAxis.field - 图表Y轴字段名。
  62779. * @param {string} options.chartOptions.yAxis.name - 图表Y轴名称。
  62780. * @fires SuperMap.Components.ChartViewModel#getdatafailed
  62781. */
  62782. var ChartViewModel_ChartViewModel = /*#__PURE__*/function () {
  62783. function ChartViewModel(options) {
  62784. ChartViewModel_classCallCheck(this, ChartViewModel);
  62785. this.datasets = options.datasets;
  62786. this.xField = [];
  62787. this.yField = [];
  62788. this.grid = {
  62789. top: "50px",
  62790. bottom: "50px",
  62791. left: "50px",
  62792. right: "60px"
  62793. };
  62794. this.chartType = options.type || "bar";
  62795. this._initXYField(options.chartOptions);
  62796. this.EVENT_TYPES = ["getdatafailed"];
  62797. this.events = new Events_Events(this, null, this.EVENT_TYPES);
  62798. }
  62799. /**
  62800. * @function SuperMap.Components.ChartViewModel.prototype._initXYField
  62801. * @description 初始化XY字段。
  62802. * @private
  62803. * @param {Object} chartOptions - options里的图表参数
  62804. */
  62805. ChartViewModel_createClass(ChartViewModel, [{
  62806. key: "_initXYField",
  62807. value: function _initXYField(chartOptions) {
  62808. var me = this;
  62809. if (chartOptions && chartOptions.length > 0) {
  62810. chartOptions.forEach(function (option) {
  62811. if (option.xAxis) {
  62812. me.xField.push({
  62813. field: option.xAxis.field,
  62814. name: option.xAxis.name
  62815. });
  62816. }
  62817. if (option.yAxis) {
  62818. me.yField.push({
  62819. field: option.yAxis.field,
  62820. name: option.yAxis.name
  62821. });
  62822. }
  62823. });
  62824. }
  62825. }
  62826. /**
  62827. * @function SuperMap.Components.ChartViewModel.prototype.getDatasetInfo
  62828. * @description 获得数据集数据。
  62829. * @param {function} success - 成功回调函数
  62830. */
  62831. }, {
  62832. key: "getDatasetInfo",
  62833. value: function getDatasetInfo(success) {
  62834. var _this = this;
  62835. this.createChart = success;
  62836. if (this.datasets && this._checkUrl(this.datasets.url)) {
  62837. this.chartModel = new ChartModel_ChartModel(this.datasets);
  62838. if (this.datasets.type === 'iServer') {
  62839. this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this));
  62840. } else if (this.datasets.type === 'iPortal') {
  62841. this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this));
  62842. }
  62843. /**
  62844. * @event SuperMap.Components.ChartViewModel#getdatafailed
  62845. * @description 监听到获取数据失败事件后触发
  62846. * @property {Object} error - 事件对象。
  62847. */
  62848. this.chartModel.events.on({
  62849. "getdatafailed": function getdatafailed(error) {
  62850. _this.events.triggerEvent("getdatafailed", error);
  62851. }
  62852. });
  62853. }
  62854. }
  62855. /**
  62856. * @function SuperMap.Components.ChartViewModel.prototype._getDatasetInfoSuccess
  62857. * @description 成功回调函数。
  62858. * @private
  62859. * @param {Object} results - 数据集信息
  62860. */
  62861. }, {
  62862. key: "_getDatasetInfoSuccess",
  62863. value: function _getDatasetInfoSuccess(results) {
  62864. var datasetUrl = this.datasets.url; //判断服务为地图服务 或者 数据服务
  62865. var restIndex = datasetUrl.indexOf("rest");
  62866. if (restIndex > 0) {
  62867. var index = datasetUrl.indexOf("/", restIndex + 5);
  62868. var type = datasetUrl.substring(restIndex + 5, index);
  62869. var dataUrl = datasetUrl.substring(0, restIndex + 4) + "/data";
  62870. if (type === "maps") {
  62871. var mapIndex = datasetUrl.indexOf("/", index + 1);
  62872. var mapName = datasetUrl.substring(index + 1, mapIndex);
  62873. dataUrl = datasetUrl.substring(0, restIndex + 4) + "/maps/" + mapName;
  62874. results.result.dataUrl = dataUrl;
  62875. this._getLayerFeatures(results);
  62876. } else if (type === "data") {
  62877. results.result.dataUrl = dataUrl;
  62878. this._getDataFeatures(results);
  62879. }
  62880. }
  62881. }
  62882. /**
  62883. * @function SuperMap.Components.ChartViewModel.prototype._getDataInfoSuccess
  62884. * @description 请求iportal数据成功之后的回调
  62885. * @private
  62886. */
  62887. }, {
  62888. key: "_getDataInfoSuccess",
  62889. value: function _getDataInfoSuccess(results, type) {
  62890. var me = this;
  62891. if (type === 'RESTMAP') {
  62892. me._getChartDatasFromLayer(results);
  62893. } else {
  62894. me._getChartDatas(results);
  62895. }
  62896. }
  62897. /**
  62898. * @function SuperMap.Components.ChartViewModel.prototype._getDataFeatures
  62899. * @description 请求数据集的数据信息
  62900. * @private
  62901. * @param {Object} results - 数据集信息
  62902. */
  62903. }, {
  62904. key: "_getDataFeatures",
  62905. value: function _getDataFeatures(results) {
  62906. this.chartModel.getDataFeatures(results, this._getChartDatas.bind(this));
  62907. }
  62908. /**
  62909. * @function SuperMap.Components.ChartViewModel.prototype._getLayerFeatures
  62910. * @description 请求图层的数据信息
  62911. * @private
  62912. * @param {Object} results - 数据集信息
  62913. */
  62914. }, {
  62915. key: "_getLayerFeatures",
  62916. value: function _getLayerFeatures(results) {
  62917. this.chartModel.getLayerFeatures(results, this._getChartDatasFromLayer.bind(this));
  62918. }
  62919. /**
  62920. * @function SuperMap.Components.ChartViewModel.prototype._getChartDatas
  62921. * @description 将请求回来的数据转换为图表所需的数据格式
  62922. * @private
  62923. * @param {Object} results - 数据要素信息
  62924. */
  62925. }, {
  62926. key: "_getChartDatas",
  62927. value: function _getChartDatas(results) {
  62928. if (results) {
  62929. // 数据来自restdata---results.result.features
  62930. this.features = results.result.features;
  62931. var features = this.features.features;
  62932. var data = {};
  62933. if (features.length) {
  62934. var feature = features[0];
  62935. var attrFields = [],
  62936. itemTypes = [];
  62937. for (var attr in feature.properties) {
  62938. attrFields.push(attr);
  62939. itemTypes.push(this._getDataType(feature.properties[attr]));
  62940. }
  62941. data = {
  62942. features: features,
  62943. fieldCaptions: attrFields,
  62944. fieldTypes: itemTypes,
  62945. fieldValues: []
  62946. };
  62947. for (var m in itemTypes) {
  62948. var fieldValue = [];
  62949. for (var j in features) {
  62950. var _feature = features[j];
  62951. var caption = data.fieldCaptions[m];
  62952. var value = _feature.properties[caption];
  62953. fieldValue.push(value);
  62954. }
  62955. data.fieldValues.push(fieldValue);
  62956. }
  62957. this.createChart(data);
  62958. }
  62959. }
  62960. }
  62961. /**
  62962. * @function SuperMap.Components.ChartViewModel.prototype._getChartDatasFromLayer
  62963. * @description 将请求回来的数据转换为图表所需的数据格式
  62964. * @private
  62965. * @param {Object} results - 图层数据要素信息
  62966. */
  62967. }, {
  62968. key: "_getChartDatasFromLayer",
  62969. value: function _getChartDatasFromLayer(results) {
  62970. if (results.result.recordsets) {
  62971. var recordsets = results.result.recordsets[0];
  62972. var features = recordsets.features.features;
  62973. this.features = recordsets.features;
  62974. var data = {};
  62975. if (features.length) {
  62976. data = {
  62977. features: recordsets.features,
  62978. fieldCaptions: recordsets.fieldCaptions,
  62979. fieldTypes: recordsets.fieldTypes,
  62980. fieldValues: []
  62981. };
  62982. for (var m in data.fieldCaptions) {
  62983. var fieldValue = [];
  62984. for (var j in features) {
  62985. var feature = features[j];
  62986. var caption = data.fieldCaptions[m];
  62987. var value = feature.properties[caption];
  62988. fieldValue.push(value);
  62989. }
  62990. data.fieldValues.push(fieldValue);
  62991. }
  62992. this.createChart(data);
  62993. }
  62994. }
  62995. }
  62996. /**
  62997. * @function SuperMap.Components.ChartViewModel.prototype._createChartOptions
  62998. * @description 创建图表所需参数
  62999. * @private
  63000. * @param {Object} data - 图表数据
  63001. */
  63002. }, {
  63003. key: "_createChartOptions",
  63004. value: function _createChartOptions(data) {
  63005. this.calculatedData = this._createChartDatas(data);
  63006. return this.updateChartOptions(this.chartType);
  63007. }
  63008. /**
  63009. * @function SuperMap.Components.ChartViewModel.prototype.changeType
  63010. * @description 改变图表类型
  63011. * @param {string} type - 图表类型
  63012. */
  63013. }, {
  63014. key: "changeType",
  63015. value: function changeType(type) {
  63016. if (type !== this.chartType) {
  63017. this.chartType = type;
  63018. return this.updateChartOptions(this.chartType);
  63019. }
  63020. }
  63021. /**
  63022. * @function SuperMap.Components.ChartViewModel.prototype.updateData
  63023. * @description 改变图表类型
  63024. * @param {SuperMap.Components.Chart.Datasets} datasets - 数据来源
  63025. * @param {function} success 成功回调函数
  63026. */
  63027. }, {
  63028. key: "updateData",
  63029. value: function updateData(datasets, chartOption, success) {
  63030. this.updateChart = success;
  63031. this.xField = [];
  63032. this.yField = [];
  63033. this._initXYField(chartOption); // type的设置默认值
  63034. datasets.type = datasets.type || 'iServer'; // withCredentials的设置默认值
  63035. datasets.withCredentials = datasets.withCredentials || false;
  63036. this.datasets = datasets;
  63037. this.getDatasetInfo(this._updateDataSuccess.bind(this));
  63038. }
  63039. /**
  63040. * @function SuperMap.Components.ChartViewModel.prototype._updateDataSuccess
  63041. * @description 改变图表类型
  63042. * @private
  63043. * @param {Object} data - 图表数据
  63044. */
  63045. }, {
  63046. key: "_updateDataSuccess",
  63047. value: function _updateDataSuccess(data) {
  63048. var options = this._createChartOptions(data);
  63049. this.updateChart(options);
  63050. }
  63051. /**
  63052. * @function SuperMap.Components.ChartViewModel.prototype.updateChartOptions
  63053. * @description 更新图表所需参数
  63054. * @param {string} type - 图表类型
  63055. * @param {Object} style - 图表样式
  63056. */
  63057. }, {
  63058. key: "updateChartOptions",
  63059. value: function updateChartOptions(type, style) {
  63060. if (this.calculatedData) {
  63061. var grid = this.grid;
  63062. var series = this._createChartSeries(this.calculatedData, type);
  63063. var datas = [];
  63064. for (var i in this.calculatedData.XData) {
  63065. datas.push({
  63066. value: this.calculatedData.XData[i].fieldsData
  63067. });
  63068. }
  63069. var xAxis = {
  63070. type: "category",
  63071. name: this.xField[0].name || "X",
  63072. data: datas,
  63073. nameTextStyle: {
  63074. color: '#fff',
  63075. fontSize: 14
  63076. },
  63077. splitLine: {
  63078. show: false
  63079. },
  63080. axisLine: {
  63081. lineStyle: {
  63082. color: '#eee'
  63083. }
  63084. }
  63085. };
  63086. var yAxis = {
  63087. type: "value",
  63088. name: this.yFieldName || "Y",
  63089. data: {},
  63090. nameTextStyle: {
  63091. color: '#fff',
  63092. fontSize: 14
  63093. },
  63094. splitLine: {
  63095. show: false
  63096. },
  63097. axisLine: {
  63098. lineStyle: {
  63099. color: '#eee'
  63100. }
  63101. }
  63102. };
  63103. var tooltip = {
  63104. formatter: '{b0}: {c0}'
  63105. };
  63106. var backgroundColor = '#404a59';
  63107. if (style) {
  63108. if (style.grid) {
  63109. grid = style.grid;
  63110. }
  63111. if (style.tooltip) {
  63112. tooltip = style.tooltip;
  63113. }
  63114. if (style.backgroundColor) {
  63115. backgroundColor = style.backgroundColor;
  63116. }
  63117. }
  63118. return {
  63119. backgroundColor: backgroundColor,
  63120. grid: grid,
  63121. series: series,
  63122. xAxis: xAxis,
  63123. yAxis: yAxis,
  63124. tooltip: tooltip
  63125. };
  63126. }
  63127. }
  63128. /**
  63129. * @function SuperMap.Components.ChartViewModel.prototype._createChartDatas
  63130. * @description 构建图表数据
  63131. * @private
  63132. * @param {Object} data - 源数据
  63133. */
  63134. }, {
  63135. key: "_createChartDatas",
  63136. value: function _createChartDatas(data) {
  63137. var fieldIndex = 0,
  63138. yfieldIndexs = [];
  63139. var fieldCaptions = data.fieldCaptions;
  63140. var me = this; //X
  63141. fieldCaptions.forEach(function (field, index) {
  63142. if (me.xField[0] && field === me.xField[0].field) {
  63143. fieldIndex = index;
  63144. }
  63145. }); //Y
  63146. this.yFieldName = "";
  63147. this.yField.forEach(function (value, index) {
  63148. if (index !== 0) {
  63149. me.yFieldName = me.yFieldName + ",";
  63150. }
  63151. me.yFieldName = me.yFieldName + value.name;
  63152. fieldCaptions.forEach(function (field, index) {
  63153. if (field === value.field) {
  63154. yfieldIndexs.push(index);
  63155. }
  63156. });
  63157. });
  63158. var datas = this._getAttrData(data, fieldIndex);
  63159. var yDatas = [];
  63160. if (yfieldIndexs.length > 0) {
  63161. yfieldIndexs.forEach(function (yfieldIndex) {
  63162. var yData = [];
  63163. for (var i in data.fieldValues[yfieldIndex]) {
  63164. yData.push({
  63165. value: data.fieldValues[yfieldIndex][i]
  63166. });
  63167. }
  63168. yDatas.push(yData);
  63169. });
  63170. } else {
  63171. //未指定Y字段时,y轴计数
  63172. var YData = [],
  63173. XData = [],
  63174. len = datas.length; //计算X轴,Y轴数据,并去重
  63175. for (var i = 0; i < len; i++) {
  63176. var isSame = false;
  63177. for (var j = 0, leng = XData.length; j < leng; j++) {
  63178. if (datas[i].fieldsData === XData[j].fieldsData) {
  63179. YData[j].value++;
  63180. XData[j].recordIndexs.push(i);
  63181. isSame = true;
  63182. break;
  63183. }
  63184. }
  63185. if (!isSame) {
  63186. if (datas[i].fieldsData) {
  63187. XData.push({
  63188. fieldsData: datas[i].fieldsData,
  63189. recordIndexs: [i]
  63190. });
  63191. YData.push({
  63192. value: 1
  63193. });
  63194. }
  63195. }
  63196. }
  63197. datas = XData;
  63198. yDatas = [YData];
  63199. }
  63200. return {
  63201. XData: datas,
  63202. YData: yDatas
  63203. };
  63204. }
  63205. /**
  63206. * @function SuperMap.Components.ChartViewModel.prototype._getAttrData
  63207. * @description 选中字段数据
  63208. * @private
  63209. * @param {Object} datacontent - 图表数据
  63210. * @param {number} index - 字段索引
  63211. */
  63212. }, {
  63213. key: "_getAttrData",
  63214. value: function _getAttrData(datacontent, index) {
  63215. if (index === 0) {
  63216. this.xField = [{
  63217. field: datacontent.fieldCaptions[index],
  63218. name: datacontent.fieldCaptions[index]
  63219. }];
  63220. }
  63221. var fieldsDatas = [];
  63222. for (var i = 0, len = datacontent.fieldValues[index].length; i < len; i++) {
  63223. var value = datacontent.fieldValues[index][i];
  63224. fieldsDatas.push({
  63225. recordIndexs: i,
  63226. fieldsData: value
  63227. });
  63228. }
  63229. return fieldsDatas;
  63230. }
  63231. /**
  63232. * @function SuperMap.Components.ChartViewModel.prototype._createChartSeries
  63233. * @description 图表数据
  63234. * @private
  63235. * @param {Object} calculatedData - 图表数据
  63236. * @param {string} chartType - 图表类型
  63237. */
  63238. }, {
  63239. key: "_createChartSeries",
  63240. value: function _createChartSeries(calculatedData, chartType) {
  63241. var series = [];
  63242. var yDatas = calculatedData.YData;
  63243. yDatas.forEach(function (yData) {
  63244. var value = 0;
  63245. var serieData = [];
  63246. var _iterator = _createForOfIteratorHelper(yData),
  63247. _step;
  63248. try {
  63249. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  63250. var data = _step.value;
  63251. value = data.value;
  63252. serieData.push({
  63253. value: value
  63254. });
  63255. }
  63256. } catch (err) {
  63257. _iterator.e(err);
  63258. } finally {
  63259. _iterator.f();
  63260. }
  63261. var serie = {
  63262. type: chartType,
  63263. data: serieData,
  63264. name: "y"
  63265. };
  63266. series.push(serie);
  63267. });
  63268. return series;
  63269. }
  63270. /**
  63271. * @function SuperMap.Components.ChartViewModel.prototype._isDate
  63272. * @description 判断是否为日期
  63273. * @private
  63274. * @param {string} data - 字符串
  63275. */
  63276. }, {
  63277. key: "_isDate",
  63278. value: function _isDate(data) {
  63279. 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;
  63280. return reg.test(data);
  63281. }
  63282. /**
  63283. * @function SuperMap.Components.ChartViewModel.prototype._isNumber
  63284. * @description 判断是否为数值
  63285. * @private
  63286. * @param {string} data - 字符串
  63287. */
  63288. }, {
  63289. key: "_isNumber",
  63290. value: function _isNumber(data) {
  63291. var mdata = Number(data);
  63292. if (mdata === 0) {
  63293. return true;
  63294. }
  63295. return !isNaN(mdata);
  63296. }
  63297. /**
  63298. * @function SuperMap.Components.ChartViewModel.prototype._getDataType
  63299. * @description 判断数据的类型
  63300. * @private
  63301. * @param {string} data - 字符串
  63302. */
  63303. }, {
  63304. key: "_getDataType",
  63305. value: function _getDataType(data) {
  63306. if (data !== null && data !== undefined && data !== '') {
  63307. if (this._isDate(data)) {
  63308. return "DATE";
  63309. }
  63310. if (this._isNumber(data)) {
  63311. return "NUMBER";
  63312. }
  63313. }
  63314. return "STRING";
  63315. }
  63316. /**
  63317. * @function SuperMap.Components.ChartViewModel.prototype._checkUrl
  63318. * @description 检查url是否符合要求
  63319. * @private
  63320. * @param {string} url
  63321. */
  63322. }, {
  63323. key: "_checkUrl",
  63324. value: function _checkUrl(url) {
  63325. var match;
  63326. if (url === '' || !this._isMatchUrl(url)) {
  63327. match = false;
  63328. } else if (/^http[s]?:\/\/localhost/.test(url) || /^http[s]?:\/\/127.0.0.1/.test(url)) {
  63329. //不是实际域名
  63330. match = false;
  63331. } else {
  63332. match = true;
  63333. }
  63334. return match;
  63335. }
  63336. /**
  63337. * @function SuperMap.Components.ChartViewModel.prototype._isMatchUrl
  63338. * @description 判断输入的地址是否符合地址格式
  63339. * @private
  63340. * @param {string} str - url
  63341. */
  63342. }, {
  63343. key: "_isMatchUrl",
  63344. value: function _isMatchUrl(str) {
  63345. var reg = new RegExp('(https?|http|file|ftp)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]');
  63346. return reg.test(str);
  63347. }
  63348. /**
  63349. * @function SuperMap.Components.ChartViewModel.prototype.getStyle
  63350. * @description 获取图表样式。
  63351. */
  63352. }, {
  63353. key: "getStyle",
  63354. value: function getStyle() {
  63355. var style = {
  63356. grid: this.grid,
  63357. tooltip: this.tooltip,
  63358. backgroundColor: this.backgroundColor
  63359. };
  63360. return style;
  63361. }
  63362. /**
  63363. * @function SuperMap.Components.ChartViewModel.prototype.getFeatures
  63364. * @description 获取地图服务,数据服务请求返回的数据。
  63365. */
  63366. }, {
  63367. key: "getFeatures",
  63368. value: function getFeatures() {
  63369. return this.features;
  63370. }
  63371. /**
  63372. * @function SuperMap.Components.ChartViewModel.prototype.setStyle
  63373. * @description 设置图表样式。
  63374. * @param {Object} style - 图表样式
  63375. */
  63376. }, {
  63377. key: "setStyle",
  63378. value: function setStyle(style) {
  63379. return this.updateChartOptions(this.chartType, style);
  63380. }
  63381. }]);
  63382. return ChartViewModel;
  63383. }();
  63384. SuperMap.Components.ChartViewModel = ChartViewModel_ChartViewModel;
  63385. // CONCATENATED MODULE: ./src/common/components/chart/ChartView.js
  63386. function ChartView_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63387. 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); } }
  63388. function ChartView_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartView_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartView_defineProperties(Constructor, staticProps); return Constructor; }
  63389. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  63390. * This program are made available under the terms of the Apache License, Version 2.0
  63391. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63392. /**
  63393. * @class SuperMap.Components.Chart
  63394. * @classdesc 图表组件
  63395. * @version 9.1.2
  63396. * @param {string} domID - 图表dom元素ID。
  63397. * @param {Object} options - 可选参数。
  63398. * @param {string} options.type - 图表类型。
  63399. * @param {SuperMap.Components.Chart.Datasets} options.datasets - 数据来源
  63400. * @param {Array.<Object>} options.chartOptions - 图表可选参数。
  63401. * @param {Array.<Object>} options.chartOptions.xAxis - 图表X轴。
  63402. * @param {string} options.chartOptions.xAxis.field - 图表X轴字段名。
  63403. * @param {string} options.chartOptions.xAxis.name - 图表X轴名称。
  63404. * @param {Array.<Object>} options.chartOptions.yAxis - 图表Y轴。
  63405. * @param {string} options.chartOptions.yAxis.field - 图表Y轴字段名。
  63406. * @param {string} options.chartOptions.yAxis.name - 图表Y轴名称。
  63407. * @category Components Chart
  63408. */
  63409. /**
  63410. * @typedef {Object} SuperMap.Components.Chart.Datasets - 数据来源
  63411. * @property {string} [type = 'iServer'] - 服务类型 iServer, iPortal。
  63412. * @property {string} url - 服务url地址。
  63413. * @property {boolean} [withCredentials = false] - 设置请求是否带cookie
  63414. * @property {SuperMap.FilterParameter} queryInfo - 查询条件
  63415. */
  63416. var ChartView_ChartView = /*#__PURE__*/function () {
  63417. function ChartView(domID, options) {
  63418. ChartView_classCallCheck(this, ChartView);
  63419. this.domID = domID;
  63420. this.chartType = options.type || "bar"; // 设置options.datasets.type的默认值是iServer
  63421. options.datasets.type = options.datasets.type || 'iServer'; // 设置withCredentials的默认值为false
  63422. options.datasets.withCredentials = options.datasets.withCredentials || false;
  63423. this.viewModel = new ChartViewModel_ChartViewModel(options); //添加控件。
  63424. this._fillDataToView();
  63425. }
  63426. /**
  63427. * @function SuperMap.Components.Chart.prototype.onAdd
  63428. * @description 创建图表之后成功回调
  63429. * @param {function} addChart - 回调函数
  63430. */
  63431. ChartView_createClass(ChartView, [{
  63432. key: "onAdd",
  63433. value: function onAdd(addChart) {
  63434. this.addChart = addChart;
  63435. }
  63436. /**
  63437. * @function SuperMap.Components.Chart.prototype._fillDataToView
  63438. * @description 填充数据到 view。
  63439. * @private
  63440. */
  63441. }, {
  63442. key: "_fillDataToView",
  63443. value: function _fillDataToView() {
  63444. var messageboxs = new MessageBox(); //iclient 绑定createChart事件成功回调
  63445. this.viewModel.getDatasetInfo(this._createChart.bind(this));
  63446. this.viewModel.events.on({
  63447. "getdatafailed": function getdatafailed(error) {
  63448. messageboxs.showView(error.message);
  63449. }
  63450. });
  63451. }
  63452. /**
  63453. * @function SuperMap.Components.Chart.prototype.getStyle
  63454. * @description 获取图表样式。
  63455. */
  63456. }, {
  63457. key: "getStyle",
  63458. value: function getStyle() {
  63459. return this.viewModel.getStyle();
  63460. }
  63461. /**
  63462. * @function SuperMap.Components.Chart.prototype.getFeatures
  63463. * @description 获取地图服务,数据服务请求返回的数据。
  63464. */
  63465. }, {
  63466. key: "getFeatures",
  63467. value: function getFeatures() {
  63468. return this.viewModel.getFeatures();
  63469. }
  63470. /**
  63471. * @function SuperMap.Components.Chart.prototype.setStyle
  63472. * @description 设置图表样式。
  63473. * @param {Object} style - 图表样式 参考Echarts-options样式设置
  63474. */
  63475. }, {
  63476. key: "setStyle",
  63477. value: function setStyle(style) {
  63478. var newOptions = this.viewModel.setStyle(style);
  63479. this._updateChart(newOptions);
  63480. }
  63481. /**
  63482. * @function SuperMap.Components.Chart.prototype.changeType
  63483. * @description 改变图表类型
  63484. * @param {string} type - 图表类型
  63485. */
  63486. }, {
  63487. key: "changeType",
  63488. value: function changeType(type) {
  63489. if (this.chartType !== type) {
  63490. this.chartType = type;
  63491. var newOptions = this.viewModel.changeType(type);
  63492. this._updateChart(newOptions);
  63493. }
  63494. }
  63495. /**
  63496. * @function SuperMap.Components.Chart.prototype.updateData
  63497. * @description 更新图表数据
  63498. * @param {SuperMap.Components.Chart.Datasets} datasets - 数据来源
  63499. * @param {Object} chartOption - X,Y轴信息
  63500. */
  63501. }, {
  63502. key: "updateData",
  63503. value: function updateData(datasets, chartOption) {
  63504. var me = this;
  63505. this.viewModel.updateData(datasets, chartOption, function (options) {
  63506. me._updateChart(options);
  63507. if (me.addChart) {
  63508. me.addChart();
  63509. }
  63510. });
  63511. }
  63512. /**
  63513. * @function SuperMap.Components.Chart.prototype._createChart
  63514. * @description 创建图表
  63515. * @private
  63516. * @param {Object} data - 图表数据
  63517. */
  63518. }, {
  63519. key: "_createChart",
  63520. value: function _createChart(data) {
  63521. this.echart = external_function_try_return_echarts_catch_e_return_default.a.init(document.getElementById(this.domID), null, {
  63522. renderer: "canvas"
  63523. });
  63524. var options = this.viewModel._createChartOptions(data);
  63525. this.echart.setOption(options);
  63526. if (this.addChart) {
  63527. this.addChart();
  63528. }
  63529. }
  63530. /**
  63531. * @function SuperMap.Components.Chart.prototype._updateChart
  63532. * @description 更新图表
  63533. * @private
  63534. * @param {Object} options - 图表参数
  63535. */
  63536. }, {
  63537. key: "_updateChart",
  63538. value: function _updateChart(options) {
  63539. if (this.echart) {
  63540. this.echart.clear();
  63541. this.echart.setOption(options);
  63542. }
  63543. }
  63544. }]);
  63545. return ChartView;
  63546. }();
  63547. SuperMap.Components.Chart = ChartView_ChartView;
  63548. // CONCATENATED MODULE: ./src/common/components/templates/TemplateBase.js
  63549. function TemplateBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63550. 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); } }
  63551. function TemplateBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TemplateBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TemplateBase_defineProperties(Constructor, staticProps); return Constructor; }
  63552. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  63553. * This program are made available under the terms of the Apache License, Version 2.0
  63554. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63555. /**
  63556. * @class SuperMap.Components.TemplateBase
  63557. * @classdesc 组件公用组件父类,用于约束统一封装的公用组件结构。
  63558. * @version 9.1.1
  63559. * @param {Object} options - 组件配置参数。
  63560. * @param {string} options.id - 组件 dom 元素 id。
  63561. * @category Components Common
  63562. */
  63563. var TemplateBase = /*#__PURE__*/function () {
  63564. function TemplateBase(options) {
  63565. TemplateBase_classCallCheck(this, TemplateBase);
  63566. options = options ? options : {};
  63567. /**
  63568. * @member {string} [SuperMap.Components.TemplateBase.prototype.id=null]
  63569. * @description 组件 dom 元素 id。
  63570. */
  63571. this.id = options.id ? options.id : null;
  63572. /**
  63573. * @member {Element} [SuperMap.Components.TemplateBase.prototype.rootContainer=null]
  63574. * @description 组件 dom 元素对象。
  63575. */
  63576. this.rootContainer = null;
  63577. }
  63578. /**
  63579. * @function SuperMap.Components.TemplateBase.prototype.getElement
  63580. * @description 获取当前组件元素对象。
  63581. * @return {Element}
  63582. */
  63583. TemplateBase_createClass(TemplateBase, [{
  63584. key: "getElement",
  63585. value: function getElement() {
  63586. //todo 其实感觉再这里给组件设置不太合理
  63587. if (this.id) {
  63588. this.rootContainer.id = this.id;
  63589. }
  63590. return this.rootContainer;
  63591. }
  63592. /**
  63593. * @function SuperMap.Components.TemplateBase.prototype._initView
  63594. * @private
  63595. * @description 初始化模板。
  63596. */
  63597. }, {
  63598. key: "_initView",
  63599. value: function _initView() {//子类实现此方法
  63600. }
  63601. /**
  63602. * @function SuperMap.Components.TemplateBase.prototype.showView
  63603. * @description 显示组件。
  63604. */
  63605. }, {
  63606. key: "showView",
  63607. value: function showView() {
  63608. this.rootContainer.hidden = false;
  63609. }
  63610. /**
  63611. * @function SuperMap.Components.TemplateBase.prototype.closeView
  63612. * @description 隐藏组件。
  63613. */
  63614. }, {
  63615. key: "closeView",
  63616. value: function closeView() {
  63617. this.rootContainer.hidden = true;
  63618. }
  63619. }]);
  63620. return TemplateBase;
  63621. }();
  63622. SuperMap.Components.TemplateBase = TemplateBase;
  63623. // CONCATENATED MODULE: ./src/common/components/templates/CommonContainer.js
  63624. 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); }
  63625. function CommonContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63626. 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); } }
  63627. function CommonContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonContainer_defineProperties(Constructor, staticProps); return Constructor; }
  63628. 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); }
  63629. function CommonContainer_setPrototypeOf(o, p) { CommonContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CommonContainer_setPrototypeOf(o, p); }
  63630. 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); }; }
  63631. function CommonContainer_possibleConstructorReturn(self, call) { if (call && (CommonContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return CommonContainer_assertThisInitialized(self); }
  63632. function CommonContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63633. 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; } }
  63634. function CommonContainer_getPrototypeOf(o) { CommonContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CommonContainer_getPrototypeOf(o); }
  63635. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  63636. * This program are made available under the terms of the Apache License, Version 2.0
  63637. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63638. /**
  63639. * @class SuperMap.Components.CommonContainer
  63640. * @classdesc 组件统一外框。
  63641. * @version 9.1.1
  63642. * @param {Object} options - 组件可选参数。
  63643. * @param {string} options.id - 组件 dom 元素 id。
  63644. * @param {string} options.title - 标题。
  63645. * @category Components Common
  63646. * @extends {SuperMap.Components.TemplateBase}
  63647. */
  63648. var CommonContainer = /*#__PURE__*/function (_TemplateBase) {
  63649. CommonContainer_inherits(CommonContainer, _TemplateBase);
  63650. var _super = CommonContainer_createSuper(CommonContainer);
  63651. function CommonContainer(options) {
  63652. var _this;
  63653. CommonContainer_classCallCheck(this, CommonContainer);
  63654. _this = _super.call(this, options);
  63655. var title = options.title ? options.title : "";
  63656. _this._initView(title);
  63657. return _this;
  63658. }
  63659. /**
  63660. * @private
  63661. * @override
  63662. */
  63663. CommonContainer_createClass(CommonContainer, [{
  63664. key: "_initView",
  63665. value: function _initView(title) {
  63666. var container = document.createElement("div");
  63667. container.setAttribute("class", "component-container"); //title
  63668. var titleContainer = document.createElement("div");
  63669. titleContainer.setAttribute("class", "component-title");
  63670. var titleContent = document.createElement("div");
  63671. titleContent.innerHTML = title;
  63672. titleContainer.appendChild(titleContent);
  63673. container.appendChild(titleContainer); //container
  63674. var componentContent = document.createElement("div");
  63675. componentContent.setAttribute("class", "component-content");
  63676. container.appendChild(componentContent);
  63677. this.content = componentContent;
  63678. this.rootContainer = container;
  63679. return container;
  63680. }
  63681. /**
  63682. * @function SuperMap.Components.CommonContainer.prototype.getContentElement
  63683. * @description 获取内容元素容器
  63684. */
  63685. }, {
  63686. key: "getContentElement",
  63687. value: function getContentElement() {
  63688. return this.content;
  63689. }
  63690. /**
  63691. * @function SuperMap.Components.CommonContainer.prototype.appendContent
  63692. * @description 填充内容元素
  63693. */
  63694. }, {
  63695. key: "appendContent",
  63696. value: function appendContent(element) {
  63697. this.content.appendChild(element);
  63698. }
  63699. }]);
  63700. return CommonContainer;
  63701. }(TemplateBase);
  63702. SuperMap.Components.CommonContainer = CommonContainer;
  63703. // CONCATENATED MODULE: ./src/common/components/templates/Select.js
  63704. 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); }
  63705. function Select_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63706. 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); } }
  63707. function Select_createClass(Constructor, protoProps, staticProps) { if (protoProps) Select_defineProperties(Constructor.prototype, protoProps); if (staticProps) Select_defineProperties(Constructor, staticProps); return Constructor; }
  63708. 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); }
  63709. function Select_setPrototypeOf(o, p) { Select_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Select_setPrototypeOf(o, p); }
  63710. 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); }; }
  63711. function Select_possibleConstructorReturn(self, call) { if (call && (Select_typeof(call) === "object" || typeof call === "function")) { return call; } return Select_assertThisInitialized(self); }
  63712. function Select_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63713. 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; } }
  63714. function Select_getPrototypeOf(o) { Select_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Select_getPrototypeOf(o); }
  63715. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  63716. * This program are made available under the terms of the Apache License, Version 2.0
  63717. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63718. /**
  63719. * @class SuperMap.Components.Select
  63720. * @classdesc 组件统一的文字下拉框。
  63721. * @version 9.1.1
  63722. * @param {Array.<string|Array>} options - 需要创建的 Select 数据数组。
  63723. * @param {string} options.id - 组件 dom 元素 id。
  63724. * @param {string} [options.labelName] - label 名称。
  63725. * @param {Array.<string>} options.optionsArr - 需要创建的 option 数据数组。
  63726. * @param {Function} [options.optionsClickCb] - option 点击事件回调函数。
  63727. * @extends {SuperMap.Components.TemplateBase}
  63728. * @category Components Common
  63729. */
  63730. var Select = /*#__PURE__*/function (_TemplateBase) {
  63731. Select_inherits(Select, _TemplateBase);
  63732. var _super = Select_createSuper(Select);
  63733. function Select(options) {
  63734. var _this;
  63735. Select_classCallCheck(this, Select);
  63736. _this = _super.call(this, options);
  63737. _this._initView(options);
  63738. return _this;
  63739. }
  63740. Select_createClass(Select, [{
  63741. key: "_initView",
  63742. value: function _initView(options) {
  63743. var selectTool = this._createElement('div', "component-selecttool");
  63744. if (options.labelName) {
  63745. var label = this._createElement('label', 'component-selecttool__lable--describe', selectTool);
  63746. label.innerHTML = options.labelName;
  63747. }
  63748. var chartSelect = this._createElement('div', 'component-selecttool--chart', selectTool);
  63749. chartSelect.setAttribute('tabindex', '1');
  63750. var selectName = this._createElement('div', "component-selecttool__name", chartSelect);
  63751. selectName.title = options.optionsArr[0];
  63752. selectName.innerHTML = options.optionsArr[0];
  63753. var chartTriangleBtn = this._createElement('div', 'component-selecttool__trianglebtn--chart', chartSelect);
  63754. var triangleBtn = this._createElement('div', 'component-triangle-down-img', chartTriangleBtn);
  63755. var selectContent = this._createElement('div', 'component-selecttool__content', chartSelect);
  63756. var scrollarea = this._createElement('div', 'component-selecttool__content--chart', selectContent);
  63757. var scrollareaContent = this._createElement('div', 'component-selecttool__scrollarea__content', scrollarea);
  63758. scrollareaContent.setAttribute('tabindex', '1');
  63759. this.createOptions(scrollareaContent, options.optionsArr);
  63760. this.optionClickEvent(scrollareaContent, selectName, options.optionsClickCb); // 下拉框显示 & 隐藏事件
  63761. this._selectClickEvent(chartSelect, selectContent, triangleBtn);
  63762. this.rootContainer = selectTool;
  63763. }
  63764. /**
  63765. * @function SuperMap.Components.Select.prototype.createOptions
  63766. * @description 创建所属下拉框选项。
  63767. */
  63768. }, {
  63769. key: "createOptions",
  63770. value: function createOptions(container, optionsArr) {
  63771. for (var i in optionsArr) {
  63772. var option = this._createElement('div', 'component-selecttool__option', container);
  63773. option.title = optionsArr[i];
  63774. option.innerHTML = optionsArr[i];
  63775. }
  63776. }
  63777. /**
  63778. * @function SuperMap.Components.Select.prototype._selectClickEvent
  63779. * @description select 点击显示&隐藏事件。
  63780. * @private
  63781. */
  63782. }, {
  63783. key: "_selectClickEvent",
  63784. value: function _selectClickEvent(eventElement, contentElement, triangleBtn) {
  63785. eventElement.onclick = function (e) {
  63786. if (contentElement.style.display === "block") {
  63787. contentElement.style.display = "none";
  63788. triangleBtn.className = "component-triangle-down-img";
  63789. } else {
  63790. contentElement.style.display = "block";
  63791. triangleBtn.className = "triangle-up-img";
  63792. }
  63793. e.preventDefault();
  63794. e.stopPropagation();
  63795. };
  63796. eventElement.onmousedown = function (evt) {
  63797. //console.log('dropdownbox onmousedown '+evt.target.className);
  63798. if (evt.target !== this) {
  63799. this.focus();
  63800. evt.preventDefault();
  63801. evt.stopPropagation();
  63802. }
  63803. };
  63804. eventElement.onblur = function () {
  63805. contentElement.style.display = "none";
  63806. triangleBtn.className = "component-triangle-down-img";
  63807. };
  63808. }
  63809. /**
  63810. * @function Select.prototype._createElement
  63811. * @description 通用创建元素。
  63812. * @private
  63813. */
  63814. }, {
  63815. key: "_createElement",
  63816. value: function _createElement(tagName, className, parentEle) {
  63817. var ele = document.createElement(tagName || 'div');
  63818. className && (ele.className = className);
  63819. parentEle && parentEle.appendChild(ele);
  63820. return ele;
  63821. }
  63822. /**
  63823. * @function SuperMap.Components.Select.prototype.optionClickEvent
  63824. * @description 下拉框的 option 的点击事件。
  63825. */
  63826. }, {
  63827. key: "optionClickEvent",
  63828. value: function optionClickEvent(optionEleArr, selectNameEle, optionsClickCb) {
  63829. var _loop = function _loop(i) {
  63830. var childEle = optionEleArr.children[i];
  63831. childEle.onclick = function () {
  63832. selectNameEle.innerHTML = childEle.innerHTML;
  63833. selectNameEle.title = childEle.title;
  63834. if (childEle.getAttribute('data-value')) {
  63835. selectNameEle.setAttribute('data-value', childEle.getAttribute('data-value'));
  63836. }
  63837. optionsClickCb && optionsClickCb(childEle);
  63838. };
  63839. };
  63840. for (var i = 0; i < optionEleArr.children.length; i++) {
  63841. _loop(i);
  63842. }
  63843. }
  63844. }]);
  63845. return Select;
  63846. }(TemplateBase);
  63847. SuperMap.Components.Select = Select;
  63848. // CONCATENATED MODULE: ./src/common/components/templates/DropDownBox.js
  63849. 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); }
  63850. function DropDownBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63851. 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); } }
  63852. function DropDownBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) DropDownBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) DropDownBox_defineProperties(Constructor, staticProps); return Constructor; }
  63853. 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); }
  63854. function DropDownBox_setPrototypeOf(o, p) { DropDownBox_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DropDownBox_setPrototypeOf(o, p); }
  63855. 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); }; }
  63856. function DropDownBox_possibleConstructorReturn(self, call) { if (call && (DropDownBox_typeof(call) === "object" || typeof call === "function")) { return call; } return DropDownBox_assertThisInitialized(self); }
  63857. function DropDownBox_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63858. 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; } }
  63859. function DropDownBox_getPrototypeOf(o) { DropDownBox_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DropDownBox_getPrototypeOf(o); }
  63860. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  63861. * This program are made available under the terms of the Apache License, Version 2.0
  63862. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63863. /**
  63864. * @class SuperMap.Components.DropDownBox
  63865. * @classdesc 组件统一的图片下拉框。
  63866. * @version 9.1.1
  63867. * @param {Array.<Object>} optionsArr - 需要创建的 option 数据数组。
  63868. * @param {string} optionsArr.id - 组件 dom 元素 id。
  63869. * @param {string} optionsArr.title - 下拉框 title。
  63870. * @param {string} optionsArr.remark - 下拉框解释标记文本。
  63871. * @param {string} optionsArr.icon - 下拉框图标。
  63872. * @param {string} [optionsArr.dataValue] - 下拉框 attribute 名为 data-value 的值 。
  63873. * @param {string} [optionsArr.icon.className] - 下拉框图标类名。
  63874. * @param {string} [optionsArr.icon.background] - 下拉框图标背景 url。
  63875. * @category Components Common
  63876. * @extends {SuperMap.Components.TemplateBase}
  63877. */
  63878. var DropDownBox = /*#__PURE__*/function (_TemplateBase) {
  63879. DropDownBox_inherits(DropDownBox, _TemplateBase);
  63880. var _super = DropDownBox_createSuper(DropDownBox);
  63881. function DropDownBox(optionsArr) {
  63882. var _this;
  63883. DropDownBox_classCallCheck(this, DropDownBox);
  63884. _this = _super.call(this, optionsArr);
  63885. _this._initView(optionsArr);
  63886. return _this;
  63887. }
  63888. /**
  63889. * @function SuperMap.Components.DropDownBox.prototype._initView
  63890. * @description 初始化下拉框。
  63891. * @private
  63892. * @override
  63893. */
  63894. DropDownBox_createClass(DropDownBox, [{
  63895. key: "_initView",
  63896. value: function _initView(optionsArr) {
  63897. var dropDownContainer = document.createElement('div');
  63898. dropDownContainer.className = 'component-dropdownbox--container';
  63899. var dropDownBox = document.createElement('div');
  63900. dropDownBox.setAttribute('tabindex', '1');
  63901. dropDownBox.className = "component-dropdownbox";
  63902. dropDownContainer.appendChild(dropDownBox);
  63903. var dropDownTopContainer = document.createElement('div');
  63904. dropDownBox.appendChild(dropDownTopContainer);
  63905. this._createDropDownOption(optionsArr[0], dropDownTopContainer);
  63906. var triangleBtnContainer = document.createElement('div');
  63907. triangleBtnContainer.className = 'component-dropdownbox__triangle-btn';
  63908. dropDownBox.appendChild(triangleBtnContainer);
  63909. var triangleBtn = document.createElement('div');
  63910. triangleBtn.className = 'component-triangle-down-img';
  63911. triangleBtnContainer.appendChild(triangleBtn);
  63912. var createDropDownBoxParam = {
  63913. "parentEle": dropDownBox,
  63914. "dropDownContent": ['component-dropdownbox__content component-dropdownbox__content--chart', 'dropDownContent'],
  63915. "scrollareaContent": 'component-selecttool__scrollarea__content',
  63916. "optionsArr": optionsArr,
  63917. "triangleBtn": triangleBtn,
  63918. "dropDownTopContainer": dropDownTopContainer
  63919. };
  63920. this._createDropDownBox(createDropDownBoxParam);
  63921. this.rootContainer = dropDownContainer;
  63922. }
  63923. /**
  63924. * @function SuperMap.Components.DropDownBox.prototype._createDropDownBox
  63925. * @description 创建下拉框。
  63926. * @private
  63927. */
  63928. }, {
  63929. key: "_createDropDownBox",
  63930. value: function _createDropDownBox(createDropDownBoxParam) {
  63931. var dropDownBox = createDropDownBoxParam.parentEle;
  63932. var dropDownTopContainer = createDropDownBoxParam.dropDownTopContainer;
  63933. var dropDownContent = document.createElement('div');
  63934. dropDownContent.className = createDropDownBoxParam.dropDownContent[0];
  63935. dropDownBox.appendChild(dropDownContent);
  63936. var scrollareaContent = document.createElement('div');
  63937. scrollareaContent.className = createDropDownBoxParam.scrollareaContent;
  63938. dropDownContent.appendChild(scrollareaContent);
  63939. var optionsArr = createDropDownBoxParam.optionsArr;
  63940. for (var i = 0; i < optionsArr.length; i++) {
  63941. this._createDropDownOption(optionsArr[i], scrollareaContent);
  63942. } // 下拉框显示 & 隐藏事件
  63943. var triangleBtn = createDropDownBoxParam.triangleBtn;
  63944. this._dropDownClickEvent(dropDownBox, dropDownContent, triangleBtn);
  63945. this._eleOnblur(dropDownBox, dropDownContent, triangleBtn); // 下拉框 options 点击事件
  63946. var scrollareaOptions = scrollareaContent.children;
  63947. var _loop = function _loop(_i) {
  63948. scrollareaOptions[_i].onclick = function () {
  63949. dropDownTopContainer.innerHTML = scrollareaOptions[_i].outerHTML; //evt.stopPropagation();
  63950. };
  63951. };
  63952. for (var _i = 0; _i < scrollareaOptions.length; _i++) {
  63953. _loop(_i);
  63954. }
  63955. }
  63956. /**
  63957. * @function SuperMap.Components.DropDownBox.prototype._createDropDownOption
  63958. * @description 创建下拉框子元素。
  63959. * @private
  63960. */
  63961. }, {
  63962. key: "_createDropDownOption",
  63963. value: function _createDropDownOption(data, parentElement) {
  63964. var ele = document.createElement('div');
  63965. ele.className = 'component-dropdownbox__item';
  63966. var dataItem = data;
  63967. if (dataItem['dataValue']) {
  63968. ele.setAttribute('data-value', dataItem['dataValue']);
  63969. }
  63970. parentElement.appendChild(ele);
  63971. var imgContainer = document.createElement('div');
  63972. imgContainer.className = 'component-dropdownbox__item__img';
  63973. ele.appendChild(imgContainer);
  63974. var img = document.createElement('div');
  63975. if (dataItem.icon.className) {
  63976. img.className = dataItem.icon.className;
  63977. }
  63978. if (dataItem.icon.background) {
  63979. img.style.background = dataItem.icon.background;
  63980. }
  63981. imgContainer.appendChild(img);
  63982. var title = document.createElement('div');
  63983. title.className = 'component-dropdownbox__item__title';
  63984. title.title = dataItem.title;
  63985. title.innerHTML = dataItem.title;
  63986. ele.appendChild(title);
  63987. var remark = document.createElement('div');
  63988. remark.className = 'component-dropdownbox__item__remark';
  63989. remark.title = dataItem.remark;
  63990. remark.innerHTML = dataItem.remark;
  63991. ele.appendChild(remark);
  63992. }
  63993. /**
  63994. * @function SuperMap.Components.DropDownBox.prototype._dropDownClickEvent
  63995. * @description 下拉框点击事件。
  63996. * @private
  63997. */
  63998. }, {
  63999. key: "_dropDownClickEvent",
  64000. value: function _dropDownClickEvent(eventElement, contentElement, triangleBtn) {
  64001. eventElement.onclick = function (e) {
  64002. if (contentElement.style.display === "block") {
  64003. contentElement.style.display = "none";
  64004. triangleBtn.className = "component-triangle-down-img";
  64005. } else {
  64006. contentElement.style.display = "block";
  64007. triangleBtn.className = "triangle-up-img";
  64008. }
  64009. e.preventDefault();
  64010. e.stopPropagation();
  64011. };
  64012. eventElement.onmousedown = function (evt) {
  64013. //console.log('dropdownbox onmousedown '+evt.target.className);
  64014. if (evt.target !== this) {
  64015. this.focus();
  64016. evt.preventDefault();
  64017. evt.stopPropagation();
  64018. }
  64019. };
  64020. }
  64021. /**
  64022. * @function SuperMap.Components.DropDownBox.prototype._eleOnblur
  64023. * @description 下拉框失焦事件。
  64024. * @private
  64025. */
  64026. }, {
  64027. key: "_eleOnblur",
  64028. value: function _eleOnblur(eventElement, contentElement, triangleBtn) {
  64029. eventElement.onblur = function () {
  64030. contentElement.style.display = "none";
  64031. triangleBtn.className = "component-triangle-down-img";
  64032. };
  64033. }
  64034. /**
  64035. * @function SuperMap.Components.DropDownBox.prototype._createElement
  64036. * @description 通用创建元素。
  64037. * @private
  64038. */
  64039. }, {
  64040. key: "_createElement",
  64041. value: function _createElement(tagName, className, parentEle) {
  64042. var ele = document.createElement(tagName || 'div');
  64043. className && (ele.className = className);
  64044. parentEle && parentEle.appendChild(ele);
  64045. return ele;
  64046. }
  64047. }]);
  64048. return DropDownBox;
  64049. }(TemplateBase);
  64050. SuperMap.Components.DropDownBox = DropDownBox;
  64051. // CONCATENATED MODULE: ./src/common/components/templates/PopContainer.js
  64052. 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); }
  64053. function PopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64054. 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); } }
  64055. function PopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PopContainer_defineProperties(Constructor, staticProps); return Constructor; }
  64056. 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); }
  64057. function PopContainer_setPrototypeOf(o, p) { PopContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PopContainer_setPrototypeOf(o, p); }
  64058. 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); }; }
  64059. function PopContainer_possibleConstructorReturn(self, call) { if (call && (PopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return PopContainer_assertThisInitialized(self); }
  64060. function PopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64061. 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; } }
  64062. function PopContainer_getPrototypeOf(o) { PopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PopContainer_getPrototypeOf(o); }
  64063. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  64064. * This program are made available under the terms of the Apache License, Version 2.0
  64065. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64066. /**
  64067. * @class SuperMap.Components.PopContainer
  64068. * @classdesc 弹框组件。
  64069. * @version 9.1.1
  64070. * @param {Object} options - 组件配置参数。
  64071. * @param {string} options.id - 组件 dom 元素 id。
  64072. * @param {string} options.title - 弹框组件名称。
  64073. * @extends {SuperMap.Components.TemplateBase}
  64074. * @category Components Common
  64075. */
  64076. var PopContainer = /*#__PURE__*/function (_TemplateBase) {
  64077. PopContainer_inherits(PopContainer, _TemplateBase);
  64078. var _super = PopContainer_createSuper(PopContainer);
  64079. function PopContainer(options) {
  64080. var _this;
  64081. PopContainer_classCallCheck(this, PopContainer);
  64082. options = options ? options : {};
  64083. _this = _super.call(this, options);
  64084. options.title = options.title ? options.title : "";
  64085. _this._initView(options.title);
  64086. return _this;
  64087. }
  64088. /**
  64089. * @private
  64090. * @override
  64091. */
  64092. PopContainer_createClass(PopContainer, [{
  64093. key: "_initView",
  64094. value: function _initView(titile) {
  64095. var container = document.createElement("div");
  64096. container.setAttribute("class", "component-popcontainer"); //header
  64097. var header = document.createElement("div");
  64098. header.setAttribute("class", "component-popcontainer__header");
  64099. var title = document.createElement("label");
  64100. title.setAttribute("class", "component-popcontainer__header__title");
  64101. title.innerHTML = titile;
  64102. header.appendChild(title);
  64103. var closeBtn = document.createElement("span");
  64104. closeBtn.setAttribute("class", "supermapol-icons-clear component-popcontainer__header__close");
  64105. closeBtn.onclick = this.closeView.bind(this);
  64106. container.appendChild(closeBtn);
  64107. container.appendChild(header); //content
  64108. var content = document.createElement("div");
  64109. content.setAttribute("class", "component-popcontainer__content");
  64110. this.content = content;
  64111. container.appendChild(content);
  64112. this.rootContainer = container;
  64113. }
  64114. /**
  64115. * @function SuperMap.Components.PopContainer.prototype.appendContent
  64116. * @description 追加内容。
  64117. * @param {Element} dom - 内容元素。
  64118. */
  64119. }, {
  64120. key: "appendContent",
  64121. value: function appendContent(dom) {
  64122. this.content.appendChild(dom);
  64123. }
  64124. }]);
  64125. return PopContainer;
  64126. }(TemplateBase);
  64127. SuperMap.Components.PopContainer = PopContainer;
  64128. // CONCATENATED MODULE: ./src/common/components/templates/AttributesPopContainer.js
  64129. 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); }
  64130. function AttributesPopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64131. 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); } }
  64132. function AttributesPopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) AttributesPopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) AttributesPopContainer_defineProperties(Constructor, staticProps); return Constructor; }
  64133. 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); }
  64134. function AttributesPopContainer_setPrototypeOf(o, p) { AttributesPopContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AttributesPopContainer_setPrototypeOf(o, p); }
  64135. 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); }; }
  64136. function AttributesPopContainer_possibleConstructorReturn(self, call) { if (call && (AttributesPopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return AttributesPopContainer_assertThisInitialized(self); }
  64137. function AttributesPopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64138. 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; } }
  64139. function AttributesPopContainer_getPrototypeOf(o) { AttributesPopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AttributesPopContainer_getPrototypeOf(o); }
  64140. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  64141. * This program are made available under the terms of the Apache License, Version 2.0
  64142. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64143. /**
  64144. * @class SuperMap.Components.AttributesPopContainer
  64145. * @classdesc 属性弹框组件
  64146. * @version 9.1.1
  64147. * @param {Object} options - 组件配置参数。
  64148. * @param {string} options.id - 组件 dom 元素 id。
  64149. * @param {Object} options.title - 属性弹框组件名称。
  64150. * @param {Object} options.attributes - 组件需要显示的属性内容。
  64151. * @extends {SuperMap.Components.PopContainer}
  64152. * @category Components Common
  64153. */
  64154. var AttributesPopContainer = /*#__PURE__*/function (_PopContainer) {
  64155. AttributesPopContainer_inherits(AttributesPopContainer, _PopContainer);
  64156. var _super = AttributesPopContainer_createSuper(AttributesPopContainer);
  64157. function AttributesPopContainer(options) {
  64158. var _this;
  64159. AttributesPopContainer_classCallCheck(this, AttributesPopContainer);
  64160. //默认为属性:
  64161. options.title = options.title ? options.title : "属性";
  64162. _this = _super.call(this, options);
  64163. _this.rootContainer.firstChild.hidden = true;
  64164. options.attributes = options.attributes ? options.attributes : [];
  64165. _this._createAttributesTable(options.attributes);
  64166. return _this;
  64167. }
  64168. AttributesPopContainer_createClass(AttributesPopContainer, [{
  64169. key: "_createAttributesTable",
  64170. value: function _createAttributesTable(attributes) {
  64171. var table = document.createElement("table");
  64172. table.setAttribute("class", "component-popcontainer__content__table");
  64173. var tbody = document.createElement("tbody");
  64174. var single = true;
  64175. for (var name in attributes) {
  64176. var tr = document.createElement("tr");
  64177. if (single) {
  64178. tr.setAttribute("class", "component-popcontainer__content__td--color");
  64179. }
  64180. var title = document.createElement("td");
  64181. var titleSpan = document.createElement("Span");
  64182. titleSpan.innerHTML = name;
  64183. title.appendChild(titleSpan);
  64184. var value = document.createElement("td");
  64185. value.innerHTML = attributes[name];
  64186. tr.appendChild(title);
  64187. tr.appendChild(value);
  64188. tbody.appendChild(tr);
  64189. single = !single;
  64190. }
  64191. table.appendChild(tbody);
  64192. this.appendContent(table);
  64193. }
  64194. }]);
  64195. return AttributesPopContainer;
  64196. }(PopContainer);
  64197. SuperMap.Components.AttributesPopContainer = AttributesPopContainer;
  64198. // CONCATENATED MODULE: ./src/common/components/templates/IndexTabsPageContainer.js
  64199. 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); }
  64200. function IndexTabsPageContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64201. 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); } }
  64202. function IndexTabsPageContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) IndexTabsPageContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) IndexTabsPageContainer_defineProperties(Constructor, staticProps); return Constructor; }
  64203. 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); }
  64204. function IndexTabsPageContainer_setPrototypeOf(o, p) { IndexTabsPageContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return IndexTabsPageContainer_setPrototypeOf(o, p); }
  64205. 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); }; }
  64206. function IndexTabsPageContainer_possibleConstructorReturn(self, call) { if (call && (IndexTabsPageContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return IndexTabsPageContainer_assertThisInitialized(self); }
  64207. function IndexTabsPageContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64208. 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; } }
  64209. function IndexTabsPageContainer_getPrototypeOf(o) { IndexTabsPageContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return IndexTabsPageContainer_getPrototypeOf(o); }
  64210. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  64211. * This program are made available under the terms of the Apache License, Version 2.0
  64212. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64213. /**
  64214. * @class SuperMap.Components.IndexTabsPageContainer
  64215. * @description 标签索引组件。
  64216. * @version 9.1.1
  64217. * @param {Object} options - 可选参数。
  64218. * @param {string} options.id - 组件 dom 元素 id。
  64219. * @category Components Common
  64220. * @extends {SuperMap.Components.TemplateBase}
  64221. */
  64222. var IndexTabsPageContainer = /*#__PURE__*/function (_TemplateBase) {
  64223. IndexTabsPageContainer_inherits(IndexTabsPageContainer, _TemplateBase);
  64224. var _super = IndexTabsPageContainer_createSuper(IndexTabsPageContainer);
  64225. function IndexTabsPageContainer(options) {
  64226. var _this;
  64227. IndexTabsPageContainer_classCallCheck(this, IndexTabsPageContainer);
  64228. _this = _super.call(this, options);
  64229. _this._initView();
  64230. return _this;
  64231. }
  64232. /**
  64233. * @private
  64234. * @override
  64235. */
  64236. IndexTabsPageContainer_createClass(IndexTabsPageContainer, [{
  64237. key: "_initView",
  64238. value: function _initView() {
  64239. var container = document.createElement("div");
  64240. container.setAttribute("class", "component-tabpage");
  64241. var header = document.createElement("ul");
  64242. this.header = header;
  64243. var content = document.createElement("div");
  64244. content.setAttribute("class", "component-tabpage__content");
  64245. this.content = content;
  64246. container.appendChild(header);
  64247. container.appendChild(content);
  64248. this.rootContainer = container;
  64249. }
  64250. /**
  64251. * @function SuperMap.Components.IndexTabsPageContainer.prototype.setTabs
  64252. * @description 设置标签元素。
  64253. * @param {Array.<Element>} tabs
  64254. */
  64255. }, {
  64256. key: "setTabs",
  64257. value: function setTabs(tabs) {
  64258. this.removeAllTabs();
  64259. this.appendTabs(tabs);
  64260. }
  64261. /**
  64262. * @function SuperMap.Components.IndexTabsPageContainer.prototype.appendTabs
  64263. * @description 追加标签元素。
  64264. * @param {Array.<Element>} tabs
  64265. */
  64266. }, {
  64267. key: "appendTabs",
  64268. value: function appendTabs(tabs) {
  64269. for (var i = 0; i < tabs.length; i++) {
  64270. var title = document.createElement("span");
  64271. title.index = i;
  64272. title.appendChild(document.createTextNode(tabs[i].title)); //绑定标签切换对应页面:
  64273. title.onclick = this._changeTabsPage.bind(this);
  64274. var content = tabs[i].content;
  64275. content.index = i;
  64276. content.hidden = true;
  64277. this.header.appendChild(title);
  64278. this.content.appendChild(content);
  64279. } //todo 确认是否两个子元素的 index 相互对应
  64280. //默认显示第一个标签对象
  64281. this.header.firstChild.setAttribute("class", "on");
  64282. this.content.firstChild.hidden = false;
  64283. }
  64284. /**
  64285. * @function SuperMap.Components.IndexTabsPageContainer.prototype.removeTab
  64286. * @description 删除某个标签页面。
  64287. * @param {number} index - 标签索引号。
  64288. */
  64289. }, {
  64290. key: "removeTab",
  64291. value: function removeTab(index) {
  64292. this.header.removeChild(this.header.children[index]);
  64293. this.content.removeChild(this.content.children[index]);
  64294. }
  64295. /**
  64296. * @function SuperMap.Components.IndexTabsPageContainer.prototype.removeAllTabs
  64297. * @description 删除所有标签。
  64298. */
  64299. }, {
  64300. key: "removeAllTabs",
  64301. value: function removeAllTabs() {
  64302. for (var i = this.header.children.length; i > 0; i--) {
  64303. this.header.removeChild(this.header.children[i]);
  64304. this.content.removeChild(this.content.children[i]);
  64305. }
  64306. }
  64307. }, {
  64308. key: "_changeTabsPage",
  64309. value: function _changeTabsPage(e) {
  64310. var index = e.target.index;
  64311. for (var i = 0; i < this.header.children.length; i++) {
  64312. this.header.children[i].setAttribute("class", "");
  64313. this.content.children[i].hidden = true;
  64314. if (i === index) {
  64315. this.header.children[i].setAttribute("class", "on");
  64316. this.content.children[i].hidden = false;
  64317. }
  64318. }
  64319. }
  64320. }]);
  64321. return IndexTabsPageContainer;
  64322. }(TemplateBase);
  64323. SuperMap.Components.IndexTabsPageContainer = IndexTabsPageContainer;
  64324. // CONCATENATED MODULE: ./src/common/components/templates/CityTabsPage.js
  64325. 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); }
  64326. function CityTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64327. 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); } }
  64328. function CityTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) CityTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) CityTabsPage_defineProperties(Constructor, staticProps); return Constructor; }
  64329. 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); }
  64330. function CityTabsPage_setPrototypeOf(o, p) { CityTabsPage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CityTabsPage_setPrototypeOf(o, p); }
  64331. 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); }; }
  64332. function CityTabsPage_possibleConstructorReturn(self, call) { if (call && (CityTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } return CityTabsPage_assertThisInitialized(self); }
  64333. function CityTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64334. 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; } }
  64335. function CityTabsPage_getPrototypeOf(o) { CityTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CityTabsPage_getPrototypeOf(o); }
  64336. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  64337. * This program are made available under the terms of the Apache License, Version 2.0
  64338. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64339. /**
  64340. * @class SuperMap.Components.CityTabsPage
  64341. * @classdesc 城市地址匹配组件模板
  64342. * @version 9.1.1
  64343. * @param {Object} options - 组件配置参数。
  64344. * @param {string} options.id - 组件 dom 元素 id。
  64345. * @param {Object|Array.<string>} options.config - 城市名称配置列表,支持两种格式:{key1:{A:[],B:[]}, key2:{C:[],D:[]}} 或
  64346. * ["成都市","北京市"],用户可根据自己的项目需求进行配置
  64347. * @extends {SuperMap.Components.IndexTabsPageContainer}
  64348. * @category Components Common
  64349. */
  64350. var CityTabsPage_CityTabsPage = /*#__PURE__*/function (_IndexTabsPageContain) {
  64351. CityTabsPage_inherits(CityTabsPage, _IndexTabsPageContain);
  64352. var _super = CityTabsPage_createSuper(CityTabsPage);
  64353. function CityTabsPage(options) {
  64354. var _this;
  64355. CityTabsPage_classCallCheck(this, CityTabsPage);
  64356. _this = _super.call(this, options); //去掉默认的边框阴影样式:
  64357. _this.rootContainer.classList.add("component-citytabpage--noneBoxShadow");
  64358. _this.config = options.config; //header,若 config为城市名称数组,则直接加载内容
  64359. if (Util_Util.isArray(_this.config)) {
  64360. _this.header.hidden = true;
  64361. _this._createCityItem("城市", _this.config);
  64362. _this.content.style.border = "none";
  64363. } else {
  64364. _this._createTabs();
  64365. _this.header.onclick = function (e) {
  64366. //关闭所有元素 是否有更简化的写法?
  64367. for (var i = 0; i < _this.header.children.length; i++) {
  64368. _this.header.children[i].setAttribute("class", "");
  64369. } //打开点击内容元素
  64370. e.target.setAttribute("class", "on");
  64371. _this._createCityContent(e.target.innerHTML);
  64372. };
  64373. }
  64374. return _this;
  64375. }
  64376. /**
  64377. * @function SuperMap.Components.CityTabsPage.prototype._createTabs
  64378. * @description 创建 Tabs
  64379. * @private
  64380. */
  64381. CityTabsPage_createClass(CityTabsPage, [{
  64382. key: "_createTabs",
  64383. value: function _createTabs() {
  64384. //header
  64385. if (Util_Util.isArray(this.config)) {
  64386. for (var i = 0; i < this.config.length; i++) {
  64387. var innerHTML = "";
  64388. for (var key in this.config[i]) {
  64389. innerHTML += key;
  64390. }
  64391. var li = document.createElement("li");
  64392. li.innerHTML = innerHTML;
  64393. this.header.appendChild(li);
  64394. }
  64395. } else {
  64396. for (var _key in this.config) {
  64397. var _li = document.createElement("li");
  64398. _li.innerHTML = _key;
  64399. this.header.appendChild(_li);
  64400. }
  64401. }
  64402. this.header.firstChild.setAttribute("class", "on");
  64403. this._createCityContent(this.header.firstChild.innerHTML);
  64404. }
  64405. /**
  64406. * @function SuperMap.Components.CityTabsPage.prototype._createCityContent
  64407. * @description 创建列表容器
  64408. * @private
  64409. */
  64410. }, {
  64411. key: "_createCityContent",
  64412. value: function _createCityContent(keyName) {
  64413. //清除元素:
  64414. for (var i = this.content.children.length; i > 0; i--) {
  64415. this.content.removeChild(this.content.children[i - 1]);
  64416. } //创建对应元素
  64417. var cities = this.config[keyName];
  64418. for (var key in cities) {
  64419. this._createCityItem(key, cities[key]);
  64420. }
  64421. }
  64422. /**
  64423. * @function SuperMap.Components.CityTabsPage.prototype._createCityContent
  64424. * @description 创建列表容器
  64425. * @private
  64426. */
  64427. }, {
  64428. key: "_createCityItem",
  64429. value: function _createCityItem(key, cities) {
  64430. var city = document.createElement("div");
  64431. var cityClass = document.createElement("div");
  64432. cityClass.setAttribute("class", "component-citytabpag__py-key");
  64433. cityClass.innerHTML = key;
  64434. city.appendChild(cityClass);
  64435. var cityContent = document.createElement("div");
  64436. cityContent.setAttribute("class", "component-citytabpag__content");
  64437. for (var i = 0; i < cities.length; i++) {
  64438. var span = document.createElement("span");
  64439. span.innerHTML = cities[i];
  64440. cityContent.appendChild(span);
  64441. } //HOT 元素长度单独微调:
  64442. if (key === "HOT") {
  64443. cityContent.style.width = "428px";
  64444. }
  64445. city.appendChild(cityContent);
  64446. this.content.appendChild(city);
  64447. }
  64448. }]);
  64449. return CityTabsPage;
  64450. }(IndexTabsPageContainer);
  64451. SuperMap.Components.CityTabsPage = CityTabsPage_CityTabsPage;
  64452. // CONCATENATED MODULE: ./src/common/components/templates/NavTabsPage.js
  64453. 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); }
  64454. function NavTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64455. 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); } }
  64456. function NavTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) NavTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) NavTabsPage_defineProperties(Constructor, staticProps); return Constructor; }
  64457. 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); }
  64458. function NavTabsPage_setPrototypeOf(o, p) { NavTabsPage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NavTabsPage_setPrototypeOf(o, p); }
  64459. 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); }; }
  64460. function NavTabsPage_possibleConstructorReturn(self, call) { if (call && (NavTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } return NavTabsPage_assertThisInitialized(self); }
  64461. function NavTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64462. 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; } }
  64463. function NavTabsPage_getPrototypeOf(o) { NavTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NavTabsPage_getPrototypeOf(o); }
  64464. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  64465. * This program are made available under the terms of the Apache License, Version 2.0
  64466. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64467. /**
  64468. * @class SuperMap.Components.NavTabsPage
  64469. * @classdesc 标签页面组件。
  64470. * @version 9.1.1
  64471. * @param {Object} options - 组件配置参数。
  64472. * @param {string} optionsArr.id - 组件 dom 元素 id。
  64473. * @param {Array.<Object>} [options.tabs=[]] - 标签对象数组,形如:[{title: "",content: HTMLElement}],初始时,传入则创建页面。
  64474. * @extends {SuperMap.Components.TemplateBase}
  64475. * @category Components Common
  64476. */
  64477. // todo 思考拆分的控件应该以哪种方式使用
  64478. var NavTabsPage = /*#__PURE__*/function (_TemplateBase) {
  64479. NavTabsPage_inherits(NavTabsPage, _TemplateBase);
  64480. var _super = NavTabsPage_createSuper(NavTabsPage);
  64481. function NavTabsPage(options) {
  64482. var _this;
  64483. NavTabsPage_classCallCheck(this, NavTabsPage);
  64484. _this = _super.call(this, options);
  64485. _this.navTabsTitle = null;
  64486. _this.navTabsContent = null;
  64487. options.tabs = options.tabs ? options.tabs : [];
  64488. _this._initView(options.tabs);
  64489. return _this;
  64490. }
  64491. /**
  64492. * @override
  64493. * @private
  64494. */
  64495. NavTabsPage_createClass(NavTabsPage, [{
  64496. key: "_initView",
  64497. value: function _initView(tabs) {
  64498. var navTabsPage = document.createElement("div");
  64499. navTabsPage.setAttribute("class", "component-navtabspage"); //关闭按钮
  64500. var closeBtn = document.createElement("span");
  64501. closeBtn.setAttribute("class", "supermapol-icons-close");
  64502. closeBtn.onclick = this.closeView.bind(this);
  64503. navTabsPage.appendChild(closeBtn); //标签
  64504. var navTabsTitle = document.createElement("div");
  64505. this.navTabsTitle = navTabsTitle;
  64506. navTabsTitle.setAttribute("class", "component-navtabspage__title");
  64507. navTabsPage.appendChild(navTabsTitle); //内容
  64508. var navTabsContent = document.createElement("div");
  64509. this.navTabsContent = navTabsContent;
  64510. navTabsContent.setAttribute("class", "component-navtabspage__content");
  64511. navTabsPage.appendChild(navTabsContent); //若 tabs 初始传入值,则
  64512. if (tabs.length > 0) {
  64513. this.appendTabs(tabs);
  64514. }
  64515. this.rootContainer = navTabsPage;
  64516. }
  64517. /**
  64518. * @function SuperMap.Components.NavTabsPage.prototype.setTabs
  64519. * @description 设置标签。
  64520. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  64521. */
  64522. }, {
  64523. key: "setTabs",
  64524. value: function setTabs(tabs) {
  64525. this.removeAllTabs();
  64526. this.appendTabs(tabs);
  64527. }
  64528. /**
  64529. * @function SuperMap.Components.NavTabsPage.prototype.appendTabs
  64530. * @description 添加标签页面。
  64531. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  64532. */
  64533. }, {
  64534. key: "appendTabs",
  64535. value: function appendTabs(tabs) {
  64536. for (var i = 0; i < tabs.length; i++) {
  64537. var title = document.createElement("span");
  64538. title.index = i;
  64539. title.appendChild(document.createTextNode(tabs[i].title)); //绑定标签切换对应页面:
  64540. title.onclick = this._changeTabsPage.bind(this);
  64541. var content = tabs[i].content;
  64542. content.index = i;
  64543. content.hidden = true;
  64544. this.navTabsTitle.appendChild(title);
  64545. this.navTabsContent.appendChild(content);
  64546. } //todo 确认是否两个子元素的 index 相互对应
  64547. //默认显示第一个标签对象
  64548. this.navTabsTitle.firstChild.setAttribute("class", "component-navtabspage__tabs--select");
  64549. this.navTabsContent.firstChild.hidden = false;
  64550. }
  64551. /**
  64552. * @function SuperMap.Components.NavTabsPage.prototype.removeTab
  64553. * @description 删除某个标签页面。
  64554. * @param {number} index - 标签索引号。
  64555. */
  64556. }, {
  64557. key: "removeTab",
  64558. value: function removeTab(index) {
  64559. this.navTabsTitle.removeChild(this.navTabsTitle.children[index]);
  64560. this.navTabsContent.removeChild(this.navTabsContent.children[index]);
  64561. }
  64562. /**
  64563. * @function SuperMap.Components.NavTabsPage.prototype.removeAllTabs
  64564. * @description 删除所有标签。
  64565. */
  64566. }, {
  64567. key: "removeAllTabs",
  64568. value: function removeAllTabs() {
  64569. for (var i = this.navTabsTitle.children.length; i > 0; i--) {
  64570. this.navTabsTitle.removeChild(this.navTabsTitle.children[i]);
  64571. this.navTabsContent.removeChild(this.navTabsContent.children[i]);
  64572. }
  64573. }
  64574. }, {
  64575. key: "_changeTabsPage",
  64576. value: function _changeTabsPage(e) {
  64577. var index = e.target.index;
  64578. for (var i = 0; i < this.navTabsTitle.children.length; i++) {
  64579. this.navTabsTitle.children[i].setAttribute("class", "");
  64580. this.navTabsContent.children[i].hidden = true;
  64581. if (i === index) {
  64582. this.navTabsTitle.children[i].setAttribute("class", "component-navtabspage__tabs--select");
  64583. this.navTabsContent.children[i].hidden = false;
  64584. }
  64585. }
  64586. }
  64587. }]);
  64588. return NavTabsPage;
  64589. }(TemplateBase);
  64590. SuperMap.Components.NavTabsPage = NavTabsPage;
  64591. // CONCATENATED MODULE: ./src/common/components/templates/PaginationContainer.js
  64592. 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); }
  64593. function PaginationContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64594. 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); } }
  64595. function PaginationContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PaginationContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PaginationContainer_defineProperties(Constructor, staticProps); return Constructor; }
  64596. 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); }
  64597. function PaginationContainer_setPrototypeOf(o, p) { PaginationContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PaginationContainer_setPrototypeOf(o, p); }
  64598. 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); }; }
  64599. function PaginationContainer_possibleConstructorReturn(self, call) { if (call && (PaginationContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return PaginationContainer_assertThisInitialized(self); }
  64600. function PaginationContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64601. 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; } }
  64602. function PaginationContainer_getPrototypeOf(o) { PaginationContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PaginationContainer_getPrototypeOf(o); }
  64603. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  64604. * This program are made available under the terms of the Apache License, Version 2.0
  64605. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64606. /**
  64607. * @class SuperMap.Components.PaginationContainer
  64608. * @classdesc 分页组件模板。
  64609. * @version 9.1.1
  64610. * @param {Object} options - 组件配置参数。
  64611. * @param {string} optionsArr.id - 组件 dom 元素 id。
  64612. * @param {HTMLElement} options.contents - 页面填充的 DOM 元素对象。
  64613. * @param {number} options.pageCounts - 页数。
  64614. * @extends {SuperMap.Components.TemplateBase}
  64615. * @category Components Common
  64616. */
  64617. var PaginationContainer = /*#__PURE__*/function (_TemplateBase) {
  64618. PaginationContainer_inherits(PaginationContainer, _TemplateBase);
  64619. var _super = PaginationContainer_createSuper(PaginationContainer);
  64620. function PaginationContainer(options) {
  64621. var _this;
  64622. PaginationContainer_classCallCheck(this, PaginationContainer);
  64623. options = options ? options : {};
  64624. _this = _super.call(this, options);
  64625. _this.currentPage = 0;
  64626. _this.pageNumberLis = [];
  64627. _this.currentPageNumberLis = [];
  64628. _this.linkageEvent = null;
  64629. options.contents = options.contents ? options.contents : null;
  64630. options.pageCounts = options.pageCounts ? options.pageCounts : 0;
  64631. _this._initView(options.contents, options.pageCounts);
  64632. return _this;
  64633. }
  64634. /**
  64635. * @function SuperMap.Components.PaginationContainer.prototype.setLinkageEvent
  64636. * @description 设置页面联动方法。
  64637. * @param {function} linkageEvent - 联动方法,实现指定功能。
  64638. */
  64639. PaginationContainer_createClass(PaginationContainer, [{
  64640. key: "setLinkageEvent",
  64641. value: function setLinkageEvent(linkageEvent) {
  64642. this.linkageEvent = linkageEvent;
  64643. }
  64644. /**
  64645. * @private
  64646. * @override
  64647. */
  64648. }, {
  64649. key: "_initView",
  64650. value: function _initView(contents, pageCounts) {
  64651. var container = document.createElement("div");
  64652. container.setAttribute("class", "component-pagination"); //content
  64653. var content = document.createElement("div");
  64654. content.setAttribute("class", "component-pagination__content");
  64655. container.appendChild(content);
  64656. this.content = content; //link
  64657. var link = document.createElement("ul");
  64658. link.setAttribute("class", "component-pagination__link");
  64659. link.onclick = this._changePageEvent.bind(this);
  64660. container.appendChild(link);
  64661. this._createLink(link);
  64662. this.link = link; //填充内容:
  64663. if (contents) {
  64664. this.setContent(contents);
  64665. }
  64666. if (pageCounts !== 0) {
  64667. this.setPageLink(pageCounts);
  64668. }
  64669. this.rootContainer = container;
  64670. }
  64671. /**---------以下是页面相关操作 **/
  64672. /**
  64673. * @function SuperMap.Components.PaginationContainer.prototype.setContent
  64674. * @description 设置页面内容。
  64675. * @param {Element} element - 页面内容元素。
  64676. */
  64677. }, {
  64678. key: "setContent",
  64679. value: function setContent(element) {
  64680. this.clearContent();
  64681. this.appendContent(element);
  64682. }
  64683. /**
  64684. * @function SuperMap.Components.PaginationContainer.prototype.appendContent
  64685. * @description 追加内容。
  64686. * @param {Element} element - 页面内容元素。
  64687. */
  64688. }, {
  64689. key: "appendContent",
  64690. value: function appendContent(element) {
  64691. this.content.appendChild(element);
  64692. }
  64693. /**
  64694. * @function SuperMap.Components.PaginationContainer.prototype.clearContent
  64695. * @description 清空内容元素。
  64696. */
  64697. }, {
  64698. key: "clearContent",
  64699. value: function clearContent() {
  64700. for (var i = this.content.children.length - 1; i >= 0; i--) {
  64701. this.content.removeChild(this.content.children[i]);
  64702. }
  64703. }
  64704. /** -----以下是页码相关的操作:**/
  64705. /**
  64706. * @function SuperMap.Components.PaginationContainer.prototype.setPageLink
  64707. * @description 设置页码数。
  64708. * @param {number} pageNumber - 页码数。
  64709. */
  64710. }, {
  64711. key: "setPageLink",
  64712. value: function setPageLink(pageNumber) {
  64713. //清空当前页码
  64714. this.pageNumberLis = [];
  64715. this.currentPageNumberLis = [];
  64716. this.clearPageLink(); //创建页码
  64717. this._createPageLi(pageNumber); //添加页码到页码列表
  64718. this._appendPageLink();
  64719. }
  64720. /**
  64721. * @description 创建页码。
  64722. * @param pageNumber
  64723. * @private
  64724. */
  64725. }, {
  64726. key: "_createPageLi",
  64727. value: function _createPageLi(pageNumber) {
  64728. for (var i = 0; i < pageNumber; i++) {
  64729. var pageLi = document.createElement("li");
  64730. pageLi.innerHTML = i + 1;
  64731. /*const liContent = document.createElement("span");
  64732. liContent.innerHTML = i + 1;*/
  64733. // pageLi.appendChild(liContent);
  64734. this.pageNumberLis.push(pageLi);
  64735. }
  64736. this.pageNumberLis[0].setAttribute("class", "active");
  64737. this.currentPage = 1;
  64738. if (pageNumber < 5) {
  64739. this.currentPageNumberLis = this.pageNumberLis;
  64740. } else {
  64741. for (var _i = 0; _i < 5; _i++) {
  64742. this.currentPageNumberLis.push(this.pageNumberLis[_i]);
  64743. }
  64744. }
  64745. }
  64746. /**
  64747. * @description 添加页码到页码列表。
  64748. * @private
  64749. */
  64750. }, {
  64751. key: "_appendPageLink",
  64752. value: function _appendPageLink() {
  64753. //todo 如何插入中间
  64754. for (var i = 0; i < this.currentPageNumberLis.length; i++) {
  64755. this.link.insertBefore(this.currentPageNumberLis[i], this.link.childNodes[this.link.children.length - 2]);
  64756. }
  64757. for (var _i2 = 0; _i2 < this.currentPageNumberLis.length; _i2++) {
  64758. //清空 active 状态
  64759. this.currentPageNumberLis[_i2].setAttribute("class", ""); //给当前选中的 li 赋值 active 状态
  64760. if (Number(this.currentPageNumberLis[_i2].innerHTML) === this.currentPage) {
  64761. this.currentPageNumberLis[_i2].setAttribute("class", "active");
  64762. }
  64763. } //根据 currentPage 改变按钮状态
  64764. this._changeDisableState();
  64765. if (this.linkageEvent) {
  64766. this.linkageEvent(this.currentPage);
  64767. }
  64768. }
  64769. /**
  64770. * @function SuperMap.Components.PaginationContainer.prototype.clearPageLink
  64771. * @description 清除页码列表。
  64772. */
  64773. }, {
  64774. key: "clearPageLink",
  64775. value: function clearPageLink() {
  64776. for (var i = this.link.children.length - 3; i > 1; i--) {
  64777. this.link.removeChild(this.link.children[i]);
  64778. }
  64779. }
  64780. /**
  64781. * @description 创建页码按钮。
  64782. * @param ul
  64783. * @private
  64784. */
  64785. }, {
  64786. key: "_createLink",
  64787. value: function _createLink(ul) {
  64788. for (var i = 0; i < 4; i++) {
  64789. var li = document.createElement("li");
  64790. li.setAttribute("class", "disable");
  64791. var liContent = document.createElement("span");
  64792. li.appendChild(liContent);
  64793. if (i === 0) {
  64794. liContent.id = "first";
  64795. liContent.setAttribute("class", "supermapol-icons-first");
  64796. } else if (i === 1) {
  64797. liContent.id = "prev";
  64798. liContent.setAttribute("class", "supermapol-icons-prev");
  64799. } else if (i === 2) {
  64800. liContent.id = "next";
  64801. liContent.setAttribute("class", "supermapol-icons-next");
  64802. } else if (i === 3) {
  64803. liContent.id = "last";
  64804. liContent.setAttribute("class", "supermapol-icons-last");
  64805. }
  64806. ul.appendChild(li);
  64807. }
  64808. }
  64809. /**
  64810. * @description 点击页码事件。
  64811. * @param e
  64812. * @private
  64813. */
  64814. }, {
  64815. key: "_changePageEvent",
  64816. value: function _changePageEvent(e) {
  64817. //todo
  64818. var trigger = e.target; //若列表禁用,点击无效
  64819. if (trigger.parentElement.classList[0] === "disable") {
  64820. return;
  64821. }
  64822. var targetLi;
  64823. if (trigger.id) {
  64824. targetLi = trigger.id;
  64825. } else if (Number(trigger.innerHTML)) {
  64826. targetLi = Number(trigger.innerHTML);
  64827. } else {
  64828. return;
  64829. } //页码预处理:
  64830. this._prePageNum(targetLi); //根据 currentPageNumberLis 创建页码列表
  64831. this.clearPageLink();
  64832. this._appendPageLink();
  64833. }
  64834. /**
  64835. * @description 根据 currentPage 改变按钮状态。
  64836. * @private
  64837. */
  64838. }, {
  64839. key: "_changeDisableState",
  64840. value: function _changeDisableState() {
  64841. this.link.children[0].setAttribute("class", "");
  64842. this.link.children[1].setAttribute("class", "");
  64843. this.link.children[this.link.children.length - 1].setAttribute("class", "");
  64844. this.link.children[this.link.children.length - 2].setAttribute("class", "");
  64845. if (this.currentPage === 1) {
  64846. this.link.children[0].setAttribute("class", "disable");
  64847. this.link.children[1].setAttribute("class", "disable");
  64848. }
  64849. if (this.currentPage === this.pageNumberLis.length) {
  64850. this.link.children[this.link.children.length - 1].setAttribute("class", "disable");
  64851. this.link.children[this.link.children.length - 2].setAttribute("class", "disable");
  64852. }
  64853. }
  64854. /**
  64855. * @description 根据点击页码列表事件准备需展现的页码列表。
  64856. * @param {string|number} targetLi - 被点击的列表对象 id 或 被点击的页码值。
  64857. * @private
  64858. */
  64859. }, {
  64860. key: "_prePageNum",
  64861. value: function _prePageNum(targetLi) {
  64862. var currentPageNumberLis = [];
  64863. if (targetLi === "first") {
  64864. this.currentPage = 1;
  64865. } else if (targetLi === "last") {
  64866. this.currentPage = this.pageNumberLis.length;
  64867. } else if (targetLi === "prev") {
  64868. this.currentPage = this.currentPage - 1;
  64869. } else if (targetLi === "next") {
  64870. this.currentPage = this.currentPage + 1;
  64871. } else {
  64872. this.currentPage = targetLi;
  64873. }
  64874. if (this.pageNumberLis.length <= 5) {
  64875. for (var i = 0; i < this.pageNumberLis.length; i++) {
  64876. currentPageNumberLis.push(this.pageNumberLis[i]);
  64877. }
  64878. } else {
  64879. //当前点击前三,都取前五
  64880. if (this.currentPage <= 3) {
  64881. for (var _i3 = 0; _i3 < 5; _i3++) {
  64882. currentPageNumberLis.push(this.pageNumberLis[_i3]);
  64883. }
  64884. } else if (this.currentPage >= this.pageNumberLis.length - 3) {
  64885. //点击后三,都取后5
  64886. for (var _i4 = this.pageNumberLis.length - 5; _i4 < this.pageNumberLis.length; _i4++) {
  64887. currentPageNumberLis.push(this.pageNumberLis[_i4]);
  64888. }
  64889. } else {
  64890. //其他,取中间:
  64891. for (var _i5 = this.currentPage - 3; _i5 <= this.currentPage + 1; _i5++) {
  64892. currentPageNumberLis.push(this.pageNumberLis[_i5]);
  64893. }
  64894. }
  64895. }
  64896. if (currentPageNumberLis.length > 0) {
  64897. this.currentPageNumberLis = currentPageNumberLis;
  64898. }
  64899. }
  64900. }]);
  64901. return PaginationContainer;
  64902. }(TemplateBase);
  64903. SuperMap.Components.PaginationContainer = PaginationContainer;
  64904. // CONCATENATED MODULE: ./src/common/components/util/Util.js
  64905. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  64906. * This program are made available under the terms of the Apache License, Version 2.0
  64907. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64908. var ComponentsUtil = {
  64909. /**
  64910. * 获取上传文件类型
  64911. * @param fileName
  64912. */
  64913. getFileType: function getFileType(fileName) {
  64914. var regCSV = /^.*\.(?:csv)$/i;
  64915. var regExcel = /^.*\.(?:xls|xlsx)$/i; //文件名可以带空格
  64916. var regGeojson = /^.*\.(?:geojson|json)$/i;
  64917. if (regExcel.test(fileName)) {
  64918. //校验不通过
  64919. return FileTypes.EXCEL;
  64920. } else if (regCSV.test(fileName)) {
  64921. return FileTypes.CSV;
  64922. } else if (regGeojson.test(fileName)) {
  64923. return FileTypes.GEOJSON;
  64924. }
  64925. return null;
  64926. }
  64927. };
  64928. // CONCATENATED MODULE: ./src/common/components/util/index.js
  64929. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  64930. * This program are made available under the terms of the Apache License, Version 2.0
  64931. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64932. // CONCATENATED MODULE: ./src/common/components/index.js
  64933. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  64934. * This program are made available under the terms of the Apache License, Version 2.0
  64935. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64936. //数据
  64937. //组件
  64938. //提示框组件
  64939. //图表组件
  64940. //公用模板:
  64941. //工具类
  64942. // CONCATENATED MODULE: ./src/common/lang/locales/en-US.js
  64943. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  64944. * This program are made available under the terms of the Apache License, Version 2.0
  64945. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64946. /**
  64947. * Namespace: SuperMap.Lang["en"]
  64948. * Dictionary for English. Keys for entries are used in calls to
  64949. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  64950. * strings formatted for use with <SuperMap.String.format> calls.
  64951. */
  64952. var en = {
  64953. 'title_dataFlowService': 'Data Flow Service',
  64954. 'title_distributedAnalysis': 'Distributed Analysis',
  64955. 'title_clientComputing': 'Client Computing',
  64956. 'title_dataServiceQuery': 'Data Service Query',
  64957. 'title_searchCity': 'Search city',
  64958. 'title_searchLayer': ' Search layer',
  64959. 'text_input_value_inputDataFlowUrl': 'Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  64960. 'text_displayFeaturesInfo': 'Display feature information',
  64961. 'text_subscribe': 'subscribe',
  64962. 'text_cancelSubscribe': 'unsubscribe',
  64963. 'text_densityAnalysis': 'Density Analysis',
  64964. 'text_CalculateTheValuePerUnitArea': 'Calculate the value per unit area within the neighborhood shape',
  64965. 'text_option_selectDataset': 'Please select a dataset',
  64966. 'text_label_dataset': 'Dataset',
  64967. 'text_option_simplePointDensityAnalysis': 'Simple point density analysis',
  64968. 'text_option_nuclearDensityAnalysis': 'Nuclear density analysis',
  64969. 'text_label_analyticalMethod': 'Analytical method',
  64970. 'text_option_quadrilateral': 'Quadrilateral',
  64971. 'text_option_hexagon': 'hexagon',
  64972. 'text_label_meshType': 'Mesh type',
  64973. 'text_option_notSet': 'Not set',
  64974. 'text_label_weightField': 'Weight field',
  64975. 'text_label_gridSizeInMeters': 'Grid size',
  64976. 'text_label_searchRadius': 'Search radius',
  64977. 'text_label_queryRange': 'Scope of analysis',
  64978. 'text_label_areaUnit': 'Area unit',
  64979. 'text_option_equidistantSegmentation': 'Equidistant segmentation',
  64980. 'text_option_logarithm': 'Logarithm',
  64981. 'text_option_equalCountingSegment': 'Equal counting segment',
  64982. 'text_option_squareRootSegmentation': 'Square root segmentation',
  64983. 'text_label_thematicMapSegmentationMode': 'Thematic map segmentation mode',
  64984. 'text_label_thematicMapSegmentationParameters': 'Thematic map segmentation parameters',
  64985. 'text_option_greenOrangePurpleGradient': 'Green orange purple gradient',
  64986. 'text_option_greenOrangeRedGradient': 'Green orange red gradient',
  64987. 'text_option_rainbowGradient': 'Rainbow gradient',
  64988. 'text_option_spectralGradient': 'Spectral gradient',
  64989. 'text_option_terrainGradient': 'Terrain gradient',
  64990. 'text_label_thematicMapColorGradientMode': 'Thematic map color gradient mode',
  64991. 'text_label_resultLayerName': 'Result layer name',
  64992. 'text_chooseFile': 'Open File',
  64993. 'text_isoline': 'Isoline',
  64994. 'text_extractDiscreteValue': 'Extract discrete value generation curve',
  64995. 'text_buffer': 'Buffer',
  64996. 'text_specifyTheDistance': 'Specify the distance to create the surrounding area',
  64997. 'text_label_analysisLayer': 'Analysis layer',
  64998. 'text_label_extractField': 'Extract field',
  64999. 'text_label_extractedValue': 'Extracted value',
  65000. 'text_label_distanceAttenuation': 'Distance attenuation',
  65001. 'text_label_gridSize': 'gridSize',
  65002. 'text_label_bufferRadius': 'Buffer radius',
  65003. 'text_label_defaultkilometers': 'Default 10 kilometers',
  65004. 'text_label_kilometer': 'kilometer',
  65005. 'text_label_unit': 'unit',
  65006. 'text_retainOriginal': 'Retain original object field',
  65007. 'text_mergeBuffer': 'Merge buffer',
  65008. 'text_label_color': 'Color',
  65009. 'text_label_buffer': '[Buffer]',
  65010. 'text_label_isolines': '[Isolines]',
  65011. 'text_label_queryRangeTips': 'The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850',
  65012. 'text_label_queryModel': 'Query mode',
  65013. 'text_label_IDArrayOfFeatures': 'ID array of features',
  65014. 'text_label_maxFeatures': 'The maximum number of features that can be returned',
  65015. 'text_label_bufferDistance': 'Buffer distance',
  65016. 'text_label_queryRange1': 'Query range',
  65017. 'text_label_spatialQueryMode': 'Spatial query mode',
  65018. 'text_label_featureFilter': 'Feature filter',
  65019. 'text_label_geometricObject': 'Geometric object',
  65020. 'text_label_queryMode': 'Query mode',
  65021. 'text_label_searchTips': 'Search for city locations or layer features',
  65022. 'text_label_chooseSearchLayers': 'Select a query layer',
  65023. 'text_loadSearchCriteria': 'Load search criteria',
  65024. 'text_saveSearchCriteria': 'Save search criteria',
  65025. "btn_analyze": "Analyze",
  65026. "btn_analyzing": "Analyzing",
  65027. "btn_emptyTheAnalysisLayer": "Empty the analysis layer",
  65028. "btn_cancelAnalysis": "Cancel",
  65029. "btn_query": "Query",
  65030. "btn_querying": "Querying",
  65031. "btn_emptyTheRresultLayer": "Clear all result layers",
  65032. 'msg_dataReturnedIsEmpty.': 'The request is successful and the data returned by the query is empty.',
  65033. 'msg_dataFlowServiceHasBeenSubscribed': 'The data stream service has been subscribed to.',
  65034. 'msg_inputDataFlowUrlFirst': 'Please enter the data stream service address first.',
  65035. 'msg_datasetOrMethodUnsupport': 'This dataset does not support this analysis type. Please reselect the dataset.',
  65036. 'msg_selectDataset': 'Please select a data set!',
  65037. 'msg_setTheWeightField': 'Please set the weight field!',
  65038. 'msg_theFieldNotSupportAnalysis': 'The field you currently select does not support analysis!',
  65039. 'msg_resultIsEmpty': 'The result of the analysis is empty!',
  65040. 'msg_openFileFail': 'Failed to open file!',
  65041. 'msg_fileTypeUnsupported': 'File format is not supported!',
  65042. 'msg_fileSizeExceeded': 'File size exceeded! The file size should not exceed 10M!',
  65043. 'msg_dataInWrongGeoJSONFormat': 'Wrong data format! Non standard GEOJSON format data!',
  65044. 'msg_dataInWrongFormat': 'Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!',
  65045. 'msg_searchKeywords': "Search keywords cannot be empty. Please enter your search criteria.",
  65046. 'msg_searchGeocodeField': "Did not match the address matching service data!",
  65047. 'msg_cityGeocodeField': "The address matching service of the current city is not configured.",
  65048. 'msg_getFeatureField': "No related vector features found!",
  65049. 'msg_dataflowservicesubscribed': 'The data stream service has been subscribed to.',
  65050. 'msg_subscribesucceeded': 'The data stream service subscription was successful.',
  65051. 'msg_crsunsupport': 'Does not support the coordinate system of the current map',
  65052. 'msg_tilematrixsetunsupport': 'Incoming TileMatrixSet is not supported',
  65053. 'msg_jsonResolveFiled': 'JSON format parsing failure!',
  65054. 'msg_requestContentFiled': 'Failed to request data through iportal!',
  65055. 'msg_getdatafailed': 'Failed to get data!'
  65056. };
  65057. SuperMap.Lang['en-US'] = en;
  65058. // CONCATENATED MODULE: ./src/common/lang/locales/zh-CN.js
  65059. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  65060. * This program are made available under the terms of the Apache License, Version 2.0
  65061. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65062. /**
  65063. * Namespace: SuperMap.Lang["zh-CN"]
  65064. * Dictionary for Simplified Chinese. Keys for entries are used in calls to
  65065. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  65066. * strings formatted for use with <SuperMap.String.format> calls.
  65067. */
  65068. var zh = {
  65069. 'title_dataFlowService': '数据流服务',
  65070. 'title_distributedAnalysis': '分布式分析',
  65071. 'title_clientComputing': '客户端计算',
  65072. 'title_dataServiceQuery': '数据服务查询',
  65073. 'title_searchCity': '搜索城市',
  65074. 'title_searchLayer': '搜索图层',
  65075. 'text_input_value_inputDataFlowUrl': '请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  65076. 'text_displayFeaturesInfo': '显示要素信息',
  65077. 'text_subscribe': '订阅',
  65078. 'text_cancelSubscribe': '取消订阅',
  65079. 'text_densityAnalysis': '密度分析',
  65080. 'text_CalculateTheValuePerUnitArea': '计算点指定邻域形状内的每单位面积量值',
  65081. 'text_option_selectDataset': '请选择数据集',
  65082. 'text_label_dataset': '数据集',
  65083. 'text_option_simplePointDensityAnalysis': '简单点密度分析',
  65084. 'text_option_nuclearDensityAnalysis': '核密度分析',
  65085. 'text_label_analyticalMethod': '分析方法',
  65086. 'text_option_quadrilateral': '四边形',
  65087. 'text_option_hexagon': '六边形',
  65088. 'text_label_meshType': '网格面类型',
  65089. 'text_option_notSet': '未设置',
  65090. 'text_label_weightField': '权重字段',
  65091. 'text_label_gridSizeInMeters': '网格大小',
  65092. 'text_label_searchRadius': '搜索半径',
  65093. 'text_label_queryRange': '分析范围',
  65094. 'text_label_areaUnit': '面积单位',
  65095. 'text_option_equidistantSegmentation': '等距离分段',
  65096. 'text_option_logarithm': '对数',
  65097. 'text_option_equalCountingSegment': '等计数分段',
  65098. 'text_option_squareRootSegmentation': '平方根分段',
  65099. 'text_label_thematicMapSegmentationMode': '专题图分段模式',
  65100. 'text_label_thematicMapSegmentationParameters': '专题图分段参数',
  65101. 'text_option_greenOrangePurpleGradient': '绿橙紫渐变',
  65102. 'text_option_greenOrangeRedGradient': '绿橙红渐变',
  65103. 'text_option_rainbowGradient': '彩虹渐变',
  65104. 'text_option_spectralGradient': '光谱渐变',
  65105. 'text_option_terrainGradient': '地形渐变',
  65106. 'text_label_thematicMapColorGradientMode': '专题图颜色渐变模式',
  65107. 'text_label_resultLayerName': '结果图层名称',
  65108. 'text_chooseFile': '选择文件',
  65109. 'text_isoline': '等值线',
  65110. 'text_extractDiscreteValue': '提取离散值生成曲线',
  65111. 'text_buffer': '缓冲区',
  65112. 'text_specifyTheDistance': '指定距离创建周边区域',
  65113. 'text_label_analysisLayer': '分析图层',
  65114. 'text_label_extractField': '提取字段',
  65115. 'text_label_extractedValue': '提取值',
  65116. 'text_label_distanceAttenuation': '距离衰减',
  65117. 'text_label_gridSize': '栅格大小',
  65118. 'text_label_bufferRadius': '缓冲半径',
  65119. 'text_label_defaultkilometers': '默认10千米',
  65120. 'text_option_kilometer': '千米',
  65121. 'text_label_unit': '单位',
  65122. 'text_retainOriginal': '保留原对象字段属性',
  65123. 'text_mergeBuffer': '合并缓冲区',
  65124. 'text_label_color': '颜色',
  65125. 'text_label_buffer': '[缓冲区]',
  65126. 'text_label_isolines': '[等值线]',
  65127. 'text_label_queryRangeTips': '默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850',
  65128. 'text_label_IDArrayOfFeatures': '要素 ID 数组',
  65129. 'text_label_maxFeatures': '最多可返回的要素数量',
  65130. 'text_label_bufferDistance': '缓冲区距离',
  65131. 'text_label_queryRange1': '查询范围',
  65132. 'text_label_spatialQueryMode': '空间查询模式',
  65133. 'text_label_featureFilter': '要素过滤器',
  65134. 'text_label_geometricObject': '几何对象',
  65135. 'text_label_queryMode': '查询模式',
  65136. 'text_label_searchTips': '搜索城市地点或图层要素',
  65137. 'text_label_chooseSearchLayers': '选择查询图层',
  65138. 'text_loadSearchCriteria': '加载搜索条件',
  65139. 'text_saveSearchCriteria': '保存搜索条件',
  65140. "btn_analyze": "分析",
  65141. "btn_analyzing": "分析中",
  65142. "btn_emptyTheAnalysisLayer": "清空分析图层",
  65143. "btn_cancelAnalysis": "取消",
  65144. "btn_query": "查询",
  65145. "btn_querying": "查询中",
  65146. "btn_emptyTheRresultLayer": "清除所有结果图层",
  65147. 'msg_dataFlowServiceHasBeenSubscribed': '已订阅该数据流服务。',
  65148. 'msg_inputDataFlowUrlFirst': '请先输入数据流服务地址。',
  65149. 'msg_datasetOrMethodUnsupport': '该数据集不支持本分析类型,请重新选择数据集',
  65150. 'msg_selectDataset': '请选择数据集!',
  65151. 'msg_setTheWeightField': '请设置权重字段!',
  65152. 'msg_theFieldNotSupportAnalysis': '您当前选择的字段不支持分析!',
  65153. 'msg_resultIsEmpty': '分析的结果为空!',
  65154. 'msg_dataReturnedIsEmpty': '请求成功,查询返回的数据为空。',
  65155. 'msg_openFileFail': '打开文件失败!',
  65156. 'msg_fileTypeUnsupported': '不支持该文件格式!',
  65157. 'msg_fileSizeExceeded': '文件大小超限!文件大小不得超过 10M!',
  65158. 'msg_dataInWrongGeoJSONFormat': '数据格式错误!非标准的 GEOJSON 格式数据!',
  65159. 'msg_dataInWrongFormat': '数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!',
  65160. 'msg_searchKeywords': "搜索关键字不能为空,请输入搜索条件。",
  65161. 'msg_searchGeocodeField': "未匹配到地址匹配服务数据!",
  65162. 'msg_cityGeocodeField': "未配置当前城市的地址匹配服务。",
  65163. 'msg_getFeatureField': "未查找到相关矢量要素!",
  65164. 'msg_dataflowservicesubscribed': '已订阅该数据流服务。',
  65165. 'msg_subscribesucceeded': '数据流服务订阅成功。',
  65166. 'msg_crsunsupport': '不支持当前地图的坐标系',
  65167. 'msg_tilematrixsetunsupport': '不支持传入的TileMatrixSet',
  65168. 'msg_jsonResolveFiled': 'json格式解析失败!',
  65169. 'msg_requestContentFiled': '通过iportal请求数据失败!',
  65170. 'msg_getdatafailed': '获取数据失败!'
  65171. };
  65172. SuperMap.Lang["zh-CN"] = zh;
  65173. // CONCATENATED MODULE: ./src/common/lang/index.js
  65174. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  65175. * This program are made available under the terms of the Apache License, Version 2.0
  65176. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65177. // CONCATENATED MODULE: ./src/common/index.js
  65178. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  65179. * This program are made available under the terms of the Apache License, Version 2.0
  65180. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65181. // EXTERNAL MODULE: external "mapboxgl"
  65182. var external_mapboxgl_ = __webpack_require__(0);
  65183. var external_mapboxgl_default = /*#__PURE__*/__webpack_require__.n(external_mapboxgl_);
  65184. // CONCATENATED MODULE: ./src/mapboxgl/core/MapExtend.js
  65185. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  65186. * This program are made available under the terms of the Apache License, Version 2.0
  65187. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65188. /**
  65189. * @function mapboxgl.supermap.MapExtend
  65190. * @description 扩展了 mapboxgl.Map 对图层相关的操作。
  65191. * @private
  65192. */
  65193. var MapExtend = function () {
  65194. external_mapboxgl_default.a.Map.prototype.overlayLayersManager = {};
  65195. external_mapboxgl_default.a.Map.prototype.addLayerBak = external_mapboxgl_default.a.Map.prototype.addLayer;
  65196. external_mapboxgl_default.a.Map.prototype.addLayer = function (layer, before) {
  65197. if (layer.source || layer.type === 'custom' || layer.type === "background") {
  65198. this.addLayerBak(layer, before);
  65199. return this;
  65200. }
  65201. if (this.overlayLayersManager[layer.id] || this.style._layers[layer.id]) {
  65202. this.fire('error', {
  65203. error: new Error('A layer with this id already exists.')
  65204. });
  65205. return;
  65206. }
  65207. addLayer(layer, this);
  65208. this.overlayLayersManager[layer.id] = layer;
  65209. return this;
  65210. };
  65211. external_mapboxgl_default.a.Map.prototype.getLayer = function (id) {
  65212. if (this.overlayLayersManager[id]) {
  65213. return this.overlayLayersManager[id];
  65214. }
  65215. return this.style.getLayer(id);
  65216. };
  65217. external_mapboxgl_default.a.Map.prototype.moveLayer = function (id, beforeId) {
  65218. if (this.overlayLayersManager[id]) {
  65219. moveLayer(id, beforeId);
  65220. return this;
  65221. }
  65222. if (this.style._layers[id]) {
  65223. this.style.moveLayer(id, beforeId);
  65224. this._update(true);
  65225. return this;
  65226. }
  65227. };
  65228. external_mapboxgl_default.a.Map.prototype.removeLayer = function (id) {
  65229. if (this.overlayLayersManager[id]) {
  65230. removeLayer(this.overlayLayersManager[id]);
  65231. delete this.overlayLayersManager[id];
  65232. return this;
  65233. }
  65234. this.style.removeLayer(id);
  65235. this._update(true);
  65236. return this;
  65237. }; //目前扩展的overlayer,只支持显示或隐藏图层操作
  65238. external_mapboxgl_default.a.Map.prototype.setLayoutProperty = function (layerID, name, value) {
  65239. if (this.overlayLayersManager[layerID]) {
  65240. if (name === "visibility") {
  65241. if (value === "visible") {
  65242. value = true;
  65243. } else {
  65244. value = false;
  65245. }
  65246. setVisibility(this.overlayLayersManager[layerID], value);
  65247. this.style.fire('data', {
  65248. dataType: 'style'
  65249. });
  65250. }
  65251. return this;
  65252. }
  65253. this.style.setLayoutProperty(layerID, name, value);
  65254. this._update(true);
  65255. return this;
  65256. };
  65257. external_mapboxgl_default.a.Map.prototype.updateTransform = function (units, originX, originY, centerX, centerY, width, height) {
  65258. this.transform.units = units;
  65259. this.transform.latRange = [this._tileExtent[1], this._tileExtent[3]];
  65260. this.transform.lngRange = [this._tileExtent[0], this._tileExtent[2]];
  65261. var mercatorZfromAltitude = this.mercatorZfromAltitude;
  65262. external_mapboxgl_default.a.MercatorCoordinate.fromLngLat = function (lngLatLike, altitude) {
  65263. altitude = altitude || 0;
  65264. var lngLat = external_mapboxgl_default.a.LngLat.convert(lngLatLike);
  65265. return new external_mapboxgl_default.a.MercatorCoordinate((lngLat.lng - originX) / width, (originY - lngLat.lat) / height, mercatorZfromAltitude(altitude, lngLat.lat));
  65266. };
  65267. external_mapboxgl_default.a.MercatorCoordinate.prototype.toLngLat = function () {
  65268. return new external_mapboxgl_default.a.LngLat(this.x * width + originX, originY - this.y * height);
  65269. };
  65270. 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 + ';}}'], {
  65271. type: "text/javascript"
  65272. }));
  65273. };
  65274. function addLayer(layer, map) {
  65275. layer.onAdd && layer.onAdd(map);
  65276. }
  65277. /**
  65278. * @function mapboxgl.supermap.MapExtend.prototype.removeFromMap
  65279. * @description 移除事件。
  65280. */
  65281. function removeLayer(layer) {
  65282. layer.removeFromMap && layer.removeFromMap();
  65283. }
  65284. /**
  65285. * @function mapboxgl.supermap.MapExtend.prototype.setVisibility
  65286. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  65287. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  65288. */
  65289. function setVisibility(layer, visibility) {
  65290. layer.setVisibility && layer.setVisibility(visibility);
  65291. }
  65292. /**
  65293. * @function mapboxgl.supermap.MapExtend.prototype.moveTo
  65294. * @description 将图层移动到某个图层之前。
  65295. * @param {string} layerID -待插入的图层 ID。
  65296. * @param {boolean} [beforeLayerID] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  65297. */
  65298. function moveLayer(layerID, beforeLayerID) {
  65299. var layer = document.getElementById(layerID); // var beforeLayer;
  65300. if (beforeLayerID) {
  65301. var beforeLayer = document.getElementById(beforeLayerID);
  65302. if (!beforeLayer) {
  65303. external_mapboxgl_default.a.Evented.prototype.fire("error", {
  65304. error: new Error("Layer with id \"".concat(beforeLayerID, "\" does not exist on this document."))
  65305. });
  65306. }
  65307. }
  65308. if (layer && beforeLayer) {
  65309. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  65310. } else {
  65311. //当没有传入beforeLayerID ,则默认将图层移动到最上面
  65312. layer.parentNode.appendChild(layer);
  65313. }
  65314. }
  65315. }();
  65316. // CONCATENATED MODULE: ./src/mapboxgl/core/Base.js
  65317. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  65318. * This program are made available under the terms of the Apache License, Version 2.0
  65319. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65320. /**
  65321. * SuperMap mapboxgl基类
  65322. * 定义命名空间
  65323. */
  65324. /**
  65325. * @namespace mapboxgl
  65326. * @category BaseTypes Namespace
  65327. */
  65328. /**
  65329. * @namespace mapboxgl.supermap
  65330. * @category BaseTypes Namespace
  65331. */
  65332. external_mapboxgl_default.a.supermap = external_mapboxgl_default.a.supermap || {};
  65333. // CONCATENATED MODULE: ./src/mapboxgl/control/Logo.js
  65334. function Logo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65335. 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); } }
  65336. function Logo_createClass(Constructor, protoProps, staticProps) { if (protoProps) Logo_defineProperties(Constructor.prototype, protoProps); if (staticProps) Logo_defineProperties(Constructor, staticProps); return Constructor; }
  65337. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  65338. * This program are made available under the terms of the Apache License, Version 2.0
  65339. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65340. /**
  65341. * @class mapboxgl.supermap.LogoControl
  65342. * @category Control
  65343. * @classdesc Logo 控件。默认不显示。
  65344. *
  65345. * @example
  65346. * (start code)
  65347. * map.addControl(new mapboxgl.supermap.LogoControl(),'bottom-right');
  65348. * (end)
  65349. * @param {Object} options - logo 控件配置项。
  65350. * @param {string} [options.imageUrl] - logo 图片地址。
  65351. * @param {string} [options.width] - logo 图片宽。
  65352. * @param {string} [options.height] - logo 图片高。
  65353. * @param {string} [options.link] - logo 图片跳转链接。
  65354. * @param {string} [options.alt='SuperMap iClient'] - logo 图片失效时显示文本。
  65355. */
  65356. var Logo_Logo = /*#__PURE__*/function () {
  65357. function Logo(options) {
  65358. Logo_classCallCheck(this, Logo);
  65359. //logo图片地址
  65360. this.imageUrl = null; //跳转链接
  65361. this.link = null; //logo图片宽
  65362. this.width = null; //logo图片高
  65363. this.height = null; //logo图片失效时显示文本
  65364. this.alt = "SuperMap iClient";
  65365. this._extend(this, options);
  65366. }
  65367. /**
  65368. * @function mapboxgl.supermap.LogoControl.prototype.onAdd
  65369. * @description 添加一个 logo。
  65370. * @returns {HTMLElement} 返回创建的 logo 元素。
  65371. */
  65372. Logo_createClass(Logo, [{
  65373. key: "onAdd",
  65374. value: function onAdd(map) {
  65375. this._map = map;
  65376. this._container = document.createElement('div');
  65377. this._container.className = 'mapboxgl-ctrl iclient-logo';
  65378. this._container.style.marginTop = 0;
  65379. this._container.style.marginBottom = 0;
  65380. this._container.style.marginLeft = 0;
  65381. this._container.style.marginRight = 0;
  65382. var imgSrc = LogoBase64;
  65383. if (this.imageUrl) {
  65384. imgSrc = this.imageUrl;
  65385. }
  65386. var alt = this.alt;
  65387. var imageWidth = "94px";
  65388. var imageHeight = "29px";
  65389. var styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  65390. if (this.imageUrl) {
  65391. imageWidth = this.width;
  65392. imageHeight = this.height;
  65393. styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  65394. if (!imageWidth || !imageHeight) {
  65395. styleSize = "";
  65396. }
  65397. }
  65398. var link = this.link || "https://iclient.supermap.io";
  65399. this._container.innerHTML = "<a href='" + link + "' target='_blank'>" + "<img src=" + imgSrc + " alt='" + alt + "' style='" + styleSize + "margin-bottom: 2px'></a>";
  65400. this._createStyleSheet();
  65401. return this._container;
  65402. }
  65403. }, {
  65404. key: "_createStyleSheet",
  65405. value: function _createStyleSheet() {
  65406. var style = document.createElement('style');
  65407. style.type = 'text/css';
  65408. style.innerHTML = ".iclient-logo{" + "margin:0 !important;" + "}" + ".iclient-logo a{" + "border: none;" + "display: block;" + "height:31px;" + "}" + ".iclient-logo img{" + "border: none;" + "white-space: nowrap" + "}";
  65409. document.getElementsByTagName('head')[0].appendChild(style);
  65410. }
  65411. }, {
  65412. key: "_extend",
  65413. value: function _extend(dest) {
  65414. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  65415. var arg = Object.getOwnPropertyNames(arguments)[index];
  65416. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  65417. continue;
  65418. }
  65419. var obj = arguments[arg];
  65420. if (obj) {
  65421. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  65422. var key = Object.getOwnPropertyNames(obj)[j];
  65423. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  65424. continue;
  65425. }
  65426. dest[key] = obj[key];
  65427. }
  65428. }
  65429. }
  65430. return dest;
  65431. }
  65432. }]);
  65433. return Logo;
  65434. }();
  65435. external_mapboxgl_default.a.supermap.LogoControl = Logo_Logo;
  65436. // CONCATENATED MODULE: ./src/mapboxgl/control/index.js
  65437. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  65438. * This program are made available under the terms of the Apache License, Version 2.0
  65439. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65440. // CONCATENATED MODULE: ./src/mapboxgl/core/Util.js
  65441. function core_Util_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65442. 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); } }
  65443. function core_Util_createClass(Constructor, protoProps, staticProps) { if (protoProps) core_Util_defineProperties(Constructor.prototype, protoProps); if (staticProps) core_Util_defineProperties(Constructor, staticProps); return Constructor; }
  65444. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  65445. * This program are made available under the terms of the Apache License, Version 2.0
  65446. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65447. /**
  65448. * @class mapboxgl.supermap.Util
  65449. * @category BaseTypes Util
  65450. * @classdesc 工具类。
  65451. */
  65452. var core_Util_Util = /*#__PURE__*/function () {
  65453. function Util() {
  65454. core_Util_classCallCheck(this, Util);
  65455. }
  65456. core_Util_createClass(Util, null, [{
  65457. key: "toSuperMapGeometry",
  65458. /**
  65459. * @function mapboxgl.supermap.Util.toSuperMapGeometry
  65460. * @description 将 GeoJSON 对象转为 SuperMap 几何图形。
  65461. * @param {GeoJSONObject} geoJSON - GeoJSON 对象。
  65462. * @returns {SuperMap.Geometry}
  65463. */
  65464. value: function toSuperMapGeometry(geoJSON) {
  65465. if (geoJSON && geoJSON.type) {
  65466. var format = new GeoJSON_GeoJSON();
  65467. var result = format.read(geoJSON, "FeatureCollection");
  65468. return result[0].geometry;
  65469. }
  65470. }
  65471. }, {
  65472. key: "toSuperMapBounds",
  65473. value: function toSuperMapBounds(bounds) {
  65474. if (this.isArray(bounds)) {
  65475. //左下右上
  65476. return new Bounds_Bounds(bounds[0], bounds[1], bounds[2], bounds[3]);
  65477. }
  65478. return new Bounds_Bounds(bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth());
  65479. }
  65480. }, {
  65481. key: "toSuperMapPoint",
  65482. value: function toSuperMapPoint(lnglat) {
  65483. //客户端可传入 geojson 对象 或者 mapboxgl lnglat 点对象,或者是点数组
  65484. if (this.isArray(lnglat)) {
  65485. return new Point_Point(lnglat[0], lnglat[1]);
  65486. } else if (lnglat.lng && lnglat.lat) {
  65487. return new Point_Point(lnglat.lng, lnglat.lat);
  65488. }
  65489. return new Point_Point(lnglat.geometry.coordinates[0], lnglat.geometry.coordinates[1]);
  65490. }
  65491. /**
  65492. * @function mapboxgl.supermap.Util.toSuperMapPolygon
  65493. * @description 将 Mapbox GL LngLatbounds 对象转为 SuperMap 几何图形。
  65494. * @param {Mapboxgl.LngLatbounds} lnglatBounds - Mapbox GL LngLatbounds对象。
  65495. * @returns {SuperMap.Geometry.Polygon}
  65496. */
  65497. }, {
  65498. key: "toSuperMapPolygon",
  65499. value: function toSuperMapPolygon(lnglatBounds) {
  65500. var west = lnglatBounds.getWest();
  65501. var east = lnglatBounds.getEast();
  65502. var sourth = lnglatBounds.getSouth();
  65503. var north = lnglatBounds.getNorth();
  65504. return new Polygon([new LinearRing([new Point_Point(west, sourth), new Point_Point(east, sourth), new Point_Point(east, north), new Point_Point(west, north)])]);
  65505. }
  65506. /**
  65507. * @function mapboxgl.supermap.Util.isArray
  65508. * @description 判断是否为数组格式。
  65509. * @param {Object} obj - 待判断对象。
  65510. * @returns {boolean} 是否是数组。
  65511. */
  65512. }, {
  65513. key: "isArray",
  65514. value: function isArray(obj) {
  65515. return Object.prototype.toString.call(obj) == "[object Array]";
  65516. }
  65517. /**
  65518. * @function mapboxgl.supermap.Util.toGeoJSON
  65519. * @description 将传入对象转为 GeoJSON 格式。
  65520. * @param {Object} smObj - 待转参数。
  65521. */
  65522. }, {
  65523. key: "toGeoJSON",
  65524. value: function toGeoJSON(smObj) {
  65525. if (smObj) {
  65526. var format = new GeoJSON_GeoJSON();
  65527. return format.toGeoJSON(smObj);
  65528. }
  65529. }
  65530. /**
  65531. * @function mapboxgl.supermap.Util.toProcessingParam
  65532. * @description 将 Region 节点数组转为 Processing 服务需要的分析参数。
  65533. * @param {Array} points - Region 各个节点数组。
  65534. * @returns {Object} processing 服务裁剪、查询分析的分析参数。
  65535. */
  65536. }, {
  65537. key: "toProcessingParam",
  65538. value: function toProcessingParam(points) {
  65539. var geometryParam = {};
  65540. if (points.length < 1) {
  65541. geometryParam = "";
  65542. } else {
  65543. var results = [];
  65544. for (var i = 0; i < points.length; i++) {
  65545. var point = {};
  65546. point.x = points[i][0];
  65547. point.y = points[i][1];
  65548. results.push(point);
  65549. }
  65550. geometryParam.type = "REGION";
  65551. geometryParam.points = results;
  65552. }
  65553. return geometryParam;
  65554. }
  65555. /**
  65556. * @function mapboxgl.supermap.Util.extend
  65557. * @description 对象拷贝赋值。
  65558. * @param {Object} dest - 目标对象。
  65559. * @param {Object} arguments - 待拷贝的对象。
  65560. * @returns {Object} 赋值后的目标对象。
  65561. */
  65562. }, {
  65563. key: "extend",
  65564. value: function extend(dest) {
  65565. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  65566. var arg = Object.getOwnPropertyNames(arguments)[index];
  65567. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  65568. continue;
  65569. }
  65570. var obj = arguments[arg];
  65571. if (obj) {
  65572. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  65573. var key = Object.getOwnPropertyNames(obj)[j];
  65574. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  65575. continue;
  65576. }
  65577. dest[key] = obj[key];
  65578. }
  65579. }
  65580. }
  65581. return dest;
  65582. }
  65583. /**
  65584. * 检测数据是否为number
  65585. * @param value 值,未知数据类型
  65586. * @returns {boolean}
  65587. */
  65588. }, {
  65589. key: "isNumber",
  65590. value: function isNumber(value) {
  65591. if (value === "") {
  65592. return false;
  65593. }
  65594. var mdata = Number(value);
  65595. if (mdata === 0) {
  65596. return true;
  65597. }
  65598. return !isNaN(mdata);
  65599. }
  65600. }, {
  65601. key: "isString",
  65602. value: function isString(str) {
  65603. return typeof str === 'string' && str.constructor === String;
  65604. }
  65605. /**
  65606. * 随机生成id
  65607. * @param attr
  65608. * @returns {string}
  65609. */
  65610. }, {
  65611. key: "newGuid",
  65612. value: function newGuid(attr) {
  65613. var len = attr || 32;
  65614. var guid = "";
  65615. for (var i = 1; i < len; i++) {
  65616. var n = Math.floor(Math.random() * 16.0).toString(16);
  65617. guid += n;
  65618. }
  65619. return guid;
  65620. }
  65621. /**
  65622. * @description 十六进制转 RGBA 格式。
  65623. * @param {Object} hex - 十六进制格式参数。
  65624. * @param {number} opacity -Alpha 参数。
  65625. * @returns {string} 生成的 RGBA 格式。
  65626. */
  65627. }, {
  65628. key: "hexToRgba",
  65629. value: function hexToRgba(hex, opacity) {
  65630. var color = [],
  65631. rgba = [];
  65632. hex = hex.replace(/#/, "");
  65633. if (hex.length == 3) {
  65634. var tmp = [];
  65635. for (var i = 0; i < 3; i++) {
  65636. tmp.push(hex.charAt(i) + hex.charAt(i));
  65637. }
  65638. hex = tmp.join("");
  65639. }
  65640. for (var _i = 0; _i < 6; _i += 2) {
  65641. color[_i] = "0x" + hex.substr(_i, 2);
  65642. rgba.push(parseInt(Number(color[_i])));
  65643. }
  65644. rgba.push(opacity);
  65645. return "rgba(" + rgba.join(",") + ")";
  65646. }
  65647. /**
  65648. * @param {string} featureName 原始数据中的地名
  65649. * @param {string} fieldName 需要匹配的地名
  65650. * @returns {boolean} 是否匹配
  65651. */
  65652. }, {
  65653. key: "isMatchAdministrativeName",
  65654. value: function isMatchAdministrativeName(featureName, fieldName) {
  65655. if (this.isString(fieldName)) {
  65656. var shortName = featureName.substr(0, 2); // 张家口市和张家界市 特殊处理
  65657. if (shortName === '张家') {
  65658. shortName = featureName.substr(0, 3);
  65659. }
  65660. return !!fieldName.match(new RegExp(shortName));
  65661. }
  65662. return false;
  65663. }
  65664. }]);
  65665. return Util;
  65666. }();
  65667. external_mapboxgl_default.a.supermap.Util = core_Util_Util;
  65668. // CONCATENATED MODULE: ./src/mapboxgl/core/index.js
  65669. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  65670. * This program are made available under the terms of the Apache License, Version 2.0
  65671. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65672. // CONCATENATED MODULE: ./src/mapboxgl/overlay/theme/ThemeFeature.js
  65673. function ThemeFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65674. 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); } }
  65675. function ThemeFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeFeature_defineProperties(Constructor, staticProps); return Constructor; }
  65676. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  65677. * This program are made available under the terms of the Apache License, Version 2.0
  65678. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65679. /**
  65680. * @class mapboxgl.supermap.ThemeFeature
  65681. * @category Visualization Theme
  65682. * @classdesc 专题图要素类。
  65683. * @param {GeoJSONObject} geometry - 专题图要素几何对象。
  65684. * @param {Object} [attributes] - 几何对象属性。
  65685. */
  65686. var ThemeFeature_ThemeFeature = /*#__PURE__*/function () {
  65687. function ThemeFeature(geometry, attributes) {
  65688. ThemeFeature_classCallCheck(this, ThemeFeature);
  65689. this.geometry = geometry;
  65690. this.attributes = attributes;
  65691. }
  65692. /**
  65693. * @function mapboxgl.supermap.ThemeFeature.prototype.toFeature
  65694. * @description 转为矢量要素。
  65695. */
  65696. ThemeFeature_createClass(ThemeFeature, [{
  65697. key: "toFeature",
  65698. value: function toFeature() {
  65699. var geometry = core_Util_Util.toSuperMapGeometry(this.geometry);
  65700. var points = [];
  65701. if (this.geometry instanceof external_mapboxgl_default.a.LngLat) {
  65702. points = [this.geometry.lng, this.geometry.lat];
  65703. } else if (this.geometry instanceof external_mapboxgl_default.a.Point) {
  65704. points = [this.geometry.x, this.geometry.y];
  65705. } else if (this.geometry.length === 3) {
  65706. geometry = new GeoText_GeoText(this.geometry[0], this.geometry[1], this.geometry[2]);
  65707. }
  65708. if (points.length > 1) {
  65709. geometry = new Point_Point(points[0], points[1]);
  65710. }
  65711. return new Vector_Vector(geometry, this.attributes);
  65712. }
  65713. }]);
  65714. return ThemeFeature;
  65715. }();
  65716. external_mapboxgl_default.a.supermap.ThemeFeature = ThemeFeature_ThemeFeature;
  65717. // CONCATENATED MODULE: ./src/mapboxgl/overlay/theme/ThemeLayer.js
  65718. function ThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65719. 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); } }
  65720. function ThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  65721. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  65722. * This program are made available under the terms of the Apache License, Version 2.0
  65723. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65724. /**
  65725. * @class mapboxgl.supermap.ThemeLayer
  65726. * @category Visualization Theme
  65727. * @classdesc 专题图基类。
  65728. * @param {string} name - 专题图图层名。
  65729. * @param {Object} options -可选参数。
  65730. * @param {mapboxgl.Map} options.map - 当前 mapboxgl map 对象,将在下个版本弃用,请用 map.addLayer()方法添加图层。
  65731. * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  65732. * @param {boolean} [options.loadWhileAnimating=true] - 是否实时重绘。
  65733. * @param {boolean} [options.visibility=true] - 图层是否可见。
  65734. * @param {number} [options.opacity=1] - 图层透明度。
  65735. * @fires mapboxgl.supermap.ThemeLayer#changelayer
  65736. * @fires mapboxgl.supermap.ThemeLayer#featuresremoved
  65737. */
  65738. var ThemeLayer_Theme = /*#__PURE__*/function () {
  65739. function Theme(name, opt_options) {
  65740. ThemeLayer_classCallCheck(this, Theme);
  65741. var options = opt_options ? opt_options : {};
  65742. /**
  65743. * @member {string} mapboxgl.supermap.ThemeLayer.prototype.name
  65744. * @description 专题图图层名称。
  65745. */
  65746. this.name = name;
  65747. /**
  65748. * @member {string} [mapboxgl.supermap.ThemeLayer.prototype.id]
  65749. * @description 专题图图层 id。
  65750. */
  65751. this.id = options.id ? options.id : Util_Util.createUniqueID("themeLayer_");
  65752. /**
  65753. * @member {float} [mapboxgl.supermap.ThemeLayer.prototype.opacity=1]
  65754. * @description 图层透明度。
  65755. */
  65756. this.opacity = options.opacity ? options.opacity : 1;
  65757. /**
  65758. * @member {boolean} [mapboxgl.supermap.ThemeLayer.prototype.visibility=true]
  65759. * @description 图层是否可见。
  65760. */
  65761. this.visibility = true;
  65762. /**
  65763. * @member {boolean} [mapboxgl.supermap.ThemeLayer.prototype.loadWhileAnimating=true]
  65764. * @description 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为 false)。
  65765. */
  65766. this.loadWhileAnimating = options.loadWhileAnimating === undefined ? true : options.loadWhileAnimating;
  65767. /**
  65768. * @member {mapboxgl.Map} mapboxgl.supermap.ThemeLayer.prototype.map
  65769. * @description map 对象。
  65770. */
  65771. this.map = options.map ? options.map : null;
  65772. this.features = [];
  65773. this.TFEvents = []; //todo 保留之前创建图层同时添加到图层的用法,在下个版本遗弃
  65774. if (this.map) {
  65775. this.map.addLayer(this);
  65776. }
  65777. }
  65778. /**
  65779. * @function mapboxgl.supermap.ThemeLayer.prototype.onAdd
  65780. * @description 向底图添加该图层。
  65781. */
  65782. ThemeLayer_createClass(Theme, [{
  65783. key: "onAdd",
  65784. value: function onAdd(map) {
  65785. this.map = map;
  65786. this._createCanvasContainer(); //处理用户预先(在图层添加到 map 前)监听的事件
  65787. this.addTFEvents();
  65788. this.map.on('resize', this.resizeEvent.bind(this));
  65789. this.map.on('zoomstart', this.zoomStartEvent.bind(this));
  65790. this.map.on('zoomend', this.zoomEndEvent.bind(this));
  65791. this.map.on('rotatestart', this.rotateStartEvent.bind(this));
  65792. this.map.on('rotate', this.rotateEvent.bind(this));
  65793. this.map.on('rotateend', this.rotateEndEvent.bind(this));
  65794. this.map.on('dragend', this.dragEndEvent.bind(this));
  65795. this.map.on('movestart', this.moveStartEvent.bind(this));
  65796. this.map.on('move', this.moveEvent.bind(this));
  65797. this.map.on('moveend', this.moveEndEvent.bind(this));
  65798. this.map.on('remove', this.removeFromMap.bind(this));
  65799. this.refresh();
  65800. }
  65801. /**
  65802. * @function mapboxgl.supermap.HeatMapLayer.prototype.refresh
  65803. * @description 强制刷新当前热点显示,在图层热点数组发生变化后调用,更新显示。
  65804. */
  65805. }, {
  65806. key: "refresh",
  65807. value: function refresh() {
  65808. if (this.features.length === 0) {
  65809. return;
  65810. }
  65811. if (this.map) {
  65812. this.redrawThematicFeatures(this.map.getBounds());
  65813. }
  65814. }
  65815. }, {
  65816. key: "_createCanvasContainer",
  65817. value: function _createCanvasContainer() {
  65818. this.movingOffset = [0, 0];
  65819. this.mapContainer = this.map.getCanvasContainer();
  65820. this.div = document.createElement('div');
  65821. this.div.id = this.id;
  65822. this.div.style.position = 'absolute';
  65823. var container = this.map.getCanvasContainer();
  65824. var canvas = this.map.getCanvas();
  65825. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  65826. this.div.style.width = canvas.style.width;
  65827. this.div.style.height = canvas.style.height;
  65828. this.div.className = "themeLayer";
  65829. this.div.width = parseInt(canvas.width);
  65830. this.div.height = parseInt(canvas.height);
  65831. container.appendChild(this.div);
  65832. this.setOpacity(this.opacity);
  65833. this.levelRenderer = new LevelRenderer_LevelRenderer();
  65834. this.renderer = this.levelRenderer.init(this.div);
  65835. this.renderer.clear();
  65836. }
  65837. /**
  65838. * @function mapboxgl.supermap.ThemeLayer.prototype.destroyFeatures
  65839. * @description 销毁某个要素。
  65840. * @param {SuperMap.Feature.Vector} features - 将被销毁的要素。
  65841. */
  65842. }, {
  65843. key: "destroyFeatures",
  65844. value: function destroyFeatures(features) {
  65845. var all = features == undefined;
  65846. if (all) {
  65847. features = this.features;
  65848. }
  65849. if (features) {
  65850. this.removeFeatures(features);
  65851. for (var i = features.length - 1; i >= 0; i--) {
  65852. features[i].destroy();
  65853. }
  65854. }
  65855. }
  65856. /**
  65857. * @function mapboxgl.supermap.ThemeLayer.prototype.setVisibility
  65858. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  65859. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  65860. */
  65861. }, {
  65862. key: "setVisibility",
  65863. value: function setVisibility(visibility) {
  65864. if (visibility !== this.visibility) {
  65865. this.visibility = visibility;
  65866. this.display(visibility);
  65867. this.redrawThematicFeatures(this.map.getBounds());
  65868. }
  65869. }
  65870. /**
  65871. * @function mapboxgl.supermap.ThemeLayer.prototype.display
  65872. * @description 临时隐藏或者显示图层。通过对 CSS 控制产生即时效果,重新渲染失效。一般用 setVisibility 方法来动态控制图层的显示和隐藏。
  65873. * @param {boolean} [display] - 是否显示图层。
  65874. */
  65875. }, {
  65876. key: "display",
  65877. value: function display(_display) {
  65878. this.div.style.display = _display ? "block" : "none";
  65879. }
  65880. /**
  65881. * @function mapboxgl.supermap.ThemeLayer.prototype.setOpacity
  65882. * @description 设置图层的不透明度,取值[0-1]之间。
  65883. * @param {number} [opacity] - 不透明度。
  65884. */
  65885. }, {
  65886. key: "setOpacity",
  65887. value: function setOpacity(opacity) {
  65888. if (opacity !== this.opacity) {
  65889. this.opacity = opacity;
  65890. var element = this.div;
  65891. Util_Util.modifyDOMElement(element, null, null, null, null, null, null, opacity);
  65892. if (this.map !== null) {
  65893. /**
  65894. * @event mapboxgl.supermap.ThemeLayer#changelayer
  65895. * @description 图层属性改变之后触发。
  65896. * @property {Object} layer - 图层。
  65897. * @property {string} property - 被改变的属性。
  65898. */
  65899. external_mapboxgl_default.a.Evented.prototype.fire('changelayer', {
  65900. layer: this,
  65901. property: "opacity"
  65902. });
  65903. }
  65904. }
  65905. }
  65906. /**
  65907. * @function mapboxgl.supermap.ThemeLayer.prototype.addFeatures
  65908. * @param {mapboxgl.supermap.ThemeFeature|SuperMap.ServerFeature|GeoJSONObject} features - 待添加要素。
  65909. * @description 抽象方法,可实例化子类必须实现此方法。向专题图图层中添加数据 ,
  65910. */
  65911. }, {
  65912. key: "addFeatures",
  65913. value: function addFeatures(features) {// eslint-disable-line no-unused-vars
  65914. }
  65915. /**
  65916. * @function mapboxgl.supermap.ThemeLayer.prototype.removeFeatures
  65917. * @param {Array.<SuperMap.Feature.Vector>} features - 要删除 feature 的数组。
  65918. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  65919. * 参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature,
  65920. * 如果无法确定 feature 数组,则可以调用 removeAllFeatures 来删除所有 feature。
  65921. * 如果要删除的 feature 数组中的元素特别多,推荐使用 removeAllFeatures,
  65922. * 删除所有 feature 后再重新添加。这样效率会更高。
  65923. */
  65924. }, {
  65925. key: "removeFeatures",
  65926. value: function removeFeatures(features) {
  65927. if (!features || features.length === 0) {
  65928. return;
  65929. }
  65930. if (features === this.features) {
  65931. return this.removeAllFeatures();
  65932. }
  65933. if (!Util_Util.isArray(features)) {
  65934. features = [features];
  65935. }
  65936. var featuresFailRemoved = [];
  65937. for (var i = features.length - 1; i >= 0; i--) {
  65938. var feature = features[i]; //如果我们传入的feature在features数组中没有的话,则不进行删除,
  65939. //并将其放入未删除的数组中。
  65940. var findex = Util_Util.indexOf(this.features, feature);
  65941. if (findex === -1) {
  65942. featuresFailRemoved.push(feature);
  65943. continue;
  65944. }
  65945. this.features.splice(findex, 1);
  65946. }
  65947. var drawFeatures = [];
  65948. for (var hex = 0, len = this.features.length; hex < len; hex++) {
  65949. feature = this.features[hex];
  65950. drawFeatures.push(feature);
  65951. }
  65952. this.features = [];
  65953. this.addFeatures(drawFeatures); //绘制专题要素
  65954. if (this.renderer) {
  65955. this.redrawThematicFeatures(this.map.getBounds());
  65956. }
  65957. var succeed = featuresFailRemoved.length == 0 ? true : false;
  65958. /**
  65959. * @event mapboxgl.supermap.ThemeLayer#featuresremoved
  65960. * @description 要素删除之后触发。
  65961. * @property {Array.<SuperMap.Feature.Vector>} features - 未被成功删除的要素。
  65962. * @property {boolean} succeed - 删除成功与否。
  65963. */
  65964. external_mapboxgl_default.a.Evented.prototype.fire("featuresremoved", {
  65965. features: featuresFailRemoved,
  65966. succeed: succeed
  65967. });
  65968. }
  65969. /**
  65970. * @function mapboxgl.supermap.ThemeLayer.prototype.removeAllFeatures
  65971. * @description 清除当前图层所有的矢量要素。
  65972. */
  65973. }, {
  65974. key: "removeAllFeatures",
  65975. value: function removeAllFeatures() {
  65976. if (this.renderer) {
  65977. this.renderer.clear();
  65978. }
  65979. this.features = [];
  65980. external_mapboxgl_default.a.Evented.prototype.fire('featuresremoved', {
  65981. features: [],
  65982. succeed: true
  65983. });
  65984. }
  65985. /**
  65986. * @function mapboxgl.supermap.ThemeLayer.prototype.getFeatures
  65987. * @description 查看当前图层中的有效数据。
  65988. * @returns {SuperMap.Feature.Vector} 用户加入图层的有效数据。
  65989. */
  65990. }, {
  65991. key: "getFeatures",
  65992. value: function getFeatures() {
  65993. var len = this.features.length;
  65994. var clonedFeatures = new Array(len);
  65995. for (var i = 0; i < len; ++i) {
  65996. clonedFeatures[i] = this.features[i];
  65997. }
  65998. return clonedFeatures;
  65999. }
  66000. /**
  66001. * @function mapboxgl.supermap.ThemeLayer.prototype.getFeatureBy
  66002. * @description 在专题图的要素数组 features 里面遍历每一个 feature,当 feature[property] === value 时,
  66003. * 返回此 feature(并且只返回第一个)。
  66004. * @param {string} property - feature 的某个属性名称。
  66005. * @param {string} value - property 所对应的值。
  66006. * @returns {SuperMap.Feature.Vector} 第一个匹配属性和值的矢量要素。
  66007. */
  66008. }, {
  66009. key: "getFeatureBy",
  66010. value: function getFeatureBy(property, value) {
  66011. var feature = null;
  66012. for (var id in this.features) {
  66013. if (this.features[id][property] === value) {
  66014. feature = this.features[id];
  66015. break;
  66016. }
  66017. }
  66018. return feature;
  66019. }
  66020. /**
  66021. * @function mapboxgl.supermap.ThemeLayer.prototype.getFeatureById
  66022. * @description 通过给定一个 id,返回对应的矢量要素。
  66023. * @param {string} featureId - 矢量要素的属性 id。
  66024. * @returns {SuperMap.Feature.Vector} 对应 id 的 feature,如果不存在则返回 null。
  66025. */
  66026. }, {
  66027. key: "getFeatureById",
  66028. value: function getFeatureById(featureId) {
  66029. return this.getFeatureBy('id', featureId);
  66030. }
  66031. /**
  66032. * @function mapboxgl.supermap.ThemeLayer.prototype.getFeaturesByAttribute
  66033. * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
  66034. * @param {string} attrName - 属性的 key。
  66035. * @param {string} attrValue - 矢量要素的属性 id。
  66036. * @returns {Array.<SuperMap.Feature.Vector>} 一个匹配的 feature 数组。
  66037. */
  66038. }, {
  66039. key: "getFeaturesByAttribute",
  66040. value: function getFeaturesByAttribute(attrName, attrValue) {
  66041. var feature,
  66042. foundFeatures = [];
  66043. for (var id in this.features) {
  66044. feature = this.features[id];
  66045. if (feature && feature.attributes) {
  66046. if (feature.attributes[attrName] === attrValue) {
  66047. foundFeatures.push(feature);
  66048. }
  66049. }
  66050. }
  66051. return foundFeatures;
  66052. }
  66053. /**
  66054. * @function mapboxgl.supermap.ThemeLayer.prototype.redrawThematicFeatures
  66055. * @description 抽象方法,可实例化子类必须实现此方法。重绘专题要素。
  66056. * @param {mapboxgl.LngLatBounds} extent - 重绘的范围。
  66057. */
  66058. }, {
  66059. key: "redrawThematicFeatures",
  66060. value: function redrawThematicFeatures(extent) {// eslint-disable-line no-unused-vars
  66061. }
  66062. /**
  66063. * @function mapboxgl.supermap.ThemeLayer.prototype.on
  66064. * @description 添加专题要素事件监听。添加专题要素事件监听。
  66065. * @param {Event} event - 监听事件。
  66066. * @param {function} callback - 回调函数。
  66067. * @param {string} context - 信息。
  66068. */
  66069. }, {
  66070. key: "on",
  66071. value: function on(event, callback, context) {
  66072. // eslint-disable-line no-unused-vars
  66073. if (this.renderer) {
  66074. this.renderer.on(event, callback);
  66075. } else {
  66076. this.map.on(event, callback);
  66077. }
  66078. return this;
  66079. }
  66080. /**
  66081. * @function mapboxgl.supermap.ThemeLayer.prototype.off
  66082. * @description 移除专题要素事件监听。
  66083. * @param {Event} event - 监听事件。
  66084. * @param {function} callback - 回调函数。
  66085. * @param {string} context - 信息。
  66086. */
  66087. }, {
  66088. key: "off",
  66089. value: function off(event, callback, context) {
  66090. // eslint-disable-line no-unused-vars
  66091. var me = this;
  66092. if (me.renderer) {
  66093. me.renderer.off(event, callback);
  66094. } else {
  66095. this.map.off(event, callback);
  66096. }
  66097. return this;
  66098. }
  66099. /**
  66100. * @function mapboxgl.supermap.ThemeLayer.prototype.addTFEvents
  66101. * @description 将图层添加到地图上之前用户要求添加的事件监听添加到图层。
  66102. * @private
  66103. */
  66104. }, {
  66105. key: "addTFEvents",
  66106. value: function addTFEvents() {
  66107. var tfEs = this.TFEvents;
  66108. var len = tfEs.length;
  66109. for (var i = 0; i < len; i++) {
  66110. this.renderer.on(tfEs[i][0], tfEs[i][1]);
  66111. }
  66112. }
  66113. /**
  66114. * @function mapboxgl.supermap.ThemeLayer.prototype.getLocalXY
  66115. * @description 地理坐标转为像素坐标。
  66116. * @param {Object} [coordinate] - 坐标位置。
  66117. */
  66118. }, {
  66119. key: "getLocalXY",
  66120. value: function getLocalXY(coordinate) {
  66121. var pixelP,
  66122. map = this.map;
  66123. if (coordinate instanceof Point_Point || coordinate instanceof GeoText_GeoText) {
  66124. var tempPoint = map.project(new external_mapboxgl_default.a.LngLat(coordinate.x, coordinate.y));
  66125. pixelP = [tempPoint.x, tempPoint.y];
  66126. }
  66127. if (coordinate instanceof LonLat_LonLat) {
  66128. var _tempPoint = map.project(new external_mapboxgl_default.a.LngLat(coordinate.lon, coordinate.lat));
  66129. pixelP = [_tempPoint.x, _tempPoint.y];
  66130. }
  66131. return pixelP;
  66132. }
  66133. /**
  66134. * @function mapboxgl.supermap.ThemeLayer.prototype.toFeature
  66135. * @description 转为 iClient 要素。
  66136. * @param {mapboxgl.supermap.ThemeFeature|GeoJSONObject} features - 待转要素。
  66137. * @returns {SuperMap.Feature.Vector} 转换后的 iClient 要素。
  66138. */
  66139. }, {
  66140. key: "toiClientFeature",
  66141. value: function toiClientFeature(features) {
  66142. if (!Util_Util.isArray(features)) {
  66143. features = [features];
  66144. }
  66145. var featuresTemp = [];
  66146. for (var i = 0; i < features.length; i++) {
  66147. //mapboxgl.supermap.ThemeFeature 类型
  66148. if (features[i] instanceof ThemeFeature_ThemeFeature) {
  66149. featuresTemp.push(features[i].toFeature());
  66150. } else if (features[i] instanceof Vector_Vector) {
  66151. // 若是 GeometryVector 直接返回
  66152. featuresTemp.push(features[i]);
  66153. } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
  66154. //GeoJSON 规范数据类型
  66155. var format = new GeoJSON_GeoJSON();
  66156. featuresTemp = featuresTemp.concat(format.read(features[i]));
  66157. } else if (features[i].geometry && features[i].geometry.parts) {
  66158. //iServer服务器返回数据格式
  66159. featuresTemp.push(ServerFeature_ServerFeature.fromJson(features[i]).toFeature());
  66160. } else {
  66161. throw new Error("features's type is not be supported.");
  66162. }
  66163. }
  66164. return featuresTemp;
  66165. }
  66166. /**
  66167. * @function mapboxgl.supermap.ThemeLayer.prototype.toFeature
  66168. * @deprecated
  66169. * @description 转为 iClient 要素,该方法将被弃用,由 {@link mapboxgl.supermap.ThemeLayer#toiClientFeature} 代替。
  66170. * @param {mapboxgl.supermap.ThemeFeature|GeoJSONObject} features - 待转要素。
  66171. * @returns {SuperMap.Feature.Vector} 转换后的 iClient 要素。
  66172. */
  66173. }, {
  66174. key: "toFeature",
  66175. value: function toFeature(features) {
  66176. return this.toiClientFeature(features);
  66177. }
  66178. }, {
  66179. key: "moveEndEvent",
  66180. value: function moveEndEvent() {
  66181. if (this.loadWhileAnimating || !this.visibility) {
  66182. return;
  66183. }
  66184. this.div.style.transform = '';
  66185. this.redrawThematicFeatures(this.map.getBounds());
  66186. this._show();
  66187. }
  66188. }, {
  66189. key: "moveStartEvent",
  66190. value: function moveStartEvent() {
  66191. if (this.loadWhileAnimating || !this.visibility) {
  66192. return;
  66193. }
  66194. this.startPitch = this.map.getPitch();
  66195. this.startBearing = this.map.getBearing();
  66196. var startMovePoint = this.map.project(new external_mapboxgl_default.a.LngLat(0, 0));
  66197. this.startMoveX = startMovePoint.x;
  66198. this.startMoveY = startMovePoint.y;
  66199. }
  66200. }, {
  66201. key: "moveEvent",
  66202. value: function moveEvent() {
  66203. if (this.loadWhileAnimating || !this.visibility) {
  66204. this.redrawThematicFeatures(this.map.getBounds());
  66205. return;
  66206. }
  66207. if (this.rotating || this.zooming) {
  66208. return;
  66209. }
  66210. if (this.map.getPitch() !== 0) {
  66211. this._hide();
  66212. }
  66213. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  66214. var tPitch = this.map.getPitch() - this.startPitch;
  66215. var tBearing = -this.map.getBearing() + this.startBearing;
  66216. var endMovePoint = this.map.project(new external_mapboxgl_default.a.LngLat(0, 0));
  66217. var tMoveX = endMovePoint.x - this.startMoveX;
  66218. var tMoveY = endMovePoint.y - this.startMoveY;
  66219. this.div.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)' + ' translate3d(' + tMoveX + 'px, ' + tMoveY + 'px, 0px)';
  66220. }
  66221. }, {
  66222. key: "zoomStartEvent",
  66223. value: function zoomStartEvent() {
  66224. if (this.loadWhileAnimating || !this.visibility) {
  66225. return;
  66226. }
  66227. this.zooming = true;
  66228. this._hide();
  66229. }
  66230. }, {
  66231. key: "zoomEndEvent",
  66232. value: function zoomEndEvent() {
  66233. if (this.loadWhileAnimating || !this.visibility) {
  66234. return;
  66235. }
  66236. this.zooming = false;
  66237. this._show();
  66238. }
  66239. }, {
  66240. key: "rotateStartEvent",
  66241. value: function rotateStartEvent() {
  66242. if (this.loadWhileAnimating || !this.visibility) {
  66243. return;
  66244. }
  66245. this.rotating = true;
  66246. }
  66247. }, {
  66248. key: "rotateEvent",
  66249. value: function rotateEvent() {
  66250. if (this.loadWhileAnimating || !this.visibility) {
  66251. return;
  66252. }
  66253. if (this.map.getPitch() !== 0) {
  66254. this._hide();
  66255. }
  66256. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  66257. var tPitch = this.map.getPitch() - this.startPitch;
  66258. var tBearing = -this.map.getBearing() + this.startBearing;
  66259. this.div.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)';
  66260. }
  66261. }, {
  66262. key: "rotateEndEvent",
  66263. value: function rotateEndEvent() {
  66264. if (this.loadWhileAnimating || !this.visibility) {
  66265. return;
  66266. }
  66267. this.rotating = false;
  66268. this._show();
  66269. }
  66270. }, {
  66271. key: "dragEndEvent",
  66272. value: function dragEndEvent() {
  66273. if (this.loadWhileAnimating || !this.visibility) {
  66274. return;
  66275. }
  66276. this._hide();
  66277. }
  66278. }, {
  66279. key: "resizeEvent",
  66280. value: function resizeEvent() {
  66281. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  66282. var canvas = this.map.getCanvas();
  66283. this.div.style.width = canvas.style.width;
  66284. this.div.style.height = canvas.style.height;
  66285. this.div.width = parseInt(canvas.width);
  66286. this.div.height = parseInt(canvas.height);
  66287. this.renderer.resize();
  66288. }
  66289. /**
  66290. * @function mapboxgl.supermap.ThemeLayer.prototype.removeFromMap
  66291. * @description 移除图层。
  66292. */
  66293. }, {
  66294. key: "removeFromMap",
  66295. value: function removeFromMap() {
  66296. this.mapContainer.removeChild(this.div);
  66297. this.removeAllFeatures();
  66298. }
  66299. /**
  66300. * @function mapboxgl.supermap.ThemeLayer.prototype.moveTo
  66301. * @description 将图层移动到某个图层之前。
  66302. * @param {string} layerID - 待插入的图层 ID。
  66303. * @param {boolean} [before=true] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  66304. */
  66305. }, {
  66306. key: "moveTo",
  66307. value: function moveTo(layerID, before) {
  66308. var layer = document.getElementById(this.div.id);
  66309. before = before !== undefined ? before : true;
  66310. if (before) {
  66311. var beforeLayer = document.getElementById(layerID);
  66312. if (layer && beforeLayer) {
  66313. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  66314. }
  66315. return;
  66316. }
  66317. var nextLayer = document.getElementById(layerID);
  66318. if (layer) {
  66319. if (nextLayer.nextSibling) {
  66320. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  66321. return;
  66322. }
  66323. nextLayer.parentNode.appendChild(layer);
  66324. }
  66325. }
  66326. }, {
  66327. key: "_hide",
  66328. value: function _hide() {
  66329. this.renderer.painter.root.style.display = 'none';
  66330. }
  66331. }, {
  66332. key: "_show",
  66333. value: function _show() {
  66334. this.renderer.painter.root.style.display = 'block';
  66335. }
  66336. }]);
  66337. return Theme;
  66338. }();
  66339. external_mapboxgl_default.a.supermap.ThemeLayer = ThemeLayer_Theme;
  66340. // CONCATENATED MODULE: ./src/mapboxgl/overlay/GraphThemeLayer.js
  66341. 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); }
  66342. function GraphThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66343. 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); } }
  66344. function GraphThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) GraphThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) GraphThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  66345. 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); }
  66346. function GraphThemeLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GraphThemeLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  66347. 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); }
  66348. function GraphThemeLayer_setPrototypeOf(o, p) { GraphThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GraphThemeLayer_setPrototypeOf(o, p); }
  66349. 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); }; }
  66350. function GraphThemeLayer_possibleConstructorReturn(self, call) { if (call && (GraphThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return GraphThemeLayer_assertThisInitialized(self); }
  66351. function GraphThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  66352. 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; } }
  66353. function GraphThemeLayer_getPrototypeOf(o) { GraphThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GraphThemeLayer_getPrototypeOf(o); }
  66354. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  66355. * This program are made available under the terms of the Apache License, Version 2.0
  66356. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66357. /**
  66358. * @class mapboxgl.supermap.GraphThemeLayer
  66359. * @category Visualization Theme
  66360. * @classdesc 统计专题图层。
  66361. * @param {string} name - 图层名。
  66362. * @param {string} chartsType - 图表类别。
  66363. * @param {Object} opt_options - 参数。
  66364. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  66365. * @param {boolean} [opt_options.loadWhileAnimating=true] - 是否实时重绘。
  66366. * @param {mapboxgl.Map} opt_options.map - 当前mapboxgl map对象。
  66367. * @param {number} [opt_options.opacity=1] - 图层透明度。
  66368. * @param {string} opt_options.themeFields - 指定创建专题图字段。
  66369. * @param {boolean} [opt_options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  66370. * @param {string} [opt_options.chartsType] - 图表类型。目前可用:"Bar", "Line", "Pie"。
  66371. * @param {Object} opt_options.chartsSetting - 符号 Circle 配置对象。
  66372. * @param {Array.<number>} opt_options.chartsSetting.codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  66373. * @param {number} [opt_options.chartsSetting.maxR] - 圆形的最大半径。
  66374. * @param {number} [opt_options.chartsSetting.minR] - 圆形的最小半径。
  66375. * @param {string} opt_options.chartsSetting.fillColor - 圆形的填充色,如:fillColor: "#FFB980"。
  66376. * @param {Object} opt_options.chartsSetting.circleStyle - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
  66377. * @param {number} opt_options.chartsSetting.decimalNumber - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  66378. * @param {Object} opt_options.chartsSetting.circleHoverStyle - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
  66379. * @param {boolean} [opt_options.chartsSetting.circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  66380. * @param {boolean} [opt_options.chartsSetting.circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  66381. * @extends {mapboxgl.supermap.ThemeLayer}
  66382. * @fires mapboxgl.supermap.GraphThemeLayer#beforefeaturesadded
  66383. */
  66384. var GraphThemeLayer_Graph = /*#__PURE__*/function (_Theme) {
  66385. GraphThemeLayer_inherits(Graph, _Theme);
  66386. var _super = GraphThemeLayer_createSuper(Graph);
  66387. function Graph(name, chartsType, opt_options) {
  66388. var _this;
  66389. GraphThemeLayer_classCallCheck(this, Graph);
  66390. _this = _super.call(this, name, opt_options);
  66391. _this.chartsSetting = opt_options.chartsSetting || {};
  66392. _this.themeFields = opt_options.themeFields || null;
  66393. _this.overlayWeightField = opt_options.overlayWeightField || null;
  66394. _this.isOverLay = opt_options.isOverLay === undefined ? true : opt_options.isOverLay;
  66395. _this.charts = opt_options.charts || [];
  66396. _this.cache = opt_options.cache || {};
  66397. _this.chartsType = chartsType;
  66398. return _this;
  66399. }
  66400. /**
  66401. * @function mapboxgl.supermap.GraphThemeLayer.prototype.setChartsType
  66402. * @description 设置图表类型,此函数可动态改变图表类型。在调用此函数前请通过 chartsSetting 为新类型的图表做相关配置。
  66403. * @param {string} [chartsType] - 图表类型。目前可用:"Bar", "Line", "Pie"。
  66404. */
  66405. GraphThemeLayer_createClass(Graph, [{
  66406. key: "setChartsType",
  66407. value: function setChartsType(chartsType) {
  66408. this.chartsType = chartsType;
  66409. this.redraw();
  66410. }
  66411. /**
  66412. * @function mapboxgl.supermap.GraphThemeLayer.prototype.addFeatures
  66413. * @description 向专题图图层中添加数据,支持的 feature 类型为:iServer 返回的 feature JSON 对象。
  66414. * @param {SuperMap.ServerFeature} features - 待添加的要素。
  66415. */
  66416. }, {
  66417. key: "addFeatures",
  66418. value: function addFeatures(features) {
  66419. /**
  66420. * @event mapboxgl.supermap.GraphThemeLayer#beforefeaturesadded
  66421. * @description 要素添加之前触发。
  66422. * @property {SuperMap.ServerFeature} features - 要被添加的要素。
  66423. */
  66424. var ret = external_mapboxgl_default.a.Evented.prototype.fire('beforefeaturesadded', {
  66425. features: features
  66426. });
  66427. if (ret === false) {
  66428. return;
  66429. } //转换 features 形式
  66430. this.features = this.toiClientFeature(features); //绘制专题要素
  66431. if (this.renderer) {
  66432. this.redrawThematicFeatures(this.map.getBounds());
  66433. }
  66434. }
  66435. /**
  66436. * @function mapboxgl.supermap.GraphThemeLayer.prototype.redrawThematicFeatures
  66437. * @description 重绘所有专题要素。
  66438. * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。
  66439. * 地图漫游时调用此方法进行图层刷新。
  66440. * @param {mapboxgl.LngLatBounds} extent - 重绘的范围。
  66441. */
  66442. }, {
  66443. key: "redrawThematicFeatures",
  66444. value: function redrawThematicFeatures(extent) {
  66445. // eslint-disable-line no-unused-vars
  66446. this.clearCache(); //清除当前所有可视元素
  66447. this.renderer.clearAll();
  66448. var features = this.features;
  66449. for (var i = 0, len = features.length; i < len; i++) {
  66450. var feature = features[i]; // // 要素范围判断
  66451. // var feaBounds = feature.geometry.getBounds();
  66452. // //剔除当前视图(地理)范围以外的数据
  66453. // if (extent) {
  66454. // var bounds = new SuperMap.Bounds(extent.getWest(), extent.getSouth(), extent.getEast(), extent.getNorth());
  66455. // // if (!bounds.intersectsBounds(feaBounds)) continue;
  66456. // }
  66457. var cache = this.cache; // 用 feature id 做缓存标识
  66458. var cacheField = feature.id; // 数据对应的图表是否已缓存,没缓存则重新创建图表
  66459. if (cache[cacheField]) {
  66460. continue;
  66461. }
  66462. cache[cacheField] = cacheField;
  66463. var chart = this.createThematicFeature(feature); // 压盖处理权重值
  66464. if (chart && this.overlayWeightField) {
  66465. if (feature.attributes[this.overlayWeightField] && !isNaN(feature.attributes[this.overlayWeightField])) {
  66466. chart["__overlayWeight"] = feature.attributes[this.overlayWeightField];
  66467. }
  66468. }
  66469. if (chart) {
  66470. this.charts.push(chart);
  66471. }
  66472. }
  66473. this.drawCharts();
  66474. }
  66475. /**
  66476. * @function mapboxgl.supermap.GraphThemeLayer.prototype.createThematicFeature
  66477. * @description 向专题图图层中添加数据, 支持的 feature 类型为:iServer 返回的 feature json 对象。
  66478. * @param {Object} feature - 待添加的要素。
  66479. *
  66480. */
  66481. }, {
  66482. key: "createThematicFeature",
  66483. value: function createThematicFeature(feature) {
  66484. var thematicFeature; // 检查图表创建条件并创建图形
  66485. if (feature_Theme_Theme[this.chartsType] && this.themeFields && this.chartsSetting) {
  66486. thematicFeature = new feature_Theme_Theme[this.chartsType](feature, this, this.themeFields, this.chartsSetting);
  66487. } // thematicFeature 是否创建成功
  66488. if (!thematicFeature) {
  66489. return false;
  66490. } // 对专题要素执行图形装载
  66491. thematicFeature.assembleShapes();
  66492. return thematicFeature;
  66493. }
  66494. /**
  66495. * @function mapboxgl.supermap.GraphThemeLayer.prototype.drawCharts
  66496. * @description 绘制图表。包含压盖处理。
  66497. *
  66498. */
  66499. }, {
  66500. key: "drawCharts",
  66501. value: function drawCharts() {
  66502. // 判断 rendere r就绪
  66503. if (!this.renderer) {
  66504. return;
  66505. }
  66506. var charts = this.charts; // 图表权重值处理des
  66507. if (this.overlayWeightField) {
  66508. charts.sort(function (cs, ce) {
  66509. if (typeof cs["__overlayWeight"] == "undefined" && typeof ce["__overlayWeight"] == "undefined") {
  66510. return 0;
  66511. } else if (typeof cs["__overlayWeight"] != "undefined" && typeof ce["__overlayWeight"] == "undefined") {
  66512. return -1;
  66513. } else if (typeof cs["__overlayWeight"] == "undefined" && typeof ce["__overlayWeight"] != "undefined") {
  66514. return 1;
  66515. } else if (typeof cs["__overlayWeight"] != "undefined" && typeof ce["__overlayWeight"] != "undefined") {
  66516. if (parseFloat(cs["__overlayWeight"]) < parseFloat(ce["__overlayWeight"])) {
  66517. return 1;
  66518. } else {
  66519. return -1;
  66520. }
  66521. }
  66522. return 0;
  66523. });
  66524. } // 不进行避让
  66525. if (!this.isOverLay) {
  66526. for (var m = 0, len_m = charts.length; m < len_m; m++) {
  66527. var chart_m = charts[m]; // 图形参考位置 (reSetLocation 会更新 chartBounds)
  66528. var shapeROP_m = chart_m.resetLocation(); // 添加图形
  66529. var shapes_m = chart_m.shapes;
  66530. for (var n = 0, slen_n = shapes_m.length; n < slen_n; n++) {
  66531. shapes_m[n].refOriginalPosition = shapeROP_m;
  66532. this.renderer.addShape(shapes_m[n]);
  66533. }
  66534. }
  66535. } else {
  66536. // 压盖判断所需 chartsBounds 集合
  66537. var chartsBounds = []; //var extent = this.map.getBounds();
  66538. //var mapBounds = new Bounds(extent.getWest(), extent.getSouth(), extent.getEast(), extent.getNorth());
  66539. // 获取地图像素 bounds
  66540. //var mapPxLT = this.getLocalXY(new LonLat(mapBounds.left, mapBounds.top));
  66541. //var mapPxRB = this.getLocalXY(new LonLat(mapBounds.right, mapBounds.bottom));
  66542. //var mBounds = new Bounds(mapPxLT[0], mapPxRB[1], mapPxRB[0], mapPxLT[1]);
  66543. // 压盖处理 & 添加图形
  66544. for (var i = 0, len = charts.length; i < len; i++) {
  66545. var chart = charts[i]; // 图形参考位置 (reSetLocation 会更新 chartBounds)
  66546. var shapeROP = chart.resetLocation(); // 图表框
  66547. var cbs = chart.chartBounds;
  66548. var cBounds = [{
  66549. "x": cbs.left,
  66550. "y": cbs.top
  66551. }, {
  66552. "x": cbs.left,
  66553. "y": cbs.bottom
  66554. }, {
  66555. "x": cbs.right,
  66556. "y": cbs.bottom
  66557. }, {
  66558. "x": cbs.right,
  66559. "y": cbs.top
  66560. }, {
  66561. "x": cbs.left,
  66562. "y": cbs.top
  66563. }]; // // 地图范围外不绘制
  66564. // if (mBounds) {
  66565. // // if (!this.isChartInMap(mBounds, cBounds)) continue;
  66566. // }
  66567. // 是否压盖
  66568. var isOL = false;
  66569. if (i !== 0) {
  66570. for (var j = 0; j < chartsBounds.length; j++) {
  66571. //压盖判断
  66572. if (this.isQuadrilateralOverLap(cBounds, chartsBounds[j])) {
  66573. isOL = true;
  66574. break;
  66575. }
  66576. }
  66577. }
  66578. if (isOL) {
  66579. continue;
  66580. } else {
  66581. chartsBounds.push(cBounds);
  66582. } // 添加图形
  66583. var shapes = chart.shapes;
  66584. for (var _j = 0, slen = shapes.length; _j < slen; _j++) {
  66585. shapes[_j].refOriginalPosition = shapeROP;
  66586. this.renderer.addShape(shapes[_j]);
  66587. }
  66588. }
  66589. } // 绘制图形
  66590. this.renderer.render();
  66591. }
  66592. /**
  66593. * @function mapboxgl.supermap.GraphThemeLayer.prototype.getShapesByFeatureID
  66594. * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
  66595. * @param {number} featureID - 要素 ID。
  66596. */
  66597. }, {
  66598. key: "getShapesByFeatureID",
  66599. value: function getShapesByFeatureID(featureID) {
  66600. var list = [];
  66601. var shapeList = this.renderer.getAllShapes();
  66602. if (!featureID) {
  66603. return shapeList;
  66604. }
  66605. for (var i = 0, len = shapeList.length; i < len; i++) {
  66606. var si = shapeList[i];
  66607. if (si.refDataID && featureID === si.refDataID) {
  66608. list.push(si);
  66609. }
  66610. }
  66611. return list;
  66612. }
  66613. /**
  66614. * @function mapboxgl.supermap.GraphThemeLayer.prototype.isQuadrilateralOverLap
  66615. * @description 判断两个四边形是否有压盖。
  66616. * @param {Array.<Object>} quadrilateral - 四边形节点数组。
  66617. * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
  66618. */
  66619. }, {
  66620. key: "isQuadrilateralOverLap",
  66621. value: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
  66622. var quadLen = quadrilateral.length,
  66623. quad2Len = quadrilateral2.length;
  66624. if (quadLen !== 5 || quad2Len !== 5) {
  66625. return null;
  66626. } //不是四边形
  66627. var OverLap = false; //如果两四边形互不包含对方的节点,则两个四边形不相交
  66628. for (var i = 0; i < quadLen; i++) {
  66629. if (this.isPointInPoly(quadrilateral[i], quadrilateral2)) {
  66630. OverLap = true;
  66631. break;
  66632. }
  66633. }
  66634. for (var _i = 0; _i < quad2Len; _i++) {
  66635. if (this.isPointInPoly(quadrilateral2[_i], quadrilateral)) {
  66636. OverLap = true;
  66637. break;
  66638. }
  66639. } //加上两矩形十字相交的情况
  66640. for (var _i2 = 0; _i2 < quadLen - 1; _i2++) {
  66641. if (OverLap) {
  66642. break;
  66643. }
  66644. for (var j = 0; j < quad2Len - 1; j++) {
  66645. var isLineIn = Util_Util.lineIntersection(quadrilateral[_i2], quadrilateral[_i2 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
  66646. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  66647. OverLap = true;
  66648. break;
  66649. }
  66650. }
  66651. }
  66652. return OverLap;
  66653. }
  66654. /**
  66655. * @function mapboxgl.supermap.GraphThemeLayer.prototype.isPointInPoly
  66656. * @description 判断一个点是否在多边形里面。(射线法)
  66657. * @param {Object} pt - 需要判定的点对象,该对象含有属性 x (横坐标),属性 y (纵坐标)。
  66658. * @param {Array.<Object>} poly - 多边形节点数组。
  66659. */
  66660. }, {
  66661. key: "isPointInPoly",
  66662. value: function isPointInPoly(pt, poly) {
  66663. for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
  66664. (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);
  66665. }
  66666. return isIn;
  66667. }
  66668. /**
  66669. * @function mapboxgl.supermap.GraphThemeLayer.prototype.isChartInMap
  66670. * @description 判断图表是否在地图里。
  66671. * @param {SuperMap.Bounds} mapPxBounds - 地图像素范围。
  66672. * @param {Array.<Object>} chartPxBounds - 图表范围的四边形节点数组。
  66673. */
  66674. }, {
  66675. key: "isChartInMap",
  66676. value: function isChartInMap(mapPxBounds, chartPxBounds) {
  66677. var mb = mapPxBounds;
  66678. var isIn = false;
  66679. for (var i = 0, len = chartPxBounds.length; i < len; i++) {
  66680. var cb = chartPxBounds[i];
  66681. if (cb.x >= mb.left && cb.x <= mb.right && cb.y >= mb.top && cb.y <= mb.bottom) {
  66682. isIn = true;
  66683. break;
  66684. }
  66685. }
  66686. return isIn;
  66687. }
  66688. /**
  66689. * @function mapboxgl.supermap.GraphThemeLayer.prototype.clearCache
  66690. * @description 清除缓存
  66691. */
  66692. }, {
  66693. key: "clearCache",
  66694. value: function clearCache() {
  66695. this.cache = {};
  66696. this.charts = [];
  66697. }
  66698. /**
  66699. * @function mapboxgl.supermap.GraphThemeLayer.prototype.removeFeatures
  66700. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature。
  66701. * @param {SuperMap.Feature.Vector} features - 要删除的要素。
  66702. */
  66703. }, {
  66704. key: "removeFeatures",
  66705. value: function removeFeatures(features) {
  66706. this.clearCache();
  66707. GraphThemeLayer_get(GraphThemeLayer_getPrototypeOf(Graph.prototype), "removeFeatures", this).call(this, features);
  66708. }
  66709. /**
  66710. * @function mapboxgl.supermap.GraphThemeLayer.prototype.removeAllFeatures
  66711. * @description 移除所有的要素。
  66712. */
  66713. }, {
  66714. key: "removeAllFeatures",
  66715. value: function removeAllFeatures() {
  66716. this.clearCache();
  66717. GraphThemeLayer_get(GraphThemeLayer_getPrototypeOf(Graph.prototype), "removeAllFeatures", this).call(this);
  66718. }
  66719. /**
  66720. * @function mapboxgl.supermap.GraphThemeLayer.prototype.redraw
  66721. * @description 重绘该图层。
  66722. */
  66723. }, {
  66724. key: "redraw",
  66725. value: function redraw() {
  66726. this.clearCache();
  66727. if (this.renderer) {
  66728. this.redrawThematicFeatures(this.map.getBounds());
  66729. return true;
  66730. }
  66731. return false;
  66732. }
  66733. /**
  66734. * @function mapboxgl.supermap.GraphThemeLayer.prototype.clear
  66735. * @description 清除的内容包括数据(features) 、专题要素、缓存。
  66736. */
  66737. }, {
  66738. key: "clear",
  66739. value: function clear() {
  66740. if (this.renderer) {
  66741. this.renderer.clearAll();
  66742. this.renderer.refresh();
  66743. }
  66744. this.removeAllFeatures();
  66745. this.clearCache();
  66746. }
  66747. }]);
  66748. return Graph;
  66749. }(ThemeLayer_Theme);
  66750. external_mapboxgl_default.a.supermap.GraphThemeLayer = GraphThemeLayer_Graph;
  66751. // CONCATENATED MODULE: ./src/mapboxgl/overlay/theme/GeoFeatureThemeLayer.js
  66752. 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); }
  66753. function GeoFeatureThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66754. 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); } }
  66755. function GeoFeatureThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoFeatureThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoFeatureThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  66756. 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); }
  66757. function GeoFeatureThemeLayer_setPrototypeOf(o, p) { GeoFeatureThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoFeatureThemeLayer_setPrototypeOf(o, p); }
  66758. 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); }; }
  66759. function GeoFeatureThemeLayer_possibleConstructorReturn(self, call) { if (call && (GeoFeatureThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoFeatureThemeLayer_assertThisInitialized(self); }
  66760. function GeoFeatureThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  66761. 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; } }
  66762. function GeoFeatureThemeLayer_getPrototypeOf(o) { GeoFeatureThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoFeatureThemeLayer_getPrototypeOf(o); }
  66763. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  66764. * This program are made available under the terms of the Apache License, Version 2.0
  66765. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66766. /**
  66767. * @class mapboxgl.supermap.GeoFeatureThemeLayer
  66768. * @category Visualization Theme
  66769. * @classdesc 地理几何专题要素型专题图层。
  66770. * @param {string} name - 图层名。
  66771. * @param {Object} opt_options - 参数。
  66772. * @param {mapboxgl.Map} opt_options.map - 当前 mapboxgl map 对象。
  66773. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  66774. * @param {boolean} [opt_options.loadWhileAnimating=true] - 是否实时重绘。
  66775. * @param {number} [opt_options.nodesClipPixel=2] - 节点抽稀像素距离。
  66776. * @param {boolean} [opt_options.isHoverAble=false] - 图形是否在 hover 时高亮。
  66777. * @param {boolean} [opt_options.isMultiHover=false] - 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
  66778. * @param {boolean} [opt_options.isClickAble=true] - 图形是否可点击。
  66779. * @param {boolean} [opt_options.isAllowFeatureStyle=false] - 是否允许 feature 样式(style) 中的有效属性应用到专题图层。
  66780. * 禁止对专题要素使用数据(feature)的 style。
  66781. * 此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素
  66782. * 的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature) 对应专题要素赋予独立 style。
  66783. * @param {number} [opt_options.opacity=1] - 图层透明度。
  66784. * @extends {mapboxgl.supermap.ThemeLayer}
  66785. * @fires mapboxgl.supermap.GeoFeatureThemeLayer#beforefeaturesadded
  66786. */
  66787. var GeoFeatureThemeLayer_GeoFeature = /*#__PURE__*/function (_Theme) {
  66788. GeoFeatureThemeLayer_inherits(GeoFeature, _Theme);
  66789. var _super = GeoFeatureThemeLayer_createSuper(GeoFeature);
  66790. function GeoFeature(name, opt_options) {
  66791. var _this;
  66792. GeoFeatureThemeLayer_classCallCheck(this, GeoFeature);
  66793. _this = _super.call(this, name, opt_options);
  66794. /**
  66795. * @member {string} mapboxgl.supermap.GeoFeatureThemeLayer.prototype.name
  66796. * @description 专题图图层名称。
  66797. */
  66798. _this.name = null;
  66799. /**
  66800. * @member {SuperMap.ThemeStyle} mapboxgl.supermap.GeoFeatureThemeLayer.prototype.style
  66801. * @description 专题图图层全局样式。
  66802. */
  66803. _this.style = null;
  66804. /**
  66805. * @member {SuperMap.ThemeStyle} mapboxgl.supermap.GeoFeatureThemeLayer.prototype.highlightStyle
  66806. * @description 专题图图层高亮样式。
  66807. */
  66808. _this.highlightStyle = null;
  66809. /**
  66810. * @member {number} [mapboxgl.supermap.GeoFeatureThemeLayer.prototype.nodesClipPixel=2]
  66811. * @description 节点抽稀像素距离。
  66812. */
  66813. _this.nodesClipPixel = 2;
  66814. /**
  66815. * @member {boolean} [mapboxgl.supermap.GeoFeatureThemeLayer.prototype.isHoverAble=false]
  66816. * @description 图形是否在 hover 时高亮。
  66817. */
  66818. _this.isHoverAble = false;
  66819. /**
  66820. * @member {boolean} [mapboxgl.supermap.GeoFeatureThemeLayer.prototype.isMultiHover=false]
  66821. * @description 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
  66822. */
  66823. _this.isMultiHover = false;
  66824. /**
  66825. * @member {boolean} [mapboxgl.supermap.GeoFeatureThemeLayer.prototype.isClickAble=true]
  66826. * @description 图形是否可点击。
  66827. */
  66828. _this.isClickAble = true;
  66829. /**
  66830. * @member {boolean} [mapboxgl.supermap.GeoFeatureThemeLayer.prototype.isAllowFeatureStyle=false]
  66831. * @description 是否允许 feature 样式(style) 中的有效属性应用到专题图层。</br>
  66832. * 禁止对专题要素使用数据(feature)的 style。此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素
  66833. * 的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature) 对应专题要素赋予独立 style。
  66834. */
  66835. _this.isAllowFeatureStyle = false;
  66836. Util_Util.extend(GeoFeatureThemeLayer_assertThisInitialized(_this), opt_options);
  66837. _this.cache = opt_options.cache || {};
  66838. _this.cacheFields = opt_options.cacheFields || [];
  66839. _this.maxCacheCount = opt_options.maxCacheCount || 0;
  66840. _this.isCustomSetMaxCacheCount = opt_options.isCustomSetMaxCacheCount === undefined ? false : opt_options.isCustomSetMaxCacheCount;
  66841. return _this;
  66842. }
  66843. /**
  66844. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.addFeatures
  66845. * @description 添加要素。
  66846. * @param {mapboxgl.supermap.ThemeFeature|SuperMap.ServerFeature} features - 要素对象。
  66847. */
  66848. GeoFeatureThemeLayer_createClass(GeoFeature, [{
  66849. key: "addFeatures",
  66850. value: function addFeatures(features) {
  66851. /**
  66852. * @event mapboxgl.supermap.GeoFeatureThemeLayer#beforefeaturesadded
  66853. * @description 要素添加之前触发。
  66854. * @property {mapboxgl.supermap.ThemeFeature|SuperMap.ServerFeature} features - 被添加的要素。
  66855. */
  66856. external_mapboxgl_default.a.Evented.prototype.fire('beforefeaturesadded', {
  66857. features: features
  66858. }); //转换 features 形式
  66859. this.features = this.toiClientFeature(features);
  66860. if (!this.isCustomSetMaxCacheCount) {
  66861. this.maxCacheCount = this.features.length * 5;
  66862. } //绘制专题要素
  66863. if (this.renderer) {
  66864. this.redrawThematicFeatures(this.map.getBounds());
  66865. }
  66866. }
  66867. /**
  66868. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.removeFeatures
  66869. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  66870. * @param {SuperMap.Feature.Vector} features - 要删除的要素对象。
  66871. */
  66872. }, {
  66873. key: "removeFeatures",
  66874. value: function removeFeatures(features) {
  66875. // eslint-disable-line no-unused-vars
  66876. this.clearCache();
  66877. ThemeLayer_Theme.prototype.removeFeatures.apply(this, arguments);
  66878. }
  66879. /**
  66880. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.removeAllFeatures
  66881. * @description 清除当前图层所有的矢量要素。
  66882. */
  66883. }, {
  66884. key: "removeAllFeatures",
  66885. value: function removeAllFeatures() {
  66886. this.clearCache();
  66887. ThemeLayer_Theme.prototype.removeAllFeatures.apply(this, arguments);
  66888. }
  66889. /**
  66890. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.redrawThematicFeatures
  66891. * @description 重绘所有专题要素。
  66892. * @param {mapboxgl.LngLatBounds} extent - 重绘的范围。
  66893. */
  66894. }, {
  66895. key: "redrawThematicFeatures",
  66896. value: function redrawThematicFeatures(extent) {
  66897. // eslint-disable-line no-unused-vars
  66898. this.clearCache(); //获取高亮专题要素对应的用户 id
  66899. var hoverone = this.renderer.getHoverOne();
  66900. var hoverFid = null;
  66901. if (hoverone && hoverone.refDataID) {
  66902. hoverFid = hoverone.refDataID;
  66903. } //清除当前所有可视元素
  66904. this.renderer.clearAll();
  66905. var features = this.features;
  66906. var cache = this.cache;
  66907. var cacheFields = this.cacheFields;
  66908. var cmZoom = this.map.getZoom();
  66909. var maxCC = this.maxCacheCount;
  66910. for (var i = 0, len = features.length; i < len; i++) {
  66911. var feature = features[i]; // var feaBounds = feature.geometry.getBounds();
  66912. //
  66913. // //剔除当前视图(地理)范围以外的数据
  66914. // if (extent) {
  66915. // var bounds = new SuperMap.Bounds(extent.getWest(), extent.getSouth(), extent.getEast(), extent.getNorth());
  66916. // // if (!bounds.intersectsBounds(feaBounds)) continue;
  66917. // }
  66918. //缓存字段
  66919. var fields = feature.id + "_zoom_" + cmZoom.toString();
  66920. var thematicFeature; //判断专题要素缓存是否存在
  66921. if (cache[fields]) {
  66922. cache[fields].updateAndAddShapes();
  66923. } else {
  66924. //如果专题要素缓存不存在,创建专题要素
  66925. thematicFeature = this.createThematicFeature(features[i]); //检查 thematicFeature 是否有可视化图形
  66926. if (thematicFeature.getShapesCount() < 1) {
  66927. continue;
  66928. } //加入缓存
  66929. cache[fields] = thematicFeature;
  66930. cacheFields.push(fields); //缓存数量限制
  66931. if (cacheFields.length > maxCC) {
  66932. var fieldsTemp = cacheFields[0];
  66933. cacheFields.splice(0, 1);
  66934. delete cache[fieldsTemp];
  66935. }
  66936. }
  66937. }
  66938. this.renderer.render(); //地图漫游后,重新高亮图形
  66939. if (hoverFid && this.isHoverAble && this.isMultiHover) {
  66940. var hShapes = this.getShapesByFeatureID(hoverFid);
  66941. this.renderer.updateHoverShapes(hShapes);
  66942. }
  66943. }
  66944. /**
  66945. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.createThematicFeature
  66946. * @description 创建专题要素。
  66947. * @param {SuperMap.Feature.Vector} feature - 要素对象。
  66948. */
  66949. }, {
  66950. key: "createThematicFeature",
  66951. value: function createThematicFeature(feature) {
  66952. var style = Util_Util.copyAttributesWithClip(this.style);
  66953. if (feature.style && this.isAllowFeatureStyle === true) {
  66954. style = Util_Util.copyAttributesWithClip(feature.style);
  66955. } //创建专题要素时的可选参数
  66956. var options = {};
  66957. options.nodesClipPixel = this.nodesClipPixel;
  66958. options.isHoverAble = this.isHoverAble;
  66959. options.isMultiHover = this.isMultiHover;
  66960. options.isClickAble = this.isClickAble;
  66961. options.highlightStyle = ShapeFactory_ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(Vector)
  66962. var thematicFeature = new ThemeVector_ThemeVector(feature, this, ShapeFactory_ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  66963. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  66964. this.renderer.addShape(thematicFeature.shapes[m]);
  66965. }
  66966. return thematicFeature;
  66967. }
  66968. /**
  66969. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.clearCache
  66970. * @description 清除缓存。
  66971. */
  66972. }, {
  66973. key: "clearCache",
  66974. value: function clearCache() {
  66975. this.cache = {};
  66976. this.cacheFields = [];
  66977. }
  66978. /**
  66979. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.clear
  66980. * @description 清除的内容包括数据(features)、专题要素和缓存。
  66981. */
  66982. }, {
  66983. key: "clear",
  66984. value: function clear() {
  66985. this.renderer.clearAll();
  66986. this.renderer.refresh();
  66987. this.removeAllFeatures();
  66988. this.clearCache();
  66989. }
  66990. /**
  66991. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.getCacheCount
  66992. * @description 获取当前缓存数量。
  66993. * @returns {number} 当前缓存数量。
  66994. */
  66995. }, {
  66996. key: "getCacheCount",
  66997. value: function getCacheCount() {
  66998. return this.cacheFields.length;
  66999. }
  67000. /**
  67001. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.setMaxCacheCount
  67002. * @param {number} [cacheCount] - 缓存总数。
  67003. * @description 设置最大缓存条数。
  67004. */
  67005. }, {
  67006. key: "setMaxCacheCount",
  67007. value: function setMaxCacheCount(cacheCount) {
  67008. if (!isNaN(cacheCount)) {
  67009. this.maxCacheCount = cacheCount;
  67010. this.isCustomSetMaxCacheCount = true;
  67011. }
  67012. }
  67013. /**
  67014. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.setMaxCacheCount
  67015. * @param {number} [featureID=si.refDataID] - 要素 ID。
  67016. * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
  67017. */
  67018. }, {
  67019. key: "getShapesByFeatureID",
  67020. value: function getShapesByFeatureID(featureID) {
  67021. var list = [];
  67022. var shapeList = this.renderer.getAllShapes();
  67023. if (!featureID) {
  67024. return shapeList;
  67025. }
  67026. for (var i = 0, len = shapeList.length; i < len; i++) {
  67027. var si = shapeList[i];
  67028. if (si.refDataID && featureID === si.refDataID) {
  67029. list.push(si);
  67030. }
  67031. }
  67032. return list;
  67033. }
  67034. }]);
  67035. return GeoFeature;
  67036. }(ThemeLayer_Theme);
  67037. external_mapboxgl_default.a.supermap.GeoFeatureThemeLayer = GeoFeatureThemeLayer_GeoFeature;
  67038. // CONCATENATED MODULE: ./src/mapboxgl/overlay/LabelThemeLayer.js
  67039. 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); }
  67040. function LabelThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67041. 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); } }
  67042. function LabelThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  67043. 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); }
  67044. function LabelThemeLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LabelThemeLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  67045. 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); }
  67046. function LabelThemeLayer_setPrototypeOf(o, p) { LabelThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelThemeLayer_setPrototypeOf(o, p); }
  67047. 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); }; }
  67048. function LabelThemeLayer_possibleConstructorReturn(self, call) { if (call && (LabelThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelThemeLayer_assertThisInitialized(self); }
  67049. function LabelThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  67050. 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; } }
  67051. function LabelThemeLayer_getPrototypeOf(o) { LabelThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelThemeLayer_getPrototypeOf(o); }
  67052. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  67053. * This program are made available under the terms of the Apache License, Version 2.0
  67054. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67055. /**
  67056. * @class mapboxgl.supermap.LabelThemeLayer
  67057. * @category Visualization Theme
  67058. * @classdesc 标签专题图层。
  67059. * @param {string} name - 图层名。
  67060. * @param {Object} opt_options - 参数。
  67061. * @param {mapboxgl.Map} opt_options.map - 当前mapboxgl map 对象。
  67062. * @param {string} opt_options.themeField - 指定创建专题图字段。
  67063. * @param {Object} opt_options.style - 专题图样式。
  67064. * @param {Object} opt_options.styleGroups - 各专题类型样式组。
  67065. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  67066. * @param {string} [opt_options.id] - 专题图层 ID。专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  67067. * @param {boolean} [opt_options.loadWhileAnimating=true] - 是否实时重绘。
  67068. * @param {number} [opt_options.opacity=1] - 图层透明度。
  67069. * @param {boolean} [options.isAvoid=true] - 是否进行地图边缘的避让处理。
  67070. * @param {boolean} [options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  67071. * @param {boolean} [opt_options.isHoverAble] - 是否开启 hover 事件。
  67072. * @extends {mapboxgl.supermap.GeoFeatureThemeLayer}
  67073. */
  67074. var LabelThemeLayer_Label = /*#__PURE__*/function (_GeoFeature) {
  67075. LabelThemeLayer_inherits(Label, _GeoFeature);
  67076. var _super = LabelThemeLayer_createSuper(Label);
  67077. function Label(name, opt_options) {
  67078. var _this;
  67079. LabelThemeLayer_classCallCheck(this, Label);
  67080. _this = _super.call(this, name, opt_options);
  67081. /**
  67082. * @member {boolean} [mapboxgl.supermap.LabelThemeLayer.prototype.isOverLay=true]
  67083. * @description 是否进行压盖处理,如果设为 true,将隐藏被压盖的标签。
  67084. */
  67085. _this.isOverLay = true;
  67086. /**
  67087. * @member {boolean} [mapboxgl.supermap.LabelThemeLayer.prototype.isAvoid=true]
  67088. * @description 是否进行地图边缘的避让处理,如果设为 true,将把与地图边缘相交的标签移到地图范围内,在地图边缘处做避让处理。
  67089. */
  67090. _this.isAvoid = true;
  67091. /**
  67092. * @member {string} mapboxgl.supermap.LabelThemeLayer.prototype.themeField
  67093. * @description 用于指定专题要素样式的属性字段名称。</br>
  67094. * 此属性字段是要用户数据(feature) attributes 中包含的字段,且字段对应的值的类型必须是数值型。</br>
  67095. * 使用标签分组显示还需要设置 styleGroups 属性。
  67096. */
  67097. _this.themeField = null;
  67098. /**
  67099. * @member {Array.<Object>} mapboxgl.supermap.LabelThemeLayer.prototype.styleGroups
  67100. * @description 分组样式。使用此属性需要设置 themeField 属性。</br>
  67101. * 1.没有同时设置 themeField 和 styleGroups,则所有专题要素都使用本图层的 style 进行渲染;</br>
  67102. * 2.同时设置 themeField 和 styleGroups,则按照 themeField 指定的字段名称获取用户数据(feature)attributes 中对应的属性值;</br>
  67103. * &nbsp;&nbsp;a.如果属性值等于 styleGroups 数组里某个元素定义的 value 值,则此专题要素取 styleGroups 数组中该元素定义的 style 进行渲染。</br>
  67104. * &nbsp;&nbsp;b.如果属性值不等于 styleGroups 数组里任何元素定义的 value 值,则此专题要素按照本图层的 style 进行渲染。</br>
  67105. * 此数组每个元素对象必须有两个属性:value : 与字段 themeField 相对应的属性值;style:专题要素 style。
  67106. */
  67107. _this.styleGroups = null;
  67108. Util_Util.extend(LabelThemeLayer_assertThisInitialized(_this), opt_options);
  67109. _this.defaultStyle = {
  67110. //默认文本样式
  67111. fontColor: "#000000",
  67112. fontOpacity: 1,
  67113. fontSize: "12px",
  67114. fontStyle: "normal",
  67115. fontWeight: "normal",
  67116. labelAlign: "cm",
  67117. labelXOffset: 0,
  67118. labelYOffset: 0,
  67119. labelRotation: 0,
  67120. //默认样式
  67121. fill: false,
  67122. fillColor: "#ee9900",
  67123. fillOpacity: 0.4,
  67124. stroke: false,
  67125. strokeColor: "#ee9900",
  67126. strokeOpacity: 1,
  67127. strokeWidth: 1,
  67128. strokeLinecap: "round",
  67129. strokeDashstyle: "solid",
  67130. //默认显示背景框
  67131. labelRect: true,
  67132. //对用户隐藏但必须保持此值的属性
  67133. //cursor: "pointer",
  67134. labelSelect: true,
  67135. //用 _isGeoTextStrategyStyle 标记此style,携带此类style的要素特指GeoText策略中的标签要素
  67136. _isGeoTextStrategyStyle: true
  67137. }; //获取标签像素 bounds 的方式。0 - 表示通过文本类容和文本风格计算获取像素范围,现在支持中文、英文; 1 - 表示通过绘制的文本标签获取像素范围,支持各个语种的文字范围获取,但性能消耗较大(尤其是采用SVG渲染)。默认值为0。
  67138. _this.getPxBoundsMode = 0;
  67139. _this.labelFeatures = [];
  67140. return _this;
  67141. }
  67142. /**
  67143. * @function mapboxgl.supermap.LabelThemeLayer.prototype.redrawThematicFeatures
  67144. * @description 重绘所有专题要素。</br>
  67145. * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。</br>
  67146. * 地图漫游时调用此方法进行图层刷新。
  67147. * @param {mapboxgl.LngLatBounds} bounds - 重绘范围。
  67148. */
  67149. LabelThemeLayer_createClass(Label, [{
  67150. key: "redrawThematicFeatures",
  67151. value: function redrawThematicFeatures(bounds) {
  67152. if (this.features.length > 0 && this.labelFeatures.length == 0) {
  67153. var feats = this.setLabelsStyle(this.features);
  67154. for (var i = 0, len = feats.length; i < len; i++) {
  67155. this.labelFeatures.push(feats[i]);
  67156. }
  67157. }
  67158. this.features = this.getDrawnLabels(this.labelFeatures);
  67159. LabelThemeLayer_get(LabelThemeLayer_getPrototypeOf(Label.prototype), "redrawThematicFeatures", this).call(this, bounds);
  67160. }
  67161. /**
  67162. * @function mapboxgl.supermap.LabelThemeLayer.prototype.removeFeatures
  67163. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  67164. * @param {SuperMap.Feature.Vector} features - 要删除的要素对象。
  67165. */
  67166. }, {
  67167. key: "removeFeatures",
  67168. value: function removeFeatures(features) {
  67169. // eslint-disable-line no-unused-vars
  67170. this.labelFeatures = [];
  67171. LabelThemeLayer_get(LabelThemeLayer_getPrototypeOf(Label.prototype), "removeFeatures", this).call(this, arguments);
  67172. }
  67173. /**
  67174. * @function mapboxgl.supermap.LabelThemeLayer.prototype.removeAllFeatures
  67175. * @description 清除当前图层所有的矢量要素。
  67176. */
  67177. }, {
  67178. key: "removeAllFeatures",
  67179. value: function removeAllFeatures() {
  67180. this.labelFeatures = [];
  67181. LabelThemeLayer_get(LabelThemeLayer_getPrototypeOf(Label.prototype), "removeAllFeatures", this).call(this, arguments);
  67182. }
  67183. /**
  67184. * @function mapboxgl.supermap.LabelThemeLayer.prototype.createThematicFeature
  67185. * @description 创建专题图要素。
  67186. * @param {Object} feature - 要创建的专题图形要素。
  67187. */
  67188. }, {
  67189. key: "createThematicFeature",
  67190. value: function createThematicFeature(feature) {
  67191. //赋 style
  67192. var style = this.getStyleByData(feature); //创建专题要素时的可选参数
  67193. var options = {};
  67194. options.nodesClipPixel = this.nodesClipPixel;
  67195. options.isHoverAble = this.isHoverAble;
  67196. options.isMultiHover = this.isMultiHover;
  67197. options.isClickAble = this.isClickAble;
  67198. options.highlightStyle = ShapeFactory_ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(Vector)
  67199. var thematicFeature = new ThemeVector_ThemeVector(feature, this, ShapeFactory_ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  67200. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  67201. this.renderer.addShape(thematicFeature.shapes[m]);
  67202. }
  67203. return thematicFeature;
  67204. }
  67205. /**
  67206. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getDrawnLabels
  67207. * @description 获取经(压盖)处理后将要绘制在图层上的标签要素。
  67208. * @param {Array.<SuperMap.Feature.Vector>} labelFeatures - 所有标签要素的数组。
  67209. * @returns {Array.<SuperMap.Feature.Vector>} 最终要绘制的标签要素数组。
  67210. */
  67211. }, {
  67212. key: "getDrawnLabels",
  67213. value: function getDrawnLabels(labelFeatures) {
  67214. var feas = [],
  67215. //最终要绘制的标签要素集
  67216. fea,
  67217. //最终要绘制的标签要素
  67218. fi,
  67219. //临时标签要素,用户的第i个标签
  67220. labelsB = [],
  67221. //不产生压盖的标签要素范围集
  67222. styTmp,
  67223. //用于临时存储要素style的变量
  67224. feaSty,
  67225. //标签要素最终的style
  67226. // styleTemp用于屏蔽文本style中带有偏移性质style属性,偏移已经在计算bounds的过程中参与了运算,
  67227. // 所以在最终按照bounds来绘制标签时,需屏蔽style中带有偏移性质属性,否则文本的偏移量将扩大一倍。
  67228. styleTemp = {
  67229. labelAlign: "cm",
  67230. labelXOffset: 0,
  67231. labelYOffset: 0
  67232. };
  67233. var map = this.map;
  67234. var zoom = map.getZoom();
  67235. var canvas = map.getCanvas();
  67236. var mapSize = {
  67237. x: parseFloat(canvas.style.width),
  67238. y: parseFloat(canvas.style.height)
  67239. }; //对用户的每个标签要素进行处理与判断
  67240. for (var i = 0, len = labelFeatures.length; i < len; i++) {
  67241. fi = labelFeatures[i]; //检查fi的style在避让中是否被改变,如果改变,重新设置要素的style
  67242. if (fi.isStyleChange || fi.isStyleChange === undefined) {
  67243. fi = this.setStyle(fi);
  67244. } //标签最终的中心点像素位置 (偏移后)
  67245. var loc = this.getLabelPxLocation(fi); //过滤掉地图范围外的标签 (偏移后)
  67246. if (loc.x >= 0 && loc.x <= mapSize.x && loc.y >= 0 && loc.y <= mapSize.y) {
  67247. //根据当前地图缩放级别过滤标签
  67248. if (fi.style.minZoomLevel > -1) {
  67249. if (zoom <= fi.style.minZoomLevel) {
  67250. continue;
  67251. }
  67252. }
  67253. if (fi.style.maxZoomLevel > -1) {
  67254. if (zoom > fi.style.maxZoomLevel) {
  67255. continue;
  67256. }
  67257. } //计算标签bounds
  67258. var boundsQuad = null;
  67259. if (fi.isStyleChange) {
  67260. fi.isStyleChange = null;
  67261. boundsQuad = this.calculateLabelBounds(fi, loc);
  67262. } else {
  67263. if (fi.geometry.bsInfo.w && fi.geometry.bsInfo.h) {
  67264. //使用calculateLabelBounds2可以提高bounds的计算效率,尤其是在getPxBoundsMode = 1时
  67265. boundsQuad = this.calculateLabelBounds2(fi, loc);
  67266. } else {
  67267. boundsQuad = this.calculateLabelBounds(fi, loc);
  67268. }
  67269. } //避让处理 -start
  67270. var mapViewBounds = new Bounds_Bounds(0, mapSize.y, mapSize.x, 0),
  67271. //地图像素范围
  67272. quadlen = boundsQuad.length;
  67273. if (this.isAvoid) {
  67274. var avoidInfo = this.getAvoidInfo(mapViewBounds, boundsQuad); //避让信息
  67275. if (avoidInfo) {
  67276. //横向(x方向)上的避让
  67277. if (avoidInfo.aspectW === "left") {
  67278. fi.style.labelXOffset += avoidInfo.offsetX;
  67279. for (var j = 0; j < quadlen; j++) {
  67280. boundsQuad[j].x += avoidInfo.offsetX;
  67281. }
  67282. } else if (avoidInfo.aspectW === "right") {
  67283. fi.style.labelXOffset += -avoidInfo.offsetX;
  67284. for (var _j = 0; _j < quadlen; _j++) {
  67285. boundsQuad[_j].x += -avoidInfo.offsetX;
  67286. }
  67287. } //纵向(y方向)上的避让
  67288. if (avoidInfo.aspectH === "top") {
  67289. fi.style.labelYOffset += avoidInfo.offsetY;
  67290. for (var _j2 = 0; _j2 < quadlen; _j2++) {
  67291. boundsQuad[_j2].y += avoidInfo.offsetY;
  67292. }
  67293. } else if (avoidInfo.aspectH === "bottom") {
  67294. fi.style.labelYOffset += -avoidInfo.offsetY;
  67295. for (var _j3 = 0; _j3 < quadlen; _j3++) {
  67296. boundsQuad[_j3].y += -avoidInfo.offsetY;
  67297. }
  67298. } //如果style发生变化,记录下来
  67299. fi.isStyleChange = true;
  67300. }
  67301. } //避让处理 -end
  67302. //压盖处理 -start
  67303. if (this.isOverLay) {
  67304. //是否压盖
  67305. var isOL = false;
  67306. if (i != 0) {
  67307. for (var _j4 = 0; _j4 < labelsB.length; _j4++) {
  67308. //压盖判断
  67309. if (this.isQuadrilateralOverLap(boundsQuad, labelsB[_j4])) {
  67310. isOL = true;
  67311. break;
  67312. }
  67313. }
  67314. }
  67315. if (isOL) {
  67316. continue;
  67317. } else {
  67318. labelsB.push(boundsQuad);
  67319. }
  67320. } //压盖处理 -end
  67321. //背景(事件)-start
  67322. //将标签像素范围转为地理范围
  67323. var geoBs = [];
  67324. for (var _j5 = 0; _j5 < quadlen - 1; _j5++) {
  67325. geoBs.push(map.unproject(boundsQuad[_j5]));
  67326. } //屏蔽有偏移性质的style属性,偏移量在算bounds时已经加入计算
  67327. var leftBottom = geoBs[3];
  67328. var rightTop = geoBs[1];
  67329. var bounds = new Bounds_Bounds(leftBottom.lng, leftBottom.lat, rightTop.lng, rightTop.lat);
  67330. var center = bounds.getCenterLonLat();
  67331. var label = new GeoText_GeoText(center.lon, center.lat, fi.attributes[this.themeField]);
  67332. label.calculateBounds();
  67333. styTmp = Util_Util.cloneObject(fi.style);
  67334. feaSty = Util_Util.cloneObject(Util_Util.copyAttributes(styTmp, styleTemp));
  67335. fea = new Vector_Vector(label, fi.attributes, feaSty); //赋予id
  67336. fea.id = fi.id;
  67337. fea.fid = fi.fid;
  67338. feas.push(fea);
  67339. }
  67340. } //返回最终要绘制的标签要素
  67341. return feas;
  67342. }
  67343. /**
  67344. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getStyleByData
  67345. * @description 根据用户数据(feature)设置专题要素的 Style。
  67346. * @param {SuperMap.Feature.Vector} feat - 矢量要素对象。
  67347. * @returns {Array.<SuperMap.ThemeStyle>} 专题要素的 Style。
  67348. */
  67349. }, {
  67350. key: "getStyleByData",
  67351. value: function getStyleByData(feat) {
  67352. var feature = feat;
  67353. feature.style = Util_Util.copyAttributes(feature.style, this.defaultStyle); //将style赋给标签
  67354. if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
  67355. this.style.fontSize = "12px";
  67356. }
  67357. feature.style = Util_Util.copyAttributes(feature.style, this.style);
  67358. if (this.themeField && this.styleGroups && feature.attributes) {
  67359. var Sf = this.themeField;
  67360. var attributes = feature.attributes;
  67361. var groups = this.styleGroups;
  67362. var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
  67363. var attr = null; //属性值
  67364. for (var property in attributes) {
  67365. if (Sf === property) {
  67366. isSfInAttrs = true;
  67367. attr = attributes[property];
  67368. break;
  67369. }
  67370. } //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
  67371. if (isSfInAttrs) {
  67372. for (var i = 0, len = groups.length; i < len; i++) {
  67373. if (attr >= groups[i].start && attr < groups[i].end) {
  67374. var sty1 = groups[i].style;
  67375. if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
  67376. sty1.fontSize = "12px";
  67377. }
  67378. feature.style = Util_Util.copyAttributes(feature.style, sty1);
  67379. }
  67380. }
  67381. }
  67382. feature.style.label = feature.attributes[this.themeField];
  67383. }
  67384. return feature.style;
  67385. }
  67386. /**
  67387. * @function mapboxgl.supermap.LabelThemeLayer.prototype.setLabelsStyle
  67388. * @description 设置标签要素的 Style。
  67389. * @param {Array.<SuperMap.Feature.Vector>} labelFeatures - 需要设置 Style 的标签要素数组。
  67390. * @returns {Array.<SuperMap.Feature.Vector>} 赋予 Style 后的标签要素数组。
  67391. */
  67392. }, {
  67393. key: "setLabelsStyle",
  67394. value: function setLabelsStyle(labelFeatures) {
  67395. var fea,
  67396. labelFeas = [];
  67397. for (var i = 0, len = labelFeatures.length; i < len; i++) {
  67398. var feature = labelFeatures[i];
  67399. if (feature.geometry.CLASS_NAME === "SuperMap.Geometry.GeoText") {
  67400. //设置标签的Style
  67401. if (feature.geometry.bsInfo.w || feature.geometry.bsInfo.h) {
  67402. feature.geometry.bsInfo.w = null;
  67403. feature.geometry.bsInfo.h = null;
  67404. feature.geometry.labelWTmp = null;
  67405. }
  67406. fea = this.setStyle(feature); //为标签要素指定图层
  67407. fea.layer = this.layer;
  67408. labelFeas.push(fea);
  67409. } else {
  67410. return labelFeatures;
  67411. }
  67412. }
  67413. return labelFeas;
  67414. }
  67415. /**
  67416. * @function mapboxgl.supermap.LabelThemeLayer.prototype.setStyle
  67417. * @description 设置标签要素的Style。
  67418. * @param {SuperMap.Feature.Vector} feat - 需要赋予 style 的要素。
  67419. */
  67420. }, {
  67421. key: "setStyle",
  67422. value: function setStyle(feat) {
  67423. var feature = feat;
  67424. feature.style = Util_Util.copyAttributes(feature.style, this.defaultStyle); //将style赋给标签
  67425. if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
  67426. this.style.fontSize = "12px";
  67427. }
  67428. feature.style = Util_Util.copyAttributes(feature.style, this.style);
  67429. if (this.groupField && this.styleGroups && feature.attributes) {
  67430. var Sf = this.groupField;
  67431. var Attrs = feature.attributes;
  67432. var Gro = this.styleGroups;
  67433. var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
  67434. var attr = null; //属性值
  67435. for (var property in Attrs) {
  67436. if (Sf === property) {
  67437. isSfInAttrs = true;
  67438. attr = Attrs[property];
  67439. break;
  67440. }
  67441. } //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
  67442. if (isSfInAttrs) {
  67443. for (var i = 0, len = Gro.length; i < len; i++) {
  67444. if (attr >= Gro[i].start && attr < Gro[i].end) {
  67445. //feature.style = Util.copyAttributes(feature.style, this.defaultStyle);
  67446. var sty1 = Gro[i].style;
  67447. if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
  67448. sty1.fontSize = "12px";
  67449. }
  67450. feature.style = Util_Util.copyAttributes(feature.style, sty1);
  67451. }
  67452. }
  67453. }
  67454. } //将文本内容赋到标签要素的style上
  67455. feature.style.label = feature.geometry.text;
  67456. return feature;
  67457. }
  67458. /**
  67459. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getLabelPxLocation
  67460. * @description 获取标签要素的像素坐标。
  67461. * @param {SuperMap.Feature.Vector} feature - 标签要素。
  67462. * @returns {mapboxgl.Point} 标签位置。
  67463. */
  67464. }, {
  67465. key: "getLabelPxLocation",
  67466. value: function getLabelPxLocation(feature) {
  67467. var geoText = feature.geometry;
  67468. var styleTmp = feature.style; //将标签的地理位置转为像素位置
  67469. var locationTmp = geoText.getCentroid();
  67470. var locTmp = this.map.project(new external_mapboxgl_default.a.LngLat(locationTmp.x, locationTmp.y));
  67471. var loc = new external_mapboxgl_default.a.Point(locTmp.x, locTmp.y); //偏移处理
  67472. if (styleTmp.labelXOffset || styleTmp.labelYOffset) {
  67473. var xOffset = isNaN(styleTmp.labelXOffset) ? 0 : styleTmp.labelXOffset;
  67474. var yOffset = isNaN(styleTmp.labelYOffset) ? 0 : styleTmp.labelYOffset;
  67475. var point = loc.add(new external_mapboxgl_default.a.Point(xOffset, -yOffset));
  67476. return new external_mapboxgl_default.a.Point(point.x, point.y);
  67477. } else {
  67478. return new external_mapboxgl_default.a.Point(loc.x, loc.y);
  67479. }
  67480. }
  67481. /**
  67482. * @function mapboxgl.supermap.LabelThemeLayer.prototype.calculateLabelBounds
  67483. * @description 获得标签要素的最终范围。
  67484. *
  67485. * @param {SuperMap.Feature.Vector} feature - 需要计算 bounds 的标签要素数。
  67486. * @param {mapboxgl.Point} loc - 标签位置。
  67487. *
  67488. * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  67489. */
  67490. }, {
  67491. key: "calculateLabelBounds",
  67492. value: function calculateLabelBounds(feature, loc) {
  67493. var geoText = feature.geometry; //标签范围(未旋转前)
  67494. var labB = null;
  67495. var labelInfo = null; //获取bounds的方式
  67496. if (this.getPxBoundsMode == 0) {
  67497. labB = geoText.getLabelPxBoundsByText(loc, feature.style);
  67498. } else if (this.getPxBoundsMode === 1) {
  67499. //canvas
  67500. labelInfo = this.getLabelInfo(feature.geometry.getCentroid(), feature.style);
  67501. labB = geoText.getLabelPxBoundsByLabel(loc, labelInfo.w, labelInfo.h, feature.style);
  67502. } else {
  67503. return null;
  67504. } //旋转Bounds
  67505. var boundsQuad = [];
  67506. if (feature.style.labelRotation % 180 == 0) {
  67507. boundsQuad = [{
  67508. "x": labB.left,
  67509. "y": labB.top
  67510. }, {
  67511. "x": labB.right,
  67512. "y": labB.top
  67513. }, {
  67514. "x": labB.right,
  67515. "y": labB.bottom
  67516. }, {
  67517. "x": labB.left,
  67518. "y": labB.bottom
  67519. }, {
  67520. "x": labB.left,
  67521. "y": labB.top
  67522. }];
  67523. } else {
  67524. boundsQuad = this.rotationBounds(labB, loc, feature.style.labelRotation);
  67525. } //重置GeoText的bounds
  67526. geoText.bounds = new Bounds_Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
  67527. return boundsQuad;
  67528. }
  67529. /**
  67530. * @function mapboxgl.supermap.LabelThemeLayer.prototype.calculateLabelBounds2
  67531. * @description 获得标签要素的最终范围的另一种算法(通过记录下的标签宽高),提高计算 bounds 的效率。
  67532. *
  67533. * @param {SuperMap.Feature.Vector} feature - 需要计算 bounds 的标签要素数。
  67534. * @param {mapboxgl.Point} loc - 标签位置。
  67535. *
  67536. * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  67537. */
  67538. }, {
  67539. key: "calculateLabelBounds2",
  67540. value: function calculateLabelBounds2(feature, loc) {
  67541. var labB, left, bottom, top, right;
  67542. var labelSize = feature.geometry.bsInfo;
  67543. var style = feature.style;
  67544. var locationPx = Util_Util.cloneObject(loc); //处理文字对齐
  67545. if (style.labelAlign && style.labelAlign !== "cm") {
  67546. switch (style.labelAlign) {
  67547. case "lt":
  67548. locationPx.x += labelSize.w / 2;
  67549. locationPx.y += labelSize.h / 2;
  67550. break;
  67551. case "lm":
  67552. locationPx.x += labelSize.w / 2;
  67553. break;
  67554. case "lb":
  67555. locationPx.x += labelSize.w / 2;
  67556. locationPx.y -= labelSize.h / 2;
  67557. break;
  67558. case "ct":
  67559. locationPx.y += labelSize.h / 2;
  67560. break;
  67561. case "cb":
  67562. locationPx.y -= labelSize.h / 2;
  67563. break;
  67564. case "rt":
  67565. locationPx.x -= labelSize.w / 2;
  67566. locationPx.y += labelSize.h / 2;
  67567. break;
  67568. case "rm":
  67569. locationPx.x -= labelSize.w / 2;
  67570. break;
  67571. case "rb":
  67572. locationPx.x -= labelSize.w / 2;
  67573. locationPx.y -= labelSize.h / 2;
  67574. break;
  67575. default:
  67576. break;
  67577. }
  67578. }
  67579. left = locationPx.x - labelSize.w / 2;
  67580. bottom = locationPx.y + labelSize.h / 2; //处理斜体字
  67581. if (style.fontStyle && style.fontStyle === "italic") {
  67582. right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
  67583. } else {
  67584. right = locationPx.x + labelSize.w / 2;
  67585. }
  67586. top = locationPx.y - labelSize.h / 2;
  67587. labB = new Bounds_Bounds(left, bottom, right, top); //旋转Bounds
  67588. var boundsQuad = [];
  67589. if (style.labelRotation % 180 == 0) {
  67590. boundsQuad = [{
  67591. "x": labB.left,
  67592. "y": labB.top
  67593. }, {
  67594. "x": labB.right,
  67595. "y": labB.top
  67596. }, {
  67597. "x": labB.right,
  67598. "y": labB.bottom
  67599. }, {
  67600. "x": labB.left,
  67601. "y": labB.bottom
  67602. }, {
  67603. "x": labB.left,
  67604. "y": labB.top
  67605. }];
  67606. } else {
  67607. boundsQuad = this.rotationBounds(labB, loc, style.labelRotation);
  67608. } //重置GeoText的bounds
  67609. feature.geometry.bounds = new Bounds_Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
  67610. return boundsQuad;
  67611. }
  67612. /**
  67613. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getLabelInfo
  67614. * @description 根据当前位置获取绘制后的标签信息,包括标签的宽,高和行数等。
  67615. * @returns {Object} 绘制后的标签信息。
  67616. */
  67617. }, {
  67618. key: "getLabelInfo",
  67619. value: function getLabelInfo(location, style) {
  67620. var LABEL_ALIGN = {
  67621. "l": "left",
  67622. "r": "right",
  67623. "t": "top",
  67624. "b": "bottom"
  67625. },
  67626. LABEL_FACTOR = {
  67627. "l": 0,
  67628. "r": -1,
  67629. "t": 0,
  67630. "b": -1
  67631. };
  67632. style = Util_Util.extend({
  67633. fontColor: "#000000",
  67634. labelAlign: "cm"
  67635. }, style);
  67636. var pt = this.getLocalXY(location);
  67637. var labelWidth = 0;
  67638. if (style.labelXOffset || style.labelYOffset) {
  67639. var xOffset = isNaN(style.labelXOffset) ? 0 : style.labelXOffset;
  67640. var yOffset = isNaN(style.labelYOffset) ? 0 : style.labelYOffset;
  67641. pt[0] += xOffset;
  67642. pt[1] -= yOffset;
  67643. }
  67644. var canvas = document.createElement('canvas');
  67645. canvas.globalAlpha = 0;
  67646. canvas.lineWidth = 1;
  67647. var ctx = canvas.getContext("2d");
  67648. ctx.fillStyle = style.fontColor;
  67649. ctx.globalAlpha = style.fontOpacity || 1.0;
  67650. 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(" ");
  67651. var labelRows = style.label.split('\n');
  67652. var numRows = labelRows.length;
  67653. var vfactor, lineHeight, labelWidthTmp;
  67654. if (ctx.fillText) {
  67655. // HTML5
  67656. ctx.font = fontStyle;
  67657. ctx.textAlign = LABEL_ALIGN[style.labelAlign[0]] || "center";
  67658. ctx.textBaseline = LABEL_ALIGN[style.labelAlign[1]] || "middle";
  67659. vfactor = LABEL_FACTOR[style.labelAlign[1]];
  67660. if (vfactor == null) {
  67661. vfactor = -.5;
  67662. }
  67663. lineHeight = ctx.measureText('Mg').height || ctx.measureText('xx').width;
  67664. pt[1] += lineHeight * vfactor * (numRows - 1);
  67665. for (var i = 0; i < numRows; i++) {
  67666. labelWidthTmp = ctx.measureText(labelRows[i]).width;
  67667. if (labelWidth < labelWidthTmp) {
  67668. labelWidth = labelWidthTmp;
  67669. }
  67670. }
  67671. } else if (ctx.mozDrawText) {
  67672. // Mozilla pre-Gecko1.9.1 (<FF3.1)
  67673. ctx.mozTextStyle = fontStyle;
  67674. vfactor = LABEL_FACTOR[style.labelAlign[1]];
  67675. if (vfactor == null) {
  67676. vfactor = -.5;
  67677. }
  67678. lineHeight = ctx.mozMeasureText('xx');
  67679. pt[1] += lineHeight * (1 + vfactor * numRows);
  67680. for (var _i = 0; _i < numRows; _i++) {
  67681. labelWidthTmp = ctx.measureText(labelRows[_i]).width;
  67682. if (labelWidth < labelWidthTmp) {
  67683. labelWidth = labelWidthTmp;
  67684. }
  67685. }
  67686. }
  67687. var labelInfo = {}; //标签信息
  67688. if (labelWidth) {
  67689. labelInfo.w = labelWidth; //标签的宽
  67690. } else {
  67691. return null;
  67692. }
  67693. labelInfo.h = style.fontSize; //一行标签的高
  67694. labelInfo.rows = labelRows.length; //标签的行数
  67695. return labelInfo;
  67696. }
  67697. /**
  67698. * @function mapboxgl.supermap.LabelThemeLayer.prototype.rotationBounds
  67699. * @description 旋转 bounds。
  67700. *
  67701. * @param {SuperMap.Bounds} bounds - 要旋转的 bounds。
  67702. * @param {Object} rotationCenterPoi - 旋转中心点对象,此对象含有属性X(横坐标),属性Y(纵坐标)。
  67703. * @param {number} angle - 旋转角度(顺时针)。
  67704. *
  67705. * @returns {Array.<Object>} bounds 旋转后形成的多边形节点数组。是一个四边形,形如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]
  67706. */
  67707. }, {
  67708. key: "rotationBounds",
  67709. value: function rotationBounds(bounds, rotationCenterPoi, angle) {
  67710. var ltPoi = new external_mapboxgl_default.a.Point(bounds.left, bounds.top);
  67711. var rtPoi = new external_mapboxgl_default.a.Point(bounds.right, bounds.top);
  67712. var rbPoi = new external_mapboxgl_default.a.Point(bounds.right, bounds.bottom);
  67713. var lbPoi = new external_mapboxgl_default.a.Point(bounds.left, bounds.bottom);
  67714. var ver = [];
  67715. ver.push(this.getRotatedLocation(ltPoi.x, ltPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
  67716. ver.push(this.getRotatedLocation(rtPoi.x, rtPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
  67717. ver.push(this.getRotatedLocation(rbPoi.x, rbPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
  67718. ver.push(this.getRotatedLocation(lbPoi.x, lbPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle)); //bounds旋转后形成的多边形节点数组
  67719. var quad = [];
  67720. for (var i = 0; i < ver.length; i++) {
  67721. quad.push({
  67722. "x": ver[i].x,
  67723. "y": ver[i].y
  67724. });
  67725. }
  67726. quad.push({
  67727. "x": ver[0].x,
  67728. "y": ver[0].y
  67729. });
  67730. return quad;
  67731. }
  67732. /**
  67733. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getRotatedLocation
  67734. * @description 获取一个点绕旋转中心顺时针旋转后的位置(此方法用于屏幕坐标)。
  67735. *
  67736. * @param {number} x - 旋转点横坐标。
  67737. * @param {number} y - 旋转点纵坐标。
  67738. * @param {number} rx - 旋转中心点横坐标。
  67739. * @param {number} ry - 旋转中心点纵坐标。
  67740. * @param {number} angle - 旋转角度。
  67741. *
  67742. * @returns {Object} 旋转后的坐标位置对象,该对象含有属性X(横坐标),属性Y(纵坐标)。
  67743. */
  67744. }, {
  67745. key: "getRotatedLocation",
  67746. value: function getRotatedLocation(x, y, rx, ry, angle) {
  67747. var loc = {},
  67748. x0,
  67749. y0;
  67750. y = -y;
  67751. ry = -ry;
  67752. angle = -angle; //顺时针旋转
  67753. x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
  67754. y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
  67755. loc.x = x0;
  67756. loc.y = -y0;
  67757. return loc;
  67758. }
  67759. /**
  67760. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getAvoidInfo
  67761. * @description 获取避让的信息。
  67762. *
  67763. * @param {SuperMap.Bounds} bounds - 地图像素范围。
  67764. * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  67765. *
  67766. * @returns {Object} 避让的信息。
  67767. */
  67768. }, {
  67769. key: "getAvoidInfo",
  67770. value: function getAvoidInfo(bounds, quadrilateral) {
  67771. if (quadrilateral.length !== 5) {
  67772. return null;
  67773. } //不是四边形
  67774. //将bound序列化为点数组形式
  67775. var bounddQuad = [{
  67776. "x": bounds.left,
  67777. "y": bounds.top
  67778. }, {
  67779. "x": bounds.right,
  67780. "y": bounds.top
  67781. }, {
  67782. "x": bounds.right,
  67783. "y": bounds.bottom
  67784. }, {
  67785. "x": bounds.left,
  67786. "y": bounds.bottom
  67787. }, {
  67788. "x": bounds.left,
  67789. "y": bounds.top
  67790. }];
  67791. var isIntersection = false,
  67792. bqLen = bounddQuad.length,
  67793. quadLen = quadrilateral.length;
  67794. var offsetX = 0,
  67795. offsetY = 0,
  67796. aspectH = "",
  67797. aspectW = "";
  67798. for (var i = 0; i < bqLen - 1; i++) {
  67799. for (var j = 0; j < quadLen - 1; j++) {
  67800. var isLineIn = Util_Util.lineIntersection(bounddQuad[i], bounddQuad[i + 1], quadrilateral[j], quadrilateral[j + 1]);
  67801. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  67802. //设置避让信息
  67803. setInfo(quadrilateral[j]);
  67804. setInfo(quadrilateral[j + 1]);
  67805. isIntersection = true;
  67806. }
  67807. }
  67808. }
  67809. if (isIntersection) {
  67810. //组织避让操作所需的信息
  67811. return {
  67812. "aspectW": aspectW,
  67813. "aspectH": aspectH,
  67814. "offsetX": offsetX,
  67815. "offsetY": offsetY
  67816. };
  67817. } else {
  67818. return null;
  67819. } //内部函数:设置避让信息
  67820. //参数:{Object} vec- quadrilateral四边形单个节点。如:{"x":1,"y":1}。
  67821. function setInfo(vec) {
  67822. //四边形不在bounds内的节点
  67823. if (!bounds.contains(vec.x, vec.y)) {
  67824. //bounds的Top边
  67825. if (vec.y < bounds.top) {
  67826. var oY = Math.abs(bounds.top - vec.y);
  67827. if (oY > offsetY) {
  67828. offsetY = oY;
  67829. aspectH = "top";
  67830. }
  67831. } //bounds的Bottom边
  67832. if (vec.y > bounds.bottom) {
  67833. var _oY = Math.abs(vec.y - bounds.bottom);
  67834. if (_oY > offsetY) {
  67835. offsetY = _oY;
  67836. aspectH = "bottom";
  67837. }
  67838. } //bounds的left边
  67839. if (vec.x < bounds.left) {
  67840. var oX = Math.abs(bounds.left - vec.x);
  67841. if (oX > offsetX) {
  67842. offsetX = oX;
  67843. aspectW = "left";
  67844. }
  67845. } //bounds的right边
  67846. if (vec.x > bounds.right) {
  67847. var _oX = Math.abs(vec.x - bounds.right);
  67848. if (_oX > offsetX) {
  67849. offsetX = _oX;
  67850. aspectW = "right";
  67851. }
  67852. }
  67853. }
  67854. }
  67855. }
  67856. /**
  67857. * @function mapboxgl.supermap.LabelThemeLayer.prototype.isQuadrilateralOverLap
  67858. * @description 判断两个四边形是否有压盖。
  67859. * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  67860. * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
  67861. * @returns {boolean} 是否压盖,true 表示压盖。
  67862. */
  67863. }, {
  67864. key: "isQuadrilateralOverLap",
  67865. value: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
  67866. var quadLen = quadrilateral.length,
  67867. quad2Len = quadrilateral2.length;
  67868. if (quadLen !== 5 || quad2Len !== 5) {
  67869. return null;
  67870. } //不是四边形
  67871. var OverLap = false; //如果两四边形互不包含对方的节点,则两个四边形不相交
  67872. for (var i = 0; i < quadLen; i++) {
  67873. if (this.isPointInPoly(quadrilateral[i], quadrilateral2)) {
  67874. OverLap = true;
  67875. break;
  67876. }
  67877. }
  67878. for (var _i2 = 0; _i2 < quad2Len; _i2++) {
  67879. if (this.isPointInPoly(quadrilateral2[_i2], quadrilateral)) {
  67880. OverLap = true;
  67881. break;
  67882. }
  67883. } //加上两矩形十字相交的情况
  67884. for (var _i3 = 0; _i3 < quadLen - 1; _i3++) {
  67885. if (OverLap) {
  67886. break;
  67887. }
  67888. for (var j = 0; j < quad2Len - 1; j++) {
  67889. var isLineIn = Util_Util.lineIntersection(quadrilateral[_i3], quadrilateral[_i3 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
  67890. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  67891. OverLap = true;
  67892. break;
  67893. }
  67894. }
  67895. }
  67896. return OverLap;
  67897. }
  67898. /**
  67899. * @function mapboxgl.supermap.LabelThemeLayer.prototype.isPointInPoly
  67900. * @description 判断一个点是否在多边形里面。(射线法)
  67901. *
  67902. * @param {Object} pt - 需要判定的点对象,该对象含有属性x(横坐标),属性y(纵坐标)。
  67903. * @param {Array.<Object>} poly - 多边形节点数组。例如一个四边形:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]
  67904. * @returns {boolean} 点是否在多边形内。
  67905. */
  67906. }, {
  67907. key: "isPointInPoly",
  67908. value: function isPointInPoly(pt, poly) {
  67909. for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
  67910. (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);
  67911. }
  67912. return isIn;
  67913. }
  67914. }]);
  67915. return Label;
  67916. }(GeoFeatureThemeLayer_GeoFeature);
  67917. external_mapboxgl_default.a.supermap.LabelThemeLayer = LabelThemeLayer_Label;
  67918. // EXTERNAL MODULE: external "function(){try{return mapv}catch(e){return {}}}()"
  67919. var external_function_try_return_mapv_catch_e_return_ = __webpack_require__(2);
  67920. // CONCATENATED MODULE: ./src/mapboxgl/overlay/mapv/MapvRenderer.js
  67921. 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); }
  67922. function MapvRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67923. 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); } }
  67924. function MapvRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapvRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapvRenderer_defineProperties(Constructor, staticProps); return Constructor; }
  67925. 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); }
  67926. function MapvRenderer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapvRenderer_getPrototypeOf(object); if (object === null) break; } return object; }
  67927. 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); }
  67928. function MapvRenderer_setPrototypeOf(o, p) { MapvRenderer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapvRenderer_setPrototypeOf(o, p); }
  67929. 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); }; }
  67930. function MapvRenderer_possibleConstructorReturn(self, call) { if (call && (MapvRenderer_typeof(call) === "object" || typeof call === "function")) { return call; } return MapvRenderer_assertThisInitialized(self); }
  67931. function MapvRenderer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  67932. 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; } }
  67933. function MapvRenderer_getPrototypeOf(o) { MapvRenderer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapvRenderer_getPrototypeOf(o); }
  67934. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  67935. * This program are made available under the terms of the Apache License, Version 2.0
  67936. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67937. var BaseLayer = external_function_try_return_mapv_catch_e_return_["baiduMapLayer"] ? external_function_try_return_mapv_catch_e_return_["baiduMapLayer"].__proto__ : Function;
  67938. /**
  67939. * @private
  67940. * @class MapvRenderer
  67941. * @classdesc MapV图层渲染。
  67942. * @param {Object} map - 地图。
  67943. * @param {Object} layer - 图层。
  67944. * @param {MapV.DataSet} dataSet - 数据集。
  67945. * @param {Object} options - 交互时所需可选参数。
  67946. * @extends {MapV.BaseLayer}
  67947. *
  67948. */
  67949. var MapvRenderer_MapvRenderer = /*#__PURE__*/function (_BaseLayer) {
  67950. MapvRenderer_inherits(MapvRenderer, _BaseLayer);
  67951. var _super = MapvRenderer_createSuper(MapvRenderer);
  67952. function MapvRenderer(map, layer, dataSet, options) {
  67953. var _this;
  67954. MapvRenderer_classCallCheck(this, MapvRenderer);
  67955. _this = _super.call(this, map, dataSet, options);
  67956. if (!BaseLayer) {
  67957. return MapvRenderer_possibleConstructorReturn(_this);
  67958. }
  67959. _this.map = map;
  67960. var self = MapvRenderer_assertThisInitialized(_this);
  67961. options = options || {};
  67962. self.init(options);
  67963. self.argCheck(options);
  67964. _this.canvasLayer = layer;
  67965. _this.stopAniamation = false;
  67966. _this.animation = options.animation;
  67967. _this.clickEvent = _this.clickEvent.bind(MapvRenderer_assertThisInitialized(_this));
  67968. _this.mousemoveEvent = _this.mousemoveEvent.bind(MapvRenderer_assertThisInitialized(_this));
  67969. _this.bindMapEvent();
  67970. _this.bindEvent();
  67971. _this._expectShow = true;
  67972. return _this;
  67973. }
  67974. /**
  67975. * @function MapvRenderer.prototype.clickEvent
  67976. * @description 点击绑定事件。
  67977. * @param {Object} e - 事件。
  67978. */
  67979. MapvRenderer_createClass(MapvRenderer, [{
  67980. key: "clickEvent",
  67981. value: function clickEvent(e) {
  67982. var pixel = e.point;
  67983. MapvRenderer_get(MapvRenderer_getPrototypeOf(MapvRenderer.prototype), "clickEvent", this).call(this, pixel, e);
  67984. }
  67985. /**
  67986. * @function MapvRenderer.prototype.mousemoveEvent
  67987. * @description 鼠标移动事件。
  67988. * @param {Object} e - 事件。
  67989. */
  67990. }, {
  67991. key: "mousemoveEvent",
  67992. value: function mousemoveEvent(e) {
  67993. var pixel = e.point;
  67994. MapvRenderer_get(MapvRenderer_getPrototypeOf(MapvRenderer.prototype), "mousemoveEvent", this).call(this, pixel, e);
  67995. }
  67996. /**
  67997. * @function MapvRenderer.prototype.bindEvent
  67998. * @description 绑定事件。
  67999. */
  68000. }, {
  68001. key: "bindEvent",
  68002. value: function bindEvent() {
  68003. var map = this.map;
  68004. if (this.options.methods) {
  68005. if (this.options.methods.click) {
  68006. map.on('click', this.clickEvent);
  68007. }
  68008. if (this.options.methods.mousemove) {
  68009. map.on('mousemove', this.mousemoveEvent);
  68010. }
  68011. }
  68012. }
  68013. /**
  68014. * @function MapvRenderer.prototype.unbindEvent
  68015. * @description 解绑事件。
  68016. */
  68017. }, {
  68018. key: "unbindEvent",
  68019. value: function unbindEvent() {
  68020. var map = this.map;
  68021. if (this.options.methods) {
  68022. if (this.options.methods.click) {
  68023. map.off('click', this.clickEvent);
  68024. }
  68025. if (this.options.methods.mousemove) {
  68026. map.off('mousemove', this.mousemoveEvent);
  68027. }
  68028. }
  68029. }
  68030. /**
  68031. * @function MapvRenderer.prototype.getContext
  68032. * @description 获取信息。
  68033. */
  68034. }, {
  68035. key: "getContext",
  68036. value: function getContext() {
  68037. return this.canvasLayer.canvas.getContext(this.context);
  68038. }
  68039. /**
  68040. * @function MapvRenderer.prototype.addData
  68041. * @description 添加数据。
  68042. * @param {oject} data - 待添加的数据。
  68043. * @param {oject} options - 待添加的数据信息。
  68044. */
  68045. }, {
  68046. key: "addData",
  68047. value: function addData(data, options) {
  68048. var _data = data;
  68049. if (data && data.get) {
  68050. _data = data.get();
  68051. }
  68052. this.dataSet.add(_data);
  68053. this.update({
  68054. options: options
  68055. });
  68056. }
  68057. /**
  68058. * @function MapvRenderer.prototype.update
  68059. * @description 更新图层。
  68060. * @param {Object} opt - 待更新的数据。
  68061. * @param {Object} opt.data - mapv 数据集。
  68062. * @param {Object} opt.options - mapv 绘制参数。
  68063. */
  68064. }, {
  68065. key: "update",
  68066. value: function update(opt) {
  68067. var update = opt || {};
  68068. var _data = update.data;
  68069. if (_data && _data.get) {
  68070. _data = _data.get();
  68071. }
  68072. if (_data != undefined) {
  68073. this.dataSet.set(_data);
  68074. }
  68075. MapvRenderer_get(MapvRenderer_getPrototypeOf(MapvRenderer.prototype), "update", this).call(this, {
  68076. options: update.options
  68077. });
  68078. }
  68079. /**
  68080. * @function MapvRenderer.prototype.getData
  68081. * @description 获取数据。
  68082. */
  68083. }, {
  68084. key: "getData",
  68085. value: function getData() {
  68086. return this.dataSet;
  68087. }
  68088. /**
  68089. * @function MapvRenderer.prototype.removeData
  68090. * @description 删除符合过滤条件的数据。
  68091. * @param {function} [filter] - 过滤条件。条件参数为数据项,返回值为true,表示删除该元素;否则表示不删除。
  68092. */
  68093. }, {
  68094. key: "removeData",
  68095. value: function removeData(_filter) {
  68096. if (!this.dataSet) {
  68097. return;
  68098. }
  68099. var newData = this.dataSet.get({
  68100. filter: function filter(data) {
  68101. return _filter != null && typeof _filter === 'function' ? !_filter(data) : true;
  68102. }
  68103. });
  68104. this.dataSet.set(newData);
  68105. this.update({
  68106. options: null
  68107. });
  68108. }
  68109. /**
  68110. * @function MapVRenderer.prototype.clearData
  68111. * @description 清除数据。
  68112. */
  68113. }, {
  68114. key: "clearData",
  68115. value: function clearData() {
  68116. this.dataSet && this.dataSet.clear();
  68117. this.update({
  68118. options: null
  68119. });
  68120. }
  68121. /**
  68122. * @function MapVRenderer.prototype.updateData
  68123. * @param {Object} dataSet - 数据集。
  68124. * @param {Object} options - 数据项配置。
  68125. * @description 更新数据。
  68126. */
  68127. }, {
  68128. key: "updateData",
  68129. value: function updateData(dataSet, options) {
  68130. if (dataSet && dataSet.get) {
  68131. this.dataSet.set(dataSet.get());
  68132. }
  68133. this.update({
  68134. options: options
  68135. });
  68136. }
  68137. }, {
  68138. key: "_canvasUpdate",
  68139. value: function _canvasUpdate(time) {
  68140. var map = this.map;
  68141. if (!this.canvasLayer || this.stopAniamation) {
  68142. return;
  68143. }
  68144. var self = this;
  68145. var animationOptions = self.options.animation;
  68146. var context = this.getContext();
  68147. if (self.isEnabledTime()) {
  68148. if (time === undefined) {
  68149. this.clear(context);
  68150. return;
  68151. }
  68152. if (this.context === '2d') {
  68153. context.save();
  68154. context.globalCompositeOperation = 'destination-out';
  68155. context.fillStyle = 'rgba(0, 0, 0, .1)';
  68156. context.fillRect(0, 0, context.canvas.width, context.canvas.height);
  68157. context.restore();
  68158. }
  68159. } else {
  68160. this.clear(context);
  68161. }
  68162. if (this.context === '2d') {
  68163. for (var key in self.options) {
  68164. context[key] = self.options[key];
  68165. }
  68166. } else {
  68167. context.clear(context.COLOR_BUFFER_BIT);
  68168. }
  68169. if (self.options.minZoom && map.getZoom() < self.options.minZoom || self.options.maxZoom && map.getZoom() > self.options.maxZoom) {
  68170. return;
  68171. }
  68172. var bounds = map.getBounds(),
  68173. dw = bounds.getEast() - bounds.getWest(),
  68174. dh = bounds.getNorth() - bounds.getSouth();
  68175. var resolutionX = dw / this.canvasLayer.canvas.width,
  68176. resolutionY = dh / this.canvasLayer.canvas.height; // 一个像素是多少米
  68177. var zoomUnit = MapCalculateUtil_getMeterPerMapUnit('DEGREE') * resolutionX;
  68178. var center = map.getCenter();
  68179. var centerPx = map.project(center);
  68180. var dataGetOptions = {
  68181. transferCoordinate: function transferCoordinate(coordinate) {
  68182. if (map.transform.rotationMatrix || self.context === '2d') {
  68183. var worldPoint = map.project(new external_mapboxgl_default.a.LngLat(coordinate[0], coordinate[1]));
  68184. return [worldPoint.x, worldPoint.y];
  68185. }
  68186. var pixel = [(coordinate[0] - center.lng) / resolutionX, (center.lat - coordinate[1]) / resolutionY];
  68187. return [pixel[0] + centerPx.x, pixel[1] + centerPx.y];
  68188. }
  68189. };
  68190. if (time !== undefined) {
  68191. dataGetOptions.filter = function (item) {
  68192. var trails = animationOptions.trails || 10;
  68193. return time && item.time > time - trails && item.time < time;
  68194. };
  68195. }
  68196. var data = self.dataSet.get(dataGetOptions);
  68197. this.processData(data); // 兼容unit为'm'的情况
  68198. if (self.options.unit === 'm') {
  68199. if (self.options.size) {
  68200. self.options._size = self.options.size / zoomUnit;
  68201. }
  68202. if (self.options.width) {
  68203. self.options._width = self.options.width / zoomUnit;
  68204. }
  68205. if (self.options.height) {
  68206. self.options._height = self.options.height / zoomUnit;
  68207. }
  68208. } else {
  68209. self.options._size = self.options.size;
  68210. self.options._height = self.options.height;
  68211. self.options._width = self.options.width;
  68212. }
  68213. var worldPoint = map.project(new external_mapboxgl_default.a.LngLat(0, 0));
  68214. this.drawContext(context, data, self.options, worldPoint);
  68215. self.options.updateCallback && self.options.updateCallback(time);
  68216. }
  68217. }, {
  68218. key: "init",
  68219. value: function init(options) {
  68220. var self = this;
  68221. self.options = options;
  68222. this.initDataRange(options);
  68223. this.context = self.options.context || '2d';
  68224. if (self.options.zIndex) {
  68225. this.canvasLayer && this.canvasLayer.setZIndex(self.options.zIndex);
  68226. }
  68227. this.initAnimator();
  68228. }
  68229. /**
  68230. * @function L.supermap.MapVRenderer.prototype.bindMapEvent
  68231. * @description 绑定鼠标移动事件。
  68232. */
  68233. }, {
  68234. key: "bindMapEvent",
  68235. value: function bindMapEvent() {
  68236. this.mapEvent = {
  68237. resizeEvent: this.resizeEvent.bind(this),
  68238. zoomStartEvent: this.zoomStartEvent.bind(this),
  68239. zoomEndEvent: this.zoomEndEvent.bind(this),
  68240. rotateStartEvent: this.rotateStartEvent.bind(this),
  68241. rotateEvent: this.rotateEvent.bind(this),
  68242. moveStartEvent: this.moveStartEvent.bind(this),
  68243. rotateEndEvent: this.rotateEndEvent.bind(this),
  68244. moveEvent: this.moveEvent.bind(this),
  68245. moveEndEvent: this.moveEndEvent.bind(this),
  68246. removeEvent: this.removeEvent.bind(this)
  68247. };
  68248. this.map.on('resize', this.mapEvent.resizeEvent);
  68249. this.map.on('zoomstart', this.mapEvent.zoomStartEvent);
  68250. this.map.on('zoomend', this.mapEvent.zoomEndEvent);
  68251. this.map.on('rotatestart', this.mapEvent.rotateStartEvent);
  68252. this.map.on('rotate', this.mapEvent.rotateEvent);
  68253. this.map.on('rotateend', this.mapEvent.rotateEndEvent); // this.map.on('dragend', this.dragEndEvent.bind(this));
  68254. this.map.on('movestart', this.mapEvent.moveStartEvent);
  68255. this.map.on('move', this.mapEvent.moveEvent);
  68256. this.map.on('moveend', this.mapEvent.moveEndEvent);
  68257. this.map.on('remove', this.mapEvent.removeEvent);
  68258. }
  68259. /**
  68260. * @function L.supermap.MapVRenderer.prototype.unbindMapEvent
  68261. * @description 解绑鼠标移动事件。
  68262. */
  68263. }, {
  68264. key: "unbindMapEvent",
  68265. value: function unbindMapEvent() {
  68266. this.map.off('resize', this.mapEvent.resizeEvent);
  68267. this.map.off('zoomstart', this.mapEvent.zoomStartEvent);
  68268. this.map.off('zoomend', this.mapEvent.zoomEndEvent);
  68269. this.map.off('rotatestart', this.mapEvent.rotateStartEvent);
  68270. this.map.off('rotate', this.mapEvent.rotateEvent);
  68271. this.map.off('rotateend', this.mapEvent.rotateEndEvent);
  68272. this.map.off('movestart', this.mapEvent.moveStartEvent);
  68273. this.map.off('move', this.mapEvent.moveEvent);
  68274. this.map.off('moveend', this.mapEvent.moveEndEvent);
  68275. this.map.off('remove', this.mapEvent.removeEvent);
  68276. }
  68277. /**
  68278. * @function L.supermap.MapVRenderer.prototype.destroy
  68279. * @description 释放资源。
  68280. */
  68281. }, {
  68282. key: "destroy",
  68283. value: function destroy() {
  68284. this.unbindMapEvent();
  68285. this.unbindEvent();
  68286. this.clearData();
  68287. this.animator && this.animator.stop();
  68288. this.animator = null;
  68289. this.canvasLayer = null;
  68290. }
  68291. /**
  68292. * @function MapvRenderer.prototype.addAnimatorEvent
  68293. * @description 添加动画事件。
  68294. */
  68295. }, {
  68296. key: "addAnimatorEvent",
  68297. value: function addAnimatorEvent() {}
  68298. /**
  68299. * @function MapvRenderer.prototype.removeEvent
  68300. * @description 移除事件。
  68301. */
  68302. }, {
  68303. key: "removeEvent",
  68304. value: function removeEvent() {
  68305. this.canvasLayer.mapContainer.removeChild(this.canvasLayer.canvas);
  68306. }
  68307. /**
  68308. * @function MapvRenderer.prototype.resizeEvent
  68309. * @description 调整事件。
  68310. */
  68311. }, {
  68312. key: "resizeEvent",
  68313. value: function resizeEvent() {
  68314. this.canvasLayer.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  68315. var canvas = this.canvasLayer.canvas;
  68316. canvas.style.position = 'absolute';
  68317. canvas.style.top = 0 + 'px';
  68318. canvas.style.left = 0 + 'px';
  68319. var global$2 = typeof window === 'undefined' ? {} : window;
  68320. var devicePixelRatio = this.canvasLayer.devicePixelRatio = global$2.devicePixelRatio || 1;
  68321. canvas.width = parseInt(this.map.getCanvas().style.width) * devicePixelRatio;
  68322. canvas.height = parseInt(this.map.getCanvas().style.height) * devicePixelRatio;
  68323. if (!this.canvasLayer.mapVOptions.context || this.canvasLayer.mapVOptions.context == '2d') {
  68324. canvas.getContext('2d').scale(devicePixelRatio, devicePixelRatio);
  68325. }
  68326. canvas.style.width = this.map.getCanvas().style.width;
  68327. canvas.style.height = this.map.getCanvas().style.height;
  68328. }
  68329. }, {
  68330. key: "moveEndEvent",
  68331. value: function moveEndEvent() {
  68332. this.stopAniamation = false;
  68333. var canvas = this.getContext().canvas;
  68334. canvas.style.transform = '';
  68335. this._canvasUpdate();
  68336. if (this._expectShow === true) {
  68337. this._show();
  68338. }
  68339. }
  68340. }, {
  68341. key: "moveStartEvent",
  68342. value: function moveStartEvent() {
  68343. this.startPitch = this.map.getPitch();
  68344. this.startBearing = this.map.getBearing();
  68345. var startMovePoint = this.map.project(new external_mapboxgl_default.a.LngLat(0, 0));
  68346. this.startMoveX = startMovePoint.x;
  68347. this.startMoveY = startMovePoint.y;
  68348. if (this.animation) {
  68349. this.stopAniamation = true;
  68350. }
  68351. if (this.rotating || this.zooming) {
  68352. return;
  68353. }
  68354. this._expectShow = this.canvasLayer.canvas.style.display !== 'none';
  68355. if (this.map.getPitch() !== 0) {
  68356. this._hide();
  68357. }
  68358. }
  68359. }, {
  68360. key: "moveEvent",
  68361. value: function moveEvent() {
  68362. this.canvasLayer.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  68363. var tPitch = this.map.getPitch() - this.startPitch;
  68364. var tBearing = -this.map.getBearing() + this.startBearing;
  68365. var endMovePoint = this.map.project(new external_mapboxgl_default.a.LngLat(0, 0));
  68366. var tMoveX = endMovePoint.x - this.startMoveX;
  68367. var tMoveY = endMovePoint.y - this.startMoveY;
  68368. var canvas = this.getContext().canvas;
  68369. canvas.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)' + ' translate3d(' + tMoveX + 'px, ' + tMoveY + 'px, 0px)';
  68370. }
  68371. }, {
  68372. key: "zoomStartEvent",
  68373. value: function zoomStartEvent() {
  68374. this.zooming = true;
  68375. this._hide();
  68376. }
  68377. }, {
  68378. key: "zoomEndEvent",
  68379. value: function zoomEndEvent() {
  68380. this.zooming = false;
  68381. }
  68382. }, {
  68383. key: "rotateStartEvent",
  68384. value: function rotateStartEvent() {
  68385. this.rotating = true;
  68386. if (this.map.getPitch() !== 0) {
  68387. this._hide();
  68388. }
  68389. }
  68390. }, {
  68391. key: "rotateEvent",
  68392. value: function rotateEvent() {
  68393. this.canvasLayer.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  68394. var tPitch = this.map.getPitch() - this.startPitch;
  68395. var tBearing = -this.map.getBearing() + this.startBearing;
  68396. var canvas = this.getContext().canvas;
  68397. canvas.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)';
  68398. }
  68399. }, {
  68400. key: "rotateEndEvent",
  68401. value: function rotateEndEvent() {
  68402. this.rotating = false;
  68403. }
  68404. /**
  68405. * @function MapvRenderer.prototype.clear
  68406. * @param {Object} context - 当前环境。
  68407. * @description 清除环境。
  68408. */
  68409. }, {
  68410. key: "clear",
  68411. value: function clear(context) {
  68412. context && context.clearRect && context.clearRect(0, 0, parseInt(this.map.getCanvas().style.width), parseInt(this.map.getCanvas().style.height));
  68413. }
  68414. /**
  68415. * @function MapvRenderer.prototype.draw
  68416. * @description 渲染绘制。
  68417. */
  68418. }, {
  68419. key: "draw",
  68420. value: function draw() {
  68421. this._canvasUpdate();
  68422. }
  68423. }, {
  68424. key: "_hide",
  68425. value: function _hide() {
  68426. this.canvasLayer.canvas.style.display = 'none';
  68427. }
  68428. }, {
  68429. key: "_show",
  68430. value: function _show() {
  68431. this.canvasLayer.canvas.style.display = 'block';
  68432. }
  68433. }]);
  68434. return MapvRenderer;
  68435. }(BaseLayer);
  68436. // CONCATENATED MODULE: ./src/mapboxgl/overlay/MapvLayer.js
  68437. function MapvLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68438. 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); } }
  68439. function MapvLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapvLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapvLayer_defineProperties(Constructor, staticProps); return Constructor; }
  68440. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  68441. * This program are made available under the terms of the Apache License, Version 2.0
  68442. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68443. /**
  68444. * @class mapboxgl.supermap.MapvLayer
  68445. * @category Visualization MapV
  68446. * @classdesc Mapv 图层。
  68447. * @param {mapboxgl.Map} map - mapboxgl 地图对象,将在下个版本弃用,请用 map.addLayer() 方法添加图层。
  68448. * @param {Mapv.DataSet} dataSet - MapV 图层数据集。
  68449. * @param {Object} mapVOptions - Mapv 参数。
  68450. * @param {string} [mapVOptions.layerID] - 图层 ID。默认使用 CommonUtil.createUniqueID("mapvLayer_") 创建专题图层 ID。
  68451. */
  68452. var MapvLayer_MapvLayer = /*#__PURE__*/function () {
  68453. function MapvLayer(map, dataSet, mapVOptions) {
  68454. MapvLayer_classCallCheck(this, MapvLayer);
  68455. this.map = map;
  68456. this.id = mapVOptions.layerID ? mapVOptions.layerID : Util_Util.createUniqueID('mapvLayer_');
  68457. delete mapVOptions['layerID'];
  68458. this.mapVOptions = mapVOptions;
  68459. this.dataSet = dataSet;
  68460. this.visibility = true; //保留之前的用法
  68461. if (this.map) {
  68462. this.map.addLayer(this);
  68463. }
  68464. }
  68465. MapvLayer_createClass(MapvLayer, [{
  68466. key: "onAdd",
  68467. value: function onAdd(map) {
  68468. this.map = map;
  68469. this.renderer = new MapvRenderer_MapvRenderer(this.map, this, this.dataSet, this.mapVOptions);
  68470. this.canvas = this._createCanvas();
  68471. this.renderer._canvasUpdate();
  68472. this.mapContainer = map.getCanvasContainer();
  68473. this.mapContainer.appendChild(this.canvas);
  68474. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  68475. }
  68476. /**
  68477. * @function mapboxgl.supermap.MapvLayer.prototype.removeFromMap
  68478. * @description 移除图层。
  68479. */
  68480. }, {
  68481. key: "removeFromMap",
  68482. value: function removeFromMap() {
  68483. this.mapContainer.removeChild(this.canvas);
  68484. this.renderer.destroy();
  68485. }
  68486. /**
  68487. * @function mapboxgl.supermap.MapvLayer.prototype.setVisibility
  68488. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  68489. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  68490. */
  68491. }, {
  68492. key: "setVisibility",
  68493. value: function setVisibility(visibility) {
  68494. if (visibility !== this.visibility) {
  68495. this.visibility = visibility;
  68496. if (visibility) {
  68497. this.show();
  68498. } else {
  68499. this.hide();
  68500. }
  68501. }
  68502. }
  68503. /**
  68504. * @function mapboxgl.supermap.MapvLayer.prototype.moveTo
  68505. * @description 将图层移动到某个图层之前。
  68506. * @param {string} layerID - 待插入的图层 ID。
  68507. * @param {boolean} [before=true] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  68508. */
  68509. }, {
  68510. key: "moveTo",
  68511. value: function moveTo(layerID, before) {
  68512. var layer = document.getElementById(this.canvas.id);
  68513. before = before !== undefined ? before : true;
  68514. if (before) {
  68515. var beforeLayer = document.getElementById(layerID);
  68516. if (layer && beforeLayer) {
  68517. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  68518. }
  68519. return;
  68520. }
  68521. var nextLayer = document.getElementById(layerID);
  68522. if (layer) {
  68523. if (nextLayer.nextSibling) {
  68524. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  68525. return;
  68526. }
  68527. nextLayer.parentNode.appendChild(layer);
  68528. }
  68529. }
  68530. /**
  68531. * @function mapboxgl.supermap.MapvLayer.prototype.getTopLeft
  68532. * @description 获取左上的距离。
  68533. */
  68534. }, {
  68535. key: "getTopLeft",
  68536. value: function getTopLeft() {
  68537. var map = this.map;
  68538. var topLeft;
  68539. if (map) {
  68540. var bounds = map.getBounds();
  68541. topLeft = bounds.getNorthWest();
  68542. }
  68543. return topLeft;
  68544. }
  68545. /**
  68546. * @function mapboxgl.supermap.MapvLayer.prototype.addData
  68547. * @description 追加数据。
  68548. * @param {Object} data - 要追加的数据。
  68549. * @param {Object} options - 要追加的值。
  68550. */
  68551. }, {
  68552. key: "addData",
  68553. value: function addData(data, options) {
  68554. this.renderer.addData(data, options);
  68555. }
  68556. /**
  68557. * @function mapboxgl.supermap.MapvLayer.prototype.update
  68558. * @description 更新图层。
  68559. * @param {Object} opt - 待更新的数据。
  68560. * @param {Object} opt.data - mapv 数据集。
  68561. * @param {Object} opt.options - mapv 绘制参数。
  68562. */
  68563. }, {
  68564. key: "update",
  68565. value: function update(opt) {
  68566. this.renderer.update(opt);
  68567. }
  68568. /**
  68569. * @function mapboxgl.supermap.MapvLayer.prototype.getData
  68570. * @description 获取数据。
  68571. * @returns {mapv.DataSet} mapv 数据集。
  68572. */
  68573. }, {
  68574. key: "getData",
  68575. value: function getData() {
  68576. if (this.renderer) {
  68577. this.dataSet = this.renderer.getData();
  68578. }
  68579. return this.dataSet;
  68580. }
  68581. /**
  68582. * @function mapboxgl.supermap.MapvLayer.prototype.removeData
  68583. * @description 删除符合过滤条件的数据。
  68584. * @param {function} [filter] - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  68585. * @example
  68586. * filter=function(data){
  68587. * if(data.id=="1"){
  68588. * return true
  68589. * }
  68590. * return false;
  68591. * }
  68592. */
  68593. }, {
  68594. key: "removeData",
  68595. value: function removeData(filter) {
  68596. this.renderer && this.renderer.removeData(filter);
  68597. }
  68598. /**
  68599. * @function mapboxgl.supermap.MapvLayer.prototype.clearData
  68600. * @description 清除数据。
  68601. */
  68602. }, {
  68603. key: "clearData",
  68604. value: function clearData() {
  68605. this.renderer.clearData();
  68606. }
  68607. }, {
  68608. key: "show",
  68609. value: function show() {
  68610. if (this.renderer) {
  68611. this.renderer._show();
  68612. }
  68613. return this;
  68614. }
  68615. }, {
  68616. key: "hide",
  68617. value: function hide() {
  68618. if (this.renderer) {
  68619. this.renderer._hide();
  68620. }
  68621. return this;
  68622. }
  68623. }, {
  68624. key: "_createCanvas",
  68625. value: function _createCanvas() {
  68626. var canvas = document.createElement('canvas');
  68627. canvas.id = this.id;
  68628. canvas.style.position = 'absolute';
  68629. canvas.style.top = 0 + 'px';
  68630. canvas.style.left = 0 + 'px';
  68631. var global$2 = typeof window === 'undefined' ? {} : window;
  68632. var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio || 1;
  68633. canvas.width = parseInt(this.map.getCanvas().style.width) * devicePixelRatio;
  68634. canvas.height = parseInt(this.map.getCanvas().style.height) * devicePixelRatio;
  68635. if (!this.mapVOptions.context || this.mapVOptions.context == '2d') {
  68636. canvas.getContext('2d').scale(devicePixelRatio, devicePixelRatio);
  68637. }
  68638. canvas.style.width = this.map.getCanvas().style.width;
  68639. canvas.style.height = this.map.getCanvas().style.height;
  68640. return canvas;
  68641. }
  68642. /**
  68643. * @function mapboxgl.supermap.MapvLayer.prototype.setZIndex
  68644. * @description 设置 canvas 层级。
  68645. * @param {number} zIndex - canvas 层级。
  68646. */
  68647. }, {
  68648. key: "setZIndex",
  68649. value: function setZIndex(z) {
  68650. this.canvas.style.zIndex = z;
  68651. }
  68652. }]);
  68653. return MapvLayer;
  68654. }();
  68655. external_mapboxgl_default.a.supermap.MapvLayer = MapvLayer_MapvLayer;
  68656. // CONCATENATED MODULE: ./src/mapboxgl/overlay/theme/Theme3DLayer.js
  68657. function Theme3DLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68658. 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); } }
  68659. function Theme3DLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) Theme3DLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) Theme3DLayer_defineProperties(Constructor, staticProps); return Constructor; }
  68660. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  68661. * This program are made available under the terms of the Apache License, Version 2.0
  68662. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68663. /**
  68664. * @class mapboxgl.supermap.Theme3DLayer
  68665. * @category Visualization Theme
  68666. * @classdesc 三维专题图基类,不能直接实例化。
  68667. * @param {string} [id] - 专题图图层 id。默认使用 CommonUtil.createUniqueID("theme3DLayer") 创建专题图层 ID。
  68668. * @param {Object} layerOptions -专题图图层配置项。
  68669. * @param {number} [layerOptions.opacity=1] - 图层透明度。
  68670. * @param {boolean} [layerOptions.parseNumber=fasle] - 是否预处理数据,将数据转换为 number。
  68671. * @param {boolean} [layerOptions.enableHighlight=false] - 是否开启高亮。
  68672. * @param {string} [layerOptions.highlight="#ADA91E"] - 高亮颜色。
  68673. * @param {string} [layerOptions.baseHeightField] - 数据中表示基础高度的字段。
  68674. * @param {number} [layerOptions.height] - 高度。如果数据指定的 heightField (为height)没有可以表示高度的字段,可以为所有数据统一设置一个高度。
  68675. * @param {string} [layerOptions.heightField] - 数据中表示高度的字段。
  68676. * @param {string} [layerOptions.themeField] - 专题展示的字段。
  68677. * @param {boolean} [playerOptions.showLegend=true] - 是否显示图例。
  68678. * @param {string} [layerOptions.legendTitle] - 图例标题。
  68679. * @param {string} [layerOptions.legendTheme='light'] - 图例主题,取值:'light','dark'。
  68680. * @param {string} [layerOptions.legendOrientation='horizontal'] - 图例方向,取值:'horizontal','vertical'。
  68681. * @param {string} [layerOptions.legendPosition] - 图例位置,取值:'top-right'|'top-left'|'bottom-left'|'bottom-right'。
  68682. */
  68683. var Theme3DLayer = /*#__PURE__*/function () {
  68684. function Theme3DLayer(id, layerOptions) {
  68685. Theme3DLayer_classCallCheck(this, Theme3DLayer);
  68686. /**
  68687. * @member {string} mapboxgl.supermap.Theme3DLayer.prototype.id
  68688. * @description Mapbox GL 图层 id。
  68689. */
  68690. this.id = id;
  68691. /**
  68692. * @member {Object} mapboxgl.supermap.Theme3DLayer.prototype.map
  68693. * @description Mapbox GL 地图对象。
  68694. */
  68695. this.map = null;
  68696. /**
  68697. * @member {number} [mapboxgl.supermap.Theme3DLayer.prototype.opacity=1]
  68698. * @description 图层透明度。
  68699. */
  68700. this.opacity = 1;
  68701. /**
  68702. * @member {boolean} [mapboxgl.supermap.Theme3DLayer.prototype.parseNumber=false]
  68703. * @description 是否进行数据预处理,有些字段是 string 类型,需要转换为 number。
  68704. */
  68705. this.parseNumber = false;
  68706. /**
  68707. * @member {boolean} [mapboxgl.supermap.Theme3DLayer.prototype.enableHighlight=false]
  68708. * @description 是否开启高亮。
  68709. */
  68710. this.enableHighlight = false;
  68711. /**
  68712. * @member {Object} [mapboxgl.supermap.Theme3DLayer.prototype.highlight={color: "#ADA91E"}]
  68713. * @description 高亮相关配置。
  68714. */
  68715. this.highlight = {
  68716. color: "#ADA91E"
  68717. };
  68718. /**
  68719. * @member {string} mapboxgl.supermap.Theme3DLayer.prototype.baseHeightField
  68720. * @description 数据中表示基础高度的字段。
  68721. */
  68722. this.baseHeightField = null;
  68723. /**
  68724. * @member {number} mapboxgl.supermap.Theme3DLayer.prototype.height
  68725. * @description 高度。如果数据指定的 heightField (默认 height) 没有可以表示高度的字段,可以为所有数据统一设置一个高度。
  68726. */
  68727. this.height = null;
  68728. /**
  68729. * @member {string} mapboxgl.supermap.Theme3DLayer.prototype.heightField
  68730. * @description 数据中表示高度的字段。
  68731. */
  68732. this.heightField = 'height';
  68733. /**
  68734. * @member {string} [mapboxgl.supermap.Theme3DLayer.prototype.themeField]
  68735. * @description 专题展示的字段。
  68736. */
  68737. this.themeField = this.heightField;
  68738. /**
  68739. * @member {boolean} [mapboxgl.supermap.Theme3DLayer.prototype.showLegend=true]
  68740. * @description 是否显示图例。
  68741. */
  68742. this.showLegend = true;
  68743. /**
  68744. * @member {string} [mapboxgl.supermap.Theme3DLayer.prototype.legendTitle]
  68745. * @description 图例标题。
  68746. */
  68747. this.legendTitle = null;
  68748. /**
  68749. * @member {string} [mapboxgl.supermap.Theme3DLayer.prototype.legendTheme='light']
  68750. * @description 图例主题,取值:'light','dark'。
  68751. * @default 'light'
  68752. */
  68753. this.legendTheme = 'light';
  68754. /**
  68755. * @member {string} [mapboxgl.supermap.Theme3DLayer.prototype.legendOrientation='horizontal']
  68756. * @description 图例方向,取值:'horizontal','vertical'。
  68757. * @default 'horizontal'
  68758. */
  68759. this.legendOrientation = 'horizontal';
  68760. /**
  68761. * @member {string} mapboxgl.supermap.Theme3DLayer.prototype.legendPosition
  68762. * @description 图例位置,取值:'top-right'|'top-left'|'bottom-left'|'bottom-right'。
  68763. * @default 'bottom-right'
  68764. */
  68765. this.legendPosition = 'bottom-right';
  68766. this._highlightLayerId = "".concat(this.id, "-highlightLayer");
  68767. this._extend(this, layerOptions);
  68768. }
  68769. /**
  68770. * @function mapboxgl.supermap.Theme3DLayer.prototype.setLayerOptions
  68771. * @description 设置图层相关参数。
  68772. * @param {Object} layerOptions - 该专题图图层相关参数。
  68773. * @param {number} [layerOptions.opacity=1] - 图层透明度。
  68774. * @param {boolean} [layerOptions.parseNumber=false] - 是否预处理数据,将数据转换为 number。
  68775. * @param {string} [layerOptions.baseHeightField] - 数据中表示基础高度的字段
  68776. * @param {number} [layerOptions.height] - 高度。如果数据指定的heightField(默认height)没有可以表示高度的字段,可以为所有数据统一设置一个高度。
  68777. * @param {string} [layerOptions.heightField] - 数据中表示高度的字段。
  68778. * @param {string} [layerOptions.themeField] - 专题展示的字段。
  68779. * @param {boolean} [layerOptions.showLegend=true] - 是否显示图例。
  68780. * @param {string} layerOptions.legendTitle - 图例标题。
  68781. * @param {string} [layerOptions.legendTheme='light'] - 图例主题,取值:'light','dark'。
  68782. * @param {string} [layerOptions.legendOrientation='horizontal'] - 图例方向,取值:'horizontal','vertical'。
  68783. * @param {string} [layerOptions.legendPosition] - 图例位置,取值:'top-right'|'top-left'|'bottom-left'|'bottom-right'。
  68784. * @returns {this}
  68785. */
  68786. Theme3DLayer_createClass(Theme3DLayer, [{
  68787. key: "setLayerOptions",
  68788. value: function setLayerOptions(layerOptions) {
  68789. this._extend(this, layerOptions);
  68790. return this;
  68791. }
  68792. /**
  68793. * @function mapboxgl.supermap.Theme3DLayer.prototype.setHighlightStyleOptions
  68794. * @description 设置图层高亮相关参数。
  68795. * @param {Object} highlightOptions - 该专题图图层高亮相关参数。
  68796. * @param {string} [highlightOptions.color] - 颜色。
  68797. * @param {function} highlightOptions.callback - 回调,返回数据参数(data,event)。
  68798. * @returns {this}
  68799. */
  68800. }, {
  68801. key: "setHighlightStyleOptions",
  68802. value: function setHighlightStyleOptions(highlightOptions) {
  68803. this._extend(this.highlight, highlightOptions);
  68804. return this;
  68805. }
  68806. /**
  68807. * @function mapboxgl.supermap.Theme3DLayer.prototype.setData
  68808. * @description 设置数据,数据格式必须为 GeoJSON 格式。
  68809. * @param {GeoJSONObject} data - GeoJSON 格式数据。
  68810. * @param {boolean} [parseNumber=false] - 是否进行数据预处理,有些字段是 string 类型,需要转换为 number。
  68811. */
  68812. }, {
  68813. key: "setData",
  68814. value: function setData(data, parseNumber) {
  68815. var me = this;
  68816. me.data = data;
  68817. if (parseNumber != null) {
  68818. me.parseNumber = parseNumber;
  68819. }
  68820. me.parseNumber && me.data && me.data.features && me.data.features.map(function (val) {
  68821. if (me.baseHeightField && val.properties[me.baseHeightField]) {
  68822. val.properties[me.baseHeightField] = parseFloat(val.properties[me.baseHeightField]);
  68823. }
  68824. if (me.heightField && val.properties[me.heightField]) {
  68825. val.properties[me.heightField] = parseFloat(val.properties[me.heightField]);
  68826. }
  68827. return val;
  68828. });
  68829. return this;
  68830. }
  68831. /**
  68832. * @function mapboxgl.supermap.Theme3DLayer.prototype.getData
  68833. * @description 获取数据。
  68834. * @returns {GeoJSONObject} 获取的数据。
  68835. */
  68836. }, {
  68837. key: "getData",
  68838. value: function getData() {
  68839. return this.data;
  68840. }
  68841. /**
  68842. * @function mapboxgl.supermap.Theme3DLayer.prototype.addTo
  68843. * @description 添加图层到地图上。
  68844. * @param {mapboxgl.Map} map - Mapbox GL 地图对象。
  68845. * @returns {this} this 对象。
  68846. */
  68847. }, {
  68848. key: "addTo",
  68849. value: function addTo(map) {
  68850. this.map = map;
  68851. if (!this.map) {
  68852. return this;
  68853. }
  68854. this.show();
  68855. return this;
  68856. }
  68857. /**
  68858. * @function mapboxgl.supermap.Theme3DLayer.prototype.show
  68859. * @description 显示图层。
  68860. * @param {Object} options - 图层配置项。
  68861. * @returns {this} this 对象。
  68862. */
  68863. }, {
  68864. key: "show",
  68865. value: function show(options) {
  68866. this._extend(this, options);
  68867. this._addLayer();
  68868. if (this.enableHighlight) {
  68869. this._addHighLightLayer();
  68870. }
  68871. if (this.showLegend) {
  68872. if (!this.legend) {
  68873. this.legend = this._createLegendControl();
  68874. }
  68875. this.map.addControl(this.legend, this.legendPosition);
  68876. }
  68877. return this;
  68878. }
  68879. /**
  68880. * @function mapboxgl.supermap.Theme3DLayer.prototype.remove
  68881. * @description 从地图上移除图层。
  68882. * @returns {this} this 对象。
  68883. */
  68884. }, {
  68885. key: "remove",
  68886. value: function remove() {
  68887. if (!this.map) {
  68888. return this;
  68889. } //移除图层
  68890. var layerId = this.id ? this.id : "theme3DLayer";
  68891. if (this.map.getLayer(layerId)) {
  68892. this.map.off('mousemove', layerId, this._onMouseMove.bind(this));
  68893. this.map.on('mouseout', layerId, this._onMouseMove.bind(this));
  68894. this.map.removeLayer(layerId);
  68895. } //移除高亮图层
  68896. if (this.map.getLayer(this._highlightLayerId)) {
  68897. this._selectFeatureId = null;
  68898. this.map.removeLayer(this._highlightLayerId);
  68899. } //移除图例
  68900. if (this.legend) {
  68901. this.map.removeControl(this.legend);
  68902. }
  68903. return this;
  68904. }
  68905. /**
  68906. * @function mapboxgl.supermap.Theme3DLayer.prototype.getLayerStyleOptions
  68907. * @description 获取图层样式。
  68908. * @returns {Object} Mapbox GL 样式对象。
  68909. */
  68910. }, {
  68911. key: "getLayerStyleOptions",
  68912. value: function getLayerStyleOptions() {//子类重写实现
  68913. }
  68914. /**
  68915. * @function mapboxgl.supermap.Theme3DLayer.prototype.getHighlightStyleOptions
  68916. * @description 获取高亮样式,子类重写实现。
  68917. * @returns {Object} Mapbox GL 样式对象。
  68918. */
  68919. }, {
  68920. key: "getHighlightStyleOptions",
  68921. value: function getHighlightStyleOptions() {//子类重写实现
  68922. }
  68923. }, {
  68924. key: "_createLegendControl",
  68925. value: function _createLegendControl(html) {
  68926. var me = this;
  68927. function LegendControl() {}
  68928. LegendControl.prototype.onAdd = function (map) {
  68929. this._map = map;
  68930. this._container = document.createElement('div');
  68931. var className = 'mapboxgl-ctrl legend ';
  68932. var theme = 'legend-light';
  68933. if (me.legendTheme === 'dark') {
  68934. theme = 'legend-dark';
  68935. }
  68936. var orientation = ' legend-horizontal';
  68937. if (me.legendOrientation === 'vertical') {
  68938. orientation = ' legend-vertical';
  68939. }
  68940. this._container.className = className + theme + orientation;
  68941. if (html) {
  68942. this._container.innerHTML = html;
  68943. } else {
  68944. var legendTitle = me.legendTitle || "";
  68945. var titleElement = " <div class='legend-title'>" + legendTitle + "</div>";
  68946. var content = me._createLegendElement.call(me) || "";
  68947. var contentElement = "<div class='legend-content'>" + content + "</div>";
  68948. this._container.innerHTML = titleElement + contentElement;
  68949. }
  68950. me._appendLegendCSSStyle();
  68951. return this._container;
  68952. };
  68953. LegendControl.prototype.onRemove = function () {
  68954. this._container.parentNode.removeChild(this._container);
  68955. this._map = undefined;
  68956. };
  68957. return new LegendControl();
  68958. }
  68959. }, {
  68960. key: "_createLegendElement",
  68961. value: function _createLegendElement() {//子类实现
  68962. }
  68963. }, {
  68964. key: "_addLayer",
  68965. value: function _addLayer() {
  68966. var paintOptions = this.getLayerStyleOptions();
  68967. var id = this.id ? this.id : "theme3DLayer";
  68968. var sourceId = this.sourceId = id + 'Source';
  68969. if (!this.map.getSource(sourceId)) {
  68970. this.map.addSource(sourceId, {
  68971. 'type': 'geojson',
  68972. 'data': this.data
  68973. });
  68974. } else {
  68975. this.map.removeSource(sourceId);
  68976. this.map.addSource(sourceId, {
  68977. 'type': 'geojson',
  68978. 'data': this.data
  68979. });
  68980. }
  68981. this.map.addLayer({
  68982. 'id': id,
  68983. 'type': 'fill-extrusion',
  68984. 'source': sourceId,
  68985. 'paint': paintOptions
  68986. });
  68987. this.map.moveLayer(id);
  68988. } //添加高亮图层
  68989. }, {
  68990. key: "_addHighLightLayer",
  68991. value: function _addHighLightLayer() {
  68992. if (!this.map) {
  68993. return;
  68994. }
  68995. var map = this.map;
  68996. map.addLayer({
  68997. 'id': this._highlightLayerId,
  68998. 'type': 'fill-extrusion',
  68999. 'source': this.sourceId,
  69000. 'paint': this.getHighlightStyleOptions(),
  69001. "filter": ["in", "$id", ""]
  69002. });
  69003. this._selectFeatureId = null;
  69004. map.on('mousemove', this.id, this._onMouseMove.bind(this));
  69005. map.on('mouseout', this.id, this._onMouseMove.bind(this));
  69006. }
  69007. }, {
  69008. key: "_onMouseMove",
  69009. value: function _onMouseMove(e) {
  69010. var me = this,
  69011. map = this.map;
  69012. var features = map.queryRenderedFeatures(e.point, {
  69013. layers: [me.id]
  69014. });
  69015. if (me.highlight && me.highlight.callback) {
  69016. me.highlight.callback(features, e);
  69017. }
  69018. if (!features || features.length < 1) {
  69019. me._clearHighlight.call(me);
  69020. me._selectFeatureId = null;
  69021. return;
  69022. }
  69023. var id = features[0].id;
  69024. if (me._selectFeatureId === id) {
  69025. return;
  69026. }
  69027. me._selectFeatureId = id;
  69028. map.setFilter(me._highlightLayerId, ['==', '$id', me._selectFeatureId]);
  69029. }
  69030. }, {
  69031. key: "_clearHighlight",
  69032. value: function _clearHighlight() {
  69033. if (this.map) {
  69034. this.map.setFilter(this._highlightLayerId, ["in", "$id", ""]);
  69035. }
  69036. }
  69037. }, {
  69038. key: "_appendLegendCSSStyle",
  69039. value: function _appendLegendCSSStyle() {
  69040. var legendStyle = document.createElement('style');
  69041. legendStyle.type = 'text/css';
  69042. 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 ";
  69043. legendStyle.innerHTML = baseStyle + this._legendCSSStyle();
  69044. document.getElementsByTagName('head')[0].appendChild(legendStyle);
  69045. } //各种图层对应的自己的图例的样式
  69046. }, {
  69047. key: "_legendCSSStyle",
  69048. value: function _legendCSSStyle() {
  69049. //子类可重写实现
  69050. 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 ";
  69051. }
  69052. }, {
  69053. key: "_extend",
  69054. value: function _extend(dest) {
  69055. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  69056. var arg = Object.getOwnPropertyNames(arguments)[index];
  69057. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  69058. continue;
  69059. }
  69060. var obj = arguments[arg];
  69061. if (obj) {
  69062. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  69063. var key = Object.getOwnPropertyNames(obj)[j];
  69064. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  69065. continue;
  69066. }
  69067. dest[key] = obj[key];
  69068. }
  69069. }
  69070. }
  69071. return dest;
  69072. }
  69073. }]);
  69074. return Theme3DLayer;
  69075. }();
  69076. external_mapboxgl_default.a.supermap.Theme3DLayer = Theme3DLayer;
  69077. // CONCATENATED MODULE: ./src/mapboxgl/overlay/RangeTheme3DLayer.js
  69078. 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); }
  69079. function RangeTheme3DLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69080. 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); } }
  69081. function RangeTheme3DLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) RangeTheme3DLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) RangeTheme3DLayer_defineProperties(Constructor, staticProps); return Constructor; }
  69082. 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); }
  69083. function RangeTheme3DLayer_setPrototypeOf(o, p) { RangeTheme3DLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RangeTheme3DLayer_setPrototypeOf(o, p); }
  69084. 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); }; }
  69085. function RangeTheme3DLayer_possibleConstructorReturn(self, call) { if (call && (RangeTheme3DLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return RangeTheme3DLayer_assertThisInitialized(self); }
  69086. function RangeTheme3DLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  69087. 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; } }
  69088. function RangeTheme3DLayer_getPrototypeOf(o) { RangeTheme3DLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RangeTheme3DLayer_getPrototypeOf(o); }
  69089. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  69090. * This program are made available under the terms of the Apache License, Version 2.0
  69091. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69092. /**
  69093. * @class mapboxgl.supermap.RangeTheme3DLayer
  69094. * @category Visualization Theme
  69095. * @classdesc 三维分段专题图。
  69096. * @param {string} [id] - 专题图图层 id。默认使用 CommonUtil.createUniqueID("theme3DLayer") 创建专题图层 ID。
  69097. * @param {Object} layerOptions - 专题图图层配置项,参数继承自 Theme3DLayer。
  69098. * @param {Array} [layerOptions.heightStops] - 新增参数,数据高度分段数组。
  69099. * @param {Array} layerOptions.colorStops - 新增参数,数据颜色分段数组。
  69100. * @param {number} [layerOptions.base] - 新增参数,数据分段线性增量。
  69101. * @param {number} [layerOptions.legendRatio=1] - 新增参数,图例数值扩大系数。
  69102. * @example
  69103. * new mapboxgl.supermap.RangeTheme3DLayer(layerId, map, {
  69104. * enableHighlight:true,
  69105. * // 设置分段
  69106. * heightField: "floor",
  69107. * heightStops: [[1, 10], [10, 100]],
  69108. * 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)']],
  69109. * // 显示图例
  69110. * showLegend: true,
  69111. * legendTheme: 'dark',
  69112. * legendTitle: "图例"
  69113. * });
  69114. */
  69115. var RangeTheme3DLayer = /*#__PURE__*/function (_Theme3DLayer) {
  69116. RangeTheme3DLayer_inherits(RangeTheme3DLayer, _Theme3DLayer);
  69117. var _super = RangeTheme3DLayer_createSuper(RangeTheme3DLayer);
  69118. function RangeTheme3DLayer(id, layerOptions) {
  69119. var _this;
  69120. RangeTheme3DLayer_classCallCheck(this, RangeTheme3DLayer);
  69121. _this = _super.call(this, id, layerOptions);
  69122. /**
  69123. * @member {Array} mapboxgl.supermap.RangeTheme3DLayer.prototype.heightStops
  69124. * @description 数据高度分段数组。
  69125. */
  69126. _this.heightStops = null;
  69127. /**
  69128. * @member {Array} mapboxgl.supermap.RangeTheme3DLayer.prototype.colorStops
  69129. * @description 数据颜色分段数组。
  69130. */
  69131. _this.colorStops = null;
  69132. /**
  69133. * @member {number} mapboxgl.supermap.RangeTheme3DLayer.prototype.base
  69134. * @description 数据分段线性增量。
  69135. */
  69136. _this.base = null;
  69137. /**
  69138. * @member {number} [mapboxgl.supermap.RangeTheme3DLayer.prototype.legendRatio=1]
  69139. * @description 图例数值扩大系数。
  69140. */
  69141. _this.legendRatio = 1;
  69142. _this._extend(RangeTheme3DLayer_assertThisInitialized(_this), layerOptions);
  69143. return _this;
  69144. }
  69145. /**
  69146. * @function mapboxgl.supermap.RangeTheme3DLayer.prototype.getLayerStyleOptions
  69147. * @description 获取图层样式。
  69148. * @returns {Object} Mapbox GL 样式对象。
  69149. */
  69150. RangeTheme3DLayer_createClass(RangeTheme3DLayer, [{
  69151. key: "getLayerStyleOptions",
  69152. value: function getLayerStyleOptions() {
  69153. var opacity = this.opacity == null ? 1 : this.opacity;
  69154. opacity = isNaN(parseFloat(opacity)) ? 1 : parseFloat(opacity);
  69155. var reg = /^[0-9]+.?[0-9]*$/;
  69156. var options = {
  69157. 'fill-extrusion-color': {
  69158. 'stops': this.colorStops,
  69159. 'property': this.themeField || this.heightField,
  69160. 'type': 'interval',
  69161. 'base': reg.test(this.base) ? this.base : 1
  69162. },
  69163. 'fill-extrusion-opacity': opacity
  69164. };
  69165. if (this.heightStops) {
  69166. options['fill-extrusion-height'] = {
  69167. 'stops': this.heightStops,
  69168. 'property': this.heightField || 'height',
  69169. 'base': reg.test(this.base) ? this.base : 1
  69170. };
  69171. } else if (this.height) {
  69172. options['fill-extrusion-height'] = this.height;
  69173. } else {
  69174. options['fill-extrusion-height'] = {
  69175. 'property': this.heightField || 'height',
  69176. 'type': 'identity'
  69177. };
  69178. }
  69179. if (this.baseHeightField) {
  69180. options['fill-extrusion-base'] = {
  69181. 'property': this.baseHeightField,
  69182. 'type': 'identity'
  69183. };
  69184. }
  69185. return options;
  69186. }
  69187. /**
  69188. * @function mapboxgl.supermap.RangeTheme3DLayer.prototype.getHighlightStyleOptions
  69189. * @description 获取高亮样式。
  69190. * @returns {Object} mapboxgl 样式对象。
  69191. */
  69192. }, {
  69193. key: "getHighlightStyleOptions",
  69194. value: function getHighlightStyleOptions() {
  69195. var color = this.highlight && this.highlight.color != null ? this.highlight.color : '#ADA91E';
  69196. return {
  69197. 'fill-extrusion-color': color,
  69198. 'fill-extrusion-height': {
  69199. "stops": this.heightStops,
  69200. "property": this.heightField
  69201. },
  69202. 'fill-extrusion-opacity': this.highlight && this.highlight.opacity || 0.6
  69203. };
  69204. }
  69205. }, {
  69206. key: "_createLegendElement",
  69207. value: function _createLegendElement() {
  69208. var len = this.colorStops && this.colorStops.length || 0; //颜色分段对应标识
  69209. var legendListElement = "<ul>";
  69210. var i;
  69211. for (i = 0; i < len; i++) {
  69212. var value = this.colorStops[i][0];
  69213. var text = this._getWrapperText(value);
  69214. if (i === len - 1) {
  69215. text = "> " + text;
  69216. } else {
  69217. var next = this._getWrapperText(this.colorStops[i + 1][0]);
  69218. text = text + "-" + next;
  69219. }
  69220. var color = this.colorStops[i][1];
  69221. legendListElement += "<li><span style='background-color:" + color + ";'></span><span>" + text + "</span></li>";
  69222. }
  69223. legendListElement += "</ul>";
  69224. return legendListElement;
  69225. }
  69226. }, {
  69227. key: "_getWrapperText",
  69228. value: function _getWrapperText(number) {
  69229. var value = number * (this.legendRatio == null ? 1 : parseFloat(this.legendRatio)); //单个颜色值宽度为60px,最大只能完全显示1000000,否则就超出宽度,则显示以为k计数单位的值
  69230. var num = parseFloat(value);
  69231. if (num % 1000000 <= 1000000) {
  69232. return num.toString();
  69233. }
  69234. return parseInt(num / 1000) + 'k';
  69235. }
  69236. }]);
  69237. return RangeTheme3DLayer;
  69238. }(Theme3DLayer);
  69239. external_mapboxgl_default.a.supermap.RangeTheme3DLayer = RangeTheme3DLayer;
  69240. // CONCATENATED MODULE: ./src/mapboxgl/overlay/RangeThemeLayer.js
  69241. 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); }
  69242. function RangeThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69243. 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); } }
  69244. function RangeThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) RangeThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) RangeThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  69245. 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); }
  69246. function RangeThemeLayer_setPrototypeOf(o, p) { RangeThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RangeThemeLayer_setPrototypeOf(o, p); }
  69247. 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); }; }
  69248. function RangeThemeLayer_possibleConstructorReturn(self, call) { if (call && (RangeThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return RangeThemeLayer_assertThisInitialized(self); }
  69249. function RangeThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  69250. 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; } }
  69251. function RangeThemeLayer_getPrototypeOf(o) { RangeThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RangeThemeLayer_getPrototypeOf(o); }
  69252. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  69253. * This program are made available under the terms of the Apache License, Version 2.0
  69254. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69255. /**
  69256. * @class mapboxgl.supermap.RangeThemeLayer
  69257. * @category Visualization Theme
  69258. * @classdesc 分段专题图层。
  69259. * @param {string} name - 图层名。
  69260. * @param {Object} options - 参数。
  69261. * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  69262. * @param {boolean} [options.loadWhileAnimating=true] - 是否实时重绘。
  69263. * @param {mapboxgl.Map} options.map - 当前 Mapbox GL map 对象。
  69264. * @param {number} [options.opacity=1] - 图层透明度。
  69265. * @param {string} options.themeField - 指定创建专题图字段。
  69266. * @param {Object} options.style - 专题图样式。
  69267. * @param {Object} options.styleGroups - 各专题类型样式组。
  69268. * @param {boolean} [options.isHoverAble=false] - 是否开启 hover 事件。
  69269. * @param {Object} [options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  69270. * @extends {mapboxgl.supermap.GeoFeatureThemeLayer}
  69271. */
  69272. var RangeThemeLayer_Range = /*#__PURE__*/function (_GeoFeature) {
  69273. RangeThemeLayer_inherits(Range, _GeoFeature);
  69274. var _super = RangeThemeLayer_createSuper(Range);
  69275. function Range(name, opt_options) {
  69276. var _this;
  69277. RangeThemeLayer_classCallCheck(this, Range);
  69278. _this = _super.call(this, name, opt_options);
  69279. _this.style = opt_options.style;
  69280. _this.isHoverAble = opt_options.isHoverAble;
  69281. _this.highlightStyle = opt_options.highlightStyle;
  69282. _this.themeField = opt_options.themeField;
  69283. _this.styleGroups = opt_options.styleGroups;
  69284. return _this;
  69285. }
  69286. /**
  69287. * @function mapboxgl.supermap.RangeThemeLayer.prototype.createThematicFeature
  69288. * @description 创建专题图要素。
  69289. * @param {Object} feature - 要创建的专题图形要素。
  69290. */
  69291. RangeThemeLayer_createClass(Range, [{
  69292. key: "createThematicFeature",
  69293. value: function createThematicFeature(feature) {
  69294. //赋 style
  69295. var style = this.getStyleByData(feature); //创建专题要素时的可选参数
  69296. var options = {};
  69297. options.nodesClipPixel = this.nodesClipPixel;
  69298. options.isHoverAble = this.isHoverAble;
  69299. options.isMultiHover = this.isMultiHover;
  69300. options.isClickAble = this.isClickAble;
  69301. options.highlightStyle = ShapeFactory_ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(Vector)
  69302. var thematicFeature = new ThemeVector_ThemeVector(feature, this, ShapeFactory_ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  69303. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  69304. this.renderer.addShape(thematicFeature.shapes[m]);
  69305. }
  69306. return thematicFeature;
  69307. }
  69308. /**
  69309. * @private
  69310. * @function mapboxgl.supermap.RangeThemeLayer.prototype.getStyleByData
  69311. * @description 通过数据获取 style。
  69312. * @param {Object} fea - 要素数据。
  69313. */
  69314. }, {
  69315. key: "getStyleByData",
  69316. value: function getStyleByData(fea) {
  69317. var style = {};
  69318. var feature = fea;
  69319. style = Util_Util.copyAttributesWithClip(style, this.style);
  69320. if (this.themeField && this.styleGroups && this.styleGroups.length > 0 && feature.attributes) {
  69321. var Sf = this.themeField;
  69322. var Attrs = feature.attributes;
  69323. var Gro = this.styleGroups;
  69324. var isSfInAttrs = false; //指定的 themeField 是否是 feature 的属性字段之一
  69325. var attr = null; //属性值
  69326. for (var property in Attrs) {
  69327. if (Sf === property) {
  69328. isSfInAttrs = true;
  69329. attr = Attrs[property];
  69330. break;
  69331. }
  69332. } //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
  69333. if (isSfInAttrs) {
  69334. for (var i = 0, len = Gro.length; i < len; i++) {
  69335. if (attr >= Gro[i].start && attr < Gro[i].end) {
  69336. //feature.style = CommonUtil.copyAttributes(feature.style, this.defaultStyle);
  69337. var sty1 = Gro[i].style;
  69338. style = Util_Util.copyAttributesWithClip(style, sty1);
  69339. }
  69340. }
  69341. }
  69342. }
  69343. if (feature.style && this.isAllowFeatureStyle === true) {
  69344. style = Util_Util.copyAttributesWithClip(feature.style);
  69345. }
  69346. return style;
  69347. }
  69348. }]);
  69349. return Range;
  69350. }(GeoFeatureThemeLayer_GeoFeature);
  69351. external_mapboxgl_default.a.supermap.RangeThemeLayer = RangeThemeLayer_Range;
  69352. // CONCATENATED MODULE: ./src/mapboxgl/overlay/RankSymbolThemeLayer.js
  69353. 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); }
  69354. function RankSymbolThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69355. 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); } }
  69356. function RankSymbolThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) RankSymbolThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) RankSymbolThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  69357. 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); }
  69358. function RankSymbolThemeLayer_setPrototypeOf(o, p) { RankSymbolThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RankSymbolThemeLayer_setPrototypeOf(o, p); }
  69359. 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); }; }
  69360. function RankSymbolThemeLayer_possibleConstructorReturn(self, call) { if (call && (RankSymbolThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return RankSymbolThemeLayer_assertThisInitialized(self); }
  69361. function RankSymbolThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  69362. 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; } }
  69363. function RankSymbolThemeLayer_getPrototypeOf(o) { RankSymbolThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RankSymbolThemeLayer_getPrototypeOf(o); }
  69364. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  69365. * This program are made available under the terms of the Apache License, Version 2.0
  69366. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69367. /**
  69368. * @class mapboxgl.supermap.RankSymbolThemeLayer
  69369. * @category Visualization Theme
  69370. * @classdesc 等级符号专题图层。
  69371. * @param {string} name - 图层名。
  69372. * @param {string} symbolType - 符号类型。
  69373. * @param {Object} opt_options - 参数。
  69374. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  69375. * @param {boolean} [opt_options.loadWhileAnimating=true] - 是否实时重绘。
  69376. * @param {mapboxgl.Map} opt_options.map - 当前 mapboxgl map 对象。
  69377. * @param {number} [opt_options.opacity=1] - 图层透明度。
  69378. * @param {string} opt_options.themeFields - 指定创建专题图字段。
  69379. * @param {boolean} [opt_options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  69380. * @param {string} [opt_options.chartsType] - 图表类型。目前可用:"Bar", "Line", "Pie"。
  69381. * @param {Object} [opt_options.symbolSetting] - 各类型图表的 symbolSetting 对象可设属性请参考具体图表模型类的注释中对 symbolSetting 对象可设属性的描述。symbolSetting 对象通常都具有以下 5 个基础可设属性:
  69382. * @param {number} [opt_options.symbolSetting.width] - 专题要素(图表)宽度。
  69383. * @param {number} [opt_options.symbolSetting.height] - 专题要素(图表)高度。
  69384. * @param {Array.<number>} opt_options.symbolSetting.codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  69385. * @param {number} [opt_options.symbolSetting.XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  69386. * @param {number} [opt_options.symbolSetting.YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  69387. * @param {Array.<number>} opt_options.symbolSetting.dataViewBoxParameter - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值,长度为 4 的一维数组。
  69388. * @param {number} opt_options.symbolSetting.decimalNumber - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  69389. * @extends {mapboxgl.supermap.GraphThemeLayer}
  69390. */
  69391. var RankSymbolThemeLayer_RankSymbol = /*#__PURE__*/function (_Graph) {
  69392. RankSymbolThemeLayer_inherits(RankSymbol, _Graph);
  69393. var _super = RankSymbolThemeLayer_createSuper(RankSymbol);
  69394. function RankSymbol(name, symbolType, opt_options) {
  69395. var _this;
  69396. RankSymbolThemeLayer_classCallCheck(this, RankSymbol);
  69397. _this = _super.call(this, name, symbolType, opt_options);
  69398. _this.symbolType = symbolType;
  69399. _this.symbolSetting = opt_options.symbolSetting;
  69400. _this.themeField = opt_options.themeField;
  69401. return _this;
  69402. }
  69403. /**
  69404. * @function mapboxgl.supermap.RankSymbolThemeLayer.prototype.setSymbolType
  69405. * @description 设置标志符号。
  69406. * @param {string} [symbolType] - 符号类型。
  69407. */
  69408. RankSymbolThemeLayer_createClass(RankSymbol, [{
  69409. key: "setSymbolType",
  69410. value: function setSymbolType(symbolType) {
  69411. this.symbolType = symbolType;
  69412. this.redraw();
  69413. }
  69414. /**
  69415. * @function mapboxgl.supermap.RankSymbolThemeLayer.prototype.createThematicFeature
  69416. * @description 创建专题图形要素。
  69417. * @param {Object} feature - 要创建的专题图形要素。
  69418. */
  69419. }, {
  69420. key: "createThematicFeature",
  69421. value: function createThematicFeature(feature) {
  69422. var thematicFeature; // 检查图形创建条件并创建图形
  69423. if (feature_Theme_Theme[this.symbolType] && this.themeField && this.symbolSetting) {
  69424. thematicFeature = new feature_Theme_Theme[this.symbolType](feature, this, [this.themeField], this.symbolSetting);
  69425. } // thematicFeature 是否创建成功
  69426. if (!thematicFeature) {
  69427. return false;
  69428. } // 对专题要素执行图形装载
  69429. thematicFeature.assembleShapes();
  69430. return thematicFeature;
  69431. }
  69432. }]);
  69433. return RankSymbol;
  69434. }(GraphThemeLayer_Graph);
  69435. external_mapboxgl_default.a.supermap.RankSymbolThemeLayer = RankSymbolThemeLayer_RankSymbol;
  69436. // CONCATENATED MODULE: ./src/mapboxgl/overlay/UniqueTheme3DLayer.js
  69437. 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); }
  69438. function UniqueTheme3DLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69439. 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); } }
  69440. function UniqueTheme3DLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UniqueTheme3DLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UniqueTheme3DLayer_defineProperties(Constructor, staticProps); return Constructor; }
  69441. 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); }
  69442. function UniqueTheme3DLayer_setPrototypeOf(o, p) { UniqueTheme3DLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UniqueTheme3DLayer_setPrototypeOf(o, p); }
  69443. 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); }; }
  69444. function UniqueTheme3DLayer_possibleConstructorReturn(self, call) { if (call && (UniqueTheme3DLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UniqueTheme3DLayer_assertThisInitialized(self); }
  69445. function UniqueTheme3DLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  69446. 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; } }
  69447. function UniqueTheme3DLayer_getPrototypeOf(o) { UniqueTheme3DLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UniqueTheme3DLayer_getPrototypeOf(o); }
  69448. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  69449. * This program are made available under the terms of the Apache License, Version 2.0
  69450. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69451. /**
  69452. * @class mapboxgl.supermap.UniqueTheme3DLayer
  69453. * @category Visualization Theme
  69454. * @classdesc 三维单值专题图。
  69455. * @param {string} [id] - 专题图图层 id。默认使用 CommonUtil.createUniqueID("theme3DLayer") 创建专题图层 ID。
  69456. * @param {Object} layerOptions - 专题图图层配置项,参数继承自 Theme3DLayer。
  69457. * @param {number} [layerOptions.height] - 新增参数,如果数据指定的 heightField (默认为 height )没有可以表示高度的字段,可以为所有数据统一设置一个高度。
  69458. * @param {Array} layerOptions.colorStops - 新增参数,数据颜色分段数组。
  69459. */
  69460. var UniqueTheme3DLayer = /*#__PURE__*/function (_Theme3DLayer) {
  69461. UniqueTheme3DLayer_inherits(UniqueTheme3DLayer, _Theme3DLayer);
  69462. var _super = UniqueTheme3DLayer_createSuper(UniqueTheme3DLayer);
  69463. function UniqueTheme3DLayer(id, layerOptions) {
  69464. var _this;
  69465. UniqueTheme3DLayer_classCallCheck(this, UniqueTheme3DLayer);
  69466. _this = _super.call(this, id, layerOptions);
  69467. /**
  69468. * @member mapboxgl.supermap.UniqueTheme3DLayer.prototype.colorStops -{Array}
  69469. * @description 数据颜色数组,如[["绿地","#CD7054"],["道路","#AD1283"]]。
  69470. */
  69471. _this.colorStops = null;
  69472. _this._extend(UniqueTheme3DLayer_assertThisInitialized(_this), layerOptions);
  69473. return _this;
  69474. }
  69475. /**
  69476. * @function mapboxgl.supermap.UniqueTheme3DLayer.prototype.getLayerStyleOptions
  69477. * @description 获取图层样式。
  69478. * @returns {Object} Mapbox GL 样式对象。
  69479. */
  69480. UniqueTheme3DLayer_createClass(UniqueTheme3DLayer, [{
  69481. key: "getLayerStyleOptions",
  69482. value: function getLayerStyleOptions() {
  69483. var opacity = this.opacity == null ? 1 : this.opacity;
  69484. opacity = isNaN(parseFloat(opacity)) ? 1 : parseFloat(opacity);
  69485. var options = {
  69486. 'fill-extrusion-color': {
  69487. 'stops': this.colorStops,
  69488. 'property': this.themeField,
  69489. 'type': 'categorical'
  69490. },
  69491. 'fill-extrusion-opacity': opacity
  69492. };
  69493. if (this.height != null) {
  69494. options['fill-extrusion-height'] = this.height;
  69495. } else {
  69496. options['fill-extrusion-height'] = {
  69497. 'property': this.heightField || 'height',
  69498. 'type': 'categorical'
  69499. };
  69500. }
  69501. if (this.baseHeightField) {
  69502. options['fill-extrusion-base'] = {
  69503. 'property': this.baseHeightField,
  69504. 'type': 'identity'
  69505. };
  69506. }
  69507. return options;
  69508. }
  69509. /**
  69510. * @function mapboxgl.supermap.UniqueTheme3DLayer.prototype.getHighlightStyleOptions
  69511. * @description 获取高亮样式。
  69512. * @returns {Object} Mapbox GL 样式对象。
  69513. */
  69514. }, {
  69515. key: "getHighlightStyleOptions",
  69516. value: function getHighlightStyleOptions() {
  69517. var color = this.highlight && this.highlight.color != null ? this.highlight.color : '#ADA91E';
  69518. var paint = {
  69519. 'fill-extrusion-color': color,
  69520. 'fill-extrusion-height': {
  69521. "stops": this.heightStops,
  69522. "property": this.heightField,
  69523. 'type': 'categorical'
  69524. },
  69525. 'fill-extrusion-opacity': this.highlight && this.highlight.opacity || 0.6
  69526. };
  69527. if (this.height != null) {
  69528. paint['fill-extrusion-height'] = this.height || 0;
  69529. }
  69530. return paint;
  69531. }
  69532. }, {
  69533. key: "_createLegendElement",
  69534. value: function _createLegendElement() {
  69535. var legendListElement = "<ul>";
  69536. var len = this.colorStops && this.colorStops.length || 0;
  69537. for (var i = 0; i < len; i++) {
  69538. var text = this.colorStops[i][0];
  69539. var color = this.colorStops[i][1];
  69540. legendListElement += "<li><span style='background-color:" + color + ";'></span><span>" + text + "</span></li>";
  69541. }
  69542. legendListElement += "</ul>";
  69543. return legendListElement;
  69544. }
  69545. }]);
  69546. return UniqueTheme3DLayer;
  69547. }(Theme3DLayer);
  69548. external_mapboxgl_default.a.supermap.UniqueTheme3DLayer = UniqueTheme3DLayer;
  69549. // CONCATENATED MODULE: ./src/mapboxgl/overlay/UniqueThemeLayer.js
  69550. 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); }
  69551. function UniqueThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69552. 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); } }
  69553. function UniqueThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UniqueThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UniqueThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  69554. 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); }
  69555. function UniqueThemeLayer_setPrototypeOf(o, p) { UniqueThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UniqueThemeLayer_setPrototypeOf(o, p); }
  69556. 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); }; }
  69557. function UniqueThemeLayer_possibleConstructorReturn(self, call) { if (call && (UniqueThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UniqueThemeLayer_assertThisInitialized(self); }
  69558. function UniqueThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  69559. 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; } }
  69560. function UniqueThemeLayer_getPrototypeOf(o) { UniqueThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UniqueThemeLayer_getPrototypeOf(o); }
  69561. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  69562. * This program are made available under the terms of the Apache License, Version 2.0
  69563. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69564. /**
  69565. * @class mapboxgl.supermap.UniqueThemeLayer
  69566. * @category Visualization Theme
  69567. * @classdesc 单值专题图层。
  69568. * @param {string} name - 图层名。
  69569. * @param {Object} opt_options - 参数。
  69570. * @param {string} opt_options.themeField - 指定创建专题图字段。
  69571. * @param {Object} opt_options.style - 专题图样式。
  69572. * @param {Object} opt_options.styleGroups - 各专题类型样式组。
  69573. * @param {mapboxgl.Map} opt_options.map - 当前 mapboxgl map 对象。
  69574. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  69575. * @param {boolean} [opt_options.loadWhileAnimating=true] - 是否实时重绘。
  69576. * @param {number} [opt_options.opacity=1] - 图层透明度。
  69577. * @param {boolean} [opt_options.isHoverAble=false] - 是否开启 hover 事件。
  69578. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  69579. * @extends {mapboxgl.supermap.GeoFeatureThemeLayer}
  69580. */
  69581. var UniqueThemeLayer_Unique = /*#__PURE__*/function (_GeoFeature) {
  69582. UniqueThemeLayer_inherits(Unique, _GeoFeature);
  69583. var _super = UniqueThemeLayer_createSuper(Unique);
  69584. function Unique(name, opt_options) {
  69585. var _this;
  69586. UniqueThemeLayer_classCallCheck(this, Unique);
  69587. _this = _super.call(this, name, opt_options);
  69588. _this.themeField = opt_options.themeField;
  69589. _this.style = opt_options.style;
  69590. _this.styleGroups = opt_options.styleGroups;
  69591. _this.isHoverAble = opt_options.isHoverAble;
  69592. _this.highlightStyle = opt_options.highlightStyle;
  69593. return _this;
  69594. }
  69595. /**
  69596. * @private
  69597. * @function mapboxgl.supermap.UniqueThemeLayer.prototype.createThematicFeature
  69598. * @description 创建专题图要素。
  69599. * @param {Object} feature - 要创建的专题图形要素。
  69600. */
  69601. UniqueThemeLayer_createClass(Unique, [{
  69602. key: "createThematicFeature",
  69603. value: function createThematicFeature(feature) {
  69604. //赋 style
  69605. var style = this.getStyleByData(feature); //创建专题要素时的可选参数
  69606. var options = {};
  69607. options.nodesClipPixel = this.nodesClipPixel;
  69608. options.isHoverAble = this.isHoverAble;
  69609. options.isMultiHover = this.isMultiHover;
  69610. options.isClickAble = this.isClickAble;
  69611. options.highlightStyle = ShapeFactory_ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(Vector)
  69612. var thematicFeature = new ThemeVector_ThemeVector(feature, this, ShapeFactory_ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  69613. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  69614. this.renderer.addShape(thematicFeature.shapes[m]);
  69615. }
  69616. return thematicFeature;
  69617. }
  69618. /**
  69619. * @private
  69620. * @function mapboxgl.supermap.UniqueThemeLayer.prototype.getStyleByData
  69621. * @description 通过数据获取 style。
  69622. * @param {Object} fea - 要素数据。
  69623. */
  69624. }, {
  69625. key: "getStyleByData",
  69626. value: function getStyleByData(fea) {
  69627. var style = {};
  69628. var feature = fea;
  69629. style = Util_Util.copyAttributesWithClip(style, this.style);
  69630. if (this.themeField && this.styleGroups && this.styleGroups.length > 0 && feature.attributes) {
  69631. var tf = this.themeField;
  69632. var Attrs = feature.attributes;
  69633. var Gro = this.styleGroups;
  69634. var isSfInAttrs = false; //指定的 themeField 是否是 feature 的属性字段之一
  69635. var attr = null; //属性值
  69636. for (var property in Attrs) {
  69637. if (tf === property) {
  69638. isSfInAttrs = true;
  69639. attr = Attrs[property];
  69640. break;
  69641. }
  69642. } //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
  69643. if (isSfInAttrs) {
  69644. for (var i = 0, len = Gro.length; i < len; i++) {
  69645. if (attr.toString() === Gro[i].value.toString()) {
  69646. //feature.style = CommonUtil.copyAttributes(feature.style, this.defaultStyle);
  69647. var sty1 = Gro[i].style;
  69648. style = Util_Util.copyAttributesWithClip(style, sty1);
  69649. }
  69650. }
  69651. }
  69652. }
  69653. if (feature.style && this.isAllowFeatureStyle === true) {
  69654. style = Util_Util.copyAttributesWithClip(feature.style);
  69655. }
  69656. return style;
  69657. }
  69658. }]);
  69659. return Unique;
  69660. }(GeoFeatureThemeLayer_GeoFeature);
  69661. external_mapboxgl_default.a.supermap.UniqueThemeLayer = UniqueThemeLayer_Unique;
  69662. // CONCATENATED MODULE: ./src/mapboxgl/overlay/graphic/Graphic.js
  69663. function Graphic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69664. 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); } }
  69665. function Graphic_createClass(Constructor, protoProps, staticProps) { if (protoProps) Graphic_defineProperties(Constructor.prototype, protoProps); if (staticProps) Graphic_defineProperties(Constructor, staticProps); return Constructor; }
  69666. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  69667. * This program are made available under the terms of the Apache License, Version 2.0
  69668. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69669. /**
  69670. * @class mapboxgl.supermap.Graphic
  69671. * @classdesc 高效率点图层点要素类。
  69672. * @category Visualization Graphic
  69673. * @param {(Object|Array.<number>)} lngLat - 坐标。格式:经纬度数组或包含{lng,lat}格式对象。
  69674. * @param {Object} style - 图形参数。
  69675. * @param {Array.<number>} [style.color] - 点颜色。目前只支持 rgba 数组。
  69676. * @param {Object} [style.radius] - 点半径。
  69677. * @param {Object} [attributes] - 属性信息。
  69678. * @example
  69679. * var graphic = new mapboxgl.supermap.Graphic(
  69680. * {
  69681. * lng:116,
  69682. * lat:39
  69683. * },{
  69684. * color:[255,0,0],
  69685. * radius:30
  69686. * }
  69687. * });
  69688. */
  69689. var Graphic_Graphic = /*#__PURE__*/function () {
  69690. function Graphic(lngLat, style, attributes) {
  69691. Graphic_classCallCheck(this, Graphic);
  69692. this.lngLat = core_Util_Util.isArray(lngLat) ? {
  69693. lng: lngLat[0],
  69694. lat: lngLat[1]
  69695. } : lngLat;
  69696. this.style = core_Util_Util.extend({}, style);
  69697. this.attributes = attributes;
  69698. }
  69699. /**
  69700. * @function mapboxgl.supermap.Graphic.prototype.getId
  69701. * @description 获取当前 ID。
  69702. * @returns {string} id
  69703. */
  69704. Graphic_createClass(Graphic, [{
  69705. key: "getId",
  69706. value: function getId() {
  69707. return this.id;
  69708. }
  69709. /**
  69710. * @function mapboxgl.supermap.Graphic.prototype.setId
  69711. * @description 设置当前要素 ID。
  69712. * @param {string} id - 要素 ID。
  69713. */
  69714. }, {
  69715. key: "setId",
  69716. value: function setId(id) {
  69717. this.id = id;
  69718. }
  69719. /**
  69720. * @function mapboxgl.supermap.Graphic.prototype.getLngLat
  69721. * @description 获取经纬度坐标。
  69722. * @returns {Object} 经纬度坐标,数据格式{lng,lat}。
  69723. */
  69724. }, {
  69725. key: "getLngLat",
  69726. value: function getLngLat() {
  69727. return this.lngLat;
  69728. }
  69729. /**
  69730. * @function mapboxgl.supermap.Graphic.prototype.setLngLat
  69731. * @description 设置经纬度坐标。
  69732. * @param {Object} lngLat - 经纬度坐标,数据格式{lng,lat}。
  69733. */
  69734. }, {
  69735. key: "setLngLat",
  69736. value: function setLngLat(lngLat) {
  69737. this.lngLat = core_Util_Util.isArray(lngLat) ? {
  69738. lng: lngLat[0],
  69739. lat: lngLat[1]
  69740. } : lngLat;
  69741. }
  69742. /**
  69743. * @function mapboxgl.supermap.Graphic.prototype.setStyle
  69744. * @description 设置点样式。
  69745. * @param {Object} style -样式选项。
  69746. * @param {Array} [style.color] - 颜色。
  69747. * @param {number} [style.radius] - 半径。
  69748. */
  69749. }, {
  69750. key: "setStyle",
  69751. value: function setStyle(style) {
  69752. this.style = core_Util_Util.extend(this.style, style);
  69753. }
  69754. /**
  69755. * @function mapboxgl.supermap.Graphic.prototype.getStyle
  69756. * @description 获取样式。
  69757. * @returns {Object} 点样式。
  69758. */
  69759. }, {
  69760. key: "getStyle",
  69761. value: function getStyle() {
  69762. return this.style;
  69763. }
  69764. /**
  69765. * @function mapboxgl.supermap.Graphic.prototype.setAttributes
  69766. * @description 设置属性信息。
  69767. * @param {Object} [attributes] - 属性信息。
  69768. */
  69769. }, {
  69770. key: "setAttributes",
  69771. value: function setAttributes(attributes) {
  69772. this.attributes = core_Util_Util.extend({}, this.attributes, attributes);
  69773. }
  69774. /**
  69775. * @function mapboxgl.supermap.Graphic.prototype.getAttributes
  69776. * @description 获取属性信息。
  69777. * @returns {Object} 属性信息。
  69778. */
  69779. }, {
  69780. key: "getAttributes",
  69781. value: function getAttributes() {
  69782. return this.attributes;
  69783. }
  69784. }]);
  69785. return Graphic;
  69786. }();
  69787. external_mapboxgl_default.a.supermap.Graphic = Graphic_Graphic;
  69788. // CONCATENATED MODULE: ./src/mapboxgl/overlay/graphic/index.js
  69789. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  69790. * This program are made available under the terms of the Apache License, Version 2.0
  69791. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69792. // CONCATENATED MODULE: ./src/mapboxgl/overlay/GraphicLayer.js
  69793. function GraphicLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69794. 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); } }
  69795. function GraphicLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) GraphicLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) GraphicLayer_defineProperties(Constructor, staticProps); return Constructor; }
  69796. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  69797. * This program are made available under the terms of the Apache License, Version 2.0
  69798. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69799. var defaultProps = {
  69800. color: [0, 0, 0, 255],
  69801. opacity: 0.8,
  69802. radius: 10,
  69803. radiusScale: 1,
  69804. radiusMinPixels: 0,
  69805. radiusMaxPixels: Number.MAX_SAFE_INTEGER,
  69806. strokeWidth: 1,
  69807. outline: false
  69808. };
  69809. /**
  69810. * @class mapboxgl.supermap.GraphicLayer
  69811. * @category Visualization Graphic
  69812. * @classdesc 高效率点图层。
  69813. * @param {string} [id] - 图层id。默认使用 CommonUtil.createUniqueID("graphicLayer_") 创建专题图层 ID。
  69814. * @param {Object} options - 图层配置项。
  69815. * @param {Array.<mapboxgl.supermap.Graphic>} options.graphics - 点要素对象数组 。
  69816. * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 颜色,目前只支持 rgba 数组。
  69817. * @param {number} [options.radius=10] - 半径。
  69818. * @param {number} [options.opacity=0.8] - 不透明度。
  69819. * @param {Array.<number>} [options.highlightColor=[0, 0, 128, 128]] - 高亮颜色,目前只支持 rgba 数组。
  69820. * @param {number} [options.radiusScale=1] - 点放大倍数。
  69821. * @param {number} [options.radiusMinPixels=0] - 半径最小值(像素)。
  69822. * @param {number} [options.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  69823. * @param {number} [options.strokeWidth=1] - 边框大小。
  69824. * @param {boolean} [options.outline=false] - 是否显示边框。
  69825. */
  69826. var GraphicLayer_GraphicLayer = /*#__PURE__*/function () {
  69827. function GraphicLayer(id, options) {
  69828. GraphicLayer_classCallCheck(this, GraphicLayer);
  69829. var opt = core_Util_Util.extend(this, defaultProps, options);
  69830. /**
  69831. * @member {string} mapboxgl.supermap.GraphicLayer.prototype.id
  69832. * @description 高效率点图层 id。
  69833. */
  69834. this.id = id || Util_Util.createUniqueID("graphicLayer_");
  69835. /**
  69836. * @member {Array.<mapboxgl.supermap.Graphic>} mapboxgl.supermap.GraphicLayer.prototype.graphics
  69837. * @description 点要素对象数组。
  69838. */
  69839. this.graphics = [].concat(opt.graphics);
  69840. /**
  69841. * @member {boolean} [mapboxgl.supermap.GraphicLayer.prototype.visibility=true]
  69842. * @description 图层显示状态属性。
  69843. */
  69844. this.visibility = true;
  69845. }
  69846. /**
  69847. * @function mapboxgl.supermap.GraphicLayer.prototype.addTo
  69848. * @description 图层添加到地图,将在下个版本废弃,请使用 onAdd() 代替。
  69849. * @param {mapboxgl.Map} map - Mapbox GL 地图对象。
  69850. * @returns this
  69851. */
  69852. GraphicLayer_createClass(GraphicLayer, [{
  69853. key: "addTo",
  69854. value: function addTo(map) {
  69855. this.onAdd(map);
  69856. }
  69857. /**
  69858. * @function mapboxgl.supermap.GraphicLayer.prototype.onAdd
  69859. * @description 图层添加到地图。
  69860. * @param {mapboxgl.Map} map - Mapbox GL 地图对象。
  69861. * @returns {mapboxgl.supermap.GraphicLayer}
  69862. */
  69863. }, {
  69864. key: "onAdd",
  69865. value: function onAdd(map) {
  69866. this.map = map;
  69867. if (this.canvas) {
  69868. this.mapContainer = this.map.getCanvasContainer();
  69869. this.mapContainer.appendChild(this.canvas);
  69870. return this;
  69871. }
  69872. this._initContainer(); //当使用扩展的mapboxgl代码时有效
  69873. if (map.getCRS && map.getCRS() !== external_mapboxgl_default.a.CRS.EPSG3857) {
  69874. this.coordinateSystem = 3;
  69875. this.isGeographicCoordinateSystem = true;
  69876. }
  69877. var mapState = this.getState();
  69878. var data = mapState.data,
  69879. color = mapState.color,
  69880. radius = mapState.radius,
  69881. opacity = mapState.opacity,
  69882. highlightColor = mapState.highlightColor,
  69883. radiusScale = mapState.radiusScale,
  69884. radiusMinPixels = mapState.radiusMinPixels,
  69885. radiusMaxPixels = mapState.radiusMaxPixels,
  69886. strokeWidth = mapState.strokeWidth,
  69887. outline = mapState.outline;
  69888. var me = this;
  69889. var layerOptions = {
  69890. id: 'scatter-plot',
  69891. data: data,
  69892. pickable: Boolean(this.onClick) || Boolean(this.onHover),
  69893. autoHighlight: true,
  69894. color: color,
  69895. opacity: opacity,
  69896. radius: radius,
  69897. radiusScale: radiusScale,
  69898. highlightColor: highlightColor,
  69899. radiusMinPixels: radiusMinPixels,
  69900. radiusMaxPixels: radiusMaxPixels,
  69901. strokeWidth: strokeWidth,
  69902. outline: outline,
  69903. isGeographicCoordinateSystem: this.isGeographicCoordinateSystem,
  69904. coordinateSystem: this.coordinateSystem,
  69905. getPosition: function getPosition(point) {
  69906. if (!point) {
  69907. return [0, 0, 0];
  69908. }
  69909. var lngLat = point.getLngLat();
  69910. return lngLat && [lngLat.lng, lngLat.lat, 0];
  69911. },
  69912. getColor: function getColor(point) {
  69913. var style = point && point.getStyle();
  69914. return style && style.color || me.color;
  69915. },
  69916. getRadius: function getRadius(point) {
  69917. var style = point && point.getStyle();
  69918. return style && style.radius || me.radius;
  69919. },
  69920. updateTriggers: {
  69921. getColor: [color],
  69922. getRadius: [radius]
  69923. }
  69924. };
  69925. if (this.onClick) {
  69926. layerOptions.onClick = this.onClick;
  69927. }
  69928. if (this.onHover) {
  69929. layerOptions.onHover = this.onHover;
  69930. }
  69931. this.layer = new window.DeckGL.ScatterplotLayer(layerOptions);
  69932. var deckOptions = {};
  69933. for (var key in mapState) {
  69934. deckOptions[key] = mapState[key];
  69935. }
  69936. deckOptions.layers = [this.layer];
  69937. deckOptions.canvas = this.canvas;
  69938. this.deckGL = new window.DeckGL.experimental.DeckGLJS(deckOptions);
  69939. this.map.on('render', this._moveEvent.bind(this));
  69940. this.map.on('resize', this._resizeEvent.bind(this));
  69941. this.draw();
  69942. return this;
  69943. }
  69944. /**
  69945. * @function mapboxgl.supermap.GraphicLayer.prototype.setStyle
  69946. * @description 设置图层整体样式。
  69947. * @param {Object} styleOptions - 样式对象。
  69948. * @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
  69949. * @param {number} [styleOptions.radius=10] - 点半径。
  69950. * @param {number} [styleOptions.opacity=0.8] - 不透明度。
  69951. * @param {Array} [styleOptions.highlightColor=[0, 0, 128, 128]] - 高亮颜色,目前只支持 rgba 数组。
  69952. * @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
  69953. * @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值(像素)。
  69954. * @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  69955. * @param {number} [styleOptions.strokeWidth=1] - 边框大小。
  69956. * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
  69957. */
  69958. }, {
  69959. key: "setStyle",
  69960. value: function setStyle(styleOptions) {
  69961. var styleOpt = {
  69962. color: this.color,
  69963. radius: this.radius,
  69964. opacity: this.opacity,
  69965. highlightColor: this.highlightColor,
  69966. radiusScale: this.radiusScale,
  69967. radiusMinPixels: this.radiusMinPixels,
  69968. radiusMaxPixels: this.radiusMaxPixels,
  69969. strokeWidth: this.strokeWidth,
  69970. outline: this.outline
  69971. };
  69972. core_Util_Util.extend(this, styleOpt, styleOptions);
  69973. this.update();
  69974. }
  69975. /**
  69976. * @function mapboxgl.supermap.GraphicLayer.prototype.setGraphics
  69977. * @description 设置绘制的点要素数据,会覆盖之前的所有要素。
  69978. * @param {Array.<mapboxgl.supermap.Graphic>} graphics - 点要素对象数组。
  69979. */
  69980. }, {
  69981. key: "setGraphics",
  69982. value: function setGraphics(graphics) {
  69983. this.graphics = this.graphics || [];
  69984. this.graphics.length = 0;
  69985. var sGraphics = !core_Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics); //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  69986. if (!this.layer.props.data) {
  69987. this.layer.props.data = [];
  69988. }
  69989. this.layer.props.data.length = 0;
  69990. for (var i = 0; i < sGraphics.length; i++) {
  69991. this.layer.props.data.push(sGraphics[i]);
  69992. }
  69993. this.update();
  69994. }
  69995. /**
  69996. * @function mapboxgl.supermap.GraphicLayer.prototype.addGraphics
  69997. * @description 添加点要素,不会覆盖之前的要素。
  69998. * @param {Array.<mapboxgl.supermap.Graphic>} graphics - 点要素对象数组。
  69999. */
  70000. }, {
  70001. key: "addGraphics",
  70002. value: function addGraphics(graphics) {
  70003. this.graphics = this.graphics || [];
  70004. var sGraphics = !core_Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics); //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  70005. if (!this.layer.props.data) {
  70006. this.layer.props.data = [];
  70007. }
  70008. for (var i = 0; i < sGraphics.length; i++) {
  70009. this.layer.props.data.push(sGraphics[i]);
  70010. }
  70011. this.update();
  70012. }
  70013. /**
  70014. * @function mapboxgl.supermap.GraphicLayer.prototype.getGraphicBy
  70015. * @description 在 Vector 的要素数组 graphics 里面遍历每一个 graphic,当 graphic[property]===value 时,返回此 graphic(并且只返回第一个)。
  70016. * @param {string} property - graphic 的某个属性名称。
  70017. * @param {string} value - property 所对应的值。
  70018. * @returns {ol.Graphic} 一个匹配的 graphic。
  70019. */
  70020. }, {
  70021. key: "getGraphicBy",
  70022. value: function getGraphicBy(property, value) {
  70023. var graphic = null;
  70024. for (var index in this.graphics) {
  70025. if (this.graphics[index][property] === value) {
  70026. graphic = this.graphics[index];
  70027. break;
  70028. }
  70029. }
  70030. return graphic;
  70031. }
  70032. /**
  70033. * @function mapboxgl.supermap.GraphicLayer.prototype.getGraphicById
  70034. * @description 通过给定一个 id,返回对应的矢量要素。
  70035. * @param {string} graphicId - 矢量要素的属性 id
  70036. * @returns {ol.Graphic} 一个匹配的 graphic。
  70037. */
  70038. }, {
  70039. key: "getGraphicById",
  70040. value: function getGraphicById(graphicId) {
  70041. return this.getGraphicBy("id", graphicId);
  70042. }
  70043. /**
  70044. * @function mapboxgl.supermap.GraphicLayer.prototype.getGraphicsByAttribute
  70045. * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
  70046. * @param {string} attrName - graphic 的某个属性名称。
  70047. * @param {string} attrValue - property 所对应的值。
  70048. * @returns {Array.<ol.Graphic>} 一个匹配的 graphic 数组。
  70049. */
  70050. }, {
  70051. key: "getGraphicsByAttribute",
  70052. value: function getGraphicsByAttribute(attrName, attrValue) {
  70053. var graphic,
  70054. foundgraphics = [];
  70055. for (var index in this.graphics) {
  70056. graphic = this.graphics[index];
  70057. if (graphic && graphic.attributes) {
  70058. if (graphic.attributes[attrName] === attrValue) {
  70059. foundgraphics.push(graphic);
  70060. }
  70061. }
  70062. }
  70063. return foundgraphics;
  70064. }
  70065. /**
  70066. * @function mapboxgl.supermap.GraphicLayer.prototype.removeGraphics
  70067. * @description 删除要素数组,默认将删除所有要素
  70068. * @param {Array.<ol.Graphic>} [graphics=null] - 删除的 graphics 数组
  70069. */
  70070. }, {
  70071. key: "removeGraphics",
  70072. value: function removeGraphics() {
  70073. var graphics = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  70074. //当 graphics 为 null 、为空数组,或 === this.graphics,则清除所有要素
  70075. if (!graphics || graphics.length === 0 || graphics === this.graphics) {
  70076. this.graphics.length = 0;
  70077. if (this.layer.props.data) {
  70078. this.layer.props.data.length = 0;
  70079. }
  70080. this.update();
  70081. return;
  70082. }
  70083. if (!Util_Util.isArray(graphics)) {
  70084. graphics = [graphics];
  70085. }
  70086. for (var i = graphics.length - 1; i >= 0; i--) {
  70087. var graphic = graphics[i]; //如果我们传入的grapchic在graphics数组中没有的话,则不进行删除,
  70088. //并将其放入未删除的数组中。
  70089. var findex = Util_Util.indexOf(this.graphics, graphic);
  70090. if (findex === -1) {
  70091. continue;
  70092. }
  70093. this.graphics.splice(findex, 1);
  70094. } //删除完成后重新设置 setGraphics,以更新
  70095. this.update();
  70096. }
  70097. /**
  70098. * @function mapboxgl.supermap.GraphicLayer.prototype.update
  70099. * @description 更新图层。
  70100. */
  70101. }, {
  70102. key: "update",
  70103. value: function update() {
  70104. if (this.layer.lifecycle !== 'Awaiting state') {
  70105. this.layer.setChangeFlags({
  70106. dataChanged: true,
  70107. propsChanged: true,
  70108. viewportChanged: true,
  70109. updateTriggersChanged: true
  70110. });
  70111. var state = this.getState();
  70112. this.layer.setState(state);
  70113. }
  70114. }
  70115. /**
  70116. * @function mapboxgl.supermap.GraphicLayer.prototype.clear
  70117. * @description 释放图层资源。
  70118. */
  70119. }, {
  70120. key: "clear",
  70121. value: function clear() {
  70122. this.removeGraphics();
  70123. this.deckGL.finalize();
  70124. }
  70125. /**
  70126. * @function mapboxgl.supermap.GraphicLayer.prototype.remove
  70127. * @description 删除该图层。
  70128. */
  70129. }, {
  70130. key: "remove",
  70131. value: function remove() {
  70132. this.map.off('render', this._moveEvent.bind(this));
  70133. this.map.off('resize', this._resizeEvent.bind(this));
  70134. this.map.getCanvasContainer().removeChild(this.canvas);
  70135. }
  70136. /**
  70137. * @function mapboxgl.supermap.GraphicLayer.prototype.removeFromMap
  70138. * @deprecated
  70139. * @description 删除该图层。
  70140. */
  70141. }, {
  70142. key: "removeFromMap",
  70143. value: function removeFromMap() {
  70144. this.remove();
  70145. this.clear();
  70146. }
  70147. /**
  70148. * @function mapboxgl.supermap.GraphicLayer.prototype.moveTo
  70149. * @description 将图层移动到某个图层之前。
  70150. * @param {string} layerID - 待插入的图层 ID。
  70151. * @param {boolean} [before=true] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  70152. */
  70153. }, {
  70154. key: "moveTo",
  70155. value: function moveTo(layerID, before) {
  70156. var layer = document.getElementById(this.id);
  70157. before = before !== undefined ? before : true;
  70158. if (before) {
  70159. var beforeLayer = document.getElementById(layerID);
  70160. if (layer && beforeLayer) {
  70161. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  70162. }
  70163. return;
  70164. }
  70165. var nextLayer = document.getElementById(layerID);
  70166. if (layer) {
  70167. if (nextLayer.nextSibling) {
  70168. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  70169. return;
  70170. }
  70171. nextLayer.parentNode.appendChild(layer);
  70172. }
  70173. }
  70174. /**
  70175. * @function mapboxgl.supermap.GraphicLayer.prototype.setVisibility
  70176. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  70177. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  70178. */
  70179. }, {
  70180. key: "setVisibility",
  70181. value: function setVisibility(visibility) {
  70182. if (this.canvas && visibility !== this.visibility) {
  70183. this.visibility = visibility;
  70184. this.canvas.style.display = visibility ? "block" : "none";
  70185. }
  70186. }
  70187. /**
  70188. * @function mapboxgl.supermap.GraphicLayer.prototype.getState
  70189. * @description 获取当前地图及图层状态。
  70190. * @returns {Object} 地图及图层状态,包含地图状态信息和本图层相关状态。
  70191. */
  70192. }, {
  70193. key: "getState",
  70194. value: function getState() {
  70195. var map = this.map;
  70196. var width = parseInt(this.canvas.style.width);
  70197. var height = parseInt(this.canvas.style.height);
  70198. var center = map.getCenter();
  70199. var longitude = center.lng;
  70200. var latitude = center.lat;
  70201. var zoom = map.getZoom();
  70202. var maxZoom = map.getMaxZoom();
  70203. var pitch = map.getPitch();
  70204. var bearing = map.getBearing();
  70205. var mapViewport = {
  70206. longitude: longitude,
  70207. latitude: latitude,
  70208. zoom: zoom,
  70209. maxZoom: maxZoom,
  70210. pitch: pitch,
  70211. bearing: bearing
  70212. };
  70213. var state = {};
  70214. for (var key in mapViewport) {
  70215. state[key] = mapViewport[key];
  70216. }
  70217. state.width = width;
  70218. state.height = height;
  70219. state.data = this.graphics;
  70220. state.color = this.color;
  70221. state.radius = this.radius;
  70222. state.opacity = this.opacity;
  70223. state.highlightColor = this.highlightColor;
  70224. state.radiusScale = this.radiusScale;
  70225. state.radiusMinPixels = this.radiusMinPixels;
  70226. state.radiusMaxPixels = this.radiusMaxPixels;
  70227. state.strokeWidth = this.strokeWidth;
  70228. state.outline = this.outline; //当使用扩展的mapboxgl代码时有效
  70229. if (map.getCRS && map.getCRS() !== external_mapboxgl_default.a.CRS.EPSG3857) {
  70230. state.coordinateSystem = this.coordinateSystem;
  70231. state.isGeographicCoordinateSystem = this.isGeographicCoordinateSystem;
  70232. }
  70233. return state;
  70234. }
  70235. /**
  70236. * @function mapboxgl.supermap.GraphicLayer.prototype.draw
  70237. * @description 绘制图层。
  70238. */
  70239. }, {
  70240. key: "draw",
  70241. value: function draw() {
  70242. var mapState = this.getState();
  70243. var deckOptions = {};
  70244. for (var key in mapState) {
  70245. deckOptions[key] = mapState[key];
  70246. }
  70247. deckOptions.layers = [this.layer];
  70248. deckOptions.canvas = this.canvas;
  70249. this.deckGL.setProps(deckOptions);
  70250. }
  70251. }, {
  70252. key: "_moveEvent",
  70253. value: function _moveEvent() {
  70254. this.draw();
  70255. }
  70256. }, {
  70257. key: "_resizeEvent",
  70258. value: function _resizeEvent() {
  70259. var canvas = this.canvas;
  70260. var map = this.map;
  70261. canvas.width = parseInt(map.getCanvas().style.width);
  70262. canvas.height = parseInt(map.getCanvas().style.height);
  70263. canvas.style.width = map.getCanvas().style.width;
  70264. canvas.style.height = map.getCanvas().style.height;
  70265. this.draw();
  70266. }
  70267. }, {
  70268. key: "_initContainer",
  70269. value: function _initContainer() {
  70270. this.canvas = this._createCanvas();
  70271. this.mapContainer = this.map.getCanvasContainer();
  70272. this.mapContainer.appendChild(this.canvas);
  70273. }
  70274. }, {
  70275. key: "_createCanvas",
  70276. value: function _createCanvas() {
  70277. var canvas = document.createElement('canvas');
  70278. if (this.id) {
  70279. canvas.id = this.id;
  70280. }
  70281. canvas.style.position = 'absolute';
  70282. canvas.style.top = 0 + "px";
  70283. canvas.style.left = 0 + "px";
  70284. canvas.style.cursor = "";
  70285. var map = this.map;
  70286. canvas.width = parseInt(map.getCanvas().style.width);
  70287. canvas.height = parseInt(map.getCanvas().style.height);
  70288. canvas.style.width = map.getCanvas().style.width;
  70289. canvas.style.height = map.getCanvas().style.height;
  70290. return canvas;
  70291. }
  70292. }]);
  70293. return GraphicLayer;
  70294. }();
  70295. external_mapboxgl_default.a.supermap.GraphicLayer = GraphicLayer_GraphicLayer;
  70296. // EXTERNAL MODULE: external "function(){try{return THREE}catch(e){return {}}}()"
  70297. var external_function_try_return_THREE_catch_e_return_ = __webpack_require__(1);
  70298. // CONCATENATED MODULE: ./src/mapboxgl/overlay/threejs/Transform.js
  70299. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  70300. * This program are made available under the terms of the Apache License, Version 2.0
  70301. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70302. function wrap(source, min, max) {
  70303. if (source === max || source === min) {
  70304. return source;
  70305. }
  70306. var len = max - min;
  70307. return ((source - min) % len + len) % len + min;
  70308. }
  70309. function rad(angle) {
  70310. return angle * Math.PI / 180;
  70311. }
  70312. var Projection = {
  70313. R: 6378137,
  70314. minZoom: 0,
  70315. maxZoom: 22,
  70316. nativeMaxZoom: 19,
  70317. RAD: Math.PI / 180,
  70318. METERS_PER_DEGREE: 6378137 * Math.PI / 180,
  70319. MAX_LATITUDE: 85.0511287798,
  70320. project: function project(lngLat) {
  70321. var rad = this.RAD,
  70322. metersPerDegree = this.METERS_PER_DEGREE,
  70323. max = this.MAX_LATITUDE;
  70324. var ll = lngLat instanceof Array ? {
  70325. lng: lngLat[0],
  70326. lat: lngLat[1]
  70327. } : {
  70328. lng: lngLat.lng,
  70329. lat: lngLat.lat
  70330. };
  70331. var lng = ll.lng,
  70332. lat = Math.max(Math.min(max, ll.lat), -max);
  70333. var c;
  70334. if (lat === 0) {
  70335. c = 0;
  70336. } else {
  70337. c = Math.log(Math.tan((90 + lat) * rad / 2)) / rad;
  70338. }
  70339. return {
  70340. x: lng * metersPerDegree,
  70341. y: c * metersPerDegree
  70342. };
  70343. },
  70344. unproject: function unproject(point) {
  70345. var x = point.x,
  70346. y = point.y;
  70347. var rad = this.RAD,
  70348. metersPerDegree = this.METERS_PER_DEGREE;
  70349. var c;
  70350. if (y === 0) {
  70351. c = 0;
  70352. } else {
  70353. c = y / metersPerDegree;
  70354. c = (2 * Math.atan(Math.exp(c * rad)) - Math.PI / 2) / rad;
  70355. }
  70356. return {
  70357. lng: wrap(x / metersPerDegree, -180, 180),
  70358. lat: wrap(c, -this.MAX_LATITUDE, this.MAX_LATITUDE)
  70359. };
  70360. },
  70361. locate: function locate(lngLat, dx, dy) {
  70362. if (!lngLat) {
  70363. return null;
  70364. }
  70365. dx = !dx ? 0 : dx;
  70366. dy = !dy ? 0 : dy;
  70367. if (!dx && !dy) {
  70368. return lngLat;
  70369. }
  70370. var lng = lngLat.lng;
  70371. if (dx !== 0) {
  70372. var ndx = Math.abs(dx),
  70373. radLng = rad(lngLat.lng);
  70374. var sLng = 2 * Math.sqrt(Math.pow(Math.sin(ndx / (2 * this.R)), 2) / Math.pow(Math.cos(radLng), 2));
  70375. radLng = radLng + sLng * (ndx > 0 ? 1 : -1);
  70376. lng = wrap(radLng * 180 / Math.PI, -180, 180);
  70377. }
  70378. var lat = lngLat.lat;
  70379. if (dy !== 0) {
  70380. var ndy = Math.abs(dy),
  70381. radLat = rad(lngLat.lat);
  70382. var sLat = Math.sin(ndy / (2 * this.R)) * 2;
  70383. radLat = radLat + sLat * (ndy > 0 ? 1 : -1);
  70384. lat = wrap(radLat * 180 / Math.PI, -90, 90);
  70385. }
  70386. return {
  70387. lng: lng,
  70388. lat: lat
  70389. };
  70390. },
  70391. getResolution: function getResolution(zoom) {
  70392. if (!this.resolutions) {
  70393. var resolutions = [];
  70394. var d = 2 * 6378137 * Math.PI;
  70395. for (var i = 0; i <= this.maxZoom; i++) {
  70396. resolutions[i] = d / (256 * Math.pow(2, i));
  70397. }
  70398. this.resolutions = resolutions;
  70399. }
  70400. var z = zoom | 0,
  70401. length = this.resolutions.length;
  70402. z = z < 0 ? 0 : z > length - 1 ? length - 1 : z;
  70403. var res = this.resolutions[z];
  70404. if ((zoom | 0) !== zoom && z !== length - 1) {
  70405. var next = this.resolutions[z + 1];
  70406. return res + (next - res) * (zoom - z);
  70407. }
  70408. return res;
  70409. }
  70410. };
  70411. var Transform = {
  70412. matrix: [1, -1, 0, 0],
  70413. projection: Projection,
  70414. project: function project(lngLat) {
  70415. return this.projection.project(lngLat);
  70416. },
  70417. unproject: function unproject(point) {
  70418. return this.projection.unproject(point);
  70419. },
  70420. lngLatToPoint: function lngLatToPoint(lngLat, zoom) {
  70421. var pt = this.project(lngLat);
  70422. return this.transform(pt, this.projection.getResolution(zoom));
  70423. },
  70424. locate: function locate(lngLat, dx, dy) {
  70425. return this.projection.locate(lngLat, dx, dy);
  70426. },
  70427. transform: function transform(point, scale) {
  70428. return {
  70429. x: this.matrix[0] * (point.x - this.matrix[2]) / scale,
  70430. y: this.matrix[1] * (point.y - this.matrix[3]) / scale
  70431. };
  70432. }
  70433. };
  70434. external_mapboxgl_default.a.supermap.Transform = Transform;
  70435. // CONCATENATED MODULE: ./src/mapboxgl/overlay/threejs/ThreeLayerRenderer.js
  70436. function ThreeLayerRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70437. 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); } }
  70438. function ThreeLayerRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThreeLayerRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThreeLayerRenderer_defineProperties(Constructor, staticProps); return Constructor; }
  70439. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  70440. * This program are made available under the terms of the Apache License, Version 2.0
  70441. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70442. /**
  70443. * reference and modification
  70444. * maptalks.three
  70445. * (https://github.com/maptalks/maptalks.three)
  70446. * Apache Licene 2.0
  70447. * thanks maptalks
  70448. */
  70449. var projection = Transform.projection;
  70450. var ThreeLayerRenderer_Color = external_function_try_return_THREE_catch_e_return_["Color"],
  70451. Scene = external_function_try_return_THREE_catch_e_return_["Scene"],
  70452. WebGLRenderer = external_function_try_return_THREE_catch_e_return_["WebGLRenderer"],
  70453. CanvasRenderer = external_function_try_return_THREE_catch_e_return_["CanvasRenderer"],
  70454. PerspectiveCamera = external_function_try_return_THREE_catch_e_return_["PerspectiveCamera"];
  70455. var RADIAN = Math.PI / 180;
  70456. var ThreeLayerRenderer_frame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
  70457. var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame;
  70458. /**
  70459. * @private
  70460. * @class ThreeLayerRenderer
  70461. * @category Visualization Three
  70462. * @classdesc Three图层渲染器
  70463. * @param {mapboxgl.supermap.ThreeLayer} layer - ThreeJs图层。</br>
  70464. * @param {string} [renderer="gl"] - 图层渲染方式(canvas或WebGL)。取值:"gl","canvas"。</br>
  70465. * @param {Object} options - threejs渲染器初始化参数对象。参数内容详见:
  70466. * [WebGLRenderer]{@link https://threejs.org/docs/index.html#api/renderers/WebGLRenderer}/
  70467. * [CanvasRenderer]{@link https://threejs.org/docs/index.html#examples/renderers/CanvasRenderer}
  70468. *
  70469. * @extends {mapboxgl.Evented}
  70470. * @fires mapboxgl.supermap.ThreeLayer#initialized
  70471. * @fires mapboxgl.supermap.ThreeLayer#draw
  70472. * @fires mapboxgl.supermap.ThreeLayer#rendererinitialized
  70473. */
  70474. var ThreeLayerRenderer_ThreeLayerRenderer = /*#__PURE__*/function () {
  70475. function ThreeLayerRenderer(layer, renderer, options) {
  70476. ThreeLayerRenderer_classCallCheck(this, ThreeLayerRenderer);
  70477. this._layer = layer;
  70478. this.renderer = renderer || "gl";
  70479. this.options = options;
  70480. }
  70481. ThreeLayerRenderer_createClass(ThreeLayerRenderer, [{
  70482. key: "setMap",
  70483. value: function setMap(map) {
  70484. this.map = map;
  70485. } //开始渲染
  70486. }, {
  70487. key: "render",
  70488. value: function render() {
  70489. if (!this._layer) {
  70490. return;
  70491. }
  70492. this.prepare();
  70493. /**
  70494. * @event mapboxgl.supermap.ThreeLayer#initialized
  70495. * @description three 初始化之后后触发。
  70496. */
  70497. this._layer.fire("initialized");
  70498. this._layer && this._layer.draw(this.context, this.scene, this.camera);
  70499. /**
  70500. * @event mapboxgl.supermap.ThreeLayer#draw
  70501. * @description draw 绘制事件, 调用提供给外部绘制的接口后触发
  70502. */
  70503. this._layer.fire("draw");
  70504. this.renderScene();
  70505. }
  70506. }, {
  70507. key: "update",
  70508. value: function update() {
  70509. this.remove();
  70510. this.render();
  70511. } //渲染场景(模型已经添加到图层)
  70512. }, {
  70513. key: "renderScene",
  70514. value: function renderScene() {
  70515. this.locationCamera();
  70516. this.animationFrame = this.renderFrame(function () {
  70517. this.animationFrame = null;
  70518. this.context && this.context.render(this.scene, this.camera);
  70519. }.bind(this));
  70520. }
  70521. }, {
  70522. key: "renderFrame",
  70523. value: function renderFrame(fn) {
  70524. var render = function render() {
  70525. fn && typeof fn === "function" && fn();
  70526. };
  70527. return ThreeLayerRenderer_frame(render);
  70528. }
  70529. }, {
  70530. key: "resize",
  70531. value: function resize() {
  70532. this._resetElementSize(this.container);
  70533. this._resetElementSize(this.canvas);
  70534. var width = this.canvas.width,
  70535. height = this.canvas.height;
  70536. var size = this.getMapSize();
  70537. this.camera.aspect = width / height;
  70538. this.camera.updateProjectionMatrix();
  70539. this.context.setSize(size.width, size.height);
  70540. this.renderScene();
  70541. } //创建画布、初始化渲染器、初始化相机等
  70542. }, {
  70543. key: "prepare",
  70544. value: function prepare() {
  70545. if (!this.map) {
  70546. return new Error("map object is necessary");
  70547. }
  70548. if (!this.canvas) {
  70549. this._initContainer();
  70550. this._initThreeRenderer();
  70551. /**
  70552. * @event mapboxgl.supermap.ThreeLayer#rendererinitialized
  70553. * @description rendererinitialized 事件,初始化 three 渲染器后触发
  70554. */
  70555. this._layer.fire("rendererinitialized");
  70556. } else {
  70557. this.clear(this.context);
  70558. }
  70559. }
  70560. }, {
  70561. key: "getMapSize",
  70562. value: function getMapSize() {
  70563. var container = this.map.getContainer();
  70564. return {
  70565. width: container.clientWidth,
  70566. height: container.clientHeight
  70567. };
  70568. }
  70569. }, {
  70570. key: "cancelFrame",
  70571. value: function cancelFrame() {
  70572. if (this.animationFrame != null) {
  70573. cancel(this.animationFrame);
  70574. }
  70575. }
  70576. }, {
  70577. key: "remove",
  70578. value: function remove() {
  70579. if (this.animationFrame != null) {
  70580. cancel(this.animationFrame);
  70581. }
  70582. this.container.removeChild(this.canvas);
  70583. this.container.parentNode.removeChild(this.container);
  70584. this.context = null;
  70585. this.canvas = null;
  70586. this.container = null;
  70587. } //清理画布内容
  70588. }, {
  70589. key: "clear",
  70590. value: function clear(context) {
  70591. context && context.clear && context.clear();
  70592. context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  70593. } //计算缩放比例
  70594. }, {
  70595. key: "getScale",
  70596. value: function getScale(zoom) {
  70597. var map = this.map;
  70598. var z = zoom == null ? map.getZoom() : zoom;
  70599. var max = projection.getResolution(projection.nativeMaxZoom),
  70600. res = projection.getResolution(z);
  70601. return res / max;
  70602. }
  70603. }, {
  70604. key: "getCanvasContainer",
  70605. value: function getCanvasContainer() {
  70606. return this.container;
  70607. }
  70608. }, {
  70609. key: "getCanvas",
  70610. value: function getCanvas() {
  70611. return this.canvas;
  70612. } //重新设置相机位置
  70613. }, {
  70614. key: "locationCamera",
  70615. value: function locationCamera() {
  70616. var map = this.map;
  70617. var size = this.getMapSize();
  70618. var scale = map.transform.zoomScale(projection.nativeMaxZoom - map.getZoom() - 1);
  70619. var fovRatio = Math.tan(map.transform.fov / 2 * RADIAN);
  70620. var camera = this.camera; //倾斜时,相机位置低于Z轴
  70621. var pitch = map.getPitch() * RADIAN;
  70622. var pZ = -scale * size.height / 2 / fovRatio;
  70623. camera.position.z = pZ * Math.cos(pitch);
  70624. var centerPoint = Transform.lngLatToPoint(map.getCenter(), projection.nativeMaxZoom);
  70625. var distance = Math.sin(pitch) * pZ;
  70626. var bearing = map.getBearing() * RADIAN;
  70627. camera.position.x = centerPoint.x + distance * Math.sin(bearing);
  70628. camera.position.y = centerPoint.y - distance * Math.cos(bearing);
  70629. camera.up.set(Math.sin(bearing), -Math.cos(bearing), 0);
  70630. camera.lookAt(new external_function_try_return_THREE_catch_e_return_["Vector3"](centerPoint.x, centerPoint.y, 0));
  70631. camera.updateProjectionMatrix();
  70632. }
  70633. }, {
  70634. key: "_initContainer",
  70635. value: function _initContainer() {
  70636. var canvas = this._createCanvas();
  70637. var container = this.container = document.createElement("div");
  70638. if (this._layer._layerId) {
  70639. container.id = this._layer._layerId;
  70640. }
  70641. container.className = "threejs-wrapper";
  70642. container.style.position = "absolute";
  70643. container.style.left = "0px";
  70644. container.style.top = "0px";
  70645. container.style.overflow = "hidden";
  70646. this._resetElementSize(container);
  70647. container.appendChild(canvas);
  70648. var mapContainer = this.map.getCanvasContainer();
  70649. mapContainer.appendChild(container);
  70650. }
  70651. }, {
  70652. key: "_createCanvas",
  70653. value: function _createCanvas() {
  70654. if (this.canvas) {
  70655. return;
  70656. }
  70657. var canvas = this.canvas = document.createElement('canvas');
  70658. canvas.className = "threejs-overlay";
  70659. canvas.style.outline = "none";
  70660. this._resetElementSize(canvas);
  70661. return canvas;
  70662. }
  70663. }, {
  70664. key: "_resetElementSize",
  70665. value: function _resetElementSize(element) {
  70666. if (!element) {
  70667. return;
  70668. }
  70669. var size = this.getMapSize();
  70670. var dpr = window.devicePixelRatio ? window.devicePixelRatio : 1;
  70671. var width = dpr * size.width;
  70672. var height = dpr * size.height;
  70673. element.width = width;
  70674. element.height = height;
  70675. element.style.width = size.width + 'px';
  70676. element.style.height = size.height + 'px';
  70677. }
  70678. }, {
  70679. key: "_initThreeRenderer",
  70680. value: function _initThreeRenderer() {
  70681. var map = this.map;
  70682. var size = this.getMapSize();
  70683. var renderer = this.renderer || 'gl';
  70684. var context;
  70685. if (renderer === 'gl') {
  70686. context = new WebGLRenderer({
  70687. 'canvas': this.canvas,
  70688. 'alpha': true,
  70689. 'antialias': true,
  70690. 'preserveDrawingBuffer': true
  70691. }, this.options);
  70692. context.autoClear = true;
  70693. context.clear();
  70694. } else {
  70695. context = new CanvasRenderer(Util_Util.extend({
  70696. 'canvas': this.canvas,
  70697. 'alpha': true
  70698. }, this.options));
  70699. }
  70700. context.setClearColor(new ThreeLayerRenderer_Color(1, 1, 1), 0);
  70701. context.canvas = this.canvas;
  70702. this.context = context;
  70703. var fov = map.transform.fov;
  70704. var fovRatio = Math.tan(fov / 2 * RADIAN);
  70705. var maxScale = this.getScale(projection.minZoom) / this.getScale(projection.nativeMaxZoom);
  70706. var far = maxScale * size.height / 2 / fovRatio;
  70707. this.camera = new PerspectiveCamera(fov, size.width / size.height, 1, far);
  70708. this.scene = new Scene();
  70709. this.scene.add(this.camera);
  70710. }
  70711. }]);
  70712. return ThreeLayerRenderer;
  70713. }();
  70714. // CONCATENATED MODULE: ./src/mapboxgl/overlay/threejs/index.js
  70715. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  70716. * This program are made available under the terms of the Apache License, Version 2.0
  70717. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70718. // CONCATENATED MODULE: ./src/mapboxgl/overlay/ThreeLayer.js
  70719. 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); }
  70720. function ThreeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70721. 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); } }
  70722. function ThreeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThreeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThreeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  70723. 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); }
  70724. function ThreeLayer_setPrototypeOf(o, p) { ThreeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThreeLayer_setPrototypeOf(o, p); }
  70725. 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); }; }
  70726. function ThreeLayer_possibleConstructorReturn(self, call) { if (call && (ThreeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return ThreeLayer_assertThisInitialized(self); }
  70727. function ThreeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70728. 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; } }
  70729. function ThreeLayer_getPrototypeOf(o) { ThreeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThreeLayer_getPrototypeOf(o); }
  70730. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  70731. * This program are made available under the terms of the Apache License, Version 2.0
  70732. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70733. /**
  70734. * reference and modification
  70735. * maptalks.three
  70736. * (https://github.com/maptalks/maptalks.three)
  70737. * Apache Licene 2.0
  70738. * thanks maptalks
  70739. */
  70740. var Vector3 = external_function_try_return_THREE_catch_e_return_["Vector3"],
  70741. ThreeLayer_Shape = external_function_try_return_THREE_catch_e_return_["Shape"],
  70742. Mesh = external_function_try_return_THREE_catch_e_return_["Mesh"],
  70743. BufferGeometry = external_function_try_return_THREE_catch_e_return_["BufferGeometry"],
  70744. ExtrudeGeometry = external_function_try_return_THREE_catch_e_return_["ExtrudeGeometry"];
  70745. /**
  70746. * @class mapboxgl.supermap.ThreeLayer
  70747. * @category Visualization Three
  70748. * @classdesc Three 图层。
  70749. * @param {string} id - 图层 ID。
  70750. * @param {string} [renderer="gl"] - 图层渲染方式( canvas 或 WebGL )。取值:"gl","canvas"。
  70751. * @param {Object} options - 初始化参数。
  70752. * @param {Object} options.threeOptions - threejs 渲染器初始化参数对象。参数内容详见:
  70753. * [WebGLRenderer]{@link https://threejs.org/docs/index.html#api/renderers/WebGLRenderer}
  70754. * [CanvasRenderer]{@link https://threejs.org/docs/index.html#examples/renderers/CanvasRenderer}
  70755. *
  70756. * @extends {mapboxgl.Evented}
  70757. * @fires mapboxgl.supermap.ThreeLayer#render
  70758. * @fires mapboxgl.supermap.ThreeLayer#renderscene
  70759. * @example
  70760. * var threeLayer = new mapboxgl.supermap.ThreeLayer('three');
  70761. * //模型绘制
  70762. * threeLayer.on("initialized", draw);
  70763. * threeLayer.addTo(map);
  70764. *
  70765. * function draw() {
  70766. * var scene=threeLayer.getScene();
  70767. * camera=threeLayer.getCamera();
  70768. * var light = new THREE.PointLight(0xffffff);
  70769. * camera.add(light);
  70770. * var material = new THREE.MeshPhongMaterial({color: 0xff0000});
  70771. * //根据坐标点转换成模型
  70772. * var mesh = this.toThreeMesh(feature.geometry.coordinates, 10, material, true);
  70773. * //模型添加到3D场景
  70774. * scene.add(mesh);
  70775. * }
  70776. *
  70777. * 叠加模型可以通过两种方式:</br>
  70778. * 1.调用 threeLayer.toThreeMesh 直接将地理坐标转换成 threejs 3D 模型(适用于挤压模型,如城市建筑),然后添加到 3D 场景
  70779. * 2.使用 ThreeJS 的接口创建好 Mesh,然后调用 threeLayer.setPosition 设置地理位置,然后添加到 3D 场景
  70780. *
  70781. */
  70782. var ThreeLayer_ThreeLayer = /*#__PURE__*/function (_mapboxgl$Evented) {
  70783. ThreeLayer_inherits(ThreeLayer, _mapboxgl$Evented);
  70784. var _super = ThreeLayer_createSuper(ThreeLayer);
  70785. //options.threeOptions是初始化threejs renderer的参数对象
  70786. function ThreeLayer(id, renderer, options) {
  70787. var _this;
  70788. ThreeLayer_classCallCheck(this, ThreeLayer);
  70789. _this = _super.call(this);
  70790. _this._layerId = id;
  70791. _this.options = options;
  70792. var threeOptions = options && options.threeOptions;
  70793. _this.renderer = new ThreeLayerRenderer_ThreeLayerRenderer(ThreeLayer_assertThisInitialized(_this), renderer, threeOptions);
  70794. return _this;
  70795. }
  70796. /**
  70797. * @function mapboxgl.supermap.ThreeLayer.prototype.toThreeShape
  70798. * @description 创建 threejs shape 对象。
  70799. * @param {Array} coordinates - 坐标点数组。
  70800. * @returns THREE.Shape{@link https://threejs.org/docs/index.html#api/extras/core/Shape} threejs shape 对象。
  70801. */
  70802. ThreeLayer_createClass(ThreeLayer, [{
  70803. key: "toThreeShape",
  70804. value: function toThreeShape(coordinates) {
  70805. var _this2 = this;
  70806. if (!coordinates) {
  70807. return null;
  70808. }
  70809. var center = this.getCoordinatesCenter(coordinates);
  70810. var centerPoint = this.lngLatToPosition(center);
  70811. var outer = coordinates.map(function (coords) {
  70812. return _this2.lngLatToPosition({
  70813. lng: coords[0],
  70814. lat: coords[1]
  70815. }).sub(centerPoint);
  70816. });
  70817. return new ThreeLayer_Shape(outer);
  70818. }
  70819. /**
  70820. * @function mapboxgl.supermap.ThreeLayer.prototype.toThreeMesh
  70821. * @description 创建 threejs Mesh 对象。将地理坐标转换成 threejs 3D 模型(适用于挤压模型,如城市建筑)。
  70822. * @param {Array.<Object>} coordinates - 坐标点数组。
  70823. * @param {number} amount - 高度。
  70824. * @param {THREE.Material} material - Threejs 材质对象。参考:[THREE.Material]{@link https://threejs.org/docs/index.html#api/extras/core/Material}
  70825. * @param {boolean} [removeDuplicated] - 是否移除重复的坐标点。
  70826. * @returns {THREE.Mesh} threejs Mesh 对象。参考:[THREE.Mesh]{@link https://threejs.org/docs/index.html#api/objects/Mesh}
  70827. */
  70828. }, {
  70829. key: "toThreeMesh",
  70830. value: function toThreeMesh(coordinates, amount, material, removeDuplicated) {
  70831. if (!coordinates) {
  70832. return null;
  70833. }
  70834. var coords = coordinates;
  70835. if (removeDuplicated) {
  70836. coords = this.removeDuplicatedCoordinates(coordinates);
  70837. }
  70838. var targetAmount = this.distanceToThreeVector3(amount, amount).x;
  70839. var shape = this.toThreeShape(coords);
  70840. var geometry = new ExtrudeGeometry(shape, {
  70841. 'amount': targetAmount,
  70842. 'bevelEnabled': true
  70843. });
  70844. var bufferGeometry = new BufferGeometry().fromGeometry(geometry);
  70845. var mesh = new Mesh(bufferGeometry, material);
  70846. var center = this.lngLatToPosition(this.getCoordinatesCenter(coords));
  70847. mesh.position.set(center.x, center.y, -targetAmount);
  70848. return mesh;
  70849. }
  70850. /**
  70851. * @function mapboxgl.supermap.ThreeLayer.prototype.addObject
  70852. * @description 设置threejs 3D 对象的坐标(经纬度)。
  70853. * @param {THREE.Object3D} object3D - threejs 3D 对象。参考:[THREE.Object3D]{@link https://threejs.org/docs/index.html#api/core/Object3D}及子类对象。
  70854. * @param {(Array.<number>|Object)} coordinate - 添加的 three 对象坐标(经纬度)。
  70855. * @returns {this} this
  70856. */
  70857. }, {
  70858. key: "addObject",
  70859. value: function addObject(object3D, coordinate) {
  70860. if (coordinate && object3D) {
  70861. this.setPosition(object3D, coordinate);
  70862. }
  70863. this.renderer && this.renderer.scene.add(object3D);
  70864. }
  70865. /**
  70866. * @function mapboxgl.supermap.ThreeLayer.prototype.getScene
  70867. * @description 获取threejs 场景对象
  70868. * @returns {THREE.Scene} threejs 场景对象,参考:[THREE.Scene]{@link https://threejs.org/docs/index.html#api/scenes/Scene}
  70869. */
  70870. }, {
  70871. key: "getScene",
  70872. value: function getScene() {
  70873. return this.renderer.scene;
  70874. }
  70875. /**
  70876. * @function mapboxgl.supermap.ThreeLayer.prototype.getCamera
  70877. * @description 获取threejs 相机。
  70878. * @returns {THREE.Camera} threejs 相机。参考:[THREE.Camera]{@link https://threejs.org/docs/index.html#api/cameras/Camera}
  70879. */
  70880. }, {
  70881. key: "getCamera",
  70882. value: function getCamera() {
  70883. return this.renderer.camera;
  70884. }
  70885. /**
  70886. * @function mapboxgl.supermap.ThreeLayer.prototype.getThreeRenderer
  70887. * @description 获取 threejs renderer。
  70888. * @returns {THREE.WebGLRenderer|THREE.CanvasRenderer} threejs renderer。参考:
  70889. * [THREE.WebGLRenderer]{@link https://threejs.org/docs/index.html#api/renderers/WebGLRenderer}/
  70890. * [THREE.CanvasRenderer]{@link https://threejs.org/docs/index.html#examples/renderers/CanvasRenderer}
  70891. */
  70892. }, {
  70893. key: "getThreeRenderer",
  70894. value: function getThreeRenderer() {
  70895. return this.renderer.context;
  70896. } // /**
  70897. // * @function mapboxgl.supermap.ThreeLayer.prototype.getObject
  70898. // * @description 根据条件获取添加到场景中的对象
  70899. // * @return {THREE.Object3D} threejs 3D对象。参考:[THREE.Object3D]{@link https://threejs.org/docs/index.html#api/core/Object3D}及子类对象
  70900. // */
  70901. // getObject(conditions) {
  70902. // if(!conditions){
  70903. // return;
  70904. // }
  70905. // var scene = this.getScene();
  70906. // var objects = scene.children;
  70907. // for(let obj of objects ){
  70908. // for(let condition of conditions ){
  70909. // obj[condition]
  70910. // }
  70911. // }
  70912. // }
  70913. /**
  70914. * @function mapboxgl.supermap.ThreeLayer.prototype.clearMesh
  70915. * @description 清除所有 threejs mesh 对象。
  70916. * @returns {this} this 对象。
  70917. */
  70918. }, {
  70919. key: "clearMesh",
  70920. value: function clearMesh() {
  70921. var scene = this.renderer.scene;
  70922. if (!scene) {
  70923. return this;
  70924. }
  70925. for (var i = scene.children.length - 1; i >= 0; i--) {
  70926. if (scene.children[i] instanceof external_function_try_return_THREE_catch_e_return_["Mesh"]) {
  70927. scene.remove(scene.children[i]);
  70928. }
  70929. }
  70930. return this;
  70931. }
  70932. /**
  70933. * @function mapboxgl.supermap.ThreeLayer.prototype.clearAll
  70934. * @description 清除所有 threejs 对象。
  70935. * @param {boolean} clearCamera - 是否同时清除相机。
  70936. * @returns {this} this 对象。
  70937. */
  70938. }, {
  70939. key: "clearAll",
  70940. value: function clearAll(clearCamera) {
  70941. var scene = this.renderer.scene;
  70942. if (!scene) {
  70943. return this;
  70944. }
  70945. for (var i = scene.children.length - 1; i >= 0; i--) {
  70946. if (!clearCamera && scene.children[i] instanceof external_function_try_return_THREE_catch_e_return_["Camera"]) {
  70947. continue;
  70948. }
  70949. scene.remove(scene.children[i]);
  70950. }
  70951. return this;
  70952. }
  70953. /**
  70954. * @function mapboxgl.supermap.ThreeLayer.prototype.setPosition
  70955. * @description 设置 threejs 3D 对象的坐标(经纬度)。
  70956. * @param {THREE.Object3D} object3D - threejs 3D 对象,参考:[THREE.Object3D]{@link https://threejs.org/docs/index.html#api/core/Object3D}及子类对象。
  70957. * @param {(Array.<number>|Object)} coordinate - 添加的 three 对象坐标(经纬度)。
  70958. * @returns {this} this 对象。
  70959. */
  70960. }, {
  70961. key: "setPosition",
  70962. value: function setPosition(object3D, coordinate) {
  70963. if (!object3D || !coordinate) {
  70964. return this;
  70965. }
  70966. var pos = this.lngLatToPosition(coordinate);
  70967. object3D.position.set(pos.x, pos.y, pos.z);
  70968. return this;
  70969. }
  70970. /**
  70971. * @function mapboxgl.supermap.ThreeLayer.prototype.lngLatToPosition
  70972. * @description 经纬度转threejs 3D 失量对象。
  70973. * @param {(Array.<number>|Object)} lngLat - 经纬度坐标。
  70974. * @returns {THREE.Vector3} threejs 3D 失量对象。参考:[THREE.Vector3]{@link https://threejs.org/docs/index.html#api/math/Vector3}
  70975. */
  70976. }, {
  70977. key: "lngLatToPosition",
  70978. value: function lngLatToPosition(lngLat) {
  70979. var zoom = Transform.projection.nativeMaxZoom;
  70980. var point = Transform.lngLatToPoint(lngLat, zoom);
  70981. return new Vector3(point.x, point.y, -0);
  70982. }
  70983. /**
  70984. * @function mapboxgl.supermap.ThreeLayer.prototype.distanceToThreeVector3
  70985. * @description 计算距离指定坐标给定距离的新坐标的 threejs 3D 失量对象。
  70986. * @param {number} x - x 轴距离,单位米。
  70987. * @param {number} y - y 轴距离,单位米。
  70988. * @param {(Array.<number>|Object)} lngLat - 源坐标。
  70989. * @returns {THREE.Vector3} 目标点的 threejs 3D 失量对象。参考:[THREE.Vector3]{@link https://threejs.org/docs/index.html#api/math/Vector3}
  70990. */
  70991. }, {
  70992. key: "distanceToThreeVector3",
  70993. value: function distanceToThreeVector3(x, y, lngLat) {
  70994. var map = this._map;
  70995. var center = lngLat || map.getCenter(),
  70996. maxZoom = Transform.projection.nativeMaxZoom,
  70997. targetLngLat = Transform.locate(center, x, y);
  70998. var point1 = Transform.lngLatToPoint(center, maxZoom),
  70999. point2 = Transform.lngLatToPoint(targetLngLat, maxZoom);
  71000. var targetX = Math.abs(point2.x - point1.x) * Math.sign(x);
  71001. var targetY = Math.abs(point2.y - point1.y) * Math.sign(y);
  71002. return new Vector3(targetX, targetY, 0);
  71003. }
  71004. /**
  71005. * @function mapboxgl.supermap.ThreeLayer.prototype.removeDuplicatedCoordinates
  71006. * @description 移除数组中的重复坐标。
  71007. * @param {(Array.<Array.<number>>)} coordinates - 坐标数组。
  71008. * @returns {(Array.<Array.<number>>)} 新的坐标数组。
  71009. */
  71010. }, {
  71011. key: "removeDuplicatedCoordinates",
  71012. value: function removeDuplicatedCoordinates(coordinates) {
  71013. function equals(point1, point2) {
  71014. return point1[0] === point2[0] && point1[1] === point2[1];
  71015. }
  71016. var coords = [].concat(coordinates);
  71017. var length = coords.length;
  71018. for (var i = length - 1; i >= 1; i--) {
  71019. if (equals(coords[i], coords[i - 1])) {
  71020. coords.splice(i, 1);
  71021. }
  71022. }
  71023. var isClose = equals(coords[0], coords[coords.length - 1]);
  71024. isClose && coords.splice(coords.length - 1, 1);
  71025. return coords;
  71026. }
  71027. /**
  71028. * @function mapboxgl.supermap.ThreeLayer.prototype.getCoordinatesCenter
  71029. * @description 获取给定坐标数组的中心坐标。
  71030. * @param {(Array.<Array.<number>>)} coordinates - 坐标数组。
  71031. * @returns {Object} 包含经纬度的坐标对象。
  71032. */
  71033. }, {
  71034. key: "getCoordinatesCenter",
  71035. value: function getCoordinatesCenter(coordinates) {
  71036. var sumX = 0,
  71037. sumY = 0,
  71038. count = 0;
  71039. var i = 0,
  71040. len = coordinates.length;
  71041. for (; i < len; i++) {
  71042. if (coordinates[i]) {
  71043. sumX += coordinates[i][0];
  71044. sumY += coordinates[i][1];
  71045. count++;
  71046. }
  71047. }
  71048. return {
  71049. lng: sumX / count,
  71050. lat: sumY / count
  71051. };
  71052. }
  71053. /**
  71054. * @function mapboxgl.supermap.ThreeLayer.prototype.addTo
  71055. * @description 添加图层到地图。
  71056. * @param {Object} map - 地图对象。
  71057. * @returns {this} this 对象。
  71058. */
  71059. }, {
  71060. key: "addTo",
  71061. value: function addTo(map) {
  71062. var me = this;
  71063. me._map = map;
  71064. me.renderer.setMap(map);
  71065. me.renderer.render(); //three mbgl 联动(仅联动相机,不执行重绘操作)
  71066. me._map.on('render', this._update.bind(me));
  71067. me._map.on('resize', this._resize.bind(me));
  71068. me.on('render', function () {
  71069. this.context && this.context.render(this.scene, this.camera);
  71070. }.bind(me.renderer));
  71071. return this;
  71072. }
  71073. /**
  71074. * @function mapboxgl.supermap.ThreeLayer.prototype.getCanvasContainer
  71075. * @description 获取 three 图层容器。
  71076. * @returns {HTMLElement} three 图层的容器。
  71077. */
  71078. }, {
  71079. key: "getCanvasContainer",
  71080. value: function getCanvasContainer() {
  71081. return this.renderer.getCanvasContainer();
  71082. }
  71083. /**
  71084. * @function mapboxgl.supermap.ThreeLayer.prototype.getCanvas
  71085. * @description 获取 three 图层画布。
  71086. * @returns {HTMLCanvasElement} three 图层画布。
  71087. */
  71088. }, {
  71089. key: "getCanvas",
  71090. value: function getCanvas() {
  71091. return this.renderer.getCanvas();
  71092. }
  71093. /**
  71094. * @function mapboxgl.supermap.ThreeLayer.prototype.remove
  71095. * @description 移除图层。
  71096. */
  71097. }, {
  71098. key: "remove",
  71099. value: function remove() {
  71100. var map = this._map,
  71101. me = this;
  71102. map.off('render', me._update.bind(me));
  71103. map.off('resize', me._resize.bind(me));
  71104. me.renderer.remove();
  71105. me._map = null;
  71106. }
  71107. /**
  71108. * @function mapboxgl.supermap.ThreeLayer.prototype.draw
  71109. * @description 提供给外部的 threejs 模型绘制接口。
  71110. * @param {THREE.WebGLRenderer|THREE.CanvasRenderer} gl - threejs 渲染器上下文 。详情请参考:</br>
  71111. * [WebGLRenderer]{@link https://threejs.org/docs/index.html#api/renderers/WebGLRenderer}/
  71112. * [CanvasRenderer]{@link https://threejs.org/docs/index.html#examples/renderers/CanvasRenderer}
  71113. * @param {THREE.Scene} scene - threejs 场景对象。详情请参考:[THREE.Scene]{@link https://threejs.org/docs/index.html#api/scenes/Scene}
  71114. * @param {THREE.Camera} camera - threejs 相机对象。详情请参考:[THREE.Camera]{@link https://threejs.org/docs/index.html#api/cameras/Camera}
  71115. * @returns {this} this对象。
  71116. * @example
  71117. * var threeLayer = new mapboxgl.supermap.ThreeLayer('three');
  71118. * //可以通过重写 draw 实现模型绘制
  71119. * threeLayer.draw = function (gl, scene, camera) {
  71120. * //TODO 绘制操作
  71121. * }
  71122. * threeLayer.addTo(map);
  71123. */
  71124. }, {
  71125. key: "draw",
  71126. value: function draw(gl, scene, camera) {
  71127. // eslint-disable-line no-unused-vars
  71128. return this;
  71129. }
  71130. /**
  71131. * @function mapboxgl.supermap.ThreeLayer.prototype.renderScene
  71132. * @description 渲染场景。
  71133. * @returns {this} this
  71134. */
  71135. }, {
  71136. key: "renderScene",
  71137. value: function renderScene() {
  71138. this.renderer.renderScene();
  71139. /**
  71140. * @event mapboxgl.supermap.ThreeLayer#renderscene
  71141. * @description renderScene 事件,场景渲染后触发。
  71142. */
  71143. this.fire("renderscene");
  71144. return this;
  71145. }
  71146. }, {
  71147. key: "_resize",
  71148. value: function _resize() {
  71149. this.renderer.resize();
  71150. }
  71151. }, {
  71152. key: "_update",
  71153. value: function _update() {
  71154. /**
  71155. * @event mapboxgl.supermap.ThreeLayer#render
  71156. * @description render 事件,地图渲染时(地图状态改变时)触发。
  71157. */
  71158. this.renderScene();
  71159. this.fire('render');
  71160. return this;
  71161. }
  71162. }]);
  71163. return ThreeLayer;
  71164. }(external_mapboxgl_default.a.Evented);
  71165. external_mapboxgl_default.a.supermap.ThreeLayer = ThreeLayer_ThreeLayer;
  71166. // CONCATENATED MODULE: ./src/mapboxgl/overlay/HeatMapLayer.js
  71167. 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); }
  71168. function HeatMapLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71169. 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); } }
  71170. function HeatMapLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) HeatMapLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) HeatMapLayer_defineProperties(Constructor, staticProps); return Constructor; }
  71171. 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); }
  71172. function HeatMapLayer_setPrototypeOf(o, p) { HeatMapLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HeatMapLayer_setPrototypeOf(o, p); }
  71173. 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); }; }
  71174. function HeatMapLayer_possibleConstructorReturn(self, call) { if (call && (HeatMapLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return HeatMapLayer_assertThisInitialized(self); }
  71175. function HeatMapLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  71176. 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; } }
  71177. function HeatMapLayer_getPrototypeOf(o) { HeatMapLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HeatMapLayer_getPrototypeOf(o); }
  71178. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  71179. * This program are made available under the terms of the Apache License, Version 2.0
  71180. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71181. /**
  71182. * @class mapboxgl.supermap.HeatMapLayer
  71183. * @classdesc 热力图层类。
  71184. * @category Visualization HeatMap
  71185. * @param {string} name - 图层名称。
  71186. * @param {Object} options - 构造参数。
  71187. * @param {mapboxgl.Map} options.map - mapboxgl map 对象。
  71188. * @param {string} options.featureWeight - 对应 feature 属性中的热点权重字段名称,权重值类型为 float。
  71189. * @param {string} [options.id] - 专题图层ID。默认使用 CommonUtil.createUniqueID("HeatMapLayer_") 创建专题图层 ID。
  71190. * @param {number} [options.radius=50] - 热点渲染的最大半径(热点像素半径),单位为 px,当 useGeoUnit参数 为 true 时,单位使用当前图层地理坐标单位。热点显示的时候以精确点为中心点开始往四周辐射衰减,其衰减半径和权重值成比列。
  71191. * @param {boolean} [options.loadWhileAnimating=true] - 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为false)。
  71192. * @param {number} [options.opacity=1] - 图层透明度。
  71193. * @param {Array.<string>} [options.colors=['blue','cyan','lime','yellow','red']] - 颜色线性渐变数组,颜色值必须为canvas所支。
  71194. * @param {boolean} [options.useGeoUnit=false] - 使用地理单位,即默认热点半径默认使用像素单位。 当设置为 true 时,热点半径和图层地理坐标保持一致。
  71195. * @extends {mapboxgl.Evented}
  71196. * @fires mapboxgl.supermap.HeatMapLayer#featuresadded
  71197. * @fires mapboxgl.supermap.HeatMapLayer#changelayer
  71198. * @fires mapboxgl.supermap.HeatMapLayer#featuresremoved
  71199. *
  71200. */
  71201. var HeatMapLayer_HeatMapLayer = /*#__PURE__*/function (_mapboxgl$Evented) {
  71202. HeatMapLayer_inherits(HeatMapLayer, _mapboxgl$Evented);
  71203. var _super = HeatMapLayer_createSuper(HeatMapLayer);
  71204. function HeatMapLayer(name, options) {
  71205. var _this;
  71206. HeatMapLayer_classCallCheck(this, HeatMapLayer);
  71207. _this = _super.call(this);
  71208. var _options = options ? options : {};
  71209. /**
  71210. * @member {string} mapboxgl.supermap.HeatMapLayer.prototype.name
  71211. * @description 图层名字。
  71212. */
  71213. _this.name = name;
  71214. /**
  71215. * @member {string} mapboxgl.supermap.HeatMapLayer.prototype.id
  71216. * @description 热力图图层 id。
  71217. */
  71218. _this.id = _options.id ? _options.id : Util_Util.createUniqueID("HeatMapLayer_");
  71219. /**
  71220. * @member {mapboxgl.Map} mapboxgl.supermap.HeatMapLayer.prototype.map
  71221. * @description 热力图图层 map。
  71222. */
  71223. _this.map = _options.map ? _options.map : null;
  71224. /**
  71225. * @member {boolean} [mapboxgl.supermap.HeatMapLayer.prototype.loadWhileAnimating=true]
  71226. * @description 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为false)。
  71227. */
  71228. _this.loadWhileAnimating = _options.loadWhileAnimating === undefined ? true : _options.loadWhileAnimating;
  71229. /**
  71230. * @member {boolean} [mapboxgl.supermap.HeatMapLayer.prototype.visibility=true]
  71231. * @description 图层显示状态属性。
  71232. */
  71233. _this.visibility = true;
  71234. /**
  71235. * @member {number} [mapboxgl.supermap.HeatMapLayer.prototype.opacity=1]
  71236. * @description 图层透明度,取值范围[0,1]。
  71237. */
  71238. _this.opacity = _options.opacity ? _options.opacity : 1;
  71239. /**
  71240. * @member {Array.<string>} [mapboxgl.supermap.HeatMapLayer.prototype.colors=['blue','cyan','lime','yellow','red']]
  71241. * @description 颜色线性渐变数组,颜色值必须为 canvas 所支。
  71242. */
  71243. _this.colors = _options.colors ? _options.colors : ['blue', 'cyan', 'lime', 'yellow', 'red'];
  71244. /**
  71245. * @member {boolean} [mapboxgl.supermap.HeatMapLayer.prototype.useGeoUnit=false]
  71246. * @description 使用地理单位,即默认热点半径默认使用像素单位。 当设置为 true 时,热点半径和图层地理坐标保持一致。
  71247. */
  71248. _this.useGeoUnit = _options.useGeoUnit ? _options.useGeoUnit : false;
  71249. /**
  71250. * @member {number} [mapboxgl.supermap.HeatMapLayer.prototype.radius=50]
  71251. * @description 热点渲染的最大半径(热点像素半径),
  71252. * 热点显示的时候以精确点为中心点开始往四周辐射衰减,
  71253. * 其衰减半径和权重值成比列。
  71254. */
  71255. _this.radius = _options.radius ? _options.radius : 50;
  71256. /**
  71257. * @member {string} mapboxgl.supermap.HeatMapLayer.prototype.featureWeight
  71258. * @description 对应 feature 属性中的热点权重字段名称,权重值类型为 float。
  71259. * @example
  71260. * //feature.attributes中表示权重的字段为 height,则在 HeatMapLayer 的 featureWeight 参数赋值为 "height"。
  71261. * feature1.attributes.height = 7.0;
  71262. * feature2.attributes.height = 6.0;
  71263. * var heatMapLayer = new mapboxgl.supermap.HeatMapLayer("heatmaplayer",{"featureWeight":"height"});
  71264. * heatMapLayer.addFeatures([feature1,feature2]);
  71265. */
  71266. _this.featureWeight = _options.featureWeight ? _options.featureWeight : null;
  71267. /**
  71268. * @member {Array.<SuperMap.Feature.Vector>} mapboxgl.supermap.HeatMapLayer.prototype.features
  71269. * @description 热点信息数组,记录存储图层上添加的所有热点信息。
  71270. */
  71271. _this.features = [];
  71272. /**
  71273. * @member {number} mapboxgl.supermap.HeatMapLayer.prototype.maxWeight
  71274. * @description 设置权重最大值。如果不设置此属性,将按照当前屏幕范围内热点所拥有的权重最大值绘制热点图。
  71275. */
  71276. _this.maxWeight = null;
  71277. /**
  71278. * @member {number} mapboxgl.supermap.HeatMapLayer.prototype.minWeight
  71279. * @description 设置权重最小值。如果不设置此属性,将按照当前屏幕范围内热点所拥有的权重最小值绘制热点图。
  71280. */
  71281. _this.minWeight = null;
  71282. /**
  71283. * @member mapboxgl.supermap.HeatMapLayer.prototype.EVENT_TYPES
  71284. * @description 监听一个自定义事件可用如下方式:
  71285. * 热点图自定义事件信息,事件调用时的属性与具体事件类型相对应。
  71286. *
  71287. * All event objects have at least the following properties:
  71288. * {Object} object - A reference to layer.events.object.
  71289. * {DOMElement} element - A reference to layer.events.element.
  71290. *
  71291. * 支持的事件如下 (另外包含 <SuperMap.Layer 中定义的其他事件>):
  71292. * featuresadded - 热点添加完成时触发。传递参数为添加的热点信息数组和操作成功与否信息。
  71293. * 参数类型:{features: features, succeed: succeed}
  71294. * featuresremoved - 热点被删除时触发。传递参数为删除的热点信息数组和操作成功与否信息。
  71295. * 参数类型:{features: features, succeed: succeed}
  71296. * featuresdrawcompleted - 热点图渲染完成时触发,没有额外属性。
  71297. */
  71298. _this.EVENT_TYPES = ["featuresadded", "featuresremoved", "featuresdrawcompleted"];
  71299. /**
  71300. * @member {boolean} [mapboxgl.supermap.HeatMapLayer.prototype.supported=false]
  71301. * @description 当前浏览器是否支持 canvas 绘制,
  71302. * 决定了热点图是否可用,内部判断使用。
  71303. */
  71304. _this.supported = false;
  71305. /**
  71306. * @member {Object} mapboxgl.supermap.HeatMapLayer.prototype.rootCanvas
  71307. * @description 热点图主绘制面板。
  71308. */
  71309. _this.rootCanvas = null;
  71310. /**
  71311. * @member {Object} mapboxgl.supermap.HeatMapLayer.prototype.canvasContext
  71312. * @description 热点图主绘制对象。
  71313. */
  71314. _this.canvasContext = null;
  71315. /**
  71316. * @member {number} mapboxgl.supermap.HeatMapLayer.prototype.maxWidth
  71317. * @description 当前绘制面板宽度。和当前 map 窗口宽度一致。
  71318. */
  71319. _this.maxWidth = null;
  71320. /**
  71321. * @member {number} mapboxgl.supermap.HeatMapLayer.prototype.maxHeight
  71322. * @description 当前绘制面板宽度。和当前 map 窗口高度一致。
  71323. */
  71324. _this.maxHeight = null;
  71325. return _this;
  71326. }
  71327. /**
  71328. * @function mapboxgl.supermap.HeatMapLayer.prototype.onAdd
  71329. * @description 向底图添加该图层
  71330. */
  71331. HeatMapLayer_createClass(HeatMapLayer, [{
  71332. key: "onAdd",
  71333. value: function onAdd(map) {
  71334. this.map = map;
  71335. if (this.features.length === 0) {
  71336. return;
  71337. } //创建热力图绘制容器
  71338. this._createCanvasContainer(); //绑定图层事件与Map同步
  71339. this.map.on('resize', this._resizeEvent.bind(this));
  71340. this.map.on('zoomstart', this._zoomStartEvent.bind(this));
  71341. this.map.on('zoomend', this._zoomEndEvent.bind(this));
  71342. this.map.on('rotatestart', this._rotateStartEvent.bind(this));
  71343. this.map.on('rotate', this._rotateEvent.bind(this));
  71344. this.map.on('rotateend', this._rotateEndEvent.bind(this));
  71345. this.map.on('dragend', this._dragEndEvent.bind(this));
  71346. this.map.on('movestart', this._moveStartEvent.bind(this));
  71347. this.map.on('move', this._moveEvent.bind(this));
  71348. this.map.on('moveend', this._moveEndEvent.bind(this));
  71349. this.map.on('remove', this.removeFromMap.bind(this));
  71350. this.refresh();
  71351. }
  71352. /**
  71353. * @function mapboxgl.supermap.HeatMapLayer.prototype.removeFromMap
  71354. * @description 从底图删除该图层。
  71355. */
  71356. }, {
  71357. key: "removeFromMap",
  71358. value: function removeFromMap() {
  71359. this.removeAllFeatures();
  71360. this.map.getCanvasContainer().removeChild(this.rootCanvas);
  71361. }
  71362. /**
  71363. * @function mapboxgl.supermap.HeatMapLayer.prototype._createCanvasContainer
  71364. * @description 创建热力图绘制容器。
  71365. * @private
  71366. */
  71367. }, {
  71368. key: "_createCanvasContainer",
  71369. value: function _createCanvasContainer() {
  71370. this.supported = true; //构建绘图面板
  71371. this.mapContainer = this.map.getCanvasContainer(); //热点图要求使用canvas绘制,判断是否支持
  71372. this.rootCanvas = document.createElement("canvas");
  71373. this.rootCanvas.id = this.id;
  71374. var mapCanvas = this.map.getCanvas();
  71375. this.rootCanvas.width = this.maxWidth = parseInt(mapCanvas.width);
  71376. this.rootCanvas.height = this.maxHeight = parseInt(mapCanvas.height);
  71377. Util_Util.modifyDOMElement(this.rootCanvas, null, null, null, "absolute", null, null, this.opacity);
  71378. this.canvasContext = this.rootCanvas.getContext('2d');
  71379. this.mapContainer.appendChild(this.rootCanvas);
  71380. }
  71381. /**
  71382. * @function mapboxgl.supermap.HeatMapLayer.prototype.addFeatures
  71383. * @description 添加热点信息。
  71384. * @param {GeoJSONObject} features - 待添加的要素数组。
  71385. *
  71386. * @example
  71387. * var geojson = {
  71388. * "type": "FeatureCollection",
  71389. * "features": [
  71390. * {
  71391. * "type": "feature",
  71392. * "geometry": {
  71393. * "type": "Point", //只支持point类型
  71394. * "coordinates": [0, 0]
  71395. * },
  71396. * "properties": {
  71397. * "height": Math.random()*9,
  71398. * "geoRadius": useGeoRadius?radius:null
  71399. * }
  71400. * }
  71401. * ]
  71402. * };
  71403. * var heatMapLayer = new mapboxgl.supermap.HeatMapLayer("heatmaplayer",{"featureWeight":"height"}); pLayer = new mapboxgl.supermap.HeatMapLayer("heatmaplayer",{"featureWeight":"height"});
  71404. * heatMapLayer.addFeatures(geojson);
  71405. * map.addLayer(heatMapLayer);
  71406. */
  71407. }, {
  71408. key: "addFeatures",
  71409. value: function addFeatures(features) {
  71410. this.features = this.toiClientFeature(features);
  71411. /**
  71412. * @event mapboxgl.supermap.HeatMapLayer#featuresadded
  71413. * @description 要素添加完成之后触发。
  71414. * @property {GeoJSONObject} features - 被添加的要素。
  71415. * @property {boolean} succeed - 要素是否成功添加。
  71416. */
  71417. this.fire(this.EVENT_TYPES[0], {
  71418. features: features,
  71419. succeed: true
  71420. }); //支持更新features,刷新底图
  71421. this.refresh();
  71422. }
  71423. /**
  71424. * @function mapboxgl.supermap.HeatMapLayer.prototype.refresh
  71425. * @description 强制刷新当前热点显示,在图层热点数组发生变化后调用,更新显示。
  71426. */
  71427. }, {
  71428. key: "refresh",
  71429. value: function refresh() {
  71430. if (this.features.length === 0) {
  71431. return;
  71432. }
  71433. if (this.map) {
  71434. var extent = this.map.getBounds();
  71435. this.updateHeatPoints(extent);
  71436. }
  71437. }
  71438. /**
  71439. * @function mapboxgl.supermap.HeatMapLayer.prototype.setOpacity
  71440. * @description 设置图层的不透明度,取值[0-1]之间。
  71441. * @param {number} [opacity] - 透明度。
  71442. */
  71443. }, {
  71444. key: "setOpacity",
  71445. value: function setOpacity(opacity) {
  71446. if (opacity !== this.opacity) {
  71447. this.opacity = opacity;
  71448. Util_Util.modifyDOMElement(this.rootCanvas, null, null, null, null, null, null, opacity);
  71449. if (this.map !== null) {
  71450. /**
  71451. * @event mapboxgl.supermap.HeatMapLayer#changelayer
  71452. * @description 图层属性改变之后触发。
  71453. * @property {Object} layer - 图层。
  71454. * @property {string} property - 被改变的图层属性。
  71455. */
  71456. this.fire('changelayer', {
  71457. layer: this,
  71458. property: "opacity"
  71459. });
  71460. }
  71461. }
  71462. }
  71463. /**
  71464. * @function mapboxgl.supermap.HeatMapLayer.prototype.updateHeatPoints
  71465. * @description 刷新热点图显示。
  71466. * @param {mapboxgl.LngLatBounds} bounds - 当前显示范围。
  71467. */
  71468. }, {
  71469. key: "updateHeatPoints",
  71470. value: function updateHeatPoints(bounds) {
  71471. if (this.features && this.features.length > 0) {
  71472. this.convertFastToPixelPoints(bounds);
  71473. } else {
  71474. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxWidth);
  71475. }
  71476. }
  71477. /**
  71478. * @function mapboxgl.supermap.HeatMapLayer.prototype.convertFastToPixelPoints
  71479. * @description 过滤位于当前显示范围内的热点,并转换其为当前分辨率下的像素坐标。
  71480. * @param {mapboxgl.LngLatBounds} bounds - 当前显示范围。
  71481. * @private
  71482. */
  71483. }, {
  71484. key: "convertFastToPixelPoints",
  71485. value: function convertFastToPixelPoints(bounds) {
  71486. var data = [],
  71487. x,
  71488. y,
  71489. k,
  71490. resolution,
  71491. maxTemp,
  71492. minTemp,
  71493. maxWeightTemp; //获取当前像素下的地理范围
  71494. var dw = bounds.getEast() - bounds.getWest();
  71495. var dh = bounds.getNorth() - bounds.getSouth();
  71496. var mapCanvas = this.map.getCanvas();
  71497. if (dw / mapCanvas.width > dh / mapCanvas.height) {
  71498. resolution = dw / mapCanvas.width;
  71499. } else {
  71500. resolution = dh / mapCanvas.height;
  71501. } //热点半径
  71502. this.useRadius = this.useGeoUnit ? parseInt(this.radius / resolution) : this.radius;
  71503. for (var i = 0; i < this.features.length; i++) {
  71504. var feature = this.features[i];
  71505. var point = feature.geometry; //可通过bounds过滤需绘制的features以优化性能,但mapboxgl旋转获取得bounds不适
  71506. var pixelPoint = this.getPixelXY(new LonLat_LonLat(point.x, point.y));
  71507. if (this.featureWeight) {
  71508. pixelPoint.weight = feature.attributes[this.featureWeight]; //point.value;
  71509. if (!this.maxWeight) {
  71510. //找出最大最小权重值
  71511. maxTemp = maxTemp ? maxTemp : pixelPoint.weight;
  71512. minTemp = minTemp ? minTemp : pixelPoint.weight;
  71513. maxTemp = Math.max(maxTemp, pixelPoint.weight);
  71514. minTemp = Math.min(minTemp, pixelPoint.weight);
  71515. }
  71516. } else {
  71517. pixelPoint.weight = 1;
  71518. }
  71519. x = Math.floor(pixelPoint.x);
  71520. y = Math.floor(pixelPoint.y);
  71521. k = pixelPoint.weight;
  71522. data.push([x, y, k]);
  71523. } //无最大权重设置
  71524. if (!this.maxWeight) {
  71525. if (maxTemp && minTemp) {
  71526. maxWeightTemp = (maxTemp + minTemp) / 2;
  71527. } else {
  71528. maxWeightTemp = 1;
  71529. }
  71530. this.draw(data, maxWeightTemp);
  71531. } else {
  71532. this.draw(data, this.maxWeight);
  71533. }
  71534. }
  71535. /**
  71536. * @function mapboxgl.supermap.HeatMapLayer.prototype.draw
  71537. * @description 绘制热点图。
  71538. * @param {Array} data - convertToPixelPoints方法计算出的点。
  71539. * @private
  71540. */
  71541. }, {
  71542. key: "draw",
  71543. value: function draw(data, maxWeight) {
  71544. if (this.maxHeight > 0 && this.maxWidth > 0) {
  71545. //清空
  71546. var ctx = this.canvasContext;
  71547. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxHeight);
  71548. this.drawCircle(this.useRadius);
  71549. this.createGradient();
  71550. for (var i = 0; i < data.length; i++) {
  71551. var p = data[i];
  71552. this.canvasContext.globalAlpha = Math.max(p[2] / maxWeight, 0.05);
  71553. this.canvasContext.drawImage(this.circle, p[0] - this.useRadius, p[1] - this.useRadius);
  71554. }
  71555. var colored = ctx.getImageData(0, 0, this.maxWidth, this.maxHeight);
  71556. this.colorize(colored.data, this.grad);
  71557. ctx.putImageData(colored, 0, 0);
  71558. } else {
  71559. return false;
  71560. }
  71561. }
  71562. /**
  71563. * @function mapboxgl.supermap.HeatMapLayer.prototype.colorize
  71564. * @description 根据渐变色重置热点图rgb值。
  71565. * @param {Array} pixels - 像素 RGBA 值。
  71566. * @param {Array} gradient - 渐变 canvas.getImageData.data。
  71567. * @private
  71568. */
  71569. }, {
  71570. key: "colorize",
  71571. value: function colorize(pixels, gradient) {
  71572. for (var i = 0, j; i < pixels.length; i += 4) {
  71573. j = pixels[i + 3] * 4;
  71574. if (j) {
  71575. pixels[i] = gradient[j];
  71576. pixels[i + 1] = gradient[j + 1];
  71577. pixels[i + 2] = gradient[j + 2];
  71578. }
  71579. }
  71580. }
  71581. /**
  71582. * @function mapboxgl.supermap.HeatMapLayer.drawCircle
  71583. * @description 绘制热点半径圆。
  71584. * @param {number} r - 热点半径。
  71585. * @private
  71586. */
  71587. }, {
  71588. key: "drawCircle",
  71589. value: function drawCircle(r) {
  71590. var blur = r / 2;
  71591. var circle = this.circle = document.createElement('canvas'),
  71592. ctx = circle.getContext("2d");
  71593. circle.height = 2 * r;
  71594. circle.width = 2 * r;
  71595. ctx.shadowOffsetX = ctx.shadowOffsetY = 2 * r;
  71596. ctx.shadowBlur = blur;
  71597. ctx.shadowColor = "#000000";
  71598. ctx.beginPath();
  71599. ctx.arc(-r, -r, r / 2, 0, Math.PI * 2, true);
  71600. ctx.closePath();
  71601. ctx.fill();
  71602. }
  71603. /**
  71604. * @function mapboxgl.supermap.HeatMapLayer.createGradient
  71605. * @description 根据 this.colors 设置渐变并 getImageData。
  71606. * @private
  71607. */
  71608. }, {
  71609. key: "createGradient",
  71610. value: function createGradient() {
  71611. var colors = this.colors;
  71612. var canvas = document.createElement('canvas'),
  71613. ctx = canvas.getContext("2d"),
  71614. gradient = ctx.createLinearGradient(0, 0, 0, 256);
  71615. canvas.height = 256;
  71616. canvas.width = 1;
  71617. var index = 1;
  71618. for (var i = 0, len = colors.length; i < len; i++) {
  71619. gradient.addColorStop(index / len, colors[i]);
  71620. index++;
  71621. }
  71622. ctx.fillStyle = gradient;
  71623. ctx.fillRect(0, 0, 1, 256);
  71624. this.grad = ctx.getImageData(0, 0, 1, 256).data;
  71625. }
  71626. /**
  71627. * @function mapboxgl.supermap.HeatMapLayer.prototype.getPixelXY
  71628. * @description 转换地理坐标为相对于当前窗口左上角的像素坐标。
  71629. * @param {number} x - 热点的像素 x 坐标。
  71630. * @param {number} y - 热点的像素 y 坐标。
  71631. */
  71632. }, {
  71633. key: "getPixelXY",
  71634. value: function getPixelXY(coordinate) {
  71635. var pixelP,
  71636. map = this.map;
  71637. if (coordinate instanceof Point_Point || coordinate instanceof GeoText_GeoText) {
  71638. var tempPoint = map.project(new external_mapboxgl_default.a.LngLat(coordinate.x, coordinate.y));
  71639. pixelP = {
  71640. x: parseInt(tempPoint.x),
  71641. y: parseInt(tempPoint.y)
  71642. };
  71643. }
  71644. if (coordinate instanceof LonLat_LonLat) {
  71645. var _tempPoint = map.project(new external_mapboxgl_default.a.LngLat(coordinate.lon, coordinate.lat));
  71646. pixelP = {
  71647. x: parseInt(_tempPoint.x),
  71648. y: parseInt(_tempPoint.y)
  71649. };
  71650. }
  71651. return pixelP;
  71652. }
  71653. /**
  71654. * @function mapboxgl.supermap.HeatMapLayer.prototype.toiClientFeature
  71655. * @description 转为 iClient 要素。
  71656. * @param {GeoJSONObject} features - 待添加的要素数组。
  71657. */
  71658. }, {
  71659. key: "toiClientFeature",
  71660. value: function toiClientFeature(features) {
  71661. if (!Util_Util.isArray(features)) {
  71662. features = [features];
  71663. }
  71664. var featuresTemp = [];
  71665. for (var i = 0; i < features.length; i++) {
  71666. if (features[i] instanceof Vector_Vector) {
  71667. // 若是 GeometryVector 直接返回
  71668. featuresTemp.push(features[i]);
  71669. } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
  71670. //GeoJSON 规范数据类型
  71671. var format = new GeoJSON_GeoJSON();
  71672. featuresTemp = featuresTemp.concat(format.read(features[i]));
  71673. } else if (features[i].geometry && features[i].geometry.parts) {
  71674. //iServer服务器返回数据格式
  71675. featuresTemp.push(ServerFeature_ServerFeature.fromJson(features[i]).toFeature());
  71676. } else {
  71677. throw new Error("Features[".concat(i, "]'s type does not match, please check."));
  71678. }
  71679. }
  71680. return featuresTemp;
  71681. }
  71682. /**
  71683. * @function mapboxgl.supermap.HeatMapLayer.prototype.removeFeatures
  71684. * @description 移除指定的热点信息。
  71685. * @param {Array.<SuperMap.Feature.Vector>} features - 热点信息数组。
  71686. */
  71687. }, {
  71688. key: "removeFeatures",
  71689. value: function removeFeatures(features) {
  71690. if (!features || features.length === 0 || !this.features || this.features.length === 0) {
  71691. return;
  71692. }
  71693. if (features === this.features) {
  71694. return this.removeAllFeatures();
  71695. }
  71696. if (!Util_Util.isArray(features)) {
  71697. features = [features];
  71698. }
  71699. var heatPoint,
  71700. index,
  71701. heatPointsFailedRemoved = [];
  71702. for (var i = 0, len = features.length; i < len; i++) {
  71703. heatPoint = features[i];
  71704. index = Util_Util.indexOf(this.features, heatPoint); //找不到视为删除失败
  71705. if (index === -1) {
  71706. heatPointsFailedRemoved.push(heatPoint);
  71707. continue;
  71708. } //删除热点
  71709. this.features.splice(index, 1);
  71710. }
  71711. var succeed = heatPointsFailedRemoved.length == 0 ? true : false; //派发删除features成功的事件
  71712. /**
  71713. * @event mapboxgl.supermap.HeatMapLayer#featuresremoved
  71714. * @description 要素删除之后触发。
  71715. * @property {Array.<SuperMap.Feature.Vector>} features - 需要被删除的要素。
  71716. * @property {boolean} succeed - 要素删除成功与否。
  71717. */
  71718. this.fire(this.EVENT_TYPES[1], {
  71719. features: heatPointsFailedRemoved,
  71720. succeed: succeed
  71721. });
  71722. this.refresh();
  71723. }
  71724. /**
  71725. * @function mapboxgl.supermap.HeatMapLayer.prototype.removeAllFeatures
  71726. * @description 移除全部的热点信息。
  71727. */
  71728. }, {
  71729. key: "removeAllFeatures",
  71730. value: function removeAllFeatures() {
  71731. this.features = [];
  71732. this.refresh();
  71733. }
  71734. /**
  71735. * @function mapboxgl.supermap.HeatMapLayer.prototype.moveTo
  71736. * @description 将图层移动到某个图层之前。
  71737. * @param {string} layerID - 待插入的图层ID。
  71738. * @param {boolean} [before=true] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  71739. */
  71740. }, {
  71741. key: "moveTo",
  71742. value: function moveTo(layerID, before) {
  71743. var layer = document.getElementById(this.rootCanvas.id);
  71744. before = before !== undefined ? before : true;
  71745. if (before) {
  71746. var beforeLayer = document.getElementById(layerID);
  71747. if (layer && beforeLayer) {
  71748. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  71749. }
  71750. return;
  71751. }
  71752. var nextLayer = document.getElementById(layerID);
  71753. if (layer) {
  71754. if (nextLayer.nextSibling) {
  71755. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  71756. return;
  71757. }
  71758. nextLayer.parentNode.appendChild(layer);
  71759. }
  71760. }
  71761. /**
  71762. * @function mapboxgl.supermap.HeatMapLayer.prototype.setVisibility
  71763. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  71764. * @param {boolean} [visibility] - 是否显示图层(当前地图的resolution在最大最小resolution之间)。
  71765. */
  71766. }, {
  71767. key: "setVisibility",
  71768. value: function setVisibility(visibility) {
  71769. if (this.rootCanvas && visibility !== this.visibility) {
  71770. this.visibility = visibility;
  71771. this.rootCanvas.style.display = visibility ? "block" : "none";
  71772. }
  71773. } //事件绑定
  71774. }, {
  71775. key: "_resizeEvent",
  71776. value: function _resizeEvent() {
  71777. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  71778. var canvas = this.map.getCanvas();
  71779. this.rootCanvas.style.width = canvas.style.width;
  71780. this.rootCanvas.style.height = canvas.style.height;
  71781. this.rootCanvas.width = this.maxWidth = parseInt(canvas.width);
  71782. this.rootCanvas.height = this.maxHeight = parseInt(canvas.height);
  71783. var devicePixelRatio = window.devicePixelRatio || 1;
  71784. devicePixelRatio !== 1 && this.canvasContext && this.canvasContext.scale(devicePixelRatio, devicePixelRatio);
  71785. this.refresh();
  71786. }
  71787. }, {
  71788. key: "_zoomStartEvent",
  71789. value: function _zoomStartEvent() {
  71790. if (this.loadWhileAnimating || !this.visibility) {
  71791. return;
  71792. }
  71793. this.zooming = true;
  71794. this._hide();
  71795. }
  71796. }, {
  71797. key: "_zoomEndEvent",
  71798. value: function _zoomEndEvent() {
  71799. if (this.loadWhileAnimating || !this.visibility) {
  71800. return;
  71801. }
  71802. this.zooming = false;
  71803. this._show();
  71804. }
  71805. }, {
  71806. key: "_rotateStartEvent",
  71807. value: function _rotateStartEvent() {
  71808. if (this.loadWhileAnimating || !this.visibility) {
  71809. return;
  71810. }
  71811. this.rotating = true;
  71812. }
  71813. }, {
  71814. key: "_rotateEvent",
  71815. value: function _rotateEvent() {
  71816. if (this.loadWhileAnimating || !this.visibility) {
  71817. return;
  71818. }
  71819. if (this.map.getPitch() !== 0) {
  71820. this._hide();
  71821. }
  71822. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  71823. var tPitch = this.map.getPitch() - this.startPitch;
  71824. var tBearing = -this.map.getBearing() + this.startBearing;
  71825. this.rootCanvas.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)';
  71826. }
  71827. }, {
  71828. key: "_rotateEndEvent",
  71829. value: function _rotateEndEvent() {
  71830. if (this.loadWhileAnimating || !this.visibility) {
  71831. return;
  71832. }
  71833. this.rotating = false;
  71834. this._show();
  71835. }
  71836. }, {
  71837. key: "_dragEndEvent",
  71838. value: function _dragEndEvent() {
  71839. if (this.loadWhileAnimating || !this.visibility) {
  71840. return;
  71841. }
  71842. this._hide();
  71843. }
  71844. }, {
  71845. key: "_moveEndEvent",
  71846. value: function _moveEndEvent() {
  71847. if (this.loadWhileAnimating || !this.visibility) {
  71848. return;
  71849. }
  71850. this.rootCanvas.style.transform = '';
  71851. this.refresh();
  71852. this._show();
  71853. }
  71854. }, {
  71855. key: "_moveStartEvent",
  71856. value: function _moveStartEvent() {
  71857. if (this.loadWhileAnimating || !this.visibility) {
  71858. return;
  71859. }
  71860. this.startPitch = this.map.getPitch();
  71861. this.startBearing = this.map.getBearing();
  71862. var startMovePoint = this.map.project(new external_mapboxgl_default.a.LngLat(0, 0));
  71863. this.startMoveX = startMovePoint.x;
  71864. this.startMoveY = startMovePoint.y;
  71865. }
  71866. }, {
  71867. key: "_moveEvent",
  71868. value: function _moveEvent() {
  71869. if (this.loadWhileAnimating || !this.visibility) {
  71870. this.refresh();
  71871. return;
  71872. }
  71873. if (this.rotating || this.zooming) {
  71874. return;
  71875. }
  71876. if (this.map.getPitch() !== 0) {
  71877. this._hide();
  71878. }
  71879. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  71880. var tPitch = this.map.getPitch() - this.startPitch;
  71881. var tBearing = -this.map.getBearing() + this.startBearing;
  71882. var endMovePoint = this.map.project(new external_mapboxgl_default.a.LngLat(0, 0));
  71883. var tMoveX = endMovePoint.x - this.startMoveX;
  71884. var tMoveY = endMovePoint.y - this.startMoveY;
  71885. this.rootCanvas.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)' + ' translate3d(' + tMoveX + 'px, ' + tMoveY + 'px, 0px)';
  71886. }
  71887. }, {
  71888. key: "_hide",
  71889. value: function _hide() {
  71890. this.rootCanvas.style.display = 'none';
  71891. }
  71892. }, {
  71893. key: "_show",
  71894. value: function _show() {
  71895. this.rootCanvas.style.display = 'block';
  71896. }
  71897. }]);
  71898. return HeatMapLayer;
  71899. }(external_mapboxgl_default.a.Evented);
  71900. external_mapboxgl_default.a.supermap.HeatMapLayer = HeatMapLayer_HeatMapLayer;
  71901. // CONCATENATED MODULE: ./src/mapboxgl/overlay/DeckglLayer.js
  71902. function DeckglLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71903. 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); } }
  71904. function DeckglLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) DeckglLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) DeckglLayer_defineProperties(Constructor, staticProps); return Constructor; }
  71905. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  71906. * This program are made available under the terms of the Apache License, Version 2.0
  71907. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71908. /**
  71909. * @class mapboxgl.supermap.DeckglLayer
  71910. * @category Visualization DeckGL
  71911. * @classdesc Deckgl 高效率图层,该图图层为综合图层,通过该图层可创建 高效率点图层、路径图层(线图层)、高效率面图层、曲线图层、
  71912. * 正六边形图层(蜂巢图层)、网格图层,只需给定相依配置,因此,在创建图层之前,请仔细阅读参数配置。
  71913. * @param {string} layerTypeID - 高效率图层类型 ID,包括 "scatter-plot" 高效率点图层、"path-layer" 路径图层(线图层)、
  71914. * "polygon-layer" 高效率面图层、 "arc-layer" 曲线图层、"hexagon-layer" 正六边形图层(蜂巢图层)、"screen-grid-layer" 网格图层。
  71915. * @param {Object} options - 图层配置项,包括以下参数:
  71916. * @param {Array.<GeoJSONObject>} options.data - 图层数据,支持 GeoJSON 规范数据类型。
  71917. * @param {Object} options.callback - deckgl 图层回调函数配置项。
  71918. * @param {Object} options.props - deckgl 图层配置项, 在该参数下配置图层配置项:
  71919. * @param {boolean} options.props.coverage - "hexagon-layer" 配置项:六边形半径乘数,介于0 - 1之间。六边形的最终半径通过覆盖半径计算。 注意:覆盖范围不会影响分数的分配方式。 分配方式的半径仅由半径属性确定;
  71920. * @param {boolean} options.props.hexagonAggregator - "hexagon-layer" 配置项:* @param {boolean}
  71921. * options.props.lightSettings - 公共配置项:光照,包含以下几个配置;
  71922. * @param {Array} options.props.lightSettings.lightsPosition - 光照配置项:指定为`[x,y,z]`的光在平面阵列中的位置`, 在一个平面阵列。 长度应该是 `3 x numberOfLights`。
  71923. * @param {Array} options.props.lightSettings.lightsStrength - 光照配置项:平面阵列中指定为“[x,y]`的灯的强度。 长度应该是`2 x numberOfLights`。
  71924. * @param {number} [options.props.lightSettings.numberOfLights=1] - 光照配置项:光照值,最大值为 `5`。
  71925. * @param {number} [options.props.lightSettings.coordinateSystem=COORDINATE_SYSTEM.LNGLAT] - 光照配置项:指定灯位置的坐标系。
  71926. * @param {number} [options.props.lightSettings.coordinateOrigin=[0, 0, 0]] - 光照配置项:指定灯位置的坐标原点。
  71927. * @param {number} [options.props.lightSettings.modelMatrix] - 光照配置项:光位置的变换矩阵。
  71928. * @param {number} [options.props.lightSettings.ambientRatio=0.4] - 光照配置项:光照的环境比例。
  71929. * @param {number} [options.props.lightSettings.diffuseRatio=0.6] - 光照配置项:光的漫反射率。
  71930. * @param {number} [options.props.lightSettings.specularRatio=0.8] - 光照配置项:光的镜面反射率。
  71931. * @param {Object} [options.layerId] - DeckglLayer 图层 Dom 元素 ID。默认使用 CommonUtil.createUniqueID("graphicLayer_" + this.layerTypeID + "_") 创建专题图层 ID。
  71932. * @param {number} [options.props.opacity=1] - 公共配置项:图层透明度。
  71933. * @param {boolean} [options.props.pickable=false] - 公共配置项:是否响应鼠标事件(鼠标点击,鼠标滑动)。
  71934. * @param {function} [options.props.autoHighlight=false] - 公共配置项:鼠标滑动高亮要素。
  71935. * @param {function} [options.props.highlightColor=[0, 0, 128, 128]] - 公共配置项:鼠标滑动高亮颜色。
  71936. * @param {function} [options.props.onClick] - 公共配置项:鼠标点击事件。
  71937. * @param {function} [options.props.onHover] - 公共配置项:鼠标滑动事件。
  71938. * @param {number} [options.props.radiusScale=1] - "scatter-plot" 配置项:散点半径比例。
  71939. * @param {boolean} [options.props.outline=false] - "scatter-plot" 配置项:是否边线显示。
  71940. * @param {number} [options.props.strokeWidth=1] - "scatter-plot" 配置项:边线宽度。
  71941. * @param {number} [options.props.radiusMinPixels=0] - "scatter-plot" 配置项:半径最小像素值。
  71942. * @param {number} [options.props.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - "scatter-plot" 配置项:半径最大像素值。
  71943. * @param {boolean} [options.props.fp64=false] - "scatter-plot" 配置项:否应以高精度64位模式呈现图层。
  71944. * @param {number} [options.props.widthScale=1] - "path-layer" 配置项:线宽比例。
  71945. * @param {number} [options.props.widthMinPixels=0] - "path-layer" 配置项:线宽最小像素值。
  71946. * @param {number} [options.props.widthMaxPixels=Number.MAX_SAFE_INTEGER] - "path-layer" 配置项:线宽最大像素值。
  71947. * @param {boolean} [options.props.rounded=false] - "path-layer" 配置项:节点是否绘制为弧形。
  71948. * @param {number} [options.props.miterLimit=4] - "path-layer" 配置项:节点相对于线宽的最大范围,仅在 rounded 为 false 时有效;
  71949. * @param {boolean} [options.props.fp64=false] - "path-layer" 配置项:否应以高精度64位模式呈现图层。
  71950. * @param {boolean} [options.props.dashJustified=false] - "path-layer" 配置项:是否虚线形式显示,仅在 getDashArray() 回调函数被指定时有效。
  71951. * @param {boolean} [options.props.filled=true] - "polygon-layer" 配置项:是否填充面。
  71952. * @param {boolean} [options.props.stroked=true] - "polygon-layer" 配置项:是否绘制边线。
  71953. * @param {boolean} [options.props.extruded=false] - "polygon-layer" 配置项:是否拉伸建筑。
  71954. * @param {boolean} [options.props.wireframe=false] - "polygon-layer" 配置项:当面被拉伸为建筑时,是否描绘建筑物边线。
  71955. * @param {boolean} [options.props.elevationScale=1] - "polygon-layer" 配置项:海拔比例。
  71956. * @param {boolean} [options.props.lineWidthScale=1] - "polygon-layer" 配置项:线宽比例。
  71957. * @param {boolean} [options.props.lineWidthMinPixels=0] - "polygon-layer" 配置项:线宽最小像素值。
  71958. * @param {boolean} [options.props.lineWidthMaxPixels=Number.MAX_SAFE_INTEGER] - "polygon-layer" 配置项:线宽最大像素值。
  71959. * @param {boolean} [options.props.lineJointRounded=false] - "polygon-layer" 配置项:节点是否绘制为弧形。
  71960. * @param {boolean} [options.props.lineMiterLimit=4] - "polygon-layer" 配置项:节点相对于线宽的最大范围,仅在 lineJointRounded 为 false 时有效。
  71961. * @param {boolean} [options.props.lineDashJustified=false] - "polygon-layer" 配置项:是否虚线形式显示,仅在 getLineDashArray() 回调函数被指定时有效。
  71962. * @param {boolean} [options.props.fp64=false] - "polygon-layer" 配置项:否应以高精度64位模式呈现图层。
  71963. * @param {boolean} [options.props.fp64=false] - "arc-layer" 配置项:否应以高精度64位模式呈现图层。
  71964. * @param {boolean} [options.props.strokeWidth=1] - "arc-layer" 配置项:线宽。
  71965. * @param {boolean} [options.props.radius=1000] - "hexagon-layer" 配置项:六边形半径值。
  71966. * @param {boolean} [options.props.extruded=false] - "hexagon-layer" 配置项:是否拉伸要素。
  71967. * @param {boolean} [options.props.upperPercentile=100] - "hexagon-layer" 配置项:筛选箱并通过upperPercentile重新计算颜色。 颜色值大于upperPercentile的六边形将被隐藏。
  71968. * @param {boolean} [options.props.elevationScale=1] - "hexagon-layer" 配置项:高程乘数,实际海拔高度由 elevationScale * getElevation(d)计算。 elevationScale是一个方便的属性,可以在不更新数据的情况下缩放所有六边形。
  71969. * @param {boolean} [options.props.colorDomain=false] - "hexagon-layer" 配置项:色阶。
  71970. * @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" 配置项:色带。
  71971. */
  71972. var DeckglLayer_DeckglLayer = /*#__PURE__*/function () {
  71973. function DeckglLayer(layerTypeID, options) {
  71974. DeckglLayer_classCallCheck(this, DeckglLayer);
  71975. // Util.extend(defaultProps, options);
  71976. /**
  71977. * @member {string} mapboxgl.supermap.DeckglLayer.prototype.id
  71978. * @description 高效率点图层 id。
  71979. */
  71980. this.layerTypeID = layerTypeID;
  71981. /**
  71982. * @member {Array.<mapboxgl.supermap.Graphic>} mapboxgl.supermap.DeckglLayer.prototype.graphics
  71983. * @description 点要素对象数组。
  71984. */
  71985. this.data = [].concat(options.data);
  71986. this.props = options.props ? options.props : {};
  71987. this.callback = options.callback ? options.callback : {};
  71988. this.id = options.layerId ? options.layerId : Util_Util.createUniqueID('graphicLayer_' + this.layerTypeID + '_');
  71989. /**
  71990. * @member {boolean} [mapboxgl.supermap.DeckglLayer.prototype.visibility=true]
  71991. * @description 图层显示状态属性。
  71992. */
  71993. this.visibility = true;
  71994. }
  71995. /**
  71996. * @function mapboxgl.supermap.DeckglLayer.prototype.onAdd
  71997. * @param {mapboxgl.Map} map - Mapbox GL 地图对象。
  71998. * @returns {mapboxgl.supermap.DeckglLayer}
  71999. */
  72000. DeckglLayer_createClass(DeckglLayer, [{
  72001. key: "onAdd",
  72002. value: function onAdd(map) {
  72003. this.map = map;
  72004. if (this.canvas) {
  72005. this.mapContainer = this.map.getCanvasContainer();
  72006. this.mapContainer.appendChild(this.canvas);
  72007. return this;
  72008. } //当使用扩展的mapboxgl代码时有效
  72009. if (map.getCRS && map.getCRS() !== external_mapboxgl_default.a.CRS.EPSG3857) {
  72010. this.coordinateSystem = 3;
  72011. this.isGeographicCoordinateSystem = true;
  72012. } //创建图层容器
  72013. this._initContainer(); //创建 deckgl 图层
  72014. this._createLayerByLayerTypeID();
  72015. var mapState = this._getState();
  72016. var deckOptions = {};
  72017. for (var key in mapState) {
  72018. deckOptions[key] = mapState[key];
  72019. }
  72020. deckOptions.layers = [this.layer];
  72021. deckOptions.canvas = this.canvas;
  72022. this.deckGL = new window.DeckGL.experimental.DeckGLJS(deckOptions);
  72023. this.map.on('render', this._moveEvent.bind(this));
  72024. this.map.on('resize', this._resizeEvent.bind(this));
  72025. this._draw();
  72026. return this;
  72027. }
  72028. /**
  72029. * @function mapboxgl.supermap.DeckglLayer.prototype.remove
  72030. * @description 删除该图层。
  72031. */
  72032. }, {
  72033. key: "remove",
  72034. value: function remove() {
  72035. this.map.off('render', this._moveEvent.bind(this));
  72036. this.map.off('resize', this._resizeEvent.bind(this));
  72037. this.map.getCanvasContainer().removeChild(this.canvas);
  72038. }
  72039. /**
  72040. * @function mapboxgl.supermap.DeckglLayer.prototype.removeFromMap
  72041. * @deprecated
  72042. * @description 删除该图层。
  72043. */
  72044. }, {
  72045. key: "removeFromMap",
  72046. value: function removeFromMap() {
  72047. this.remove();
  72048. this.clear();
  72049. }
  72050. /**
  72051. * @function mapboxgl.supermap.DeckglLayer.prototype.moveTo
  72052. * @description 将图层移动到某个图层之前。
  72053. * @param {string} layerID - 待插入的图层 ID。
  72054. * @param {boolean} [before=true] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  72055. */
  72056. }, {
  72057. key: "moveTo",
  72058. value: function moveTo(layerID, before) {
  72059. var layer = document.getElementById(this.id);
  72060. before = before !== undefined ? before : true;
  72061. if (before) {
  72062. var beforeLayer = document.getElementById(layerID);
  72063. if (layer && beforeLayer) {
  72064. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  72065. }
  72066. return;
  72067. }
  72068. var nextLayer = document.getElementById(layerID);
  72069. if (layer) {
  72070. if (nextLayer.nextSibling) {
  72071. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  72072. return;
  72073. }
  72074. nextLayer.parentNode.appendChild(layer);
  72075. }
  72076. }
  72077. /**
  72078. * @function mapboxgl.supermap.DeckglLayer.prototype.setVisibility
  72079. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  72080. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  72081. */
  72082. }, {
  72083. key: "setVisibility",
  72084. value: function setVisibility(visibility) {
  72085. if (this.canvas && visibility !== this.visibility) {
  72086. this.visibility = visibility;
  72087. this.canvas.style.display = visibility ? 'block' : 'none';
  72088. }
  72089. }
  72090. /**
  72091. * @function mapboxgl.supermap.DeckglLayer.prototype.setStyle
  72092. * @description 设置图层整体样式。
  72093. * @param {Object} styleOptions - 样式对象。
  72094. * @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
  72095. * @param {number} [styleOptions.radius=10] - 点半径。
  72096. * @param {number} [styleOptions.opacity=0.8] - 不透明度。
  72097. * @param {Array} [styleOptions.highlightColor] - 高亮颜色,目前只支持 rgba 数组。
  72098. * @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
  72099. * @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值(像素)。
  72100. * @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  72101. * @param {number} [styleOptions.strokeWidth=12] - 边框大小。
  72102. * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
  72103. */
  72104. }, {
  72105. key: "setStyle",
  72106. value: function setStyle(styleOptions) {
  72107. core_Util_Util.extend(this.props, styleOptions);
  72108. this._createLayerByLayerTypeID();
  72109. this.update();
  72110. }
  72111. /**
  72112. * @function mapboxgl.supermap.DeckglLayer.prototype.setData
  72113. * @description 设置绘制的点要素数据,会覆盖之前的所有要素。
  72114. * @param {Array.<Object>} data - 点要素对象数组。
  72115. */
  72116. }, {
  72117. key: "setData",
  72118. value: function setData(data) {
  72119. this.data = this.data || [];
  72120. this.data.length = 0;
  72121. var dataTemp = !core_Util_Util.isArray(data) ? [data] : [].concat(data); //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  72122. if (!this.layer.props.data) {
  72123. this.layer.props.data = [];
  72124. }
  72125. this.layer.props.data.length = 0;
  72126. for (var i = 0; i < dataTemp.length; i++) {
  72127. this.layer.props.data.push(dataTemp[i]);
  72128. }
  72129. this.data = this.layer.props.data;
  72130. this.update();
  72131. }
  72132. /**
  72133. * @function mapboxgl.supermap.DeckglLayer.prototype.addData
  72134. * @description 添加点要素,不会覆盖之前的要素。
  72135. * @param {Array.<Object>} data - 点要素对象数组。
  72136. */
  72137. }, {
  72138. key: "addData",
  72139. value: function addData(data) {
  72140. this.data = this.data || [];
  72141. var dataTemp = !core_Util_Util.isArray(data) ? [data] : [].concat(data); //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  72142. if (!this.layer.props.data) {
  72143. this.layer.props.data = [];
  72144. }
  72145. for (var i = 0; i < dataTemp.length; i++) {
  72146. this.layer.props.data.push(dataTemp[i]);
  72147. }
  72148. this.update();
  72149. }
  72150. /**
  72151. * @function mapboxgl.supermap.DeckglLayer.prototype.update
  72152. * @description 更新图层。
  72153. */
  72154. }, {
  72155. key: "update",
  72156. value: function update() {
  72157. if (this.layer.lifecycle !== 'Awaiting state') {
  72158. var changeFlags = {
  72159. dataChanged: true,
  72160. propsChanged: true,
  72161. viewportChanged: true,
  72162. updateTriggersChanged: true
  72163. };
  72164. this.layer.setChangeFlags(changeFlags);
  72165. }
  72166. this._draw();
  72167. }
  72168. /**
  72169. * @function mapboxgl.supermap.DeckglLayer.prototype.clear
  72170. * @description 释放图层资源。
  72171. */
  72172. // todo 还有哪些资源应该被释放?
  72173. }, {
  72174. key: "clear",
  72175. value: function clear() {
  72176. this.removeData();
  72177. this.deckGL.finalize();
  72178. }
  72179. /**
  72180. * @function mapboxgl.supermap.DeckglLayer.prototype.removeData
  72181. * @description 移除所有要素。
  72182. */
  72183. }, {
  72184. key: "removeData",
  72185. value: function removeData() {
  72186. this.data.length = 0;
  72187. if (this.layer.props.data) {
  72188. this.layer.props.data.length = 0;
  72189. }
  72190. this.update();
  72191. }
  72192. }, {
  72193. key: "_draw",
  72194. value: function _draw() {
  72195. var deckOptions = this._getState();
  72196. deckOptions.layers = [this.layer];
  72197. deckOptions.canvas = this.canvas; // this.deckGL.updateLayers();
  72198. this.deckGL.setProps(deckOptions);
  72199. }
  72200. }, {
  72201. key: "_getState",
  72202. value: function _getState() {
  72203. //获取地图信息构建state
  72204. var map = this.map;
  72205. var width = parseInt(this.canvas.style.width);
  72206. var height = parseInt(this.canvas.style.height);
  72207. var center = map.getCenter();
  72208. var longitude = center.lng;
  72209. var latitude = center.lat;
  72210. var zoom = map.getZoom();
  72211. var maxZoom = map.getMaxZoom();
  72212. var pitch = map.getPitch();
  72213. var bearing = map.getBearing();
  72214. var mapViewport = {
  72215. width: width,
  72216. height: height,
  72217. longitude: longitude,
  72218. latitude: latitude,
  72219. zoom: zoom,
  72220. maxZoom: maxZoom,
  72221. pitch: pitch,
  72222. bearing: bearing
  72223. };
  72224. var state = {}; //克隆 mapViewport
  72225. for (var key in mapViewport) {
  72226. state[key] = mapViewport[key];
  72227. } //克隆 props
  72228. for (var _key in this.props) {
  72229. state[_key] = this.props[_key];
  72230. } //当使用扩展的mapboxgl代码时有效
  72231. if (map.getCRS && map.getCRS() !== external_mapboxgl_default.a.CRS.EPSG3857) {
  72232. state.coordinateSystem = this.coordinateSystem;
  72233. state.isGeographicCoordinateSystem = this.isGeographicCoordinateSystem;
  72234. } //更行数据
  72235. state.data = this.data;
  72236. return state;
  72237. }
  72238. /**
  72239. * @function mapboxgl.supermap.DeckglLayer.prototype._createLayerByLayerTypeID
  72240. * @description 判别当前创建图层类型。
  72241. * @private
  72242. */
  72243. }, {
  72244. key: "_createLayerByLayerTypeID",
  72245. value: function _createLayerByLayerTypeID() {
  72246. //统一处理公共属性:
  72247. this.props.data = this.data;
  72248. this.props.isGeographicCoordinateSystem = this.isGeographicCoordinateSystem;
  72249. this.props.coordinateSystem = this.coordinateSystem; //添加事件监听
  72250. this.props.pickable = Boolean(this.props.onClick) || Boolean(this.props.onHover); //各类型各自从 defaultProps 取出相形的参数:
  72251. if (this.layerTypeID === 'scatter-plot') {
  72252. this.props.id = 'scatter-plot';
  72253. this._createScatterPlotLayer();
  72254. } else if (this.layerTypeID === 'path-layer') {
  72255. this.props.id = 'path-layer';
  72256. this._createPathLayer();
  72257. } else if (this.layerTypeID === 'polygon-layer') {
  72258. this.props.id = 'polygon-layer';
  72259. this._createPolygonLayer();
  72260. } else if (this.layerTypeID === 'arc-layer') {
  72261. this.props.id = 'arc-layer';
  72262. this._createArcLineLayer();
  72263. } else if (this.layerTypeID === 'hexagon-layer') {
  72264. this.props.id = 'hexagon-layer';
  72265. this._createHexagonLayer();
  72266. } else {
  72267. throw new Error(this.layerTypeID + ' does not support');
  72268. }
  72269. }
  72270. /**
  72271. * @description scatter-plot
  72272. * @private
  72273. */
  72274. }, {
  72275. key: "_createScatterPlotLayer",
  72276. value: function _createScatterPlotLayer() {
  72277. //处理回调
  72278. /* this.props.getPosition = this.callback.getPosition ? this.callback.getPosition : function (point) {
  72279. if (!point) {
  72280. return [0, 0, 0];
  72281. }
  72282. return point.geometry.coordinates;
  72283. };*/
  72284. var me = this;
  72285. this.props.getPosition = this.callback.getPosition ? this.callback.getPosition : function (point) {
  72286. if (!point) {
  72287. return [0, 0, 0];
  72288. }
  72289. var lngLat = point.getLngLat();
  72290. return lngLat && [lngLat.lng, lngLat.lat, 0];
  72291. };
  72292. if (this.callback.getColor) {
  72293. this.props.getColor = this.callback.getColor ? this.callback.getColor : function (point) {
  72294. var style = point && point.getStyle();
  72295. return style && style.color || me.props.color;
  72296. };
  72297. }
  72298. if (this.callback.getRadius) {
  72299. this.props.getRadius = this.callback.getRadius ? this.callback.getRadius : function (point) {
  72300. var style = point && point.getStyle();
  72301. return style && style.radius || me.props.radius;
  72302. };
  72303. }
  72304. if (this.props.color || this.props.radius) {
  72305. this.props.updateTriggers = {};
  72306. if (this.props.radius) {
  72307. this.props.updateTriggers.getRadius = [this.props.radius];
  72308. }
  72309. if (this.props.color) {
  72310. this.props.updateTriggers.getColor = [this.props.color];
  72311. }
  72312. }
  72313. this.layer = new window.DeckGL.ScatterplotLayer(this.props);
  72314. }
  72315. /**
  72316. * @description path-layer
  72317. * @private
  72318. */
  72319. }, {
  72320. key: "_createPathLayer",
  72321. value: function _createPathLayer() {
  72322. this.props.getPath = this.callback.getPath ? this.callback.getPath : function (feature) {
  72323. return feature.geometry.coordinates;
  72324. }; //以下几个函数也可走默认值
  72325. if (this.callback.getColor) {
  72326. this.props.getColor = this.callback.getColor;
  72327. }
  72328. if (this.callback.getWidth) {
  72329. this.props.getWidth = this.callback.getWidth;
  72330. }
  72331. if (this.callback.getDashArray) {
  72332. this.props.getDashArray = this.callback.getDashArray;
  72333. }
  72334. this.layer = new window.DeckGL.PathLayer(this.props);
  72335. }
  72336. /**
  72337. * @description polygon-layer
  72338. * @private
  72339. */
  72340. }, {
  72341. key: "_createPolygonLayer",
  72342. value: function _createPolygonLayer() {
  72343. this.props.getPolygon = this.callback.getPolygon ? this.callback.getPolygon : function (feature) {
  72344. return feature.geometry.coordinates;
  72345. }; //todo 思考下真的让用户配这么多回调么,或者先判断下数据属性里面有没有配置的属性值?
  72346. if (this.callback.getElevation) {
  72347. this.props.getElevation = this.callback.getElevation;
  72348. }
  72349. if (this.callback.getFillColor) {
  72350. this.props.getFillColor = this.callback.getFillColor;
  72351. }
  72352. if (this.callback.getLineColor) {
  72353. this.props.getLineColor = this.callback.getLineColor;
  72354. }
  72355. if (this.callback.getLineWidth) {
  72356. this.props.getLineWidth = this.callback.getLineWidth;
  72357. }
  72358. this.props.updateTriggers = {};
  72359. this.props.updateTriggers.getColor = this.props.color ? this.props.color : [0, 0, 128, 128];
  72360. this.layer = new window.DeckGL.PolygonLayer(this.props);
  72361. }
  72362. /**
  72363. * @description arc-layer
  72364. * @private
  72365. */
  72366. }, {
  72367. key: "_createArcLineLayer",
  72368. value: function _createArcLineLayer() {
  72369. //todo ArcLineLayer geojson coordinates数组中只能有一个线段
  72370. this.props.getSourcePosition = this.callback.getSourcePosition ? this.callback.getSourcePosition : function (feature) {
  72371. if (!feature) {
  72372. return [0, 0, 0];
  72373. }
  72374. return feature.geometry.coordinates[0];
  72375. };
  72376. this.props.getTargetPosition = this.callback.getTargetPosition ? this.callback.getTargetPosition : function (feature) {
  72377. if (!feature) {
  72378. return [0, 0, 0];
  72379. }
  72380. return feature.geometry.coordinates[1];
  72381. };
  72382. if (this.callback.getStrokeWidth) {
  72383. this.props.getStrokeWidth = this.callback.getStrokeWidth;
  72384. }
  72385. if (this.callback.getSourceColor) {
  72386. this.props.getSourceColor = this.callback.getSourceColor;
  72387. }
  72388. if (this.callback.getTargetColor) {
  72389. this.props.getTargetColor = this.callback.getTargetColor;
  72390. }
  72391. this.layer = new window.DeckGL.ArcLayer(this.props);
  72392. }
  72393. /**
  72394. * @description hexagon-layer
  72395. * @private
  72396. */
  72397. }, {
  72398. key: "_createHexagonLayer",
  72399. value: function _createHexagonLayer() {
  72400. this.props.getPosition = this.callback.getPosition ? this.callback.getPosition : function (feature) {
  72401. if (!feature) {
  72402. return [0, 0, 0];
  72403. }
  72404. return feature.geometry.coordinates;
  72405. };
  72406. if (this.callback.getColorValue) {
  72407. this.props.getColorValue = this.callback.getColorValue;
  72408. }
  72409. if (this.callback.getElevationValue) {
  72410. this.props.getElevationValue = this.callback.getElevationValue;
  72411. }
  72412. this.layer = new window.DeckGL.HexagonLayer(this.props);
  72413. }
  72414. }, {
  72415. key: "_initContainer",
  72416. value: function _initContainer() {
  72417. this.canvas = this._createCanvas();
  72418. this.mapContainer = this.map.getCanvasContainer();
  72419. this.mapContainer.appendChild(this.canvas);
  72420. }
  72421. }, {
  72422. key: "_createCanvas",
  72423. value: function _createCanvas() {
  72424. var canvas = document.createElement('canvas');
  72425. canvas.id = this.id;
  72426. canvas.style.position = 'absolute';
  72427. canvas.style.top = 0 + 'px';
  72428. canvas.style.left = 0 + 'px';
  72429. canvas.style.cursor = '';
  72430. var map = this.map;
  72431. canvas.width = parseInt(map.getCanvas().style.width);
  72432. canvas.height = parseInt(map.getCanvas().style.height);
  72433. canvas.style.width = map.getCanvas().style.width;
  72434. canvas.style.height = map.getCanvas().style.height;
  72435. return canvas;
  72436. }
  72437. }, {
  72438. key: "_moveEvent",
  72439. value: function _moveEvent() {
  72440. this._draw();
  72441. }
  72442. }, {
  72443. key: "_resizeEvent",
  72444. value: function _resizeEvent() {
  72445. var canvas = this.canvas;
  72446. var map = this.map;
  72447. canvas.width = parseInt(map.getCanvas().style.width);
  72448. canvas.height = parseInt(map.getCanvas().style.height);
  72449. canvas.style.width = map.getCanvas().style.width;
  72450. canvas.style.height = map.getCanvas().style.height;
  72451. this._draw();
  72452. }
  72453. }]);
  72454. return DeckglLayer;
  72455. }();
  72456. external_mapboxgl_default.a.supermap.DeckglLayer = DeckglLayer_DeckglLayer;
  72457. // CONCATENATED MODULE: ./src/mapboxgl/overlay/mapv/MapvDataSet.js
  72458. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  72459. * This program are made available under the terms of the Apache License, Version 2.0
  72460. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72461. var MapvDataSet = {
  72462. /**
  72463. * 返回mapv点数据集
  72464. */
  72465. getPoint: function getPoint(center) {
  72466. if (center && center instanceof Array) {
  72467. return new external_function_try_return_mapv_catch_e_return_["DataSet"]([{
  72468. geometry: {
  72469. type: 'Point',
  72470. coordinates: center
  72471. }
  72472. }]);
  72473. }
  72474. },
  72475. /**
  72476. * 返回mapv多点数据集
  72477. */
  72478. getPoints: function getPoints(points) {
  72479. if (points && points instanceof Array) {
  72480. var mPoints = [];
  72481. points.map(function (data) {
  72482. mPoints.push({
  72483. geometry: {
  72484. type: 'Point',
  72485. coordinates: data.geometry.coordinates
  72486. }
  72487. });
  72488. return data;
  72489. });
  72490. return new external_function_try_return_mapv_catch_e_return_["DataSet"](mPoints);
  72491. }
  72492. },
  72493. /**
  72494. * 返回mapv弧形线数据集
  72495. */
  72496. getCurveLines: function getCurveLines(startPoint, LinePoints) {
  72497. if (startPoint && startPoint instanceof Array && LinePoints && LinePoints instanceof Array) {
  72498. var lineData = [];
  72499. LinePoints.map(function (data) {
  72500. var coords = data.geometry && data.geometry.coordinates;
  72501. var toCenter = {
  72502. lng: coords[0],
  72503. lat: coords[1]
  72504. };
  72505. var fromCenter = {
  72506. lng: startPoint[0],
  72507. lat: startPoint[1]
  72508. };
  72509. var cv = external_function_try_return_mapv_catch_e_return_["utilCurve"].getPoints([fromCenter, toCenter]);
  72510. lineData.push({
  72511. geometry: {
  72512. type: 'LineString',
  72513. coordinates: cv
  72514. }
  72515. });
  72516. return data;
  72517. });
  72518. return new external_function_try_return_mapv_catch_e_return_["DataSet"](lineData);
  72519. }
  72520. },
  72521. /**
  72522. * 返回mapv弧形动态点数据集
  72523. */
  72524. getCurveDynamicPoints: function getCurveDynamicPoints(center, endPoints) {
  72525. if (center && center instanceof Array && endPoints && endPoints instanceof Array) {
  72526. var timeData = [];
  72527. endPoints.map(function (data) {
  72528. var coords = data.geometry && data.geometry.coordinates;
  72529. var toCenter = {
  72530. lng: coords[0],
  72531. lat: coords[1]
  72532. };
  72533. var fromCenter = {
  72534. lng: center[0],
  72535. lat: center[1]
  72536. };
  72537. var cv = external_function_try_return_mapv_catch_e_return_["utilCurve"].getPoints([fromCenter, toCenter]);
  72538. for (var j = 0; j < cv.length; j++) {
  72539. timeData.push({
  72540. geometry: {
  72541. type: 'Point',
  72542. coordinates: cv[j]
  72543. },
  72544. time: j
  72545. });
  72546. }
  72547. return data;
  72548. });
  72549. return new external_function_try_return_mapv_catch_e_return_["DataSet"](timeData);
  72550. }
  72551. }
  72552. };
  72553. external_mapboxgl_default.a.supermap.MapvDataSet = MapvDataSet;
  72554. // CONCATENATED MODULE: ./src/mapboxgl/overlay/mapv/MapExtend.js
  72555. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  72556. * This program are made available under the terms of the Apache License, Version 2.0
  72557. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72558. external_mapboxgl_default.a.supermap = external_mapboxgl_default.a.supermap || {};
  72559. external_mapboxgl_default.a.supermap.map = external_mapboxgl_default.a.supermap.map || {};
  72560. var getDefaultVectorTileStyle = function getDefaultVectorTileStyle(urlTemplate, options) {
  72561. options = options || {};
  72562. var defaultOptions = {};
  72563. defaultOptions.version = options.version || 8;
  72564. defaultOptions.layers = options.layers || [];
  72565. defaultOptions.light = options.light || {
  72566. "anchor": "viewport",
  72567. "color": "#fcf6ef",
  72568. "intensity": 0.5,
  72569. "position": [1.15, 201, 20]
  72570. };
  72571. var style = {
  72572. "version": defaultOptions.version,
  72573. "sources": {
  72574. "vector-tiles": {
  72575. "type": "vector",
  72576. "tiles": [urlTemplate]
  72577. }
  72578. },
  72579. "layers": defaultOptions.layers,
  72580. "light": defaultOptions.light
  72581. };
  72582. if (options.sprite != null) {
  72583. style.sprite = options.sprite;
  72584. }
  72585. if (options.glyphs != null) {
  72586. style.glyphs = options.glyphs;
  72587. }
  72588. return style;
  72589. };
  72590. var setBackground = function setBackground(map, color) {
  72591. if (color && map) {
  72592. map.addLayer({
  72593. "id": "background",
  72594. "type": "background",
  72595. "paint": {
  72596. "background-color": color
  72597. }
  72598. }, "background");
  72599. }
  72600. };
  72601. var setPaintProperty = function setPaintProperty(map, layerIds, type, paint, source, sourceLayers) {
  72602. if (layerIds && map) {
  72603. if (Object.prototype.toString.call(layerIds) !== '[object Array]') {
  72604. layerIds = [layerIds];
  72605. }
  72606. for (var i = 0; i < layerIds.length; i++) {
  72607. var sourceLayer = sourceLayers ? sourceLayers[i] : null;
  72608. var layer = MapExtend_getLayer(layerIds[i], type, source, sourceLayer, paint);
  72609. map.addLayer(layer, layerIds[i]);
  72610. map.moveLayer(layerIds[i]);
  72611. }
  72612. }
  72613. };
  72614. function MapExtend_getLayer(id, type, source, sourceLayer, paint) {
  72615. var sourceType = source || "vector-tiles";
  72616. var sLayer = sourceLayer || id;
  72617. var layer = {
  72618. "id": id,
  72619. "type": type,
  72620. "source": sourceType,
  72621. "source-layer": sLayer,
  72622. "paint": paint
  72623. };
  72624. return layer;
  72625. }
  72626. external_mapboxgl_default.a.supermap.map.getDefaultVectorTileStyle = getDefaultVectorTileStyle;
  72627. external_mapboxgl_default.a.supermap.map.setBackground = setBackground;
  72628. external_mapboxgl_default.a.supermap.map.setPaintProperty = setPaintProperty;
  72629. // CONCATENATED MODULE: ./src/mapboxgl/overlay/mapv/index.js
  72630. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  72631. * This program are made available under the terms of the Apache License, Version 2.0
  72632. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72633. // CONCATENATED MODULE: ./src/mapboxgl/overlay/theme/index.js
  72634. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  72635. * This program are made available under the terms of the Apache License, Version 2.0
  72636. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72637. // CONCATENATED MODULE: ./src/mapboxgl/overlay/index.js
  72638. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  72639. * This program are made available under the terms of the Apache License, Version 2.0
  72640. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72641. // CONCATENATED MODULE: ./src/mapboxgl/services/ServiceBase.js
  72642. 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); }
  72643. function ServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  72644. 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); }
  72645. function ServiceBase_setPrototypeOf(o, p) { ServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ServiceBase_setPrototypeOf(o, p); }
  72646. 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); }; }
  72647. function ServiceBase_possibleConstructorReturn(self, call) { if (call && (ServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return ServiceBase_assertThisInitialized(self); }
  72648. function ServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  72649. 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; } }
  72650. function ServiceBase_getPrototypeOf(o) { ServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ServiceBase_getPrototypeOf(o); }
  72651. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  72652. * This program are made available under the terms of the Apache License, Version 2.0
  72653. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72654. /**
  72655. * @class mapboxgl.supermap.ServiceBase
  72656. * @category iServer
  72657. * @description mapboxgl.supermap 服务基类。
  72658. * @param {string} url - 与客户端交互的服务地址。
  72659. * @param {Object} options - 可选参数。
  72660. * @param {string} [options.proxy] - 服务代理地址。
  72661. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  72662. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  72663. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  72664. * @param {Object} [options.headers] - 请求头。
  72665. * @fires mapboxgl.supermap.ServiceBase#initialized
  72666. */
  72667. var ServiceBase = /*#__PURE__*/function (_mapboxgl$Evented) {
  72668. ServiceBase_inherits(ServiceBase, _mapboxgl$Evented);
  72669. var _super = ServiceBase_createSuper(ServiceBase);
  72670. function ServiceBase(url, options) {
  72671. var _this;
  72672. ServiceBase_classCallCheck(this, ServiceBase);
  72673. _this = _super.call(this);
  72674. _this.options = options || {};
  72675. _this.url = url;
  72676. /**
  72677. * @event mapboxgl.supermap.ServiceBase#initialized
  72678. * @description 构造函数构造成功之后触发。
  72679. * @property {Object} this - this 对象。
  72680. */
  72681. _this.fire('initialized', ServiceBase_assertThisInitialized(_this));
  72682. return _this;
  72683. }
  72684. return ServiceBase;
  72685. }(external_mapboxgl_default.a.Evented);
  72686. external_mapboxgl_default.a.supermap.ServiceBase = ServiceBase;
  72687. // CONCATENATED MODULE: ./src/mapboxgl/services/AddressMatchService.js
  72688. 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); }
  72689. function services_AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  72690. 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); } }
  72691. function services_AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_AddressMatchService_defineProperties(Constructor, staticProps); return Constructor; }
  72692. 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); }
  72693. 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); }
  72694. 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); }; }
  72695. function services_AddressMatchService_possibleConstructorReturn(self, call) { if (call && (services_AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_AddressMatchService_assertThisInitialized(self); }
  72696. function services_AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  72697. 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; } }
  72698. 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); }
  72699. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  72700. * This program are made available under the terms of the Apache License, Version 2.0
  72701. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72702. /**
  72703. * @class mapboxgl.supermap.AddressMatchService
  72704. * @category iServer AddressMatch
  72705. * @classdesc 地址匹配服务。
  72706. * @example
  72707. * new mapboxgl.supermap.AddressMatchService(url,options)
  72708. * .code(function(result){
  72709. * //doSomething
  72710. * })
  72711. * @param {string} url - 与客户端交互的服务地址。
  72712. * @param {Object} options - 交互时所需可选参数。
  72713. * @param {string} [options.proxy] - 服务代理地址。
  72714. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  72715. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  72716. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  72717. * @param {Object} [options.headers] - 请求头。
  72718. * @extends {mapboxgl.supermap.ServiceBase}
  72719. */
  72720. var services_AddressMatchService_AddressMatchService = /*#__PURE__*/function (_ServiceBase) {
  72721. services_AddressMatchService_inherits(AddressMatchService, _ServiceBase);
  72722. var _super = services_AddressMatchService_createSuper(AddressMatchService);
  72723. function AddressMatchService(url, options) {
  72724. services_AddressMatchService_classCallCheck(this, AddressMatchService);
  72725. return _super.call(this, url, options);
  72726. }
  72727. /**
  72728. * @function mapboxgl.supermap.AddressMatchService.prototype.code
  72729. * @description 获取正向地址匹配结果。
  72730. * @param {Object} params - 正向匹配参数。
  72731. * @param {RequestCallback} callback - 请求结果的回调函数。
  72732. */
  72733. services_AddressMatchService_createClass(AddressMatchService, [{
  72734. key: "code",
  72735. value: function code(params, callback) {
  72736. var me = this;
  72737. var addressMatchService = new AddressMatchService_AddressMatchService(me.url, {
  72738. proxy: me.options.proxy,
  72739. withCredentials: me.options.withCredentials,
  72740. crossOrigin: me.options.crossOrigin,
  72741. headers: me.options.headers,
  72742. serverType: me.options.serverType,
  72743. eventListeners: {
  72744. scope: me,
  72745. processCompleted: callback,
  72746. processFailed: callback
  72747. }
  72748. });
  72749. addressMatchService.code(Util_Util.urlPathAppend(me.url, 'geocoding'), params);
  72750. }
  72751. /**
  72752. * @function mapboxgl.supermap.AddressMatchService.prototype.decode
  72753. * @description 获取反向地址匹配结果。
  72754. * @param {Object} params -反向匹配参数。
  72755. * @param {RequestCallback} callback - 请求结果的回调函数。
  72756. */
  72757. }, {
  72758. key: "decode",
  72759. value: function decode(params, callback) {
  72760. var me = this;
  72761. var addressMatchService = new AddressMatchService_AddressMatchService(me.url, {
  72762. proxy: me.options.proxy,
  72763. withCredentials: me.options.withCredentials,
  72764. crossOrigin: me.options.crossOrigin,
  72765. headers: me.options.headers,
  72766. serverType: me.options.serverType,
  72767. eventListeners: {
  72768. scope: me,
  72769. processCompleted: callback,
  72770. processFailed: callback
  72771. }
  72772. });
  72773. addressMatchService.decode(Util_Util.urlPathAppend(me.url, 'geodecoding'), params);
  72774. }
  72775. }]);
  72776. return AddressMatchService;
  72777. }(ServiceBase);
  72778. external_mapboxgl_default.a.supermap.AddressMatchService = services_AddressMatchService_AddressMatchService;
  72779. // CONCATENATED MODULE: ./src/mapboxgl/services/ChartService.js
  72780. 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); }
  72781. function ChartService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  72782. 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); } }
  72783. function ChartService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartService_defineProperties(Constructor, staticProps); return Constructor; }
  72784. 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); }
  72785. function ChartService_setPrototypeOf(o, p) { ChartService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartService_setPrototypeOf(o, p); }
  72786. 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); }; }
  72787. function ChartService_possibleConstructorReturn(self, call) { if (call && (ChartService_typeof(call) === "object" || typeof call === "function")) { return call; } return ChartService_assertThisInitialized(self); }
  72788. function ChartService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  72789. 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; } }
  72790. function ChartService_getPrototypeOf(o) { ChartService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartService_getPrototypeOf(o); }
  72791. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  72792. * This program are made available under the terms of the Apache License, Version 2.0
  72793. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72794. /**
  72795. * @class mapboxgl.supermap.ChartService
  72796. * @category iServer Map Chart
  72797. * @classdesc 海图服务。
  72798. * @extends {mapboxgl.supermap.ServiceBase}
  72799. * @example
  72800. * new mapboxgl.supermap.ChartService(url)
  72801. * .queryChart(param,function(result){
  72802. * //doSomething
  72803. * })
  72804. * @param {string} url - 与客户端交互的海图服务地址。
  72805. * @param {Object} options - 交互时所需可选参数。
  72806. * @param {string} [options.proxy] - 服务代理地址。
  72807. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  72808. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  72809. * @param {Object} [options.headers] - 请求头。
  72810. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  72811. */
  72812. var ChartService_ChartService = /*#__PURE__*/function (_ServiceBase) {
  72813. ChartService_inherits(ChartService, _ServiceBase);
  72814. var _super = ChartService_createSuper(ChartService);
  72815. function ChartService(url, options) {
  72816. ChartService_classCallCheck(this, ChartService);
  72817. return _super.call(this, url, options);
  72818. }
  72819. /**
  72820. * @function mapboxgl.supermap.ChartService.prototype.queryChart
  72821. * @description 查询海图服务。
  72822. * @param {SuperMap.ChartQueryParameters} params - 海图查询所需参数类。
  72823. * @param {RequestCallback} callback 回调函数。
  72824. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果格式类型。
  72825. */
  72826. ChartService_createClass(ChartService, [{
  72827. key: "queryChart",
  72828. value: function queryChart(params, callback, resultFormat) {
  72829. var me = this,
  72830. param = me._processParams(params),
  72831. format = me._processFormat(resultFormat);
  72832. var chartQueryService = new ChartQueryService_ChartQueryService(me.url, {
  72833. proxy: me.options.proxy,
  72834. withCredentials: me.options.withCredentials,
  72835. crossOrigin: me.options.crossOrigin,
  72836. headers: me.options.headers,
  72837. serverType: me.options.serverType,
  72838. eventListeners: {
  72839. scope: me,
  72840. processCompleted: callback,
  72841. processFailed: callback
  72842. },
  72843. format: format
  72844. });
  72845. chartQueryService.processAsync(param);
  72846. }
  72847. /**
  72848. * @function mapboxgl.supermap.ChartService.prototype.getChartFeatureInfo
  72849. * @description 获取海图物标信息服务。
  72850. * @param {RequestCallback} callback 回调函数。
  72851. */
  72852. }, {
  72853. key: "getChartFeatureInfo",
  72854. value: function getChartFeatureInfo(callback) {
  72855. var me = this,
  72856. url = me.url.concat();
  72857. url = Util_Util.urlPathAppend(url, 'chartFeatureInfoSpecs');
  72858. var chartFeatureInfoSpecsService = new ChartFeatureInfoSpecsService_ChartFeatureInfoSpecsService(url, {
  72859. proxy: me.options.proxy,
  72860. withCredentials: me.options.withCredentials,
  72861. crossOrigin: me.options.crossOrigin,
  72862. headers: me.options.headers,
  72863. serverType: me.options.serverType,
  72864. eventListeners: {
  72865. scope: me,
  72866. processCompleted: callback,
  72867. processFailed: callback
  72868. }
  72869. });
  72870. chartFeatureInfoSpecsService.processAsync();
  72871. }
  72872. }, {
  72873. key: "_processParams",
  72874. value: function _processParams(params) {
  72875. if (!params) {
  72876. return {};
  72877. }
  72878. params.returnContent = params.returnContent == null ? true : params.returnContent;
  72879. if (params.filter) {
  72880. params.chartQueryFilterParameters = core_Util_Util.isArray(params.filter) ? params.filter : [params.filter];
  72881. }
  72882. if (params.bounds) {
  72883. if (params.bounds instanceof Array) {
  72884. params.bounds = new Bounds_Bounds(params.bounds[0], params.bounds[1], params.bounds[2], params.bounds[3]);
  72885. }
  72886. if (params.bounds instanceof external_mapboxgl_default.a.LngLatBounds) {
  72887. params.bounds = new Bounds_Bounds(params.bounds.getSouthWest().lng, params.bounds.getSouthWest().lat, params.bounds.getNorthEast().lng, params.bounds.getNorthEast().lat);
  72888. }
  72889. }
  72890. }
  72891. }, {
  72892. key: "_processFormat",
  72893. value: function _processFormat(resultFormat) {
  72894. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  72895. }
  72896. }]);
  72897. return ChartService;
  72898. }(ServiceBase);
  72899. external_mapboxgl_default.a.supermap.ChartService = ChartService_ChartService;
  72900. // CONCATENATED MODULE: ./src/mapboxgl/services/DataFlowService.js
  72901. 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); }
  72902. function services_DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  72903. 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); } }
  72904. function services_DataFlowService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_DataFlowService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_DataFlowService_defineProperties(Constructor, staticProps); return Constructor; }
  72905. 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); }
  72906. 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); }
  72907. 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); }; }
  72908. function services_DataFlowService_possibleConstructorReturn(self, call) { if (call && (services_DataFlowService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_DataFlowService_assertThisInitialized(self); }
  72909. function services_DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  72910. 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; } }
  72911. 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); }
  72912. /* Copyright© 2000 - 2020 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. /**
  72916. * @class mapboxgl.supermap.DataFlowService
  72917. * @category iServer DataFlow
  72918. * @classdesc 数据流服务。
  72919. * @extends {mapboxgl.supermap.ServiceBase}
  72920. * @example
  72921. * new mapboxgl.supermap.DataFlowService(url)
  72922. * .queryChart(param,function(result){
  72923. * //doSomething
  72924. * })
  72925. * @param {string} url - 与客户端交互的实时数据服务地址。
  72926. * @param {Object} options - 加载实时数据可选参数。
  72927. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  72928. * @param {Object} [options.excludeField] - 排除字段。
  72929. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  72930. * @param {Object} [options.headers] - 请求头。
  72931. * @fires mapboxgl.supermap.DataFlowService#broadcastSocketConnected
  72932. * @fires mapboxgl.supermap.DataFlowService#broadcastSocketError
  72933. * @fires mapboxgl.supermap.DataFlowService#broadcastFailed
  72934. * @fires mapboxgl.supermap.DataFlowService#broadcastSucceeded
  72935. * @fires mapboxgl.supermap.DataFlowService#subscribeSocketError
  72936. * @fires mapboxgl.supermap.DataFlowService#messageSucceeded
  72937. * @fires mapboxgl.supermap.DataFlowService#setFilterParamSucceeded
  72938. */
  72939. var services_DataFlowService_DataFlowService = /*#__PURE__*/function (_ServiceBase) {
  72940. services_DataFlowService_inherits(DataFlowService, _ServiceBase);
  72941. var _super = services_DataFlowService_createSuper(DataFlowService);
  72942. function DataFlowService(url, options) {
  72943. var _this;
  72944. services_DataFlowService_classCallCheck(this, DataFlowService);
  72945. options = options || {};
  72946. if (options.projection) {
  72947. options.prjCoordSys = options.projection;
  72948. }
  72949. _this = _super.call(this, url, options);
  72950. _this.dataFlow = new DataFlowService_DataFlowService(url, options);
  72951. /**
  72952. * @event mapboxgl.supermap.DataFlowService#broadcastSocketConnected
  72953. * @description broadcast Socket 连接成功。
  72954. */
  72955. /**
  72956. * @event mapboxgl.supermap.DataFlowService#broadcastSocketError
  72957. * @description broadcast Socket 连接失败。
  72958. */
  72959. /**
  72960. * @event mapboxgl.supermap.DataFlowService#broadcastFailed
  72961. * @description 广播失败。
  72962. */
  72963. /**
  72964. * @event mapboxgl.supermap.DataFlowService#broadcastSucceeded
  72965. * @description 广播成功。
  72966. */
  72967. /**
  72968. * @event mapboxgl.supermap.DataFlowService#subscribeSocketConnected
  72969. * @description 订阅数据连接成功。
  72970. */
  72971. /**
  72972. * @event mapboxgl.supermap.DataFlowService#subscribeSocketError
  72973. * @description 订阅数据连接失败。
  72974. */
  72975. /**
  72976. * @event mapboxgl.supermap.DataFlowService#messageSucceeded
  72977. * @description 获取信息成功。
  72978. */
  72979. /**
  72980. * @event mapboxgl.supermap.DataFlowService#setFilterParamSucceeded
  72981. * @description 设置过滤参数成功。
  72982. */
  72983. _this.dataFlow.events.on({
  72984. "broadcastSocketConnected": _this._defaultEvent,
  72985. "broadcastSocketError": _this._defaultEvent,
  72986. "broadcastFailed": _this._defaultEvent,
  72987. "broadcastSucceeded": _this._defaultEvent,
  72988. "subscribeSocketConnected": _this._defaultEvent,
  72989. "subscribeSocketError": _this._defaultEvent,
  72990. "messageSucceeded": _this._defaultEvent,
  72991. "setFilterParamSucceeded": _this._defaultEvent,
  72992. scope: services_DataFlowService_assertThisInitialized(_this)
  72993. });
  72994. var me = services_DataFlowService_assertThisInitialized(_this);
  72995. me.on('subscribeSocketConnected', function (e) {
  72996. /**
  72997. * @event mapboxgl.supermap.DataFlowService#subscribesucceeded
  72998. * @description 数据流服务订阅成功后触发。
  72999. * @property {Object} e - 事件对象。
  73000. */
  73001. me.fire('subscribesucceeded', e);
  73002. });
  73003. return _this;
  73004. }
  73005. /**
  73006. * @function mapboxgl.supermap.DataFlowService.prototype.initBroadcast
  73007. * @description 初始化广播。
  73008. * @returns {mapboxgl.supermap.DataFlowService}
  73009. */
  73010. services_DataFlowService_createClass(DataFlowService, [{
  73011. key: "initBroadcast",
  73012. value: function initBroadcast() {
  73013. this.dataFlow.initBroadcast();
  73014. return this;
  73015. }
  73016. /**
  73017. * @function mapboxgl.supermap.DataFlowService.prototype.broadcast
  73018. * @description 加载广播数据。
  73019. * @param {JSON} obj - JSON 格式的要素数据。
  73020. */
  73021. }, {
  73022. key: "broadcast",
  73023. value: function broadcast(obj) {
  73024. this.dataFlow.broadcast(obj);
  73025. }
  73026. /**
  73027. * @function mapboxgl.supermap.DataFlowService.prototype.initSubscribe
  73028. * @description 初始化订阅数据。
  73029. */
  73030. }, {
  73031. key: "initSubscribe",
  73032. value: function initSubscribe() {
  73033. this.dataFlow.initSubscribe();
  73034. return this;
  73035. }
  73036. /**
  73037. * @function mapboxgl.supermap.DataFlowService.prototype.setExcludeField
  73038. * @description 设置排除字段。
  73039. * @param {Object} excludeField - 排除字段。
  73040. */
  73041. }, {
  73042. key: "setExcludeField",
  73043. value: function setExcludeField(excludeField) {
  73044. this.dataFlow.setExcludeField(excludeField);
  73045. this.options.excludeField = excludeField;
  73046. return this;
  73047. }
  73048. /**
  73049. * @function mapboxgl.supermap.DataFlowService.prototype.setGeometry
  73050. * @description 设置添加的几何要素数据。
  73051. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  73052. */
  73053. }, {
  73054. key: "setGeometry",
  73055. value: function setGeometry(geometry) {
  73056. this.dataFlow.setGeometry(geometry);
  73057. this.options.geometry = geometry;
  73058. return this;
  73059. }
  73060. /**
  73061. * @function mapboxgl.supermap.DataFlowService.prototype.unSubscribe
  73062. * @description 结束订阅数据。
  73063. */
  73064. }, {
  73065. key: "unSubscribe",
  73066. value: function unSubscribe() {
  73067. this.dataFlow.unSubscribe();
  73068. }
  73069. /**
  73070. * @function mapboxgl.supermap.DataFlowService.prototype.unBroadcast
  73071. * @description 结束加载广播。
  73072. */
  73073. }, {
  73074. key: "unBroadcast",
  73075. value: function unBroadcast() {
  73076. this.dataFlow.unBroadcast();
  73077. }
  73078. }, {
  73079. key: "_defaultEvent",
  73080. value: function _defaultEvent(e) {
  73081. this.fire(e.eventType || e.type, e);
  73082. }
  73083. }]);
  73084. return DataFlowService;
  73085. }(ServiceBase);
  73086. external_mapboxgl_default.a.supermap.DataFlowService = services_DataFlowService_DataFlowService;
  73087. // CONCATENATED MODULE: ./src/mapboxgl/services/FeatureService.js
  73088. 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); }
  73089. function FeatureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73090. 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); } }
  73091. function FeatureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FeatureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FeatureService_defineProperties(Constructor, staticProps); return Constructor; }
  73092. 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); }
  73093. function FeatureService_setPrototypeOf(o, p) { FeatureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FeatureService_setPrototypeOf(o, p); }
  73094. 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); }; }
  73095. function FeatureService_possibleConstructorReturn(self, call) { if (call && (FeatureService_typeof(call) === "object" || typeof call === "function")) { return call; } return FeatureService_assertThisInitialized(self); }
  73096. function FeatureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73097. 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; } }
  73098. function FeatureService_getPrototypeOf(o) { FeatureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FeatureService_getPrototypeOf(o); }
  73099. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  73100. * This program are made available under the terms of the Apache License, Version 2.0
  73101. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73102. /**
  73103. * @class mapboxgl.supermap.FeatureService
  73104. * @category iServer Data Feature
  73105. * @classdesc 要素数据集类。提供:ID 查询,范围查询,SQL 查询,几何查询,bounds 查询,缓冲区查询,地物编辑。
  73106. * @example
  73107. * new mapboxgl.supermap.FeatureService(url)
  73108. * .getFeaturesByIDs(param,function(result){
  73109. * //doSomething
  73110. * })
  73111. * @extends {mapboxgl.supermap.ServiceBase}
  73112. * @param {string} url - 要素数据集服务地址。
  73113. * @param {Object} options - 创建要素数据集服务类可选参数。
  73114. * @param {string} [options.proxy] - 服务代理地址。
  73115. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  73116. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  73117. * @param {Object} [options.headers] - 请求头。
  73118. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  73119. */
  73120. var FeatureService_FeatureService = /*#__PURE__*/function (_ServiceBase) {
  73121. FeatureService_inherits(FeatureService, _ServiceBase);
  73122. var _super = FeatureService_createSuper(FeatureService);
  73123. function FeatureService(url, options) {
  73124. FeatureService_classCallCheck(this, FeatureService);
  73125. return _super.call(this, url, options);
  73126. }
  73127. /**
  73128. * @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByIDs
  73129. * @description 数据集 ID 查询服务。
  73130. * @param {SuperMap.GetFeaturesByIDsParameters} params - 查询所需参数类。
  73131. * @param {RequestCallback} callback - 回调函数。
  73132. * @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  73133. */
  73134. FeatureService_createClass(FeatureService, [{
  73135. key: "getFeaturesByIDs",
  73136. value: function getFeaturesByIDs(params, callback, resultFormat) {
  73137. var me = this;
  73138. var getFeaturesByIDsService = new GetFeaturesByIDsService_GetFeaturesByIDsService(me.url, {
  73139. proxy: me.options.proxy,
  73140. withCredentials: me.options.withCredentials,
  73141. crossOrigin: me.options.crossOrigin,
  73142. headers: me.options.headers,
  73143. serverType: me.options.serverType,
  73144. eventListeners: {
  73145. processCompleted: callback,
  73146. processFailed: callback
  73147. },
  73148. format: me._processFormat(resultFormat)
  73149. });
  73150. getFeaturesByIDsService.processAsync(me._processParams(params));
  73151. }
  73152. /**
  73153. * @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByBounds
  73154. * @description 数据集 Bounds 查询服务。
  73155. * @param {SuperMap.GetFeaturesByBoundsParameters} params - 查询所需参数类。
  73156. * @param {RequestCallback} callback - 回调函数。
  73157. * @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  73158. */
  73159. }, {
  73160. key: "getFeaturesByBounds",
  73161. value: function getFeaturesByBounds(params, callback, resultFormat) {
  73162. var me = this;
  73163. var getFeaturesByBoundsService = new GetFeaturesByBoundsService_GetFeaturesByBoundsService(me.url, {
  73164. proxy: me.options.proxy,
  73165. withCredentials: me.options.withCredentials,
  73166. crossOrigin: me.options.crossOrigin,
  73167. headers: me.options.headers,
  73168. serverType: me.options.serverType,
  73169. eventListeners: {
  73170. processCompleted: callback,
  73171. processFailed: callback
  73172. },
  73173. format: me._processFormat(resultFormat)
  73174. });
  73175. getFeaturesByBoundsService.processAsync(me._processParams(params));
  73176. }
  73177. /**
  73178. * @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByBuffer
  73179. * @description 数据集 Buffer 查询服务。
  73180. * @param {SuperMap.GetFeaturesByBufferParameters} params - 查询所需参数类。
  73181. * @param {RequestCallback} callback 回调函数。
  73182. * @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  73183. */
  73184. }, {
  73185. key: "getFeaturesByBuffer",
  73186. value: function getFeaturesByBuffer(params, callback, resultFormat) {
  73187. var me = this;
  73188. var getFeatureService = new GetFeaturesByBufferService_GetFeaturesByBufferService(me.url, {
  73189. proxy: me.options.proxy,
  73190. withCredentials: me.options.withCredentials,
  73191. crossOrigin: me.options.crossOrigin,
  73192. headers: me.options.headers,
  73193. serverType: me.options.serverType,
  73194. eventListeners: {
  73195. processCompleted: callback,
  73196. processFailed: callback
  73197. },
  73198. format: me._processFormat(resultFormat)
  73199. });
  73200. getFeatureService.processAsync(me._processParams(params));
  73201. }
  73202. /**
  73203. * @function mapboxgl.supermap.FeatureService.prototype.getFeaturesBySQL
  73204. * @description 数据集 SQL 查询服务。
  73205. * @param {SuperMap.GetFeaturesBySQLParameters} params - 查询所需参数类。
  73206. * @param {RequestCallback} callback 回调函数。
  73207. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的数据格式。
  73208. */
  73209. }, {
  73210. key: "getFeaturesBySQL",
  73211. value: function getFeaturesBySQL(params, callback, resultFormat) {
  73212. var me = this;
  73213. var getFeatureBySQLService = new GetFeaturesBySQLService_GetFeaturesBySQLService(me.url, {
  73214. proxy: me.options.proxy,
  73215. withCredentials: me.options.withCredentials,
  73216. crossOrigin: me.options.crossOrigin,
  73217. headers: me.options.headers,
  73218. serverType: me.options.serverType,
  73219. eventListeners: {
  73220. processCompleted: callback,
  73221. processFailed: callback
  73222. },
  73223. format: me._processFormat(resultFormat)
  73224. });
  73225. getFeatureBySQLService.processAsync(me._processParams(params));
  73226. }
  73227. /**
  73228. * @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByGeometry
  73229. * @description 数据集几何查询服务类。
  73230. * @param {SuperMap.GetFeaturesByGeometryParameters} params - 查询所需参数类。
  73231. * @param {RequestCallback} callback - 回调函数。
  73232. * @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  73233. */
  73234. }, {
  73235. key: "getFeaturesByGeometry",
  73236. value: function getFeaturesByGeometry(params, callback, resultFormat) {
  73237. var me = this;
  73238. var getFeaturesByGeometryService = new GetFeaturesByGeometryService_GetFeaturesByGeometryService(me.url, {
  73239. proxy: me.options.proxy,
  73240. withCredentials: me.options.withCredentials,
  73241. crossOrigin: me.options.crossOrigin,
  73242. headers: me.options.headers,
  73243. serverType: me.options.serverType,
  73244. eventListeners: {
  73245. processCompleted: callback,
  73246. processFailed: callback
  73247. },
  73248. format: me._processFormat(resultFormat)
  73249. });
  73250. getFeaturesByGeometryService.processAsync(me._processParams(params));
  73251. }
  73252. /**
  73253. * @function mapboxgl.supermap.FeatureService.prototype.editFeatures
  73254. * @description 地物编辑服务。
  73255. * @param {SuperMap.EditFeaturesParameters} params - 查询所需参数类。
  73256. * @param {RequestCallback} callback 回调函数。
  73257. */
  73258. }, {
  73259. key: "editFeatures",
  73260. value: function editFeatures(params, callback) {
  73261. if (!params || !params.dataSourceName || !params.dataSetName) {
  73262. return;
  73263. }
  73264. var me = this,
  73265. url = me.url,
  73266. dataSourceName = params.dataSourceName,
  73267. dataSetName = params.dataSetName;
  73268. url = Util_Util.urlPathAppend(url, "datasources/" + dataSourceName + "/datasets/" + dataSetName);
  73269. var editFeatureService = new EditFeaturesService_EditFeaturesService(url, {
  73270. proxy: me.options.proxy,
  73271. withCredentials: me.options.withCredentials,
  73272. crossOrigin: me.options.crossOrigin,
  73273. headers: me.options.headers,
  73274. serverType: me.options.serverType,
  73275. eventListeners: {
  73276. processCompleted: callback,
  73277. processFailed: callback
  73278. }
  73279. });
  73280. editFeatureService.processAsync(me._processParams(params));
  73281. }
  73282. /**
  73283. * @private
  73284. * @description 参数类型转换。
  73285. * @param {Object} params - 服务参数 。
  73286. * @returns {Object} params - 转换后的对接 SuperMap 服务的参数。
  73287. */
  73288. }, {
  73289. key: "_processParams",
  73290. value: function _processParams(params) {
  73291. if (!params) {
  73292. return {};
  73293. }
  73294. var me = this;
  73295. params.returnContent = params.returnContent == null ? true : params.returnContent;
  73296. params.fromIndex = params.fromIndex ? params.fromIndex : 0;
  73297. params.toIndex = params.toIndex === 0 ? 0 : params.toIndex ? params.toIndex : -1;
  73298. if (params.bounds) {
  73299. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  73300. }
  73301. if (params.editType) {
  73302. params.editType = params.editType.toLowerCase();
  73303. } //mapboxgl geojson要素对象转 SuperMap Geometry 对象
  73304. if (params.geometry) {
  73305. if (params.geometry instanceof external_mapboxgl_default.a.LngLatBounds) {
  73306. params.geometry = core_Util_Util.toSuperMapPolygon(params.geometry);
  73307. } else {
  73308. params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
  73309. }
  73310. } //editFeature服务参数转换,传入单独得对象或对象数组
  73311. if (params.features) {
  73312. var features = [];
  73313. if (core_Util_Util.isArray(params.features)) {
  73314. params.features.map(function (feature) {
  73315. features.push(me._createServerFeature(feature));
  73316. return features;
  73317. });
  73318. } else {
  73319. features.push(me._createServerFeature(params.features));
  73320. }
  73321. params.features = features;
  73322. }
  73323. return params;
  73324. } //geoFeature严格按照 mapboxgl geojson的结构
  73325. }, {
  73326. key: "_createServerFeature",
  73327. value: function _createServerFeature(geoFeature) {
  73328. var feature = {},
  73329. fieldNames = [],
  73330. fieldValues = [];
  73331. var properties = geoFeature.properties;
  73332. for (var key in properties) {
  73333. fieldNames.push(key);
  73334. fieldValues.push(properties[key]);
  73335. }
  73336. feature.fieldNames = fieldNames;
  73337. feature.fieldValues = fieldValues;
  73338. if (geoFeature.id) {
  73339. feature.id = geoFeature.id;
  73340. }
  73341. feature.geometry = core_Util_Util.toSuperMapGeometry(geoFeature);
  73342. return feature;
  73343. }
  73344. }, {
  73345. key: "_processFormat",
  73346. value: function _processFormat(resultFormat) {
  73347. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  73348. }
  73349. }]);
  73350. return FeatureService;
  73351. }(ServiceBase);
  73352. external_mapboxgl_default.a.supermap.FeatureService = FeatureService_FeatureService;
  73353. // CONCATENATED MODULE: ./src/mapboxgl/services/FieldService.js
  73354. 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); }
  73355. function FieldService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73356. 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); } }
  73357. function FieldService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldService_defineProperties(Constructor, staticProps); return Constructor; }
  73358. 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); }
  73359. function FieldService_setPrototypeOf(o, p) { FieldService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldService_setPrototypeOf(o, p); }
  73360. 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); }; }
  73361. function FieldService_possibleConstructorReturn(self, call) { if (call && (FieldService_typeof(call) === "object" || typeof call === "function")) { return call; } return FieldService_assertThisInitialized(self); }
  73362. function FieldService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73363. 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; } }
  73364. function FieldService_getPrototypeOf(o) { FieldService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldService_getPrototypeOf(o); }
  73365. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  73366. * This program are made available under the terms of the Apache License, Version 2.0
  73367. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73368. /**
  73369. * @class mapboxgl.supermap.FieldService
  73370. * @category iServer Data Field
  73371. * @classdesc 字段服务类。
  73372. * @example
  73373. * new mapboxgl.supermap.FieldService(url).getFields(function(result){
  73374. * //doSomething
  73375. * });
  73376. * @param {string} url - 与客户端交互的服务地址。
  73377. * @param {Object} options - 参数。
  73378. * @param {string} [options.proxy] - 服务代理地址。
  73379. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  73380. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  73381. * @param {Object} [options.headers] - 请求头。
  73382. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  73383. * @extends {mapboxgl.supermap.ServiceBase}
  73384. */
  73385. var FieldService_FieldService = /*#__PURE__*/function (_ServiceBase) {
  73386. FieldService_inherits(FieldService, _ServiceBase);
  73387. var _super = FieldService_createSuper(FieldService);
  73388. function FieldService(url, options) {
  73389. FieldService_classCallCheck(this, FieldService);
  73390. return _super.call(this, url, options);
  73391. }
  73392. /**
  73393. * @function mapboxgl.supermap.FieldService.prototype.getFields
  73394. * @description 字段查询服务。
  73395. * @param {SuperMap.FieldParameters} params - 字段信息查询参数类。
  73396. * @param {RequestCallback} callback 回调函数。
  73397. */
  73398. FieldService_createClass(FieldService, [{
  73399. key: "getFields",
  73400. value: function getFields(params, callback) {
  73401. var me = this;
  73402. var getFieldsService = new GetFieldsService_GetFieldsService(me.url, {
  73403. proxy: me.options.proxy,
  73404. withCredentials: me.options.withCredentials,
  73405. crossOrigin: me.options.crossOrigin,
  73406. headers: me.options.headers,
  73407. serverType: me.options.serverType,
  73408. eventListeners: {
  73409. scope: me,
  73410. processCompleted: callback,
  73411. processFailed: callback
  73412. },
  73413. datasource: params.datasource,
  73414. dataset: params.dataset
  73415. });
  73416. getFieldsService.processAsync();
  73417. }
  73418. /**
  73419. * @function mapboxgl.supermap.FieldService.prototype.getFieldStatisticsInfo
  73420. * @description 字段统计服务。
  73421. * @param {SuperMap.FieldStatisticsParameters} params - 查询所需参数类。
  73422. * @param {RequestCallback} callback 回调函数。
  73423. */
  73424. }, {
  73425. key: "getFieldStatisticsInfo",
  73426. value: function getFieldStatisticsInfo(params, callback) {
  73427. var me = this,
  73428. fieldName = params.fieldName,
  73429. modes = params.statisticMode;
  73430. if (modes && !core_Util_Util.isArray(modes)) {
  73431. modes = [modes];
  73432. }
  73433. me.currentStatisticResult = {
  73434. fieldName: fieldName
  73435. };
  73436. me._statisticsCallback = callback; //针对每种统计方式分别进行请求
  73437. modes.forEach(function (mode) {
  73438. me.currentStatisticResult[mode] = null;
  73439. me._fieldStatisticRequest(params.datasource, params.dataset, fieldName, mode);
  73440. });
  73441. }
  73442. }, {
  73443. key: "_fieldStatisticRequest",
  73444. value: function _fieldStatisticRequest(datasource, dataset, fieldName, statisticMode) {
  73445. var me = this;
  73446. var statisticService = new FieldStatisticService_FieldStatisticService(me.url, {
  73447. eventListeners: {
  73448. scope: me,
  73449. processCompleted: me._processCompleted,
  73450. processFailed: me._statisticsCallback
  73451. },
  73452. datasource: datasource,
  73453. dataset: dataset,
  73454. field: fieldName,
  73455. statisticMode: statisticMode,
  73456. crossOrigin: me.options.crossOrigin,
  73457. headers: me.options.headers
  73458. });
  73459. statisticService.processAsync();
  73460. }
  73461. }, {
  73462. key: "_processCompleted",
  73463. value: function _processCompleted(fieldStatisticResult) {
  73464. var me = this;
  73465. var getAll = true,
  73466. result = fieldStatisticResult.result;
  73467. if (this.currentStatisticResult) {
  73468. if (null == me.currentStatisticResult[result.mode]) {
  73469. this.currentStatisticResult[result.mode] = result.result;
  73470. }
  73471. }
  73472. for (var mode in me.currentStatisticResult) {
  73473. if (null == me.currentStatisticResult[mode]) {
  73474. getAll = false;
  73475. break;
  73476. }
  73477. }
  73478. if (getAll) {
  73479. me._statisticsCallback({
  73480. result: me.currentStatisticResult
  73481. });
  73482. }
  73483. }
  73484. }]);
  73485. return FieldService;
  73486. }(ServiceBase);
  73487. external_mapboxgl_default.a.supermap.FieldService = FieldService_FieldService;
  73488. // CONCATENATED MODULE: ./src/mapboxgl/services/GridCellInfosService.js
  73489. 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); }
  73490. function GridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73491. 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); } }
  73492. function GridCellInfosService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GridCellInfosService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GridCellInfosService_defineProperties(Constructor, staticProps); return Constructor; }
  73493. 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); }
  73494. function GridCellInfosService_setPrototypeOf(o, p) { GridCellInfosService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GridCellInfosService_setPrototypeOf(o, p); }
  73495. 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); }; }
  73496. function GridCellInfosService_possibleConstructorReturn(self, call) { if (call && (GridCellInfosService_typeof(call) === "object" || typeof call === "function")) { return call; } return GridCellInfosService_assertThisInitialized(self); }
  73497. function GridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73498. 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; } }
  73499. function GridCellInfosService_getPrototypeOf(o) { GridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GridCellInfosService_getPrototypeOf(o); }
  73500. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  73501. * This program are made available under the terms of the Apache License, Version 2.0
  73502. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73503. /**
  73504. * @class mapboxgl.supermap.GridCellInfosService
  73505. * @category iServer Data Grid
  73506. * @classdesc 数据栅格查询服务。
  73507. * @extends {mapboxgl.supermap.ServiceBase}
  73508. * @example
  73509. * new mapboxgl.supermap.GridCellInfosService(url)
  73510. * .getGridCellInfos(param,function(result){
  73511. * //doSomething
  73512. * })
  73513. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:</br>
  73514. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"。
  73515. * @param {Object} options - 服务所需可选参数。
  73516. * @param {string} [options.proxy] - 服务代理地址。
  73517. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  73518. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  73519. * @param {Object} [options.headers] - 请求头。
  73520. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  73521. */
  73522. var GridCellInfosService_GridCellInfosService = /*#__PURE__*/function (_ServiceBase) {
  73523. GridCellInfosService_inherits(GridCellInfosService, _ServiceBase);
  73524. var _super = GridCellInfosService_createSuper(GridCellInfosService);
  73525. function GridCellInfosService(url, options) {
  73526. GridCellInfosService_classCallCheck(this, GridCellInfosService);
  73527. return _super.call(this, url, options);
  73528. }
  73529. /**
  73530. * @function mapboxgl.supermap.GridCellInfosService.prototype.getGridCellInfos
  73531. * @param {SuperMap.GetGridCellInfosParameters} params - 查询所需参数类。
  73532. * @param {RequestCallback} callback 回调函数。
  73533. */
  73534. GridCellInfosService_createClass(GridCellInfosService, [{
  73535. key: "getGridCellInfos",
  73536. value: function getGridCellInfos(params, callback) {
  73537. if (!params) {
  73538. return null;
  73539. }
  73540. var me = this;
  73541. var gridCellQueryService = new GetGridCellInfosService_GetGridCellInfosService(me.url, {
  73542. proxy: me.options.proxy,
  73543. withCredentials: me.options.withCredentials,
  73544. crossOrigin: me.options.crossOrigin,
  73545. headers: me.options.headers,
  73546. serverType: me.options.serverType,
  73547. eventListeners: {
  73548. scope: me,
  73549. processCompleted: callback,
  73550. processFailed: callback
  73551. }
  73552. });
  73553. gridCellQueryService.processAsync(params);
  73554. }
  73555. }]);
  73556. return GridCellInfosService;
  73557. }(ServiceBase);
  73558. external_mapboxgl_default.a.supermap.GridCellInfosService = GridCellInfosService_GridCellInfosService;
  73559. // CONCATENATED MODULE: ./src/mapboxgl/services/GeoprocessingService.js
  73560. 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); }
  73561. function services_GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73562. 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); } }
  73563. function services_GeoprocessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_GeoprocessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_GeoprocessingService_defineProperties(Constructor, staticProps); return Constructor; }
  73564. 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); }
  73565. 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); }
  73566. 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); }; }
  73567. function services_GeoprocessingService_possibleConstructorReturn(self, call) { if (call && (services_GeoprocessingService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_GeoprocessingService_assertThisInitialized(self); }
  73568. function services_GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73569. 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; } }
  73570. 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); }
  73571. /**
  73572. * @class mapboxgl.supermap.GeoprocessingService
  73573. * @classdesc 地理处理服务接口类。
  73574. * @version 10.1.0
  73575. * @category iServer GeoprocessingService
  73576. * @extends {mapboxgl.supermap.ServiceBase}
  73577. * @example
  73578. * //为了安全访问受保护的地理处理服务,必须通过传递iserver令牌(token),才能正确访问相关资源。
  73579. * SuperMap.SecurityManager.registerToken(serviceUrl, token);
  73580. * var geoprocessingService = new L.supermap.geoprocessingService("http://localhost:8090/iserver/services/geoprocessing/restjsr/gp/v2")
  73581. geoprocessingService.submitJob(identifier,params, environments, function(serverResult) {
  73582. console.log(serverResult.result);
  73583. var jobID = serverResult.result.jobID;
  73584. var options = {
  73585. interval: 5000,
  73586. statusCallback: function(state) {
  73587. console.log("Job Status: ", state);
  73588. }
  73589. };
  73590. geoprocessingService.waitForJobCompletion(jobID, identifier, options, function(serverResult) {
  73591. console.log(serverResult);
  73592. })
  73593. })
  73594. * @param {string} url - 服务地址。
  73595. * @param {Object} options - 参数。
  73596. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 iServer|iPortal|online。
  73597. */
  73598. var services_GeoprocessingService_GeoprocessingService = /*#__PURE__*/function (_ServiceBase) {
  73599. services_GeoprocessingService_inherits(GeoprocessingService, _ServiceBase);
  73600. var _super = services_GeoprocessingService_createSuper(GeoprocessingService);
  73601. function GeoprocessingService(url, options) {
  73602. var _this;
  73603. services_GeoprocessingService_classCallCheck(this, GeoprocessingService);
  73604. _this = _super.call(this, url, options);
  73605. _this.headers = {};
  73606. _this.crossOrigin = true;
  73607. _this.withCredentials = true;
  73608. _this.proxy = true;
  73609. return _this;
  73610. }
  73611. /**
  73612. * @function mapboxgl.supermap.GeoprocessingService.prototype.getTools
  73613. * @description 获取地理处理工具列表。
  73614. * @param {RequestCallback} callback 请求结果的回调函数。
  73615. */
  73616. services_GeoprocessingService_createClass(GeoprocessingService, [{
  73617. key: "getTools",
  73618. value: function getTools(callback) {
  73619. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73620. proxy: this.options.proxy,
  73621. withCredentials: this.options.withCredentials,
  73622. crossOrigin: this.options.crossOrigin,
  73623. headers: this.options.headers,
  73624. serverType: this.options.serverType,
  73625. eventListeners: {
  73626. scope: this,
  73627. processCompleted: callback,
  73628. processFailed: callback
  73629. }
  73630. });
  73631. geoprocessingJobsService.getTools();
  73632. }
  73633. /**
  73634. * @function mapboxgl.supermap.GeoprocessingService.prototype.getTool
  73635. * @description 获取地理处理工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  73636. * @param {string} identifier - 地理处理工具ID。
  73637. * @param {RequestCallback} callback 请求结果的回调函数。
  73638. */
  73639. }, {
  73640. key: "getTool",
  73641. value: function getTool(identifier, callback) {
  73642. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73643. proxy: this.options.proxy,
  73644. withCredentials: this.options.withCredentials,
  73645. crossOrigin: this.options.crossOrigin,
  73646. headers: this.options.headers,
  73647. serverType: this.options.serverType,
  73648. eventListeners: {
  73649. scope: this,
  73650. processCompleted: callback,
  73651. processFailed: callback
  73652. }
  73653. });
  73654. geoprocessingJobsService.getTool(identifier);
  73655. }
  73656. /**
  73657. * @function mapboxgl.supermap.GeoprocessingService.prototype.execute
  73658. * @description 同步执行地理处理工具。
  73659. * @param {string} identifier - 地理处理工具ID。
  73660. * @param {Object} parameter - 地理处理工具的输入参数。
  73661. * @param {Object} environment - 地理处理工具的环境参数。
  73662. * @param {RequestCallback} callback 回调函数。
  73663. */
  73664. }, {
  73665. key: "execute",
  73666. value: function execute(identifier, parameter, environment, callback) {
  73667. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73668. proxy: this.options.proxy,
  73669. withCredentials: this.options.withCredentials,
  73670. crossOrigin: this.options.crossOrigin,
  73671. headers: this.options.headers,
  73672. serverType: this.options.serverType,
  73673. eventListeners: {
  73674. scope: this,
  73675. processCompleted: callback,
  73676. processFailed: callback
  73677. }
  73678. });
  73679. geoprocessingJobsService.execute(identifier, parameter, environment);
  73680. }
  73681. /**
  73682. * @function mapboxgl.supermap.GeoprocessingService.prototype.submitJob
  73683. * @description 异步执行地理处理工具。
  73684. * @param {string} identifier - 地理处理工具ID。
  73685. * @param {Object} parameter - 地理处理工具的输入参数。
  73686. * @param {Object} environment - 地理处理工具的环境参数。
  73687. * @param {RequestCallback} callback 回调函数。
  73688. */
  73689. }, {
  73690. key: "submitJob",
  73691. value: function submitJob(identifier, parameter, environment, callback) {
  73692. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73693. proxy: this.options.proxy,
  73694. withCredentials: this.options.withCredentials,
  73695. crossOrigin: this.options.crossOrigin,
  73696. headers: this.options.headers,
  73697. serverType: this.options.serverType,
  73698. eventListeners: {
  73699. scope: this,
  73700. processCompleted: callback,
  73701. processFailed: callback
  73702. }
  73703. });
  73704. geoprocessingJobsService.submitJob(identifier, parameter, environment);
  73705. }
  73706. /**
  73707. * @function mapboxgl.supermap.GeoprocessingService.prototype.waitForJobCompletion
  73708. * @description 获取地理处理异步执行状态信息。
  73709. * @param {string} jobId - 地理处理任务ID。
  73710. * @param {string} identifier - 地理处理工具ID。
  73711. * @param {Object} options - 状态信息参数。
  73712. * @param {number} options.interval - 定时器时间间隔。
  73713. * @param {Callback} options.statusCallback - 任务状态的回调函数。
  73714. * @param {RequestCallback} callback 回调函数。
  73715. */
  73716. }, {
  73717. key: "waitForJobCompletion",
  73718. value: function waitForJobCompletion(jobId, identifier, options, callback) {
  73719. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73720. proxy: this.options.proxy,
  73721. withCredentials: this.options.withCredentials,
  73722. crossOrigin: this.options.crossOrigin,
  73723. headers: this.options.headers,
  73724. serverType: this.options.serverType,
  73725. eventListeners: {
  73726. scope: this,
  73727. processCompleted: callback,
  73728. processFailed: callback
  73729. }
  73730. });
  73731. geoprocessingJobsService.waitForJobCompletion(jobId, identifier, options);
  73732. }
  73733. /**
  73734. * @function mapboxgl.supermap.GeoprocessingService.prototype.getJobInfo
  73735. * @description 获取地理处理任务的执行信息。
  73736. * @param {string} identifier - 地理处理工具ID。
  73737. * @param {string} jobId - 地理处理任务ID。
  73738. * @param {RequestCallback} callback 回调函数。
  73739. */
  73740. }, {
  73741. key: "getJobInfo",
  73742. value: function getJobInfo(identifier, jobId, callback) {
  73743. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73744. proxy: this.options.proxy,
  73745. withCredentials: this.options.withCredentials,
  73746. crossOrigin: this.options.crossOrigin,
  73747. headers: this.options.headers,
  73748. serverType: this.options.serverType,
  73749. eventListeners: {
  73750. scope: this,
  73751. processCompleted: callback,
  73752. processFailed: callback
  73753. }
  73754. });
  73755. geoprocessingJobsService.getJobInfo(identifier, jobId);
  73756. }
  73757. /**
  73758. * @function mapboxgl.supermap.GeoprocessingService.prototype.cancelJob
  73759. * @description 取消地理处理任务的异步执行。
  73760. * @param {string} identifier - 地理处理工具ID。
  73761. * @param {string} jobId - 地理处理任务ID。
  73762. * @param {RequestCallback} callback 回调函数。
  73763. */
  73764. }, {
  73765. key: "cancelJob",
  73766. value: function cancelJob(identifier, jobId, callback) {
  73767. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73768. proxy: this.options.proxy,
  73769. withCredentials: this.options.withCredentials,
  73770. crossOrigin: this.options.crossOrigin,
  73771. headers: this.options.headers,
  73772. serverType: this.options.serverType,
  73773. eventListeners: {
  73774. scope: this,
  73775. processCompleted: callback,
  73776. processFailed: callback
  73777. }
  73778. });
  73779. geoprocessingJobsService.cancelJob(identifier, jobId);
  73780. }
  73781. /**
  73782. * @function mapboxgl.supermap.GeoprocessingService.prototype.getJobs
  73783. * @description 获取地理处理服务任务列表。
  73784. * @param {string} identifier - 地理处理工具ID。(可选,传参代表identifier算子的任务列表,不传参代表所有任务的列表)
  73785. * @param {RequestCallback} callback 回调函数。
  73786. */
  73787. }, {
  73788. key: "getJobs",
  73789. value: function getJobs(identifier, callback) {
  73790. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73791. proxy: this.options.proxy,
  73792. withCredentials: this.options.withCredentials,
  73793. crossOrigin: this.options.crossOrigin,
  73794. headers: this.options.headers,
  73795. serverType: this.options.serverType,
  73796. eventListeners: {
  73797. scope: this,
  73798. processCompleted: callback,
  73799. processFailed: callback
  73800. }
  73801. });
  73802. geoprocessingJobsService.getJobs(identifier);
  73803. }
  73804. /**
  73805. * @function mapboxgl.supermap.GeoprocessingService.prototype.getResults
  73806. * @description 地理处理工具异步执行的结果,支持结果过滤。
  73807. * @param {string} identifier - 地理处理工具ID。
  73808. * @param {string} jobId - 地理处理任务ID。
  73809. * @param {string} filter - 输出异步结果的id。(可选,传入filter参数时对该地理处理工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  73810. * @param {RequestCallback} callback 请求结果的回调函数。
  73811. */
  73812. }, {
  73813. key: "getResults",
  73814. value: function getResults(identifier, jobId, filter, callback) {
  73815. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73816. proxy: this.options.proxy,
  73817. withCredentials: this.options.withCredentials,
  73818. crossOrigin: this.options.crossOrigin,
  73819. headers: this.options.headers,
  73820. serverType: this.options.serverType,
  73821. eventListeners: {
  73822. scope: this,
  73823. processCompleted: callback,
  73824. processFailed: callback
  73825. }
  73826. });
  73827. geoprocessingJobsService.getResults(identifier, jobId, filter);
  73828. }
  73829. }]);
  73830. return GeoprocessingService;
  73831. }(ServiceBase);
  73832. external_mapboxgl_default.a.supermap.GeoprocessingService = services_GeoprocessingService_GeoprocessingService;
  73833. // CONCATENATED MODULE: ./src/mapboxgl/services/LayerInfoService.js
  73834. 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); }
  73835. function LayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73836. 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); } }
  73837. function LayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) LayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) LayerInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  73838. 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); }
  73839. function LayerInfoService_setPrototypeOf(o, p) { LayerInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LayerInfoService_setPrototypeOf(o, p); }
  73840. 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); }; }
  73841. function LayerInfoService_possibleConstructorReturn(self, call) { if (call && (LayerInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return LayerInfoService_assertThisInitialized(self); }
  73842. function LayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73843. 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; } }
  73844. function LayerInfoService_getPrototypeOf(o) { LayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LayerInfoService_getPrototypeOf(o); }
  73845. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  73846. * This program are made available under the terms of the Apache License, Version 2.0
  73847. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73848. /**
  73849. * @class mapboxgl.supermap.LayerInfoService
  73850. * @category iServer Map Layer
  73851. * @classdesc 图层信息服务类 。
  73852. * @extends {mapboxgl.supermap.ServiceBase}
  73853. * @example
  73854. * new mapboxgl.supermap.LayerInfoService(url).getLayersInfo(function(result){
  73855. * //doSomething
  73856. * })
  73857. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:</br>
  73858. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"。
  73859. * @param {Object} options - 服务所需可选参数。
  73860. * @param {string} [options.proxy] - 服务代理地址。
  73861. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  73862. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  73863. * @param {Object} [options.headers] - 请求头。
  73864. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  73865. */
  73866. var LayerInfoService_LayerInfoService = /*#__PURE__*/function (_ServiceBase) {
  73867. LayerInfoService_inherits(LayerInfoService, _ServiceBase);
  73868. var _super = LayerInfoService_createSuper(LayerInfoService);
  73869. function LayerInfoService(url, options) {
  73870. LayerInfoService_classCallCheck(this, LayerInfoService);
  73871. return _super.call(this, url, options);
  73872. }
  73873. /**
  73874. * @function mapboxgl.supermap.LayerInfoService.prototype.getLayersInfo
  73875. * @description 获取图层信息服务。
  73876. * @param {RequestCallback} callback - 回调函数。
  73877. * @returns {mapboxgl.supermap.LayerInfoService} 返回图层信息类。
  73878. */
  73879. LayerInfoService_createClass(LayerInfoService, [{
  73880. key: "getLayersInfo",
  73881. value: function getLayersInfo(callback) {
  73882. var me = this;
  73883. var getLayersInfoService = new GetLayersInfoService_GetLayersInfoService(me.url, {
  73884. proxy: me.options.proxy,
  73885. withCredentials: me.options.withCredentials,
  73886. crossOrigin: me.options.crossOrigin,
  73887. headers: me.options.headers,
  73888. serverType: me.options.serverType,
  73889. eventListeners: {
  73890. processCompleted: callback,
  73891. processFailed: callback
  73892. }
  73893. });
  73894. getLayersInfoService.processAsync();
  73895. }
  73896. /**
  73897. * @function mapboxgl.supermap.LayerInfoService.prototype.setLayerInfo
  73898. * @description 设置图层信息服务。可以实现临时图层中子图层的修改。
  73899. * @param {SuperMap.SetLayerInfoParameters} params - 设置图层信息参数类。
  73900. * @param {RequestCallback} callback - 回调函数。
  73901. */
  73902. }, {
  73903. key: "setLayerInfo",
  73904. value: function setLayerInfo(params, callback) {
  73905. if (!params) {
  73906. return;
  73907. }
  73908. var me = this,
  73909. resourceID = params.resourceID,
  73910. tempLayerName = params.tempLayerName,
  73911. layerInfoParams = params.layerInfo;
  73912. if (!resourceID || !tempLayerName) {
  73913. return;
  73914. }
  73915. var url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + resourceID + "/" + tempLayerName);
  73916. var setLayerInfoService = new SetLayerInfoService_SetLayerInfoService(url, {
  73917. proxy: me.options.proxy,
  73918. withCredentials: me.options.withCredentials,
  73919. crossOrigin: me.options.crossOrigin,
  73920. headers: me.options.headers,
  73921. serverType: me.options.serverType,
  73922. eventListeners: {
  73923. processCompleted: callback,
  73924. processFailed: callback
  73925. }
  73926. });
  73927. setLayerInfoService.processAsync(layerInfoParams);
  73928. }
  73929. /**
  73930. * @function mapboxgl.supermap.LayerInfoService.prototype.setLayersInfo
  73931. * @description 设置图层信息服务。可以实现创建新的临时图层和对现有临时图层的修改。
  73932. * @param {SuperMap.SetLayersInfoParameters} params - 设置图层信息参数类,包括临时图层。
  73933. * @param {RequestCallback} callback - 回调函数。
  73934. */
  73935. }, {
  73936. key: "setLayersInfo",
  73937. value: function setLayersInfo(params, callback) {
  73938. if (!params) {
  73939. return;
  73940. }
  73941. var me = this,
  73942. resourceID = params.resourceID,
  73943. isTempLayers = params.isTempLayers ? params.isTempLayers : false,
  73944. layersInfo = params.layersInfo;
  73945. if (isTempLayers && !resourceID || !layersInfo) {
  73946. return;
  73947. }
  73948. var setLayersInfoService = new SetLayersInfoService_SetLayersInfoService(me.url, {
  73949. proxy: me.options.proxy,
  73950. withCredentials: me.options.withCredentials,
  73951. crossOrigin: me.options.crossOrigin,
  73952. headers: me.options.headers,
  73953. serverType: me.options.serverType,
  73954. eventListeners: {
  73955. processCompleted: callback,
  73956. processFailed: callback
  73957. },
  73958. resourceID: resourceID,
  73959. isTempLayers: isTempLayers
  73960. });
  73961. setLayersInfoService.processAsync(layersInfo);
  73962. }
  73963. /**
  73964. * @function mapboxgl.supermap.LayerInfoService.prototype.setLayerStatus
  73965. * @description 子图层显示控制服务。负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  73966. * @param {SuperMap.SetLayerStatusParameters} params - 子图层显示控制参数类。
  73967. * @param {RequestCallback} callback 回调函数。
  73968. */
  73969. }, {
  73970. key: "setLayerStatus",
  73971. value: function setLayerStatus(params, callback) {
  73972. if (!params) {
  73973. return;
  73974. }
  73975. var me = this;
  73976. var setLayerStatusService = new SetLayerStatusService_SetLayerStatusService(me.url, {
  73977. proxy: me.options.proxy,
  73978. withCredentials: me.options.withCredentials,
  73979. crossOrigin: me.options.crossOrigin,
  73980. headers: me.options.headers,
  73981. serverType: me.options.serverType,
  73982. eventListeners: {
  73983. processCompleted: callback,
  73984. processFailed: callback
  73985. }
  73986. });
  73987. setLayerStatusService.processAsync(params);
  73988. }
  73989. }]);
  73990. return LayerInfoService;
  73991. }(ServiceBase);
  73992. external_mapboxgl_default.a.supermap.LayerInfoService = LayerInfoService_LayerInfoService;
  73993. // CONCATENATED MODULE: ./src/mapboxgl/services/MapService.js
  73994. 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); }
  73995. function services_MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73996. 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); } }
  73997. function services_MapService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_MapService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_MapService_defineProperties(Constructor, staticProps); return Constructor; }
  73998. 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); }
  73999. 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); }
  74000. 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); }; }
  74001. function services_MapService_possibleConstructorReturn(self, call) { if (call && (services_MapService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_MapService_assertThisInitialized(self); }
  74002. function services_MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74003. 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; } }
  74004. 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); }
  74005. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  74006. * This program are made available under the terms of the Apache License, Version 2.0
  74007. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74008. /**
  74009. * @class mapboxgl.supermap.MapService
  74010. * @category iServer Map
  74011. * @classdesc 地图信息服务类。
  74012. * @extends {mapboxgl.supermap.ServiceBase}
  74013. * @param {string} url - 地图服务地址。
  74014. * @param {Object} options - 地图服务信息相关参数。
  74015. * @param {string} [options.proxy] - 服务代理地址。
  74016. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  74017. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  74018. * @param {Object} [options.headers] - 请求头。
  74019. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  74020. * @example
  74021. * new mapboxgl.supermap.MapService(url)
  74022. * .getMapInfo(function(result){
  74023. * //doSomething
  74024. * })
  74025. */
  74026. var services_MapService_MapService = /*#__PURE__*/function (_ServiceBase) {
  74027. services_MapService_inherits(MapService, _ServiceBase);
  74028. var _super = services_MapService_createSuper(MapService);
  74029. function MapService(url, options) {
  74030. services_MapService_classCallCheck(this, MapService);
  74031. return _super.call(this, url, options);
  74032. }
  74033. /**
  74034. * @function mapboxgl.supermap.MapService.prototype.getMapInfo
  74035. * @description 地图信息查询服务。
  74036. * @param {RequestCallback} callback 回调函数。
  74037. * @returns {mapboxgl.supermap.MapService} 获取服务信息。
  74038. */
  74039. services_MapService_createClass(MapService, [{
  74040. key: "getMapInfo",
  74041. value: function getMapInfo(callback) {
  74042. var me = this;
  74043. var getMapStatusService = new MapService_MapService(me.url, {
  74044. proxy: me.options.proxy,
  74045. withCredentials: me.options.withCredentials,
  74046. crossOrigin: me.options.crossOrigin,
  74047. headers: me.options.headers,
  74048. serverType: me.options.serverType,
  74049. eventListeners: {
  74050. scope: me,
  74051. processCompleted: callback,
  74052. processFailed: callback
  74053. },
  74054. projection: me.options.projection
  74055. });
  74056. getMapStatusService.processAsync();
  74057. }
  74058. /**
  74059. * @function mapboxgl.supermap.MapService.prototype.getTilesets
  74060. * @description 切片列表信息查询服务。
  74061. * @param {RequestCallback} callback - 回调函数 。
  74062. * @returns {mapboxgl.supermap.MapService} 获取服务信息。
  74063. */
  74064. }, {
  74065. key: "getTilesets",
  74066. value: function getTilesets(callback) {
  74067. var me = this;
  74068. var tilesetsService = new TilesetsService_TilesetsService(me.url, {
  74069. proxy: me.options.proxy,
  74070. withCredentials: me.options.withCredentials,
  74071. crossOrigin: me.options.crossOrigin,
  74072. headers: me.options.headers,
  74073. serverType: me.options.serverType,
  74074. eventListeners: {
  74075. scope: me,
  74076. processCompleted: callback,
  74077. processFailed: callback
  74078. }
  74079. });
  74080. tilesetsService.processAsync();
  74081. }
  74082. }]);
  74083. return MapService;
  74084. }(ServiceBase);
  74085. external_mapboxgl_default.a.supermap.MapService = services_MapService_MapService;
  74086. // CONCATENATED MODULE: ./src/mapboxgl/services/MeasureService.js
  74087. 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); }
  74088. function services_MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74089. 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); } }
  74090. function services_MeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_MeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_MeasureService_defineProperties(Constructor, staticProps); return Constructor; }
  74091. 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); }
  74092. 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); }
  74093. 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); }; }
  74094. function services_MeasureService_possibleConstructorReturn(self, call) { if (call && (services_MeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_MeasureService_assertThisInitialized(self); }
  74095. function services_MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74096. 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; } }
  74097. 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); }
  74098. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  74099. * This program are made available under the terms of the Apache License, Version 2.0
  74100. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74101. /**
  74102. * @class mapboxgl.supermap.MeasureService
  74103. * @category iServer Map Measure
  74104. * @classdesc 测量服务。
  74105. * @extends {mapboxgl.supermap.ServiceBase}
  74106. * @param {string} url - 服务访问的地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map。
  74107. * @param {Object} options - 交互服务时所需可选参数。
  74108. * @param {string} [options.proxy] - 服务代理地址。
  74109. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  74110. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  74111. * @param {Object} [options.headers] - 请求头。
  74112. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  74113. * @param {SuperMap.MeasureMode} [options.measureMode=SuperMap.MeasureMode.DISTANCE] - 量算模式,包括距离量算模式和面积量算模式。
  74114. */
  74115. var services_MeasureService_MeasureService = /*#__PURE__*/function (_ServiceBase) {
  74116. services_MeasureService_inherits(MeasureService, _ServiceBase);
  74117. var _super = services_MeasureService_createSuper(MeasureService);
  74118. function MeasureService(url, options) {
  74119. services_MeasureService_classCallCheck(this, MeasureService);
  74120. return _super.call(this, url, options);
  74121. }
  74122. /**
  74123. * @function mapboxgl.supermap.MeasureService.prototype.measureDistance
  74124. * @description 距离测量。
  74125. * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
  74126. * @param {RequestCallback} callback 回调函数。
  74127. */
  74128. services_MeasureService_createClass(MeasureService, [{
  74129. key: "measureDistance",
  74130. value: function measureDistance(params, callback) {
  74131. this.measure(params, 'DISTANCE', callback);
  74132. }
  74133. /**
  74134. * @function mapboxgl.supermap.MeasureService.prototype.measureArea
  74135. * @description 面积测量。
  74136. * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
  74137. * @param {RequestCallback} callback 回调函数。
  74138. */
  74139. }, {
  74140. key: "measureArea",
  74141. value: function measureArea(params, callback) {
  74142. this.measure(params, 'AREA', callback);
  74143. }
  74144. /**
  74145. * @function mapboxgl.supermap.MeasureService.prototype.measure
  74146. * @description 测量。
  74147. * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
  74148. * @param {string} type - 测量类型。
  74149. * @param {RequestCallback} callback - 回调函数。
  74150. * @returns {mapboxgl.supermap.MeasureService} 测量服务。
  74151. */
  74152. }, {
  74153. key: "measure",
  74154. value: function measure(params, type, callback) {
  74155. var me = this;
  74156. var measureService = new MeasureService_MeasureService(me.url, {
  74157. proxy: me.options.proxy,
  74158. withCredentials: me.options.withCredentials,
  74159. crossOrigin: me.options.crossOrigin,
  74160. headers: me.options.headers,
  74161. serverType: me.options.serverType,
  74162. measureMode: type,
  74163. eventListeners: {
  74164. scope: me,
  74165. processCompleted: callback,
  74166. processFailed: callback
  74167. }
  74168. });
  74169. measureService.processAsync(me._processParam(params));
  74170. }
  74171. }, {
  74172. key: "_processParam",
  74173. value: function _processParam(params) {
  74174. if (params && !(params.geometry instanceof Geometry_Geometry)) {
  74175. params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
  74176. }
  74177. return params;
  74178. }
  74179. }]);
  74180. return MeasureService;
  74181. }(ServiceBase);
  74182. external_mapboxgl_default.a.supermap.MeasureService = services_MeasureService_MeasureService;
  74183. // CONCATENATED MODULE: ./src/mapboxgl/services/NetworkAnalystService.js
  74184. 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); }
  74185. function NetworkAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74186. 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); } }
  74187. function NetworkAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  74188. 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); }
  74189. function NetworkAnalystService_setPrototypeOf(o, p) { NetworkAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalystService_setPrototypeOf(o, p); }
  74190. 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); }; }
  74191. function NetworkAnalystService_possibleConstructorReturn(self, call) { if (call && (NetworkAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return NetworkAnalystService_assertThisInitialized(self); }
  74192. function NetworkAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74193. 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; } }
  74194. function NetworkAnalystService_getPrototypeOf(o) { NetworkAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystService_getPrototypeOf(o); }
  74195. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  74196. * This program are made available under the terms of the Apache License, Version 2.0
  74197. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74198. /**
  74199. * @class mapboxgl.supermap.NetworkAnalystService
  74200. * @category iServer NetworkAnalyst
  74201. * @classdesc 网络分析服务类。
  74202. * @extends {mapboxgl.supermap.ServiceBase}
  74203. * @example
  74204. * new mapboxgl.supermap.NetworkAnalystService(url)
  74205. * .findPath(params,function(result){
  74206. * //doSomething
  74207. * })
  74208. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:</br>
  74209. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源}。
  74210. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  74211. * @param {Object} options - 服务所需可选参数。
  74212. * @param {string} [options.proxy] - 服务代理地址。
  74213. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  74214. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  74215. * @param {Object} [options.headers] - 请求头。
  74216. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  74217. */
  74218. var NetworkAnalystService_NetworkAnalystService = /*#__PURE__*/function (_ServiceBase) {
  74219. NetworkAnalystService_inherits(NetworkAnalystService, _ServiceBase);
  74220. var _super = NetworkAnalystService_createSuper(NetworkAnalystService);
  74221. function NetworkAnalystService(url, options) {
  74222. NetworkAnalystService_classCallCheck(this, NetworkAnalystService);
  74223. return _super.call(this, url, options);
  74224. }
  74225. /**
  74226. * @function mapboxgl.supermap.NetworkAnalystService.prototype.burstPipelineAnalyst
  74227. * @description 爆管分析服务:即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组,普通结点 ID 数组及其上下游弧段 ID 数组。
  74228. * @param {SuperMap.BurstPipelineAnalystParameters} params - 爆管分析服务参数类。
  74229. * @param {RequestCallback} callback 回调函数。
  74230. */
  74231. NetworkAnalystService_createClass(NetworkAnalystService, [{
  74232. key: "burstPipelineAnalyst",
  74233. value: function burstPipelineAnalyst(params, callback) {
  74234. var me = this;
  74235. var burstPipelineAnalystService = new BurstPipelineAnalystService_BurstPipelineAnalystService(me.url, {
  74236. proxy: me.options.proxy,
  74237. withCredentials: me.options.withCredentials,
  74238. crossOrigin: me.options.crossOrigin,
  74239. headers: me.options.headers,
  74240. serverType: me.options.serverType,
  74241. eventListeners: {
  74242. scope: me,
  74243. processCompleted: callback,
  74244. processFailed: callback
  74245. }
  74246. });
  74247. burstPipelineAnalystService.processAsync(me._processParams(params));
  74248. }
  74249. /**
  74250. * @function mapboxgl.supermap.NetworkAnalystService.prototype.computeWeightMatrix
  74251. * @description 耗费矩阵分析服务:根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  74252. * @param {SuperMap.ComputeWeightMatrixParameters} params - 耗费矩阵分析服务参数类。
  74253. * @param {RequestCallback} callback - 回调函数。
  74254. */
  74255. }, {
  74256. key: "computeWeightMatrix",
  74257. value: function computeWeightMatrix(params, callback) {
  74258. var me = this;
  74259. var computeWeightMatrixService = new ComputeWeightMatrixService_ComputeWeightMatrixService(me.url, {
  74260. proxy: me.options.proxy,
  74261. withCredentials: me.options.withCredentials,
  74262. crossOrigin: me.options.crossOrigin,
  74263. headers: me.options.headers,
  74264. serverType: me.options.serverType,
  74265. eventListeners: {
  74266. scope: me,
  74267. processCompleted: callback,
  74268. processFailed: callback
  74269. }
  74270. });
  74271. computeWeightMatrixService.processAsync(me._processParams(params));
  74272. }
  74273. /**
  74274. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findClosestFacilities
  74275. * @description 最近设施分析服务:指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  74276. * @param {SuperMap.FindClosestFacilitiesParameters} params - 最近设施分析服务参数类。
  74277. * @param {RequestCallback} callback 回调函数。
  74278. * @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  74279. */
  74280. }, {
  74281. key: "findClosestFacilities",
  74282. value: function findClosestFacilities(params, callback, resultFormat) {
  74283. var me = this;
  74284. var findClosestFacilitiesService = new FindClosestFacilitiesService_FindClosestFacilitiesService(me.url, {
  74285. proxy: me.options.proxy,
  74286. withCredentials: me.options.withCredentials,
  74287. crossOrigin: me.options.crossOrigin,
  74288. headers: me.options.headers,
  74289. serverType: me.options.serverType,
  74290. eventListeners: {
  74291. scope: me,
  74292. processCompleted: callback,
  74293. processFailed: callback
  74294. },
  74295. format: me._processFormat(resultFormat)
  74296. });
  74297. findClosestFacilitiesService.processAsync(me._processParams(params));
  74298. }
  74299. /**
  74300. * @function mapboxgl.supermap.NetworkAnalystService.prototype.streamFacilityAnalyst
  74301. * @description 上游/下游 关键设施查找资源服务:查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  74302. * @param {SuperMap.FacilityAnalystStreamParameters} params - 上游/下游 关键设施查找资源服务参数类。
  74303. * @param {RequestCallback} callback 回调函数。
  74304. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74305. */
  74306. }, {
  74307. key: "streamFacilityAnalyst",
  74308. value: function streamFacilityAnalyst(params, callback, resultFormat) {
  74309. var me = this;
  74310. var facilityAnalystStreamService = new FacilityAnalystStreamService_FacilityAnalystStreamService(me.url, {
  74311. proxy: me.options.proxy,
  74312. withCredentials: me.options.withCredentials,
  74313. crossOrigin: me.options.crossOrigin,
  74314. headers: me.options.headers,
  74315. serverType: me.options.serverType,
  74316. eventListeners: {
  74317. scope: me,
  74318. processCompleted: callback,
  74319. processFailed: callback
  74320. },
  74321. format: me._processFormat(resultFormat)
  74322. });
  74323. facilityAnalystStreamService.processAsync(me._processParams(params));
  74324. }
  74325. /**
  74326. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findLocation
  74327. * @description 选址分区分析服务:确定一个或多个待建设施的最佳或最优位置。
  74328. * @param {SuperMap.FindLocationParameters} params - 选址分区分析服务参数类。
  74329. * @param {RequestCallback} callback 回调函数。
  74330. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74331. */
  74332. }, {
  74333. key: "findLocation",
  74334. value: function findLocation(params, callback, resultFormat) {
  74335. var me = this;
  74336. var findLocationService = new FindLocationService_FindLocationService(me.url, {
  74337. proxy: me.options.proxy,
  74338. withCredentials: me.options.withCredentials,
  74339. crossOrigin: me.options.crossOrigin,
  74340. headers: me.options.headers,
  74341. serverType: me.options.serverType,
  74342. eventListeners: {
  74343. scope: me,
  74344. processCompleted: callback,
  74345. processFailed: callback
  74346. },
  74347. format: me._processFormat(resultFormat)
  74348. });
  74349. findLocationService.processAsync(me._processParams(params));
  74350. }
  74351. /**
  74352. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findPath
  74353. * @description 最佳路径分析服务:在网络数据集中指定一些节点,按照节点的选择顺序,顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  74354. * @param {SuperMap.FindPathParameters} params - 最佳路径分析服务参数类。
  74355. * @param {RequestCallback} callback - 回调函数。
  74356. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74357. */
  74358. }, {
  74359. key: "findPath",
  74360. value: function findPath(params, callback, resultFormat) {
  74361. var me = this;
  74362. var findPathService = new FindPathService_FindPathService(me.url, {
  74363. proxy: me.options.proxy,
  74364. withCredentials: me.options.withCredentials,
  74365. crossOrigin: me.options.crossOrigin,
  74366. headers: me.options.headers,
  74367. serverType: me.options.serverType,
  74368. eventListeners: {
  74369. scope: me,
  74370. processCompleted: callback,
  74371. processFailed: callback
  74372. },
  74373. format: me._processFormat(resultFormat)
  74374. });
  74375. findPathService.processAsync(me._processParams(params));
  74376. }
  74377. /**
  74378. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findTSPPaths
  74379. * @description 旅行商分析服务:路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  74380. * @param {SuperMap.SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
  74381. * @param {RequestCallback} callback - 回调函数。
  74382. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74383. */
  74384. }, {
  74385. key: "findTSPPaths",
  74386. value: function findTSPPaths(params, callback, resultFormat) {
  74387. var me = this;
  74388. var findTSPPathsService = new FindTSPPathsService_FindTSPPathsService(me.url, {
  74389. proxy: me.options.proxy,
  74390. withCredentials: me.options.withCredentials,
  74391. crossOrigin: me.options.crossOrigin,
  74392. headers: me.options.headers,
  74393. serverType: me.options.serverType,
  74394. eventListeners: {
  74395. scope: me,
  74396. processCompleted: callback,
  74397. processFailed: callback
  74398. },
  74399. format: me._processFormat(resultFormat)
  74400. });
  74401. findTSPPathsService.processAsync(me._processParams(params));
  74402. }
  74403. /**
  74404. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findMTSPPaths
  74405. * @description 多旅行商分析服务:也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。查找经济有效的配送路径,并给出相应的行走路线。
  74406. * @param {SuperMap.FindMTSPPathsParameters} params - 多旅行商分析服务参数类。
  74407. * @param {RequestCallback} callback - 回调函数。
  74408. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74409. */
  74410. }, {
  74411. key: "findMTSPPaths",
  74412. value: function findMTSPPaths(params, callback, resultFormat) {
  74413. var me = this;
  74414. var findMTSPPathsService = new FindMTSPPathsService_FindMTSPPathsService(me.url, {
  74415. proxy: me.options.proxy,
  74416. withCredentials: me.options.withCredentials,
  74417. crossOrigin: me.options.crossOrigin,
  74418. headers: me.options.headers,
  74419. serverType: me.options.serverType,
  74420. eventListeners: {
  74421. scope: me,
  74422. processCompleted: callback,
  74423. processFailed: callback
  74424. },
  74425. format: me._processFormat(resultFormat)
  74426. });
  74427. findMTSPPathsService.processAsync(me._processParams(params));
  74428. }
  74429. /**
  74430. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findServiceAreas
  74431. * @description 服务区分析服务:以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  74432. * @param {SuperMap.FindServiceAreasParameters} params - 服务区分析服务参数类。
  74433. * @param {RequestCallback} callback 回调函数。
  74434. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74435. */
  74436. }, {
  74437. key: "findServiceAreas",
  74438. value: function findServiceAreas(params, callback, resultFormat) {
  74439. var me = this;
  74440. var findServiceAreasService = new FindServiceAreasService_FindServiceAreasService(me.url, {
  74441. proxy: me.options.proxy,
  74442. withCredentials: me.options.withCredentials,
  74443. crossOrigin: me.options.crossOrigin,
  74444. headers: me.options.headers,
  74445. serverType: me.options.serverType,
  74446. eventListeners: {
  74447. scope: me,
  74448. processCompleted: callback,
  74449. processFailed: callback
  74450. },
  74451. format: me._processFormat(resultFormat)
  74452. });
  74453. findServiceAreasService.processAsync(me._processParams(params));
  74454. }
  74455. /**
  74456. * @function mapboxgl.supermap.NetworkAnalystService.prototype.updateEdgeWeight
  74457. * @description 更新边的耗费权重服务。
  74458. * @param {SuperMap.UpdateEdgeWeightParameters} params - 更新边的耗费权重服务参数类。
  74459. * @param {RequestCallback} callback 回调函数。
  74460. */
  74461. }, {
  74462. key: "updateEdgeWeight",
  74463. value: function updateEdgeWeight(params, callback) {
  74464. var me = this;
  74465. var updateEdgeWeightService = new UpdateEdgeWeightService_UpdateEdgeWeightService(me.url, {
  74466. proxy: me.options.proxy,
  74467. withCredentials: me.options.withCredentials,
  74468. crossOrigin: me.options.crossOrigin,
  74469. headers: me.options.headers,
  74470. serverType: me.options.serverType,
  74471. eventListeners: {
  74472. scope: me,
  74473. processCompleted: callback,
  74474. processFailed: callback
  74475. }
  74476. });
  74477. updateEdgeWeightService.processAsync(params);
  74478. }
  74479. /**
  74480. * @function mapboxgl.supermap.NetworkAnalystService.prototype.updateTurnNodeWeight
  74481. * @description 转向耗费权重更新服务。
  74482. * @param {SuperMap.UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类。
  74483. * @param {RequestCallback} callback - 回调函数。
  74484. */
  74485. }, {
  74486. key: "updateTurnNodeWeight",
  74487. value: function updateTurnNodeWeight(params, callback) {
  74488. var me = this;
  74489. var updateTurnNodeWeightService = new UpdateTurnNodeWeightService_UpdateTurnNodeWeightService(me.url, {
  74490. proxy: me.options.proxy,
  74491. withCredentials: me.options.withCredentials,
  74492. crossOrigin: me.options.crossOrigin,
  74493. headers: me.options.headers,
  74494. serverType: me.options.serverType,
  74495. eventListeners: {
  74496. scope: me,
  74497. processCompleted: callback,
  74498. processFailed: callback
  74499. }
  74500. });
  74501. updateTurnNodeWeightService.processAsync(params);
  74502. }
  74503. /**
  74504. * @description 所有 Point 考虑 mapboxgl.lnglat、mapboxgl.Point、[]三种形式。
  74505. * @param {Object} params - 待转换参数。
  74506. * @returns {Object}
  74507. * @private
  74508. */
  74509. }, {
  74510. key: "_processParams",
  74511. value: function _processParams(params) {
  74512. if (!params) {
  74513. return {};
  74514. }
  74515. var me = this;
  74516. if (params.centers && core_Util_Util.isArray(params.centers)) {
  74517. params.centers.map(function (point, key) {
  74518. params.centers[key] = me._toPointObject(point);
  74519. return params.centers[key];
  74520. });
  74521. }
  74522. if (params.nodes && core_Util_Util.isArray(params.nodes)) {
  74523. params.nodes.map(function (point, key) {
  74524. params.nodes[key] = me._toPointObject(point);
  74525. return params.nodes[key];
  74526. });
  74527. }
  74528. if (params.event) {
  74529. params.event = me._toPointObject(params.event);
  74530. }
  74531. if (params.facilities && core_Util_Util.isArray(params.facilities)) {
  74532. params.facilities.map(function (point, key) {
  74533. params.facilities[key] = me._toPointObject(point);
  74534. return params.facilities[key];
  74535. });
  74536. }
  74537. if (params.parameter && params.parameter.barrierPoints) {
  74538. var barrierPoints = params.parameter.barrierPoints;
  74539. if (core_Util_Util.isArray(barrierPoints)) {
  74540. barrierPoints.map(function (point, key) {
  74541. params.parameter[key] = me._toPointObject(point);
  74542. return params.parameter.barrierPoints[key];
  74543. });
  74544. } else {
  74545. params.parameter.barrierPoints = [barrierPoints instanceof external_mapboxgl_default.a.LngLat ? {
  74546. x: barrierPoints.lng,
  74547. y: barrierPoints.lat
  74548. } : barrierPoints];
  74549. }
  74550. }
  74551. return params;
  74552. }
  74553. }, {
  74554. key: "_toPointObject",
  74555. value: function _toPointObject(point) {
  74556. if (core_Util_Util.isArray(point)) {
  74557. return {
  74558. x: point[0],
  74559. y: point[1]
  74560. };
  74561. }
  74562. if (point instanceof external_mapboxgl_default.a.LngLat) {
  74563. return {
  74564. x: point.lng,
  74565. y: point.lat
  74566. };
  74567. }
  74568. return point instanceof external_mapboxgl_default.a.Point ? {
  74569. x: point.x,
  74570. y: point.y
  74571. } : point;
  74572. }
  74573. }, {
  74574. key: "_processFormat",
  74575. value: function _processFormat(resultFormat) {
  74576. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  74577. }
  74578. }]);
  74579. return NetworkAnalystService;
  74580. }(ServiceBase);
  74581. external_mapboxgl_default.a.supermap.NetworkAnalystService = NetworkAnalystService_NetworkAnalystService;
  74582. // CONCATENATED MODULE: ./src/mapboxgl/services/NetworkAnalyst3DService.js
  74583. 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); }
  74584. function NetworkAnalyst3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74585. 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); } }
  74586. function NetworkAnalyst3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalyst3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalyst3DService_defineProperties(Constructor, staticProps); return Constructor; }
  74587. 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); }
  74588. function NetworkAnalyst3DService_setPrototypeOf(o, p) { NetworkAnalyst3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalyst3DService_setPrototypeOf(o, p); }
  74589. 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); }; }
  74590. function NetworkAnalyst3DService_possibleConstructorReturn(self, call) { if (call && (NetworkAnalyst3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return NetworkAnalyst3DService_assertThisInitialized(self); }
  74591. function NetworkAnalyst3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74592. 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; } }
  74593. function NetworkAnalyst3DService_getPrototypeOf(o) { NetworkAnalyst3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalyst3DService_getPrototypeOf(o); }
  74594. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  74595. * This program are made available under the terms of the Apache License, Version 2.0
  74596. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74597. /**
  74598. * @class mapboxgl.supermap.NetworkAnalyst3DService
  74599. * @category iServer FacilityAnalyst3D
  74600. * @classdesc 3D 网络分析服务类。
  74601. * @extends {mapboxgl.supermap.ServiceBase}
  74602. * @example
  74603. * new mapboxgl.supermap.NetworkAnalyst3DService(url)
  74604. * .sinksFacilityAnalyst(params,function(result){
  74605. * //doSomething
  74606. * })
  74607. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:</br>
  74608. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源}。
  74609. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  74610. * @param {Object} options - 服务所需可选参数。
  74611. * @param {string} [options.proxy] - 服务代理地址。
  74612. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  74613. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  74614. * @param {Object} [options.headers] - 请求头。
  74615. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  74616. */
  74617. var NetworkAnalyst3DService_NetworkAnalyst3DService = /*#__PURE__*/function (_ServiceBase) {
  74618. NetworkAnalyst3DService_inherits(NetworkAnalyst3DService, _ServiceBase);
  74619. var _super = NetworkAnalyst3DService_createSuper(NetworkAnalyst3DService);
  74620. function NetworkAnalyst3DService(url, options) {
  74621. NetworkAnalyst3DService_classCallCheck(this, NetworkAnalyst3DService);
  74622. return _super.call(this, url, options);
  74623. }
  74624. /**
  74625. * @function mapboxgl.supermap.NetworkAnalyst3DService.prototype.sinksFacilityAnalyst
  74626. * @description 汇查找服务。
  74627. * @param {SuperMap.FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)。
  74628. * @param {RequestCallback} callback - 回调函数。
  74629. * @returns {mapboxgl.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  74630. */
  74631. NetworkAnalyst3DService_createClass(NetworkAnalyst3DService, [{
  74632. key: "sinksFacilityAnalyst",
  74633. value: function sinksFacilityAnalyst(params, callback) {
  74634. var me = this;
  74635. var facilityAnalystSinks3DService = new FacilityAnalystSinks3DService_FacilityAnalystSinks3DService(me.url, {
  74636. proxy: me.options.proxy,
  74637. withCredentials: me.options.withCredentials,
  74638. crossOrigin: me.options.crossOrigin,
  74639. headers: me.options.headers,
  74640. serverType: me.options.serverType,
  74641. eventListeners: {
  74642. scope: me,
  74643. processCompleted: callback,
  74644. processFailed: callback
  74645. }
  74646. });
  74647. facilityAnalystSinks3DService.processAsync(params);
  74648. }
  74649. /**
  74650. * @function mapboxgl.supermap.NetworkAnalyst3DService.prototype.sourcesFacilityAnalyst
  74651. * @description 源查找服务。
  74652. * @param {SuperMap.FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找服务)。
  74653. * @param {RequestCallback} callback - 回调函数。
  74654. * @returns {mapboxgl.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  74655. */
  74656. }, {
  74657. key: "sourcesFacilityAnalyst",
  74658. value: function sourcesFacilityAnalyst(params, callback) {
  74659. var me = this;
  74660. var facilityAnalystSources3DService = new FacilityAnalystSources3DService_FacilityAnalystSources3DService(me.url, {
  74661. proxy: me.options.proxy,
  74662. withCredentials: me.options.withCredentials,
  74663. crossOrigin: me.options.crossOrigin,
  74664. headers: me.options.headers,
  74665. serverType: me.options.serverType,
  74666. eventListeners: {
  74667. scope: me,
  74668. processCompleted: callback,
  74669. processFailed: callback
  74670. }
  74671. });
  74672. facilityAnalystSources3DService.processAsync(params);
  74673. }
  74674. /**
  74675. * @function mapboxgl.supermap.NetworkAnalyst3DService.prototype.traceUpFacilityAnalyst
  74676. * @description 上游追踪资源服务。
  74677. * @param {SuperMap.FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类。
  74678. * @param {RequestCallback} callback 回调函数。
  74679. * @returns {mapboxgl.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  74680. */
  74681. }, {
  74682. key: "traceUpFacilityAnalyst",
  74683. value: function traceUpFacilityAnalyst(params, callback) {
  74684. var me = this;
  74685. var facilityAnalystTraceup3DService = new FacilityAnalystTraceup3DService_FacilityAnalystTraceup3DService(me.url, {
  74686. proxy: me.options.proxy,
  74687. withCredentials: me.options.withCredentials,
  74688. crossOrigin: me.options.crossOrigin,
  74689. headers: me.options.headers,
  74690. serverType: me.options.serverType,
  74691. eventListeners: {
  74692. scope: me,
  74693. processCompleted: callback,
  74694. processFailed: callback
  74695. }
  74696. });
  74697. facilityAnalystTraceup3DService.processAsync(params);
  74698. }
  74699. /**
  74700. * @function mapboxgl.supermap.NetworkAnalyst3DService.prototype.traceDownFacilityAnalyst
  74701. * @description 下游追踪资源服务。
  74702. * @param {SuperMap.FacilityAnalystTracedown3DParameters} params - 下游追踪资源服务参数类。
  74703. * @param {RequestCallback} callback 回调函数。
  74704. * @returns {mapboxgl.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  74705. */
  74706. }, {
  74707. key: "traceDownFacilityAnalyst",
  74708. value: function traceDownFacilityAnalyst(params, callback) {
  74709. var me = this;
  74710. var facilityAnalystTracedown3DService = new FacilityAnalystTracedown3DService_FacilityAnalystTracedown3DService(me.url, {
  74711. proxy: me.options.proxy,
  74712. withCredentials: me.options.withCredentials,
  74713. crossOrigin: me.options.crossOrigin,
  74714. headers: me.options.headers,
  74715. serverType: me.options.serverType,
  74716. eventListeners: {
  74717. scope: me,
  74718. processCompleted: callback,
  74719. processFailed: callback
  74720. }
  74721. });
  74722. facilityAnalystTracedown3DService.processAsync(params);
  74723. }
  74724. /**
  74725. * @function mapboxgl.supermap.NetworkAnalyst3DService.prototype.upstreamFacilityAnalyst
  74726. * @description 上游关键设施查找服务。
  74727. * @param {SuperMap.FacilityAnalystUpstream3DParameters} params - 上游关键设施查找服务参数类。
  74728. * @param {RequestCallback} callback 回调函数。
  74729. * @returns {mapboxgl.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  74730. */
  74731. }, {
  74732. key: "upstreamFacilityAnalyst",
  74733. value: function upstreamFacilityAnalyst(params, callback) {
  74734. var me = this;
  74735. var facilityAnalystUpstream3DService = new FacilityAnalystUpstream3DService_FacilityAnalystUpstream3DService(me.url, {
  74736. proxy: me.options.proxy,
  74737. withCredentials: me.options.withCredentials,
  74738. crossOrigin: me.options.crossOrigin,
  74739. headers: me.options.headers,
  74740. serverType: me.options.serverType,
  74741. eventListeners: {
  74742. scope: me,
  74743. processCompleted: callback,
  74744. processFailed: callback
  74745. }
  74746. });
  74747. facilityAnalystUpstream3DService.processAsync(params);
  74748. }
  74749. }]);
  74750. return NetworkAnalyst3DService;
  74751. }(ServiceBase);
  74752. external_mapboxgl_default.a.supermap.NetworkAnalyst3DService = NetworkAnalyst3DService_NetworkAnalyst3DService;
  74753. // CONCATENATED MODULE: ./src/mapboxgl/services/ProcessingService.js
  74754. 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); }
  74755. function ProcessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74756. 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); } }
  74757. function ProcessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingService_defineProperties(Constructor, staticProps); return Constructor; }
  74758. 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); }
  74759. function ProcessingService_setPrototypeOf(o, p) { ProcessingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingService_setPrototypeOf(o, p); }
  74760. 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); }; }
  74761. function ProcessingService_possibleConstructorReturn(self, call) { if (call && (ProcessingService_typeof(call) === "object" || typeof call === "function")) { return call; } return ProcessingService_assertThisInitialized(self); }
  74762. function ProcessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74763. 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; } }
  74764. function ProcessingService_getPrototypeOf(o) { ProcessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingService_getPrototypeOf(o); }
  74765. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  74766. * This program are made available under the terms of the Apache License, Version 2.0
  74767. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74768. /**
  74769. * @class mapboxgl.supermap.ProcessingService
  74770. * @category iServer ProcessingService
  74771. * @classdesc 分布式分析相关服务类。
  74772. * @extends {mapboxgl.supermap.ServiceBase}
  74773. * @example
  74774. * new mapboxgl.supermap.ProcessingService(url,options)
  74775. * .getKernelDensityJobs(function(result){
  74776. * //doSomething
  74777. * })
  74778. * @param {string} url - 分布式分析服务地址。
  74779. * @param {Object} options - 交互服务时所需可选参数。
  74780. * @param {string} [options.proxy] - 服务代理地址。
  74781. * @param {boolean} [options.withCredentials=false] - 请求是否携带cookie。
  74782. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  74783. * @param {Object} [options.headers] - 请求头。
  74784. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  74785. */
  74786. var ProcessingService_ProcessingService = /*#__PURE__*/function (_ServiceBase) {
  74787. ProcessingService_inherits(ProcessingService, _ServiceBase);
  74788. var _super = ProcessingService_createSuper(ProcessingService);
  74789. function ProcessingService(url, options) {
  74790. var _this;
  74791. ProcessingService_classCallCheck(this, ProcessingService);
  74792. _this = _super.call(this, url, options);
  74793. _this.kernelDensityJobs = {};
  74794. _this.summaryMeshJobs = {};
  74795. _this.queryJobs = {};
  74796. _this.summaryRegionJobs = {};
  74797. _this.vectorClipJobs = {};
  74798. _this.overlayGeoJobs = {};
  74799. _this.buffersJobs = {};
  74800. _this.topologyValidatorJobs = {};
  74801. _this.summaryAttributesJobs = {};
  74802. return _this;
  74803. }
  74804. /**
  74805. * @function mapboxgl.supermap.ProcessingService.prototype.getKernelDensityJobs
  74806. * @description 获取密度分析的列表。
  74807. * @param {RequestCallback} callback - 请求结果的回调函数。
  74808. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74809. */
  74810. ProcessingService_createClass(ProcessingService, [{
  74811. key: "getKernelDensityJobs",
  74812. value: function getKernelDensityJobs(callback, resultFormat) {
  74813. var me = this,
  74814. format = me._processFormat(resultFormat);
  74815. var kernelDensityJobsService = new KernelDensityJobsService_KernelDensityJobsService(me.url, {
  74816. proxy: me.options.proxy,
  74817. withCredentials: me.options.withCredentials,
  74818. crossOrigin: me.options.crossOrigin,
  74819. headers: me.options.headers,
  74820. serverType: me.options.serverType,
  74821. eventListeners: {
  74822. scope: me,
  74823. processCompleted: callback,
  74824. processFailed: callback
  74825. },
  74826. format: format
  74827. });
  74828. kernelDensityJobsService.getKernelDensityJobs();
  74829. }
  74830. /**
  74831. * @function mapboxgl.supermap.ProcessingService.prototype.getKernelDensityJob
  74832. * @description 获取某一个密度分析。
  74833. * @param {string} id - 空间分析的id。
  74834. * @param {RequestCallback} callback - 请求结果的回调函数。
  74835. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74836. */
  74837. }, {
  74838. key: "getKernelDensityJob",
  74839. value: function getKernelDensityJob(id, callback, resultFormat) {
  74840. var me = this,
  74841. format = me._processFormat(resultFormat);
  74842. var kernelDensityJobsService = new KernelDensityJobsService_KernelDensityJobsService(me.url, {
  74843. proxy: me.options.proxy,
  74844. withCredentials: me.options.withCredentials,
  74845. crossOrigin: me.options.crossOrigin,
  74846. headers: me.options.headers,
  74847. serverType: me.options.serverType,
  74848. eventListeners: {
  74849. scope: me,
  74850. processCompleted: callback,
  74851. processFailed: callback
  74852. },
  74853. format: format
  74854. });
  74855. kernelDensityJobsService.getKernelDensityJob(id);
  74856. }
  74857. /**
  74858. * @function mapboxgl.supermap.ProcessingService.prototype.addKernelDensityJob
  74859. * @description 新建一个密度分析。
  74860. * @param {SuperMap.KernelDensityJobParameter} params -创建一个空间分析的请求参数。
  74861. * @param {RequestCallback} callback 请求结果的回调函数。
  74862. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  74863. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74864. */
  74865. }, {
  74866. key: "addKernelDensityJob",
  74867. value: function addKernelDensityJob(params, callback, seconds, resultFormat) {
  74868. var me = this,
  74869. param = me._processParams(params),
  74870. format = me._processFormat(resultFormat);
  74871. var kernelDensityJobsService = new KernelDensityJobsService_KernelDensityJobsService(me.url, {
  74872. proxy: me.options.proxy,
  74873. withCredentials: me.options.withCredentials,
  74874. crossOrigin: me.options.crossOrigin,
  74875. headers: me.options.headers,
  74876. eventListeners: {
  74877. scope: me,
  74878. processCompleted: callback,
  74879. processFailed: callback,
  74880. processRunning: function processRunning(job) {
  74881. me.kernelDensityJobs[job.id] = job.state;
  74882. }
  74883. },
  74884. format: format
  74885. });
  74886. kernelDensityJobsService.addKernelDensityJob(param, seconds);
  74887. }
  74888. /**
  74889. * @function mapboxgl.supermap.ProcessingService.prototype.getKernelDensityJobState
  74890. * @description 获取密度分析的状态。
  74891. * @param {string} id - 密度分析的id。
  74892. * @returns {Object} 密度分析的状态。
  74893. */
  74894. }, {
  74895. key: "getKernelDensityJobState",
  74896. value: function getKernelDensityJobState(id) {
  74897. return this.kernelDensityJobs[id];
  74898. }
  74899. /**
  74900. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryMeshJobs
  74901. * @description 获取点聚合分析的列表。
  74902. * @param {RequestCallback} callback - 请求结果的回调函数。
  74903. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74904. */
  74905. }, {
  74906. key: "getSummaryMeshJobs",
  74907. value: function getSummaryMeshJobs(callback, resultFormat) {
  74908. var me = this,
  74909. format = me._processFormat(resultFormat);
  74910. var summaryMeshJobsService = new SummaryMeshJobsService_SummaryMeshJobsService(me.url, {
  74911. proxy: me.options.proxy,
  74912. withCredentials: me.options.withCredentials,
  74913. crossOrigin: me.options.crossOrigin,
  74914. headers: me.options.headers,
  74915. serverType: me.options.serverType,
  74916. eventListeners: {
  74917. scope: me,
  74918. processCompleted: callback,
  74919. processFailed: callback
  74920. },
  74921. format: format
  74922. });
  74923. summaryMeshJobsService.getSummaryMeshJobs();
  74924. }
  74925. /**
  74926. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryMeshJob
  74927. * @description 获取某一个点聚合分析。
  74928. * @param {string} id - 空间分析的 id。
  74929. * @param {function} callback - 请求结果的回调函数。
  74930. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74931. */
  74932. }, {
  74933. key: "getSummaryMeshJob",
  74934. value: function getSummaryMeshJob(id, callback, resultFormat) {
  74935. var me = this,
  74936. format = me._processFormat(resultFormat);
  74937. var summaryMeshJobsService = new SummaryMeshJobsService_SummaryMeshJobsService(me.url, {
  74938. proxy: me.options.proxy,
  74939. withCredentials: me.options.withCredentials,
  74940. crossOrigin: me.options.crossOrigin,
  74941. headers: me.options.headers,
  74942. serverType: me.options.serverType,
  74943. eventListeners: {
  74944. scope: me,
  74945. processCompleted: callback,
  74946. processFailed: callback
  74947. },
  74948. format: format
  74949. });
  74950. summaryMeshJobsService.getSummaryMeshJob(id);
  74951. }
  74952. /**
  74953. * @function mapboxgl.supermap.ProcessingService.prototype.addSummaryMeshJob
  74954. * @description 新建一个点聚合分析。
  74955. * @param {SuperMap.SummaryMeshJobParameter} params - 点聚合分析任务参数类。
  74956. * @param {RequestCallback} callback 请求结果的回调函数。
  74957. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  74958. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74959. */
  74960. }, {
  74961. key: "addSummaryMeshJob",
  74962. value: function addSummaryMeshJob(params, callback, seconds, resultFormat) {
  74963. var me = this,
  74964. param = me._processParams(params),
  74965. format = me._processFormat(resultFormat);
  74966. var summaryMeshJobsService = new SummaryMeshJobsService_SummaryMeshJobsService(me.url, {
  74967. proxy: me.options.proxy,
  74968. withCredentials: me.options.withCredentials,
  74969. crossOrigin: me.options.crossOrigin,
  74970. headers: me.options.headers,
  74971. eventListeners: {
  74972. scope: me,
  74973. processCompleted: callback,
  74974. processFailed: callback,
  74975. processRunning: function processRunning(job) {
  74976. me.summaryMeshJobs[job.id] = job.state;
  74977. }
  74978. },
  74979. format: format
  74980. });
  74981. summaryMeshJobsService.addSummaryMeshJob(param, seconds);
  74982. }
  74983. /**
  74984. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryMeshJobState
  74985. * @description 获取点聚合分析的状态。
  74986. * @param {string} id - 点聚合分析的 ID。
  74987. * @returns {Object} 点聚合分析的状态。
  74988. */
  74989. }, {
  74990. key: "getSummaryMeshJobState",
  74991. value: function getSummaryMeshJobState(id) {
  74992. return this.summaryMeshJobs[id];
  74993. }
  74994. /**
  74995. * @function mapboxgl.supermap.ProcessingService.prototype.getQueryJobs
  74996. * @description 获取单对象查询分析的列表。
  74997. * @param {RequestCallback} callback - 请求结果的回调函数。
  74998. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74999. */
  75000. }, {
  75001. key: "getQueryJobs",
  75002. value: function getQueryJobs(callback, resultFormat) {
  75003. var me = this,
  75004. format = me._processFormat(resultFormat);
  75005. var singleObjectQueryJobsService = new SingleObjectQueryJobsService_SingleObjectQueryJobsService(me.url, {
  75006. proxy: me.options.proxy,
  75007. withCredentials: me.options.withCredentials,
  75008. serverType: me.options.serverType,
  75009. crossOrigin: me.options.crossOrigin,
  75010. headers: me.options.headers,
  75011. eventListeners: {
  75012. scope: me,
  75013. processCompleted: callback,
  75014. processFailed: callback
  75015. },
  75016. format: format
  75017. });
  75018. singleObjectQueryJobsService.getQueryJobs();
  75019. }
  75020. /**
  75021. * @function mapboxgl.supermap.ProcessingService.prototype.getQueryJob
  75022. * @description 获取某一个单对象查询分析。
  75023. * @param {string} id - 空间分析的 id。
  75024. * @param {RequestCallback} callback - 请求结果的回调函数。
  75025. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75026. */
  75027. }, {
  75028. key: "getQueryJob",
  75029. value: function getQueryJob(id, callback, resultFormat) {
  75030. var me = this,
  75031. format = me._processFormat(resultFormat);
  75032. var singleObjectQueryJobsService = new SingleObjectQueryJobsService_SingleObjectQueryJobsService(me.url, {
  75033. proxy: me.options.proxy,
  75034. withCredentials: me.options.withCredentials,
  75035. crossOrigin: me.options.crossOrigin,
  75036. headers: me.options.headers,
  75037. serverType: me.options.serverType,
  75038. eventListeners: {
  75039. scope: me,
  75040. processCompleted: callback,
  75041. processFailed: callback
  75042. },
  75043. format: format
  75044. });
  75045. singleObjectQueryJobsService.getQueryJob(id);
  75046. }
  75047. /**
  75048. * @function mapboxgl.supermap.ProcessingService.prototype.addQueryJob
  75049. * @description 新建一个单对象查询分析。
  75050. * @param {SuperMap.SingleObjectQueryJobsParameter} params -创建一个空间分析的请求参数。
  75051. * @param {RequestCallback} callback - 请求结果的回调函数。
  75052. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75053. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75054. */
  75055. }, {
  75056. key: "addQueryJob",
  75057. value: function addQueryJob(params, callback, seconds, resultFormat) {
  75058. var me = this,
  75059. param = me._processParams(params),
  75060. format = me._processFormat(resultFormat);
  75061. var singleObjectQueryJobsService = new SingleObjectQueryJobsService_SingleObjectQueryJobsService(me.url, {
  75062. proxy: me.options.proxy,
  75063. withCredentials: me.options.withCredentials,
  75064. crossOrigin: me.options.crossOrigin,
  75065. headers: me.options.headers,
  75066. eventListeners: {
  75067. scope: me,
  75068. processCompleted: callback,
  75069. processFailed: callback,
  75070. processRunning: function processRunning(job) {
  75071. me.queryJobs[job.id] = job.state;
  75072. }
  75073. },
  75074. format: format
  75075. });
  75076. singleObjectQueryJobsService.addQueryJob(param, seconds);
  75077. }
  75078. /**
  75079. * @function mapboxgl.supermap.ProcessingService.prototype.getQueryJobState
  75080. * @description 获取单对象查询分析的状态。
  75081. * @param {string} id - 单对象查询分析的 ID。
  75082. * @returns {Object} 单对象查询分析的状态。
  75083. */
  75084. }, {
  75085. key: "getQueryJobState",
  75086. value: function getQueryJobState(id) {
  75087. return this.queryJobs[id];
  75088. }
  75089. /**
  75090. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryRegionJobs
  75091. * @description 获取区域汇总分析的列表。
  75092. * @param {RequestCallback} callback - 请求结果的回调函数。
  75093. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75094. */
  75095. }, {
  75096. key: "getSummaryRegionJobs",
  75097. value: function getSummaryRegionJobs(callback, resultFormat) {
  75098. var me = this,
  75099. format = me._processFormat(resultFormat);
  75100. var summaryRegionJobsService = new SummaryRegionJobsService_SummaryRegionJobsService(me.url, {
  75101. proxy: me.options.proxy,
  75102. withCredentials: me.options.withCredentials,
  75103. crossOrigin: me.options.crossOrigin,
  75104. headers: me.options.headers,
  75105. serverType: me.options.serverType,
  75106. eventListeners: {
  75107. scope: me,
  75108. processCompleted: callback,
  75109. processFailed: callback
  75110. },
  75111. format: format
  75112. });
  75113. summaryRegionJobsService.getSummaryRegionJobs();
  75114. }
  75115. /**
  75116. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryRegionJob
  75117. * @description 获取某一个区域汇总分析。
  75118. * @param {string} id - 区域汇总分析的 id。
  75119. * @param {RequestCallback} callback - 请求结果的回调函数。
  75120. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75121. */
  75122. }, {
  75123. key: "getSummaryRegionJob",
  75124. value: function getSummaryRegionJob(id, callback, resultFormat) {
  75125. var me = this,
  75126. format = me._processFormat(resultFormat);
  75127. var summaryRegionJobsService = new SummaryRegionJobsService_SummaryRegionJobsService(me.url, {
  75128. proxy: me.options.proxy,
  75129. withCredentials: me.options.withCredentials,
  75130. crossOrigin: me.options.crossOrigin,
  75131. headers: me.options.headers,
  75132. serverType: me.options.serverType,
  75133. eventListeners: {
  75134. scope: me,
  75135. processCompleted: callback,
  75136. processFailed: callback
  75137. },
  75138. format: format
  75139. });
  75140. summaryRegionJobsService.getSummaryRegionJob(id);
  75141. }
  75142. /**
  75143. * @function mapboxgl.supermap.ProcessingService.prototype.addSummaryRegionJob
  75144. * @description 新建一个区域汇总分析。
  75145. * @param {SuperMap.SummaryRegionJobParameter} params - 区域汇总分析参数类。
  75146. * @param {RequestCallback} callback - 请求结果的回调函数。
  75147. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75148. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75149. */
  75150. }, {
  75151. key: "addSummaryRegionJob",
  75152. value: function addSummaryRegionJob(params, callback, seconds, resultFormat) {
  75153. var me = this,
  75154. param = me._processParams(params),
  75155. format = me._processFormat(resultFormat);
  75156. var summaryRegionJobsService = new SummaryRegionJobsService_SummaryRegionJobsService(me.url, {
  75157. proxy: me.options.proxy,
  75158. withCredentials: me.options.withCredentials,
  75159. crossOrigin: me.options.crossOrigin,
  75160. headers: me.options.headers,
  75161. eventListeners: {
  75162. scope: me,
  75163. processCompleted: callback,
  75164. processFailed: callback,
  75165. processRunning: function processRunning(job) {
  75166. me.summaryRegionJobs[job.id] = job.state;
  75167. }
  75168. },
  75169. format: format
  75170. });
  75171. summaryRegionJobsService.addSummaryRegionJob(param, seconds);
  75172. }
  75173. /**
  75174. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryRegionJobState
  75175. * @description 获取区域汇总分析的状态。
  75176. * @param {string} id - 生成区域汇总分析的 id。
  75177. * @returns {Object} 区域汇总分析的状态。
  75178. */
  75179. }, {
  75180. key: "getSummaryRegionJobState",
  75181. value: function getSummaryRegionJobState(id) {
  75182. return this.summaryRegionJobs[id];
  75183. }
  75184. /**
  75185. * @function mapboxgl.supermap.ProcessingService.prototype.getVectorClipJobs
  75186. * @description 获取矢量裁剪分析的列表。
  75187. * @param {RequestCallback} callback - 请求结果的回调函数。
  75188. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75189. */
  75190. }, {
  75191. key: "getVectorClipJobs",
  75192. value: function getVectorClipJobs(callback, resultFormat) {
  75193. var me = this,
  75194. format = me._processFormat(resultFormat);
  75195. var vectorClipJobsService = new VectorClipJobsService_VectorClipJobsService(me.url, {
  75196. proxy: me.options.proxy,
  75197. withCredentials: me.options.withCredentials,
  75198. crossOrigin: me.options.crossOrigin,
  75199. headers: me.options.headers,
  75200. serverType: me.options.serverType,
  75201. eventListeners: {
  75202. scope: me,
  75203. processCompleted: callback,
  75204. processFailed: callback
  75205. },
  75206. format: format
  75207. });
  75208. vectorClipJobsService.getVectorClipJobs();
  75209. }
  75210. /**
  75211. * @function mapboxgl.supermap.ProcessingService.prototype.getVectorClipJob
  75212. * @description 获取某一个矢量裁剪分析。
  75213. * @param {string} id - 空间分析的 id。
  75214. * @param {RequestCallback} callback - 请求结果的回调函数。
  75215. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75216. */
  75217. }, {
  75218. key: "getVectorClipJob",
  75219. value: function getVectorClipJob(id, callback, resultFormat) {
  75220. var me = this,
  75221. format = me._processFormat(resultFormat);
  75222. var vectorClipJobsService = new VectorClipJobsService_VectorClipJobsService(me.url, {
  75223. proxy: me.options.proxy,
  75224. withCredentials: me.options.withCredentials,
  75225. serverType: me.options.serverType,
  75226. crossOrigin: me.options.crossOrigin,
  75227. headers: me.options.headers,
  75228. eventListeners: {
  75229. scope: me,
  75230. processCompleted: callback,
  75231. processFailed: callback
  75232. },
  75233. format: format
  75234. });
  75235. vectorClipJobsService.getVectorClipJob(id);
  75236. }
  75237. /**
  75238. * @function mapboxgl.supermap.ProcessingService.prototype.addVectorClipJob
  75239. * @description 新建一个矢量裁剪分析。
  75240. * @param {SuperMap.VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  75241. * @param {RequestCallback} callback - 请求结果的回调函数。
  75242. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75243. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75244. */
  75245. }, {
  75246. key: "addVectorClipJob",
  75247. value: function addVectorClipJob(params, callback, seconds, resultFormat) {
  75248. var me = this,
  75249. param = me._processParams(params),
  75250. format = me._processFormat(resultFormat);
  75251. var vectorClipJobsService = new VectorClipJobsService_VectorClipJobsService(me.url, {
  75252. proxy: me.options.proxy,
  75253. withCredentials: me.options.withCredentials,
  75254. serverType: me.options.serverType,
  75255. crossOrigin: me.options.crossOrigin,
  75256. headers: me.options.headers,
  75257. eventListeners: {
  75258. scope: me,
  75259. processCompleted: callback,
  75260. processFailed: callback,
  75261. processRunning: function processRunning(job) {
  75262. me.vectorClipJobs[job.id] = job.state;
  75263. }
  75264. },
  75265. format: format
  75266. });
  75267. vectorClipJobsService.addVectorClipJob(param, seconds);
  75268. }
  75269. /**
  75270. * @function mapboxgl.supermap.ProcessingService.prototype.getVectorClipJobState
  75271. * @description 获取矢量裁剪分析的状态。
  75272. * @param {number} id - 矢量裁剪分析的id。
  75273. * @returns {Object} 矢量裁剪分析的状态。
  75274. */
  75275. }, {
  75276. key: "getVectorClipJobState",
  75277. value: function getVectorClipJobState(id) {
  75278. return this.vectorClipJobs[id];
  75279. }
  75280. /**
  75281. * @function mapboxgl.supermap.processingService.prototype.getOverlayGeoJobs
  75282. * @description 获取叠加分析的列表。
  75283. * @param {RequestCallback} callback - 请求结果的回调函数。
  75284. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75285. */
  75286. }, {
  75287. key: "getOverlayGeoJobs",
  75288. value: function getOverlayGeoJobs(callback, resultFormat) {
  75289. var me = this,
  75290. format = me._processFormat(resultFormat);
  75291. var overlayGeoJobsService = new OverlayGeoJobsService_OverlayGeoJobsService(me.url, {
  75292. proxy: me.options.proxy,
  75293. withCredentials: me.options.withCredentials,
  75294. serverType: me.options.serverType,
  75295. crossOrigin: me.options.crossOrigin,
  75296. headers: me.options.headers,
  75297. eventListeners: {
  75298. scope: me,
  75299. processCompleted: callback,
  75300. processFailed: callback
  75301. },
  75302. format: format
  75303. });
  75304. overlayGeoJobsService.getOverlayGeoJobs();
  75305. }
  75306. /**
  75307. * @function mapboxgl.supermap.processingService.prototype.getOverlayGeoJob
  75308. * @description 获取某一个叠加分析。
  75309. * @param {string} id - 空间分析的 ID。
  75310. * @param {RequestCallback} callback - 请求结果的回调函数。
  75311. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75312. */
  75313. }, {
  75314. key: "getOverlayGeoJob",
  75315. value: function getOverlayGeoJob(id, callback, resultFormat) {
  75316. var me = this,
  75317. format = me._processFormat(resultFormat);
  75318. var overlayGeoJobsService = new OverlayGeoJobsService_OverlayGeoJobsService(me.url, {
  75319. proxy: me.options.proxy,
  75320. withCredentials: me.options.withCredentials,
  75321. serverType: me.options.serverType,
  75322. crossOrigin: me.options.crossOrigin,
  75323. headers: me.options.headers,
  75324. eventListeners: {
  75325. scope: me,
  75326. processCompleted: callback,
  75327. processFailed: callback
  75328. },
  75329. format: format
  75330. });
  75331. overlayGeoJobsService.getOverlayGeoJob(id);
  75332. }
  75333. /**
  75334. * @function mapboxgl.supermap.processingService.prototype.addOverlayGeoJob
  75335. * @description 新建一个叠加分析。
  75336. * @param {SuperMap.OverlayGeoJobParameter} params - 创建一个空间分析的请求参数。
  75337. * @param {RequestCallback} callback - 请求结果的回调函数。
  75338. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75339. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75340. */
  75341. }, {
  75342. key: "addOverlayGeoJob",
  75343. value: function addOverlayGeoJob(params, callback, seconds, resultFormat) {
  75344. var me = this,
  75345. param = me._processParams(params),
  75346. format = me._processFormat(resultFormat);
  75347. var overlayGeoJobsService = new OverlayGeoJobsService_OverlayGeoJobsService(me.url, {
  75348. proxy: me.options.proxy,
  75349. withCredentials: me.options.withCredentials,
  75350. serverType: me.options.serverType,
  75351. crossOrigin: me.options.crossOrigin,
  75352. headers: me.options.headers,
  75353. eventListeners: {
  75354. scope: me,
  75355. processCompleted: callback,
  75356. processFailed: callback,
  75357. processRunning: function processRunning(job) {
  75358. me.overlayGeoJobs[job.id] = job.state;
  75359. }
  75360. },
  75361. format: format
  75362. });
  75363. overlayGeoJobsService.addOverlayGeoJob(param, seconds);
  75364. }
  75365. /**
  75366. * @function mapboxgl.supermap.processingService.prototype.getoverlayGeoJobState
  75367. * @description 获取叠加分析的状态。
  75368. * @param {string} id - 叠加分析的id。
  75369. * @returns {Object} 叠加分析的状态
  75370. */
  75371. }, {
  75372. key: "getoverlayGeoJobState",
  75373. value: function getoverlayGeoJobState(id) {
  75374. return this.overlayGeoJobs[id];
  75375. }
  75376. /**
  75377. * @function mapboxgl.supermap.processingService.prototype.getBuffersJobs
  75378. * @description 获取缓冲区分析的列表。
  75379. * @param {RequestCallback} callback - 请求结果的回调函数。
  75380. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75381. */
  75382. }, {
  75383. key: "getBuffersJobs",
  75384. value: function getBuffersJobs(callback, resultFormat) {
  75385. var me = this,
  75386. format = me._processFormat(resultFormat);
  75387. var buffersAnalystJobsService = new BuffersAnalystJobsService_BuffersAnalystJobsService(me.url, {
  75388. proxy: me.options.proxy,
  75389. withCredentials: me.options.withCredentials,
  75390. serverType: me.options.serverType,
  75391. crossOrigin: me.options.crossOrigin,
  75392. headers: me.options.headers,
  75393. eventListeners: {
  75394. scope: me,
  75395. processCompleted: callback,
  75396. processFailed: callback
  75397. },
  75398. format: format
  75399. });
  75400. buffersAnalystJobsService.getBuffersJobs();
  75401. }
  75402. /**
  75403. * @function mapboxgl.supermap.processingService.prototype.getBuffersJob
  75404. * @description 获取某一个缓冲区分析。
  75405. * @param {string} id - 空间分析的 ID。
  75406. * @param {RequestCallback} callback - 请求结果的回调函数。
  75407. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75408. */
  75409. }, {
  75410. key: "getBuffersJob",
  75411. value: function getBuffersJob(id, callback, resultFormat) {
  75412. var me = this,
  75413. format = me._processFormat(resultFormat);
  75414. var buffersAnalystJobsService = new BuffersAnalystJobsService_BuffersAnalystJobsService(me.url, {
  75415. proxy: me.options.proxy,
  75416. withCredentials: me.options.withCredentials,
  75417. serverType: me.options.serverType,
  75418. crossOrigin: me.options.crossOrigin,
  75419. headers: me.options.headers,
  75420. eventListeners: {
  75421. scope: me,
  75422. processCompleted: callback,
  75423. processFailed: callback
  75424. },
  75425. format: format
  75426. });
  75427. buffersAnalystJobsService.getBuffersJob(id);
  75428. }
  75429. /**
  75430. * @function mapboxgl.supermap.processingService.prototype.addBuffersJob
  75431. * @description 新建一个缓冲区分析。
  75432. * @param {SuperMap.BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  75433. * @param {RequestCallback} callback - 请求结果的回调函数。
  75434. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  75435. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75436. */
  75437. }, {
  75438. key: "addBuffersJob",
  75439. value: function addBuffersJob(params, callback, seconds, resultFormat) {
  75440. var me = this,
  75441. param = me._processParams(params),
  75442. format = me._processFormat(resultFormat);
  75443. var buffersAnalystJobsService = new BuffersAnalystJobsService_BuffersAnalystJobsService(me.url, {
  75444. proxy: me.options.proxy,
  75445. withCredentials: me.options.withCredentials,
  75446. serverType: me.options.serverType,
  75447. crossOrigin: me.options.crossOrigin,
  75448. headers: me.options.headers,
  75449. eventListeners: {
  75450. scope: me,
  75451. processCompleted: callback,
  75452. processFailed: callback,
  75453. processRunning: function processRunning(job) {
  75454. me.buffersJobs[job.id] = job.state;
  75455. }
  75456. },
  75457. format: format
  75458. });
  75459. buffersAnalystJobsService.addBuffersJob(param, seconds);
  75460. }
  75461. /**
  75462. * @function mapboxgl.supermap.processingService.prototype.getBuffersJobState
  75463. * @description 获取缓冲区分析的状态。
  75464. * @param {string} id - 缓冲区分析的 ID。
  75465. * @returns {Object} 缓冲区分析的状态。
  75466. */
  75467. }, {
  75468. key: "getBuffersJobState",
  75469. value: function getBuffersJobState(id) {
  75470. return this.buffersJobs[id];
  75471. }
  75472. /**
  75473. * @function mapboxgl.supermap.processingService.prototype.getTopologyValidatorJobs
  75474. * @description 获取拓扑检查分析的列表。
  75475. * @param {RequestCallback} callback - 请求结果的回调函数。
  75476. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75477. */
  75478. }, {
  75479. key: "getTopologyValidatorJobs",
  75480. value: function getTopologyValidatorJobs(callback, resultFormat) {
  75481. var me = this,
  75482. format = me._processFormat(resultFormat);
  75483. var topologyValidatorJobsService = new TopologyValidatorJobsService_TopologyValidatorJobsService(me.url, {
  75484. proxy: me.options.proxy,
  75485. withCredentials: me.options.withCredentials,
  75486. serverType: me.options.serverType,
  75487. crossOrigin: me.options.crossOrigin,
  75488. headers: me.options.headers,
  75489. eventListeners: {
  75490. scope: me,
  75491. processCompleted: callback,
  75492. processFailed: callback
  75493. },
  75494. format: format
  75495. });
  75496. topologyValidatorJobsService.getTopologyValidatorJobs();
  75497. }
  75498. /**
  75499. * @function mapboxgl.supermap.processingService.prototype.getTopologyValidatorJob
  75500. * @description 获取某一个拓扑检查分析。
  75501. * @param {string} id - 空间分析的 ID。
  75502. * @param {RequestCallback} callback - 请求结果的回调函数。
  75503. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75504. */
  75505. }, {
  75506. key: "getTopologyValidatorJob",
  75507. value: function getTopologyValidatorJob(id, callback, resultFormat) {
  75508. var me = this,
  75509. format = me._processFormat(resultFormat);
  75510. var topologyValidatorJobsService = new TopologyValidatorJobsService_TopologyValidatorJobsService(me.url, {
  75511. proxy: me.options.proxy,
  75512. withCredentials: me.options.withCredentials,
  75513. serverType: me.options.serverType,
  75514. crossOrigin: me.options.crossOrigin,
  75515. headers: me.options.headers,
  75516. eventListeners: {
  75517. scope: me,
  75518. processCompleted: callback,
  75519. processFailed: callback
  75520. },
  75521. format: format
  75522. });
  75523. topologyValidatorJobsService.getTopologyValidatorJob(id);
  75524. }
  75525. /**
  75526. * @function mapboxgl.supermap.processingService.prototype.addTopologyValidatorJob
  75527. * @description 新建一个拓扑检查分析。
  75528. * @param {SuperMap.TopologyValidatorJobsParameter} params - 创建一个空间分析的请求参数。
  75529. * @param {RequestCallback} callback - 请求结果的回调函数。
  75530. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75531. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75532. */
  75533. }, {
  75534. key: "addTopologyValidatorJob",
  75535. value: function addTopologyValidatorJob(params, callback, seconds, resultFormat) {
  75536. var me = this,
  75537. param = me._processParams(params),
  75538. format = me._processFormat(resultFormat);
  75539. var topologyValidatorJobsService = new TopologyValidatorJobsService_TopologyValidatorJobsService(me.url, {
  75540. proxy: me.options.proxy,
  75541. withCredentials: me.options.withCredentials,
  75542. serverType: me.options.serverType,
  75543. crossOrigin: me.options.crossOrigin,
  75544. headers: me.options.headers,
  75545. eventListeners: {
  75546. scope: me,
  75547. processCompleted: callback,
  75548. processFailed: callback,
  75549. processRunning: function processRunning(job) {
  75550. me.topologyValidatorJobs[job.id] = job.state;
  75551. }
  75552. },
  75553. format: format
  75554. });
  75555. topologyValidatorJobsService.addTopologyValidatorJob(param, seconds);
  75556. }
  75557. /**
  75558. * @function mapboxgl.supermap.processingService.prototype.getTopologyValidatorJobState
  75559. * @description 获取拓扑检查分析的状态。
  75560. * @param {string} id - 拓扑检查分析的 ID。
  75561. * @returns {Object} 拓扑检查分析的状态。
  75562. */
  75563. }, {
  75564. key: "getTopologyValidatorJobState",
  75565. value: function getTopologyValidatorJobState(id) {
  75566. return this.topologyValidatorJobs[id];
  75567. }
  75568. /**
  75569. * @function mapboxgl.supermap.processingService.prototype.getSummaryAttributesJobs
  75570. * @description 获取属性汇总分析的列表。
  75571. * @param {RequestCallback} callback - 请求结果的回调函数。
  75572. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75573. */
  75574. }, {
  75575. key: "getSummaryAttributesJobs",
  75576. value: function getSummaryAttributesJobs(callback, resultFormat) {
  75577. var me = this,
  75578. format = me._processFormat(resultFormat);
  75579. var summaryAttributesJobsService = new SummaryAttributesJobsService_SummaryAttributesJobsService(me.url, {
  75580. proxy: me.options.proxy,
  75581. withCredentials: me.options.withCredentials,
  75582. serverType: me.options.serverType,
  75583. crossOrigin: me.options.crossOrigin,
  75584. headers: me.options.headers,
  75585. eventListeners: {
  75586. scope: me,
  75587. processCompleted: callback,
  75588. processFailed: callback
  75589. },
  75590. format: format
  75591. });
  75592. summaryAttributesJobsService.getSummaryAttributesJobs();
  75593. }
  75594. /**
  75595. * @function mapboxgl.supermap.processingService.prototype.getSummaryAttributesJob
  75596. * @description 获取某一个属性汇总分析。
  75597. * @param {string} id - 空间分析的 ID。
  75598. * @param {RequestCallback} callback - 请求结果的回调函数。
  75599. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75600. */
  75601. }, {
  75602. key: "getSummaryAttributesJob",
  75603. value: function getSummaryAttributesJob(id, callback, resultFormat) {
  75604. var me = this,
  75605. format = me._processFormat(resultFormat);
  75606. var summaryAttributesJobsService = new SummaryAttributesJobsService_SummaryAttributesJobsService(me.url, {
  75607. proxy: me.options.proxy,
  75608. withCredentials: me.options.withCredentials,
  75609. serverType: me.options.serverType,
  75610. crossOrigin: me.options.crossOrigin,
  75611. headers: me.options.headers,
  75612. eventListeners: {
  75613. scope: me,
  75614. processCompleted: callback,
  75615. processFailed: callback
  75616. },
  75617. format: format
  75618. });
  75619. summaryAttributesJobsService.getSummaryAttributesJob(id);
  75620. }
  75621. /**
  75622. * @function mapboxgl.supermap.processingService.prototype.addSummaryAttributesJob
  75623. * @description 新建一个属性汇总分析。
  75624. * @param {SuperMap.SummaryAttributesJobsParameter} params - 创建一个空间分析的请求参数。
  75625. * @param {RequestCallback} callback - 请求结果的回调函数。
  75626. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75627. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75628. */
  75629. }, {
  75630. key: "addSummaryAttributesJob",
  75631. value: function addSummaryAttributesJob(params, callback, seconds, resultFormat) {
  75632. var me = this,
  75633. param = me._processParams(params),
  75634. format = me._processFormat(resultFormat);
  75635. var summaryAttributesJobsService = new SummaryAttributesJobsService_SummaryAttributesJobsService(me.url, {
  75636. proxy: me.options.proxy,
  75637. withCredentials: me.options.withCredentials,
  75638. serverType: me.options.serverType,
  75639. crossOrigin: me.options.crossOrigin,
  75640. headers: me.options.headers,
  75641. eventListeners: {
  75642. scope: me,
  75643. processCompleted: callback,
  75644. processFailed: callback,
  75645. processRunning: function processRunning(job) {
  75646. me.summaryAttributesJobs[job.id] = job.state;
  75647. }
  75648. },
  75649. format: format
  75650. });
  75651. summaryAttributesJobsService.addSummaryAttributesJob(param, seconds);
  75652. }
  75653. /**
  75654. * @function mapboxgl.supermap.processingService.prototype.getSummaryAttributesJobState
  75655. * @description 获取属性汇总分析的状态。
  75656. * @param {string} id - 属性汇总分析的 ID。
  75657. * @returns {Object} 属性汇总分析的状态
  75658. */
  75659. }, {
  75660. key: "getSummaryAttributesJobState",
  75661. value: function getSummaryAttributesJobState(id) {
  75662. return this.summaryAttributesJobs[id];
  75663. }
  75664. }, {
  75665. key: "_processFormat",
  75666. value: function _processFormat(resultFormat) {
  75667. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  75668. }
  75669. }, {
  75670. key: "_processParams",
  75671. value: function _processParams(params) {
  75672. if (!params) {
  75673. return {};
  75674. }
  75675. if (params.bounds) {
  75676. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  75677. } //这里只允许传端的bounds
  75678. if (params.query) {
  75679. params.query = core_Util_Util.toSuperMapBounds(params.query);
  75680. }
  75681. if (params.geometryQuery) {
  75682. params.geometryQuery = core_Util_Util.toProcessingParam(params.geometryQuery);
  75683. }
  75684. if (params.geometryClip) {
  75685. params.geometryClip = core_Util_Util.toProcessingParam(params.geometryClip);
  75686. }
  75687. return params;
  75688. }
  75689. }]);
  75690. return ProcessingService;
  75691. }(ServiceBase);
  75692. external_mapboxgl_default.a.supermap.ProcessingService = ProcessingService_ProcessingService;
  75693. // CONCATENATED MODULE: ./src/mapboxgl/services/QueryService.js
  75694. 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); }
  75695. function services_QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  75696. 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); } }
  75697. function services_QueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_QueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_QueryService_defineProperties(Constructor, staticProps); return Constructor; }
  75698. 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); }
  75699. 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); }
  75700. 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); }; }
  75701. function services_QueryService_possibleConstructorReturn(self, call) { if (call && (services_QueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_QueryService_assertThisInitialized(self); }
  75702. function services_QueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  75703. 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; } }
  75704. 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); }
  75705. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  75706. * This program are made available under the terms of the Apache License, Version 2.0
  75707. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  75708. /**
  75709. * @class mapboxgl.supermap.QueryService
  75710. * @category iServer Map QueryResults
  75711. * @classdesc 地图查询服务类。
  75712. * 提供:范围查询,SQL 查询,几何查询,距离查询。
  75713. * @extends {mapboxgl.supermap.ServiceBase}
  75714. * @param {string} url - 地图查询服务访问地址。
  75715. * @param {Object} options - 服务交互时所需的可选参数。
  75716. * @param {string} [options.proxy] - 服务代理地址。
  75717. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  75718. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  75719. * @param {Object} [options.headers] - 请求头。
  75720. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  75721. * @example
  75722. * new mapboxgl.supermap.QueryService(url)
  75723. * .queryByBounds(param,function(result){
  75724. * //doSomething
  75725. * })
  75726. */
  75727. var services_QueryService_QueryService = /*#__PURE__*/function (_ServiceBase) {
  75728. services_QueryService_inherits(QueryService, _ServiceBase);
  75729. var _super = services_QueryService_createSuper(QueryService);
  75730. function QueryService(url, options) {
  75731. services_QueryService_classCallCheck(this, QueryService);
  75732. return _super.call(this, url, options);
  75733. }
  75734. /**
  75735. * @function mapboxgl.supermap.QueryService.prototype.queryByBounds
  75736. * @description Bounds 查询地图服务。
  75737. * @param {SuperMap.QueryByBoundsParameters} params - 通过 Bounds 查询的相关参数类。
  75738. * @param {RequestCallback} callback - 回调函数。
  75739. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  75740. */
  75741. services_QueryService_createClass(QueryService, [{
  75742. key: "queryByBounds",
  75743. value: function queryByBounds(params, callback, resultFormat) {
  75744. var me = this;
  75745. var queryService = new QueryByBoundsService_QueryByBoundsService(me.url, {
  75746. proxy: me.options.proxy,
  75747. withCredentials: me.options.withCredentials,
  75748. crossOrigin: me.options.crossOrigin,
  75749. headers: me.options.headers,
  75750. serverType: me.options.serverType,
  75751. eventListeners: {
  75752. scope: me,
  75753. processCompleted: callback,
  75754. processFailed: callback
  75755. },
  75756. format: me._processFormat(resultFormat)
  75757. });
  75758. queryService.processAsync(me._processParams(params));
  75759. }
  75760. /**
  75761. * @function mapboxgl.supermap.QueryService.prototype.queryByDistance
  75762. * @description 地图距离查询服务。
  75763. * @param {SuperMap.QueryByDistanceParameters} params - Distance 查询相关参数类。
  75764. * @param {RequestCallback} callback - 回调函数。
  75765. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型
  75766. */
  75767. }, {
  75768. key: "queryByDistance",
  75769. value: function queryByDistance(params, callback, resultFormat) {
  75770. var me = this;
  75771. var queryByDistanceService = new QueryByDistanceService_QueryByDistanceService(me.url, {
  75772. proxy: me.options.proxy,
  75773. withCredentials: me.options.withCredentials,
  75774. crossOrigin: me.options.crossOrigin,
  75775. headers: me.options.headers,
  75776. serverType: me.options.serverType,
  75777. eventListeners: {
  75778. scope: me,
  75779. processCompleted: callback,
  75780. processFailed: callback
  75781. },
  75782. format: me._processFormat(resultFormat)
  75783. });
  75784. queryByDistanceService.processAsync(me._processParams(params));
  75785. }
  75786. /**
  75787. * @function mapboxgl.supermap.QueryService.prototype.queryBySQL
  75788. * @description 地图 SQL 查询服务。
  75789. * @param {SuperMap.QueryBySQLParameters} params - SQL 查询相关参数类。
  75790. * @param {RequestCallback} callback - 回调函数。
  75791. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  75792. */
  75793. }, {
  75794. key: "queryBySQL",
  75795. value: function queryBySQL(params, callback, resultFormat) {
  75796. var me = this;
  75797. var queryBySQLService = new QueryBySQLService_QueryBySQLService(me.url, {
  75798. proxy: me.options.proxy,
  75799. withCredentials: me.options.withCredentials,
  75800. crossOrigin: me.options.crossOrigin,
  75801. headers: me.options.headers,
  75802. serverType: me.options.serverType,
  75803. eventListeners: {
  75804. scope: me,
  75805. processCompleted: callback,
  75806. processFailed: callback
  75807. },
  75808. format: me._processFormat(resultFormat)
  75809. });
  75810. queryBySQLService.processAsync(me._processParams(params));
  75811. }
  75812. /**
  75813. * @function mapboxgl.supermap.QueryService.prototype.queryByGeometry
  75814. * @description 地图几何查询服务。
  75815. * @param {SuperMap.QueryByGeometryParameters} params - Geometry 查询相关参数类。
  75816. * @param {RequestCallback} callback - 回调函数。
  75817. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  75818. */
  75819. }, {
  75820. key: "queryByGeometry",
  75821. value: function queryByGeometry(params, callback, resultFormat) {
  75822. var me = this;
  75823. var queryByGeometryService = new QueryByGeometryService_QueryByGeometryService(me.url, {
  75824. proxy: me.options.proxy,
  75825. withCredentials: me.options.withCredentials,
  75826. crossOrigin: me.options.crossOrigin,
  75827. headers: me.options.headers,
  75828. serverType: me.options.serverType,
  75829. eventListeners: {
  75830. scope: me,
  75831. processCompleted: callback,
  75832. processFailed: callback
  75833. },
  75834. format: me._processFormat(resultFormat)
  75835. });
  75836. queryByGeometryService.processAsync(me._processParams(params));
  75837. }
  75838. }, {
  75839. key: "_processParams",
  75840. value: function _processParams(params) {
  75841. if (!params) {
  75842. return {};
  75843. }
  75844. params.returnContent = params.returnContent == null ? true : params.returnContent;
  75845. if (params.queryParams && !core_Util_Util.isArray(params.queryParams)) {
  75846. params.queryParams = [params.queryParams];
  75847. }
  75848. if (params.bounds) {
  75849. if (params.bounds instanceof Array) {
  75850. params.bounds = new Bounds_Bounds(params.bounds[0], params.bounds[1], params.bounds[2], params.bounds[3]);
  75851. }
  75852. if (params.bounds instanceof external_mapboxgl_default.a.LngLatBounds) {
  75853. params.bounds = new Bounds_Bounds(params.bounds.getSouthWest().lng, params.bounds.getSouthWest().lat, params.bounds.getNorthEast().lng, params.bounds.getNorthEast().lat);
  75854. }
  75855. }
  75856. if (params.geometry) {
  75857. if (params.geometry instanceof external_mapboxgl_default.a.LngLat) {
  75858. params.geometry = new Point_Point(params.geometry.lng, params.geometry.lat);
  75859. }
  75860. if (params.geometry instanceof external_mapboxgl_default.a.Point) {
  75861. params.geometry = new Point_Point(params.geometry.x, params.geometry.y);
  75862. }
  75863. if (params.geometry instanceof external_mapboxgl_default.a.LngLatBounds) {
  75864. params.geometry = core_Util_Util.toSuperMapPolygon(params.geometry);
  75865. }
  75866. if (!(params.geometry instanceof Geometry_Geometry)) {
  75867. params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
  75868. }
  75869. }
  75870. return params;
  75871. }
  75872. }, {
  75873. key: "_processFormat",
  75874. value: function _processFormat(resultFormat) {
  75875. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  75876. }
  75877. }]);
  75878. return QueryService;
  75879. }(ServiceBase);
  75880. external_mapboxgl_default.a.supermap.QueryService = services_QueryService_QueryService;
  75881. // CONCATENATED MODULE: ./src/mapboxgl/services/SpatialAnalystService.js
  75882. 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); }
  75883. function SpatialAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  75884. 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); } }
  75885. function SpatialAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SpatialAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SpatialAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  75886. 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); }
  75887. function SpatialAnalystService_setPrototypeOf(o, p) { SpatialAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SpatialAnalystService_setPrototypeOf(o, p); }
  75888. 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); }; }
  75889. function SpatialAnalystService_possibleConstructorReturn(self, call) { if (call && (SpatialAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return SpatialAnalystService_assertThisInitialized(self); }
  75890. function SpatialAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  75891. 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; } }
  75892. function SpatialAnalystService_getPrototypeOf(o) { SpatialAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystService_getPrototypeOf(o); }
  75893. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  75894. * This program are made available under the terms of the Apache License, Version 2.0
  75895. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  75896. /**
  75897. * @class mapboxgl.supermap.SpatialAnalystService
  75898. * @extends {mapboxgl.supermap.ServiceBase}
  75899. * @category iServer SpatialAnalyst
  75900. * @classdesc 空间分析服务类。提供:地区太阳辐射、缓冲区分析、点密度分析、动态分段分析、空间关系分析、插值分析、栅格代数运算、叠加分析、路由定位、路由测量计算、表面分析、地形曲率计算、泰森多边形分析。
  75901. * @example
  75902. * new mapboxgl.supermap.SpatialAnalystService(url)
  75903. * .bufferAnalysis(params,function(result){
  75904. * //doSomething
  75905. * })
  75906. * @param {string} url - 服务的访问地址。
  75907. * @param {Object} options - 交互服务时所需可选参数。
  75908. * @param {string} [options.proxy] - 服务代理地址。
  75909. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  75910. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  75911. * @param {Object} [options.headers] - 请求头。
  75912. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  75913. */
  75914. var SpatialAnalystService_SpatialAnalystService = /*#__PURE__*/function (_ServiceBase) {
  75915. SpatialAnalystService_inherits(SpatialAnalystService, _ServiceBase);
  75916. var _super = SpatialAnalystService_createSuper(SpatialAnalystService);
  75917. function SpatialAnalystService(url, options) {
  75918. SpatialAnalystService_classCallCheck(this, SpatialAnalystService);
  75919. return _super.call(this, url, options);
  75920. }
  75921. /**
  75922. * @function mapboxgl.supermap.SpatialAnalystService.prototype.getAreaSolarRadiationResult
  75923. * @description 地区太阳辐射。
  75924. * @param {SuperMap.mapboxgl} params -查询相关参数类。
  75925. * @param {RequestCallback} callback - 回调函数。
  75926. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  75927. */
  75928. SpatialAnalystService_createClass(SpatialAnalystService, [{
  75929. key: "getAreaSolarRadiationResult",
  75930. value: function getAreaSolarRadiationResult(params, callback, resultFormat) {
  75931. var me = this;
  75932. var areaSolarRadiationService = new AreaSolarRadiationService_AreaSolarRadiationService(me.url, {
  75933. proxy: me.options.proxy,
  75934. withCredentials: me.options.withCredentials,
  75935. crossOrigin: me.options.crossOrigin,
  75936. headers: me.options.headers,
  75937. serverType: me.options.serverType,
  75938. eventListeners: {
  75939. scope: me,
  75940. processCompleted: callback,
  75941. processFailed: callback
  75942. },
  75943. format: me._processFormat(resultFormat)
  75944. });
  75945. areaSolarRadiationService.processAsync(params);
  75946. }
  75947. /**
  75948. * @function mapboxgl.supermap.SpatialAnalystService.prototype.bufferAnalysis
  75949. * @description 缓冲区分析。
  75950. * @param {SuperMap.DatasetBufferAnalystParameters} params - 查询相关参数类。
  75951. * @param {RequestCallback} callback - 回调函数。
  75952. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  75953. */
  75954. }, {
  75955. key: "bufferAnalysis",
  75956. value: function bufferAnalysis(params, callback, resultFormat) {
  75957. var me = this;
  75958. var bufferAnalystService = new BufferAnalystService_BufferAnalystService(me.url, {
  75959. proxy: me.options.proxy,
  75960. withCredentials: me.options.withCredentials,
  75961. crossOrigin: me.options.crossOrigin,
  75962. headers: me.options.headers,
  75963. serverType: me.options.serverType,
  75964. eventListeners: {
  75965. scope: me,
  75966. processCompleted: callback,
  75967. processFailed: callback
  75968. },
  75969. format: me._processFormat(resultFormat)
  75970. });
  75971. bufferAnalystService.processAsync(me._processParams(params));
  75972. }
  75973. /**
  75974. * @function mapboxgl.supermap.SpatialAnalystService.prototype.densityAnalysis
  75975. * @description 点密度分析。
  75976. * @param {SuperMap.DensityKernelAnalystParameters} params - 查询相关参数类。
  75977. * @param {RequestCallback} callback - 回调函数。
  75978. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  75979. */
  75980. }, {
  75981. key: "densityAnalysis",
  75982. value: function densityAnalysis(params, callback, resultFormat) {
  75983. var me = this;
  75984. var densityAnalystService = new DensityAnalystService_DensityAnalystService(me.url, {
  75985. proxy: me.options.proxy,
  75986. withCredentials: me.options.withCredentials,
  75987. crossOrigin: me.options.crossOrigin,
  75988. headers: me.options.headers,
  75989. serverType: me.options.serverType,
  75990. eventListeners: {
  75991. scope: me,
  75992. processCompleted: callback,
  75993. processFailed: callback
  75994. },
  75995. format: me._processFormat(resultFormat)
  75996. });
  75997. densityAnalystService.processAsync(me._processParams(params));
  75998. }
  75999. /**
  76000. * @function mapboxgl.supermap.SpatialAnalystService.prototype.generateSpatialData
  76001. * @description 动态分段分析。
  76002. * @param {SuperMap.GenerateSpatialDataParameters} params - 查询相关参数类。
  76003. * @param {RequestCallback} callback - 回调函数。
  76004. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76005. */
  76006. }, {
  76007. key: "generateSpatialData",
  76008. value: function generateSpatialData(params, callback, resultFormat) {
  76009. var me = this;
  76010. var generateSpatialDataService = new GenerateSpatialDataService_GenerateSpatialDataService(me.url, {
  76011. proxy: me.options.proxy,
  76012. withCredentials: me.options.withCredentials,
  76013. crossOrigin: me.options.crossOrigin,
  76014. headers: me.options.headers,
  76015. serverType: me.options.serverType,
  76016. eventListeners: {
  76017. scope: me,
  76018. processCompleted: callback,
  76019. processFailed: callback
  76020. },
  76021. format: me._processFormat(resultFormat)
  76022. });
  76023. generateSpatialDataService.processAsync(params);
  76024. }
  76025. /**
  76026. * @function mapboxgl.supermap.SpatialAnalystService.prototype.geoRelationAnalysis
  76027. * @description 空间关系分析。
  76028. * @param {SuperMap.GeoRelationAnalystParameters} params - 查询相关参数类。
  76029. * @param {RequestCallback} callback - 回调函数。
  76030. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76031. */
  76032. }, {
  76033. key: "geoRelationAnalysis",
  76034. value: function geoRelationAnalysis(params, callback, resultFormat) {
  76035. var me = this;
  76036. var geoRelationAnalystService = new GeoRelationAnalystService_GeoRelationAnalystService(me.url, {
  76037. proxy: me.options.proxy,
  76038. withCredentials: me.options.withCredentials,
  76039. crossOrigin: me.options.crossOrigin,
  76040. headers: me.options.headers,
  76041. serverType: me.options.serverType,
  76042. eventListeners: {
  76043. scope: me,
  76044. processCompleted: callback,
  76045. processFailed: callback
  76046. },
  76047. format: me._processFormat(resultFormat)
  76048. });
  76049. geoRelationAnalystService.processAsync(params);
  76050. }
  76051. /**
  76052. * @function mapboxgl.supermap.SpatialAnalystService.prototype.interpolationAnalysis
  76053. * @description 插值分析。
  76054. * @param {SuperMap.InterpolationRBFAnalystParameters} params - 查询相关参数类。
  76055. * @param {RequestCallback} callback - 回调函数。
  76056. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76057. */
  76058. }, {
  76059. key: "interpolationAnalysis",
  76060. value: function interpolationAnalysis(params, callback, resultFormat) {
  76061. var me = this;
  76062. var interpolationAnalystService = new InterpolationAnalystService_InterpolationAnalystService(me.url, {
  76063. proxy: me.options.proxy,
  76064. withCredentials: me.options.withCredentials,
  76065. crossOrigin: me.options.crossOrigin,
  76066. headers: me.options.headers,
  76067. serverType: me.options.serverType,
  76068. eventListeners: {
  76069. scope: me,
  76070. processCompleted: callback,
  76071. processFailed: callback
  76072. },
  76073. format: me._processFormat(resultFormat)
  76074. });
  76075. interpolationAnalystService.processAsync(me._processParams(params));
  76076. }
  76077. /**
  76078. * @function mapboxgl.supermap.SpatialAnalystService.prototype.mathExpressionAnalysis
  76079. * @description 栅格代数运算。
  76080. * @param {SuperMap.MathExpressionAnalysisParameters} params - 查询相关参数类。
  76081. * @param {RequestCallback} callback - 回调函数。
  76082. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76083. */
  76084. }, {
  76085. key: "mathExpressionAnalysis",
  76086. value: function mathExpressionAnalysis(params, callback, resultFormat) {
  76087. var me = this;
  76088. var mathExpressionAnalysisService = new MathExpressionAnalysisService_MathExpressionAnalysisService(me.url, {
  76089. proxy: me.options.proxy,
  76090. withCredentials: me.options.withCredentials,
  76091. crossOrigin: me.options.crossOrigin,
  76092. headers: me.options.headers,
  76093. serverType: me.options.serverType,
  76094. eventListeners: {
  76095. scope: me,
  76096. processCompleted: callback,
  76097. processFailed: callback
  76098. },
  76099. format: me._processFormat(resultFormat)
  76100. });
  76101. mathExpressionAnalysisService.processAsync(me._processParams(params));
  76102. }
  76103. /**
  76104. * @function mapboxgl.supermap.SpatialAnalystService.prototype.overlayAnalysis
  76105. * @description 叠加分析。
  76106. * @param {(SuperMap.DatasetOverlayAnalystParameters|SuperMap.GeometryOverlayAnalystParameters)} params - 叠加分析参数类,支持批量几何要素叠加分析。
  76107. * @param {RequestCallback} callback - 回调函数。
  76108. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76109. */
  76110. }, {
  76111. key: "overlayAnalysis",
  76112. value: function overlayAnalysis(params, callback, resultFormat) {
  76113. var me = this;
  76114. var overlayAnalystService = new OverlayAnalystService_OverlayAnalystService(me.url, {
  76115. proxy: me.options.proxy,
  76116. withCredentials: me.options.withCredentials,
  76117. crossOrigin: me.options.crossOrigin,
  76118. headers: me.options.headers,
  76119. serverType: me.options.serverType,
  76120. eventListeners: {
  76121. scope: me,
  76122. processCompleted: callback,
  76123. processFailed: callback
  76124. },
  76125. format: me._processFormat(resultFormat)
  76126. });
  76127. overlayAnalystService.processAsync(me._processParams(params));
  76128. }
  76129. /**
  76130. * @function mapboxgl.supermap.SpatialAnalystService.prototype.routeCalculateMeasure
  76131. * @description 路由测量计算。
  76132. * @param {SuperMap.RouteCalculateMeasureParameters} params - 查询相关参数类。
  76133. * @param {RequestCallback} callback - 回调函数。
  76134. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76135. */
  76136. }, {
  76137. key: "routeCalculateMeasure",
  76138. value: function routeCalculateMeasure(params, callback, resultFormat) {
  76139. var me = this;
  76140. var routeCalculateMeasureService = new RouteCalculateMeasureService_RouteCalculateMeasureService(me.url, {
  76141. proxy: me.options.proxy,
  76142. withCredentials: me.options.withCredentials,
  76143. crossOrigin: me.options.crossOrigin,
  76144. headers: me.options.headers,
  76145. serverType: me.options.serverType,
  76146. eventListeners: {
  76147. scope: me,
  76148. processCompleted: callback,
  76149. processFailed: callback
  76150. },
  76151. format: me._processFormat(resultFormat)
  76152. });
  76153. routeCalculateMeasureService.processAsync(me._processParams(params));
  76154. }
  76155. /**
  76156. * @function mapboxgl.supermap.SpatialAnalystService.prototype.routeLocate
  76157. * @description 路由定位。
  76158. * @param {SuperMap.RouteLocatorParameters} params - 查询相关参数类。
  76159. * @param {RequestCallback} callback - 回调函数。
  76160. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76161. */
  76162. }, {
  76163. key: "routeLocate",
  76164. value: function routeLocate(params, callback, resultFormat) {
  76165. var me = this;
  76166. var routeLocatorService = new RouteLocatorService_RouteLocatorService(me.url, {
  76167. proxy: me.options.proxy,
  76168. withCredentials: me.options.withCredentials,
  76169. crossOrigin: me.options.crossOrigin,
  76170. headers: me.options.headers,
  76171. serverType: me.options.serverType,
  76172. eventListeners: {
  76173. scope: me,
  76174. processCompleted: callback,
  76175. processFailed: callback
  76176. },
  76177. format: me._processFormat(resultFormat)
  76178. });
  76179. routeLocatorService.processAsync(me._processParams(params));
  76180. }
  76181. /**
  76182. * @function mapboxgl.supermap.SpatialAnalystService.prototype.surfaceAnalysis
  76183. * @description 表面分析。
  76184. * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析参数类。
  76185. * @param {RequestCallback} callback - 回调函数。
  76186. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76187. */
  76188. }, {
  76189. key: "surfaceAnalysis",
  76190. value: function surfaceAnalysis(params, callback, resultFormat) {
  76191. var me = this;
  76192. var surfaceAnalystService = new SurfaceAnalystService_SurfaceAnalystService(me.url, {
  76193. proxy: me.options.proxy,
  76194. withCredentials: me.options.withCredentials,
  76195. crossOrigin: me.options.crossOrigin,
  76196. headers: me.options.headers,
  76197. serverType: me.options.serverType,
  76198. eventListeners: {
  76199. scope: me,
  76200. processCompleted: callback,
  76201. processFailed: callback
  76202. },
  76203. format: me._processFormat(resultFormat)
  76204. });
  76205. surfaceAnalystService.processAsync(me._processParams(params));
  76206. }
  76207. /**
  76208. * @function mapboxgl.supermap.SpatialAnalystService.prototype.terrainCurvatureCalculate
  76209. * @description 地形曲率计算。
  76210. * @param {SuperMap.TerrainCurvatureCalculationParameters} params - 查询相关参数类。
  76211. * @param {RequestCallback} callback - 回调函数。
  76212. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76213. */
  76214. }, {
  76215. key: "terrainCurvatureCalculate",
  76216. value: function terrainCurvatureCalculate(params, callback, resultFormat) {
  76217. var me = this;
  76218. var terrainCurvatureCalculationService = new TerrainCurvatureCalculationService_TerrainCurvatureCalculationService(me.url, {
  76219. proxy: me.options.proxy,
  76220. withCredentials: me.options.withCredentials,
  76221. crossOrigin: me.options.crossOrigin,
  76222. headers: me.options.headers,
  76223. serverType: me.options.serverType,
  76224. eventListeners: {
  76225. scope: me,
  76226. processCompleted: callback,
  76227. processFailed: callback
  76228. },
  76229. format: me._processFormat(resultFormat)
  76230. });
  76231. terrainCurvatureCalculationService.processAsync(params);
  76232. }
  76233. /**
  76234. * @function mapboxgl.supermap.SpatialAnalystService.prototype.thiessenAnalysis
  76235. * @description 泰森多边形分析。
  76236. * @param {SuperMap.DatasetThiessenAnalystParameters} params - 查询相关参数类。
  76237. * @param {RequestCallback} callback - 回调函数。
  76238. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76239. */
  76240. }, {
  76241. key: "thiessenAnalysis",
  76242. value: function thiessenAnalysis(params, callback, resultFormat) {
  76243. var me = this;
  76244. var thiessenAnalystService = new ThiessenAnalystService_ThiessenAnalystService(me.url, {
  76245. proxy: me.options.proxy,
  76246. withCredentials: me.options.withCredentials,
  76247. crossOrigin: me.options.crossOrigin,
  76248. headers: me.options.headers,
  76249. serverType: me.options.serverType,
  76250. eventListeners: {
  76251. scope: me,
  76252. processCompleted: callback,
  76253. processFailed: callback
  76254. },
  76255. format: me._processFormat(resultFormat)
  76256. });
  76257. thiessenAnalystService.processAsync(me._processParams(params));
  76258. }
  76259. /**
  76260. * @function mapboxgl.supermap.SpatialAnalystService.prototype.geometrybatchAnalysis
  76261. * @description 批量空间分析。
  76262. * @param {Array} params - 批量分析参数对象数组,包括:
  76263. * @param {string} params.analystName - 空间分析方法的名称。包括:</br>
  76264. * "buffer","overlay","interpolationDensity","interpolationidw","interpolationRBF","interpolationKriging","isoregion","isoline"。
  76265. * @param {Object} params.param - 空间分析类型对应的请求参数,包括:</br>
  76266. * {SuperMap.GeometryBufferAnalystParameters} 缓冲区分析参数类。</br>
  76267. * {SuperMap.GeometryOverlayAnalystParameters} 叠加分析参数类。</br>
  76268. * {SuperMap.InterpolationAnalystParameters} 插值分析参数类。</br>
  76269. * {SuperMap.SurfaceAnalystParameters} 表面分析参数类。</br>
  76270. * @param {RequestCallback} callback - 回调函数。
  76271. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76272. */
  76273. }, {
  76274. key: "geometrybatchAnalysis",
  76275. value: function geometrybatchAnalysis(params, callback, resultFormat) {
  76276. var me = this;
  76277. var geometryBatchAnalystService = new GeometryBatchAnalystService_GeometryBatchAnalystService(me.url, {
  76278. serverType: me.options.serverType,
  76279. eventListeners: {
  76280. scope: me,
  76281. processCompleted: callback,
  76282. processFailed: callback
  76283. },
  76284. format: me._processFormat(resultFormat)
  76285. }); //处理批量分析中各个分类类型的参数:
  76286. var analystParameters = [];
  76287. for (var i = 0; i < params.length; i++) {
  76288. var tempParameter = params[i];
  76289. analystParameters.push({
  76290. analystName: tempParameter.analystName,
  76291. param: me._processParams(tempParameter.param)
  76292. });
  76293. }
  76294. geometryBatchAnalystService.processAsync(analystParameters);
  76295. }
  76296. }, {
  76297. key: "_processParams",
  76298. value: function _processParams(params) {
  76299. if (!params) {
  76300. return {};
  76301. }
  76302. if (params.bounds) {
  76303. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  76304. } //插值分析点数组转换
  76305. if (params.inputPoints) {
  76306. for (var i = 0; i < params.inputPoints.length; i++) {
  76307. var inputPoint = params.inputPoints[i];
  76308. if (core_Util_Util.isArray(inputPoint)) {
  76309. params.inputPoints[i] = {
  76310. x: inputPoint[0],
  76311. y: inputPoint[1],
  76312. tag: inputPoint[2]
  76313. };
  76314. }
  76315. }
  76316. } //点数组转换
  76317. if (params.points) {
  76318. for (var _i = 0; _i < params.points.length; _i++) {
  76319. var point = params.points[_i];
  76320. params.points[_i] = core_Util_Util.toSuperMapPoint(point);
  76321. }
  76322. } //mapboxgl点对象转SuperMap点对象
  76323. if (params.point) {
  76324. params.point = core_Util_Util.toSuperMapPoint(params.point);
  76325. } //初步判断mapbox数据就为geojson格式 ,进行转json格式即可
  76326. //栅格代数运算的范围
  76327. if (params.extractRegion) {
  76328. params.extractRegion = core_Util_Util.toSuperMapGeometry(params.extractRegion);
  76329. } //获取或设置表面分析参数
  76330. if (params.extractParameter && params.extractParameter.clipRegion) {
  76331. params.extractParameter.clipRegion = core_Util_Util.toSuperMapGeometry(params.extractParameter.clipRegion);
  76332. }
  76333. if (params.clipParam && params.clipParam.clipRegion) {
  76334. params.clipParam.clipRegion = core_Util_Util.toSuperMapGeometry(params.clipParam.clipRegion);
  76335. } //sourceRoute 路由对象。用于里程分析,该对象可以是用户自己生 成或在数据源中查询得到的符合标准的路由对象;geojson格式
  76336. if (params.sourceRoute) {
  76337. if (params.sourceRoute) {
  76338. var target = {};
  76339. target.type = "LINEM";
  76340. target.parts = [params.sourceRoute.geometry.coordinates.length];
  76341. target.points = [];
  76342. for (var _i2 = 0; _i2 < params.sourceRoute.geometry.coordinates.length; _i2++) {
  76343. var lnglat = params.sourceRoute.geometry.coordinates[_i2]; //measure 应该在传值时设置,
  76344. target.points = target.points.concat({
  76345. x: lnglat[0],
  76346. y: lnglat[1],
  76347. measure: lnglat[2]
  76348. });
  76349. }
  76350. params.sourceRoute = target;
  76351. }
  76352. } //operateRegions 操作面对象集合,数据集叠加分析,表示与这些面对象进行叠加分析
  76353. if (params.operateRegions && core_Util_Util.isArray(params.operateRegions)) {
  76354. params.operateRegions.map(function (geometry, key) {
  76355. params.operateRegions[key] = core_Util_Util.toSuperMapGeometry(geometry);
  76356. return params.operateRegions[key];
  76357. });
  76358. } //叠加分析,几何数据源 支持格式:GeoJson
  76359. if (params.sourceGeometry) {
  76360. var SRID = null;
  76361. if (params.sourceGeometrySRID) {
  76362. SRID = params.sourceGeometrySRID;
  76363. }
  76364. params.sourceGeometry = core_Util_Util.toSuperMapGeometry(params.sourceGeometry);
  76365. if (SRID) {
  76366. params.sourceGeometry.SRID = SRID;
  76367. }
  76368. delete params.sourceGeometry.sourceGeometrySRID;
  76369. }
  76370. if (params.operateGeometry) {
  76371. params.operateGeometry = core_Util_Util.toSuperMapGeometry(params.operateGeometry);
  76372. } //支持传入多个几何要素进行叠加分析:
  76373. if (params.sourceGeometries) {
  76374. var sourceGeometries = [];
  76375. for (var k = 0; k < params.sourceGeometries.length; k++) {
  76376. sourceGeometries.push(core_Util_Util.toSuperMapGeometry(params.sourceGeometries[k]));
  76377. }
  76378. params.sourceGeometries = sourceGeometries;
  76379. } //支持传入多个几何要素进行叠加分析:
  76380. if (params.operateGeometries) {
  76381. var operateGeometries = [];
  76382. for (var j = 0; j < params.operateGeometries.length; j++) {
  76383. operateGeometries.push(core_Util_Util.toSuperMapGeometry(params.operateGeometries[j]));
  76384. }
  76385. params.operateGeometries = operateGeometries;
  76386. } //components 几何对象数组
  76387. if (params.sourceRoute && params.sourceRoute.components && core_Util_Util.isArray(params.sourceRoute.components)) {
  76388. params.sourceRoute.components.map(function (geometry, key) {
  76389. params.sourceRoute.components[key] = core_Util_Util.toSuperMapGeometry(geometry);
  76390. return params.sourceRoute.components[key];
  76391. });
  76392. }
  76393. return params;
  76394. }
  76395. }, {
  76396. key: "_processFormat",
  76397. value: function _processFormat(resultFormat) {
  76398. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  76399. }
  76400. }]);
  76401. return SpatialAnalystService;
  76402. }(ServiceBase);
  76403. external_mapboxgl_default.a.supermap.SpatialAnalystService = SpatialAnalystService_SpatialAnalystService;
  76404. // CONCATENATED MODULE: ./src/mapboxgl/services/ThemeService.js
  76405. 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); }
  76406. function services_ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76407. 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); } }
  76408. function services_ThemeService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ThemeService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ThemeService_defineProperties(Constructor, staticProps); return Constructor; }
  76409. 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); }
  76410. 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); }
  76411. 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); }; }
  76412. function services_ThemeService_possibleConstructorReturn(self, call) { if (call && (services_ThemeService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_ThemeService_assertThisInitialized(self); }
  76413. function services_ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  76414. 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; } }
  76415. 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); }
  76416. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  76417. * This program are made available under the terms of the Apache License, Version 2.0
  76418. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76419. /**
  76420. * @class mapboxgl.supermap.ThemeService
  76421. * @category iServer Map Theme
  76422. * @classdesc 专题图服务类。
  76423. * @extends {mapboxgl.supermap.ServiceBase}
  76424. * @example
  76425. * new mapboxgl.supermap.ThemeService(url,{
  76426. * projection:projection
  76427. * }).getThemeInfo(params,function(result){
  76428. * //doSomething
  76429. * });
  76430. * @param {string} url - 服务的访问地址。
  76431. * @param {Object} options - 交互服务时所需可选参数。
  76432. * @param {string} [options.proxy] - 服务代理地址。
  76433. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  76434. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  76435. * @param {Object} [options.headers] - 请求头。
  76436. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  76437. */
  76438. var services_ThemeService_ThemeService = /*#__PURE__*/function (_ServiceBase) {
  76439. services_ThemeService_inherits(ThemeService, _ServiceBase);
  76440. var _super = services_ThemeService_createSuper(ThemeService);
  76441. function ThemeService(url, options) {
  76442. services_ThemeService_classCallCheck(this, ThemeService);
  76443. return _super.call(this, url, options);
  76444. }
  76445. /**
  76446. * @function mapboxgl.supermap.ThemeService.prototype.getThemeInfo
  76447. * @description 获取专题图信息。
  76448. * @param {SuperMap.ThemeParameters} params - 专题图参数类。
  76449. * @param {RequestCallback} callback - 回调函数。
  76450. */
  76451. services_ThemeService_createClass(ThemeService, [{
  76452. key: "getThemeInfo",
  76453. value: function getThemeInfo(params, callback) {
  76454. var me = this;
  76455. var themeService = new ThemeService_ThemeService(me.url, {
  76456. proxy: me.options.proxy,
  76457. withCredentials: me.options.withCredentials,
  76458. crossOrigin: me.options.crossOrigin,
  76459. headers: me.options.headers,
  76460. serverType: me.options.serverType,
  76461. eventListeners: {
  76462. scope: me,
  76463. processCompleted: callback,
  76464. processFailed: callback
  76465. }
  76466. });
  76467. themeService.processAsync(params);
  76468. }
  76469. }]);
  76470. return ThemeService;
  76471. }(ServiceBase);
  76472. external_mapboxgl_default.a.supermap.ThemeService = services_ThemeService_ThemeService;
  76473. // CONCATENATED MODULE: ./src/mapboxgl/services/TrafficTransferAnalystService.js
  76474. 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); }
  76475. function TrafficTransferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76476. 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); } }
  76477. function TrafficTransferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TrafficTransferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TrafficTransferAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  76478. 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); }
  76479. function TrafficTransferAnalystService_setPrototypeOf(o, p) { TrafficTransferAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TrafficTransferAnalystService_setPrototypeOf(o, p); }
  76480. 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); }; }
  76481. function TrafficTransferAnalystService_possibleConstructorReturn(self, call) { if (call && (TrafficTransferAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return TrafficTransferAnalystService_assertThisInitialized(self); }
  76482. function TrafficTransferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  76483. 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; } }
  76484. function TrafficTransferAnalystService_getPrototypeOf(o) { TrafficTransferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TrafficTransferAnalystService_getPrototypeOf(o); }
  76485. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  76486. * This program are made available under the terms of the Apache License, Version 2.0
  76487. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76488. /**
  76489. * @class mapboxgl.supermap.TrafficTransferAnalystService
  76490. * @extends mapboxgl.supermap.ServiceBase
  76491. * @category iServer TrafficTransferAnalyst
  76492. * @classdesc 交通换乘分析服务类。
  76493. * @example
  76494. * new mapboxgl.supermap.TrafficTransferAnalystService(url)
  76495. * .queryStop(params,function(result){
  76496. * //doSomething
  76497. * })
  76498. * @param {string} url - 服务地址。
  76499. * @param {Object} option - 参数。
  76500. * @param {string} [options.proxy] - 服务代理地址。
  76501. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  76502. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  76503. * @param {Object} [options.headers] - 请求头。
  76504. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  76505. */
  76506. var TrafficTransferAnalystService_TrafficTransferAnalystService = /*#__PURE__*/function (_ServiceBase) {
  76507. TrafficTransferAnalystService_inherits(TrafficTransferAnalystService, _ServiceBase);
  76508. var _super = TrafficTransferAnalystService_createSuper(TrafficTransferAnalystService);
  76509. function TrafficTransferAnalystService(url, options) {
  76510. TrafficTransferAnalystService_classCallCheck(this, TrafficTransferAnalystService);
  76511. return _super.call(this, url, options);
  76512. }
  76513. /**
  76514. * @function mapboxgl.supermap.TrafficTransferAnalystService.prototype.queryStop
  76515. * @description 站点查询服务。
  76516. * @param {SuperMap.StopQueryParameters} params - 查询相关参数类。
  76517. * @param {RequestCallback} callback - 回调函数。
  76518. */
  76519. TrafficTransferAnalystService_createClass(TrafficTransferAnalystService, [{
  76520. key: "queryStop",
  76521. value: function queryStop(params, callback) {
  76522. var me = this;
  76523. var stopQueryService = new StopQueryService_StopQueryService(me.url, {
  76524. proxy: me.options.proxy,
  76525. withCredentials: me.options.withCredentials,
  76526. crossOrigin: me.options.crossOrigin,
  76527. headers: me.options.headers,
  76528. serverType: me.options.serverType,
  76529. eventListeners: {
  76530. scope: me,
  76531. processCompleted: callback,
  76532. processFailed: callback
  76533. }
  76534. });
  76535. stopQueryService.processAsync(params);
  76536. }
  76537. /**
  76538. * @function mapboxgl.supermap.TrafficTransferAnalystService.prototype.analysisTransferPath
  76539. * @description 交通换乘线路查询服务。
  76540. * @param {SuperMap.TransferPathParameters} params - 查询相关参数类。
  76541. * @param {RequestCallback} callback - 回调函数。
  76542. */
  76543. }, {
  76544. key: "analysisTransferPath",
  76545. value: function analysisTransferPath(params, callback) {
  76546. var me = this;
  76547. var transferPathService = new TransferPathService_TransferPathService(me.url, {
  76548. proxy: me.options.proxy,
  76549. withCredentials: me.options.withCredentials,
  76550. crossOrigin: me.options.crossOrigin,
  76551. headers: me.options.headers,
  76552. serverType: me.options.serverType,
  76553. eventListeners: {
  76554. scope: me,
  76555. processCompleted: callback,
  76556. processFailed: callback
  76557. }
  76558. });
  76559. transferPathService.processAsync(me._processParams(params));
  76560. }
  76561. /**
  76562. * @function mapboxgl.supermap.TrafficTransferAnalystService.prototype.analysisTransferSolution
  76563. * @description 交通换乘方案查询服务。
  76564. * @param {SuperMap.TransferSolutionParameters} params - 查询相关参数类。
  76565. * @param {RequestCallback} callback - 回调函数。
  76566. */
  76567. }, {
  76568. key: "analysisTransferSolution",
  76569. value: function analysisTransferSolution(params, callback) {
  76570. var me = this;
  76571. var transferSolutionService = new TransferSolutionService_TransferSolutionService(me.url, {
  76572. proxy: me.options.proxy,
  76573. withCredentials: me.options.withCredentials,
  76574. crossOrigin: me.options.crossOrigin,
  76575. headers: me.options.headers,
  76576. serverType: me.options.serverType,
  76577. eventListeners: {
  76578. scope: me,
  76579. processCompleted: callback,
  76580. processFailed: callback
  76581. }
  76582. });
  76583. transferSolutionService.processAsync(me._processParams(params));
  76584. }
  76585. }, {
  76586. key: "_processParams",
  76587. value: function _processParams(params) {
  76588. if (!params) {
  76589. return {};
  76590. }
  76591. if (params.transferLines && !core_Util_Util.isArray(params.transferLines)) {
  76592. params.transferLines = [params.transferLines];
  76593. }
  76594. if (params.points && core_Util_Util.isArray(params.points)) {
  76595. params.points.map(function (point, key) {
  76596. params.points[key] = point instanceof external_mapboxgl_default.a.LngLat ? {
  76597. x: point.lng,
  76598. y: point.lat
  76599. } : point;
  76600. return params.points[key];
  76601. });
  76602. }
  76603. return params;
  76604. }
  76605. }]);
  76606. return TrafficTransferAnalystService;
  76607. }(ServiceBase);
  76608. external_mapboxgl_default.a.supermap.TrafficTransferAnalystService = TrafficTransferAnalystService_TrafficTransferAnalystService;
  76609. // CONCATENATED MODULE: ./src/mapboxgl/services/WebPrintingJobService.js
  76610. 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); }
  76611. function WebPrintingJobService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76612. 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); } }
  76613. function WebPrintingJobService_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobService_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobService_defineProperties(Constructor, staticProps); return Constructor; }
  76614. 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); }
  76615. function WebPrintingJobService_setPrototypeOf(o, p) { WebPrintingJobService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebPrintingJobService_setPrototypeOf(o, p); }
  76616. 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); }; }
  76617. function WebPrintingJobService_possibleConstructorReturn(self, call) { if (call && (WebPrintingJobService_typeof(call) === "object" || typeof call === "function")) { return call; } return WebPrintingJobService_assertThisInitialized(self); }
  76618. function WebPrintingJobService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  76619. 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; } }
  76620. function WebPrintingJobService_getPrototypeOf(o) { WebPrintingJobService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingJobService_getPrototypeOf(o); }
  76621. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  76622. * This program are made available under the terms of the Apache License, Version 2.0
  76623. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76624. /**
  76625. * @class mapboxgl.supermap.WebPrintingJobService
  76626. * @category iServer WebPrintingJob
  76627. * @version 10.1.0
  76628. * @classdesc Web 打印服务类。
  76629. * 提供:创建 Web 打印任务,获取 Web 打印任务内容,获取 Web 打印输出文档流,获取 Web 打印服务的布局模板信息。
  76630. * @extends {mapboxgl.supermap.ServiceBase}
  76631. * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  76632. * @param {Object} options - 服务交互时所需的可选参数。
  76633. * @param {string} [options.proxy] - 服务代理地址。
  76634. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  76635. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  76636. * @param {Object} [options.headers] - 请求头。
  76637. * @example
  76638. * new mapboxgl.supermap.WebPrintingJobService(url)
  76639. * .createWebPrintingJob(param,function(result){
  76640. * //doSomething
  76641. * })
  76642. */
  76643. var WebPrintingJobService_WebPrintingJobService = /*#__PURE__*/function (_ServiceBase) {
  76644. WebPrintingJobService_inherits(WebPrintingJobService, _ServiceBase);
  76645. var _super = WebPrintingJobService_createSuper(WebPrintingJobService);
  76646. function WebPrintingJobService(url, options) {
  76647. WebPrintingJobService_classCallCheck(this, WebPrintingJobService);
  76648. return _super.call(this, url, options);
  76649. }
  76650. /**
  76651. * @function mapboxgl.supermap.WebPrintingJobService.prototype.createWebPrintingJob
  76652. * @description 创建 Web 打印任务。
  76653. * @param {SuperMap.WebPrintingJobParameters} params - 打印的请求参数。
  76654. * @param {RequestCallback} callback - 回调函数。
  76655. */
  76656. WebPrintingJobService_createClass(WebPrintingJobService, [{
  76657. key: "createWebPrintingJob",
  76658. value: function createWebPrintingJob(params, callback) {
  76659. if (!params) {
  76660. return;
  76661. }
  76662. var me = this;
  76663. var webPrintingService = new WebPrintingService_WebPrintingService(me.url, {
  76664. proxy: me.options.proxy,
  76665. withCredentials: me.options.withCredentials,
  76666. crossOrigin: me.options.crossOrigin,
  76667. headers: me.options.headers,
  76668. serverType: me.options.serverType,
  76669. eventListeners: {
  76670. scope: me,
  76671. processCompleted: callback,
  76672. processFailed: callback
  76673. }
  76674. });
  76675. webPrintingService.createWebPrintingJob(me._processParams(params));
  76676. }
  76677. /**
  76678. * @function mapboxgl.supermap.WebPrintingJobService.prototype.getPrintingJob
  76679. * @description 获取 Web 打印输出文档任务。
  76680. * @param {String} jobId - Web 打印输入文档任务 Id。
  76681. * @param {RequestCallback} callback - 回调函数。
  76682. */
  76683. }, {
  76684. key: "getPrintingJob",
  76685. value: function getPrintingJob(jobId, callback) {
  76686. var me = this;
  76687. var webPrintingService = new WebPrintingService_WebPrintingService(me.url, {
  76688. proxy: me.options.proxy,
  76689. withCredentials: me.options.withCredentials,
  76690. crossOrigin: me.options.crossOrigin,
  76691. headers: me.options.headers,
  76692. serverType: me.options.serverType,
  76693. eventListeners: {
  76694. scope: me,
  76695. processCompleted: callback,
  76696. processFailed: callback
  76697. }
  76698. });
  76699. webPrintingService.getPrintingJob(jobId);
  76700. }
  76701. /**
  76702. * @function mapboxgl.supermap.WebPrintingJobService.prototype.getPrintingJobResult
  76703. * @description 获取 Web 打印任务的输出文档。
  76704. * @param {String} jobId - Web 打印输入文档任务 Id。
  76705. * @param {RequestCallback} callback - 回调函数。
  76706. */
  76707. }, {
  76708. key: "getPrintingJobResult",
  76709. value: function getPrintingJobResult(jobId, callback) {
  76710. var me = this;
  76711. var webPrintingService = new WebPrintingService_WebPrintingService(me.url, {
  76712. proxy: me.options.proxy,
  76713. withCredentials: me.options.withCredentials,
  76714. crossOrigin: me.options.crossOrigin,
  76715. headers: me.options.headers,
  76716. serverType: me.options.serverType,
  76717. eventListeners: {
  76718. scope: me,
  76719. processCompleted: callback,
  76720. processFailed: callback
  76721. }
  76722. });
  76723. webPrintingService.getPrintingJobResult(jobId);
  76724. }
  76725. /**
  76726. * @function mapboxgl.supermap.WebPrintingJobService.prototype.getLayoutTemplates
  76727. * @description 查询 Web 打印服务所有可用的模板信息。
  76728. * @param {RequestCallback} callback - 回调函数。
  76729. */
  76730. }, {
  76731. key: "getLayoutTemplates",
  76732. value: function getLayoutTemplates(callback) {
  76733. var me = this;
  76734. var webPrintingService = new WebPrintingService_WebPrintingService(me.url, {
  76735. proxy: me.options.proxy,
  76736. withCredentials: me.options.withCredentials,
  76737. crossOrigin: me.options.crossOrigin,
  76738. headers: me.options.headers,
  76739. serverType: me.options.serverType,
  76740. eventListeners: {
  76741. scope: me,
  76742. processCompleted: callback,
  76743. processFailed: callback
  76744. }
  76745. });
  76746. webPrintingService.getLayoutTemplates();
  76747. }
  76748. }, {
  76749. key: "_processParams",
  76750. value: function _processParams(params) {
  76751. if (params.layoutOptions && params.layoutOptions.littleMapOptions) {
  76752. params.layoutOptions.littleMapOptions.center = this._toPointObject(params.layoutOptions.littleMapOptions.center);
  76753. }
  76754. if (params.exportOptions) {
  76755. params.exportOptions.center = this._toPointObject(params.exportOptions.center);
  76756. }
  76757. return params;
  76758. }
  76759. }, {
  76760. key: "_toPointObject",
  76761. value: function _toPointObject(point) {
  76762. if (core_Util_Util.isArray(point)) {
  76763. return {
  76764. x: point[0],
  76765. y: point[1]
  76766. };
  76767. } else if (point instanceof SuperMap.Geometry.Point || point instanceof external_mapboxgl_default.a.Point) {
  76768. return {
  76769. x: point.x,
  76770. y: point.y
  76771. };
  76772. } else if (point instanceof external_mapboxgl_default.a.LngLat) {
  76773. return {
  76774. x: point.lng,
  76775. y: point.lat
  76776. };
  76777. }
  76778. return point;
  76779. }
  76780. }]);
  76781. return WebPrintingJobService;
  76782. }(ServiceBase);
  76783. external_mapboxgl_default.a.supermap.WebPrintingJobService = WebPrintingJobService_WebPrintingJobService;
  76784. // CONCATENATED MODULE: ./src/mapboxgl/services/index.js
  76785. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  76786. * This program are made available under the terms of the Apache License, Version 2.0
  76787. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76788. // EXTERNAL MODULE: external "function(){try{return convert}catch(e){return {}}}()"
  76789. var external_function_try_return_convert_catch_e_return_ = __webpack_require__(6);
  76790. var external_function_try_return_convert_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_convert_catch_e_return_);
  76791. // EXTERNAL MODULE: external "function(){try{return canvg}catch(e){return {}}}()"
  76792. var external_function_try_return_canvg_catch_e_return_ = __webpack_require__(10);
  76793. var external_function_try_return_canvg_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_canvg_catch_e_return_);
  76794. // CONCATENATED MODULE: ./src/mapboxgl/mapping/WebMap.js
  76795. 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); }
  76796. function WebMap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76797. 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); } }
  76798. function WebMap_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebMap_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebMap_defineProperties(Constructor, staticProps); return Constructor; }
  76799. 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); }
  76800. function WebMap_setPrototypeOf(o, p) { WebMap_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebMap_setPrototypeOf(o, p); }
  76801. 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); }; }
  76802. function WebMap_possibleConstructorReturn(self, call) { if (call && (WebMap_typeof(call) === "object" || typeof call === "function")) { return call; } return WebMap_assertThisInitialized(self); }
  76803. function WebMap_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  76804. 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; } }
  76805. function WebMap_getPrototypeOf(o) { WebMap_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebMap_getPrototypeOf(o); }
  76806. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  76807. * This program are made available under the terms of the Apache License, Version 2.0
  76808. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76809. external_mapboxgl_default.a.supermap = external_mapboxgl_default.a.supermap || {};
  76810. 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'];
  76811. 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'];
  76812. var DEFAULT_WELLKNOWNSCALESET = ['GoogleCRS84Quad', 'GoogleMapsCompatible'];
  76813. /**
  76814. * @class mapboxgl.supermap.WebMap
  76815. * @version 9.1.2
  76816. * @category iPortal/Online
  76817. * @classdesc 对接 iPortal/Online 地图类。目前支持地图坐标系包括:'EPSG:3857','EPSG:4326','EPSG:4490','EPSG:4214','EPSG:4610'。
  76818. * <div style="padding: 20px;border: 1px solid #eee;border-left-width: 5px;border-radius: 3px;border-left-color: #ce4844;">
  76819. * <p style="color: #ce4844">Notice</p>
  76820. * <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>
  76821. * `<script type="text/javascript" src="https://iclient.supermap.io/web/libs/geostats/geostats.js"></script>`</br>
  76822. * `<script type="text/javascript" src="https://iclient.supermap.io/web/libs/jsonsql/jsonsql.js"></script>`
  76823. * </div>
  76824. * @param {number} id - iPortal|Online 地图 ID。
  76825. * @param {Object} options - 参数。
  76826. * @param {string} [options.target='map'] - 地图容器 ID。
  76827. * @param {string} [options.server="https://www.supermapol.com"] - 地图的地址。
  76828. * @param {string} [options.credentialKey] - 凭证密钥。
  76829. * @param {string} [options.credentialValue] - 凭证值。
  76830. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  76831. * @param {boolean} [options.excludePortalProxyUrl] - server 传递过来的 URL 是否带有代理。
  76832. * @fires mapboxgl.supermap.WebMap#getmapfailed
  76833. * @fires mapboxgl.supermap.WebMap#getwmtsfailed
  76834. * @fires mapboxgl.supermap.WebMap#getlayersfailed
  76835. * @fires mapboxgl.supermap.WebMap#getfeaturesfailed
  76836. * @fires mapboxgl.supermap.WebMap#addlayerssucceeded
  76837. * @extends {mapboxgl.Evented}
  76838. */
  76839. var WebMap_WebMap = /*#__PURE__*/function (_mapboxgl$Evented) {
  76840. WebMap_inherits(WebMap, _mapboxgl$Evented);
  76841. var _super = WebMap_createSuper(WebMap);
  76842. /**
  76843. * @constructs
  76844. * @version 9.1.2
  76845. */
  76846. function WebMap(id, options) {
  76847. var _this2;
  76848. WebMap_classCallCheck(this, WebMap);
  76849. _this2 = _super.call(this);
  76850. _this2.mapId = id;
  76851. options = options || {};
  76852. _this2.server = options.server || 'https://www.supermapol.com';
  76853. _this2.credentialKey = options.credentialKey;
  76854. _this2.credentialValue = options.credentialValue;
  76855. _this2.withCredentials = options.withCredentials || false;
  76856. _this2.target = options.target || 'map';
  76857. _this2._createWebMap();
  76858. return _this2;
  76859. }
  76860. /**
  76861. * @function mapboxgl.supermap.WebMap.prototype.resize
  76862. * @description map resize。
  76863. * @version 9.1.2
  76864. */
  76865. WebMap_createClass(WebMap, [{
  76866. key: "resize",
  76867. value: function resize() {
  76868. this.map.resize();
  76869. }
  76870. /**
  76871. * @function mapboxgl.supermap.WebMap.prototype.setMapId
  76872. * @param {string} mapId - webMap 地图 ID。
  76873. * @description 设置 WebMap ID。
  76874. * @version 9.1.2
  76875. */
  76876. }, {
  76877. key: "setMapId",
  76878. value: function setMapId(mapId) {
  76879. this.mapId = mapId;
  76880. this._createWebMap();
  76881. }
  76882. /**
  76883. * @function mapboxgl.supermap.WebMap.prototype.setWebMapOptions
  76884. * @param {Object} webMapOptions - webMap 参数。
  76885. * @description 设置 webMap 参数。
  76886. * @version 9.1.2
  76887. */
  76888. }, {
  76889. key: "setWebMapOptions",
  76890. value: function setWebMapOptions(webMapOptions) {
  76891. this.server = webMapOptions.server;
  76892. this._createWebMap();
  76893. }
  76894. /**
  76895. * @function mapboxgl.supermap.WebMap.prototype.setMapOptions
  76896. * @param {Object} mapOptions - map 参数。
  76897. * @description 设置 map 参数。
  76898. * @version 9.1.2
  76899. */
  76900. }, {
  76901. key: "setMapOptions",
  76902. value: function setMapOptions(mapOptions) {
  76903. var center = mapOptions.center,
  76904. zoom = mapOptions.zoom,
  76905. maxBounds = mapOptions.maxBounds,
  76906. minZoom = mapOptions.minZoom,
  76907. maxZoom = mapOptions.maxZoom,
  76908. isWorldCopy = mapOptions.isWorldCopy,
  76909. bearing = mapOptions.bearing,
  76910. pitch = mapOptions.pitch;
  76911. center && center.length && this.map.setCenter(center);
  76912. zoom && this.map.setZoom(zoom);
  76913. maxBounds && this.map.setMaxBounds(maxBounds);
  76914. minZoom && this.map.setMinZoom(minZoom);
  76915. maxZoom && this.map.setMaxZoom(maxZoom);
  76916. isWorldCopy && this.map.setRenderWorldCopies(isWorldCopy);
  76917. bearing && this.map.setBearing(bearing);
  76918. pitch && this.map.setPitch(pitch);
  76919. }
  76920. /**
  76921. * @private
  76922. * @function mapboxgl.supermap.WebMap.prototype._createWebMap
  76923. * @description 登陆窗口后添加地图图层。
  76924. */
  76925. }, {
  76926. key: "_createWebMap",
  76927. value: function _createWebMap() {
  76928. var urlArr = this.server.split('');
  76929. if (urlArr[urlArr.length - 1] !== '/') {
  76930. this.server += '/';
  76931. }
  76932. var mapUrl = this.server + 'web/maps/' + this.mapId + '/map';
  76933. if (this.credentialValue && this.credentialKey) {
  76934. mapUrl += '?' + this.credentialKey + '=' + this.credentialValue;
  76935. }
  76936. var filter = 'getUrlResource.json?url=';
  76937. if (this.excludePortalProxyUrl && this.server.indexOf(filter) > -1) {
  76938. //大屏需求,或者有加上代理的
  76939. var urlArray = this.server.split(filter);
  76940. if (urlArray.length > 1) {
  76941. mapUrl = urlArray[0] + filter + this.server + 'web/maps/' + this.mapId + '/map.json';
  76942. }
  76943. }
  76944. this._getMapInfo(mapUrl);
  76945. }
  76946. /**
  76947. * @private
  76948. * @function mapboxgl.supermap.WebMap.prototype._createMap
  76949. * @description 创建地图。
  76950. */
  76951. }, {
  76952. key: "_createMap",
  76953. value: function _createMap(mapInfo) {
  76954. // 获取字体样式
  76955. var fonts = [];
  76956. var layers = mapInfo.layers; // 获取 label 图层字体类型
  76957. if (layers && layers.length > 0) {
  76958. layers.forEach(function (layer) {
  76959. layer.labelStyle && fonts.push(layer.labelStyle.fontFamily);
  76960. }, this);
  76961. }
  76962. fonts.push("'supermapol-icons'");
  76963. var fontFamilys = fonts.join(','); // zoom center
  76964. var oldcenter = mapInfo.center,
  76965. zoom = mapInfo.level || 0,
  76966. center,
  76967. zoomBase = 0; // zoom = zoom === 0 ? 0 : zoom - 1;
  76968. if (mapInfo.minScale && mapInfo.maxScale) {
  76969. zoomBase = this._transformScaleToZoom(mapInfo.minScale, external_mapboxgl_default.a.CRS ? external_mapboxgl_default.a.CRS.get(this.baseProjection) : 'EPSG:3857');
  76970. } else {
  76971. zoomBase = +Math.log2(this._getResolution(external_mapboxgl_default.a.CRS ? external_mapboxgl_default.a.CRS.get(this.baseProjection).getExtent() : [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892]) / this._getResolution(mapInfo.extent)).toFixed(2);
  76972. }
  76973. zoom += zoomBase;
  76974. center = oldcenter ? this._unproject([oldcenter.x, oldcenter.y]) : new external_mapboxgl_default.a.LngLat(0, 0); // 初始化 map
  76975. this.map = new external_mapboxgl_default.a.Map({
  76976. container: this.target,
  76977. center: center,
  76978. zoom: zoom,
  76979. style: {
  76980. version: 8,
  76981. sources: {},
  76982. // "glyphs": 'https://iclient.supermap.io/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature/sdffonts/{fontstack}/{range}.pbf',
  76983. layers: []
  76984. },
  76985. crs: this.baseProjection,
  76986. localIdeographFontFamily: fontFamilys || ''
  76987. });
  76988. this.fire('mapinitialized');
  76989. }
  76990. /**
  76991. * @private
  76992. * @function mapboxgl.supermap.WebMap.prototype._getMapInfo
  76993. * @description 获取地图的 JSON 信息。
  76994. * @param {string} url - 请求地图的 url。
  76995. */
  76996. }, {
  76997. key: "_getMapInfo",
  76998. value: function _getMapInfo(url) {
  76999. var _this3 = this;
  77000. var mapUrl = url.indexOf('.json') === -1 ? "".concat(url, ".json") : url;
  77001. FetchRequest.get(mapUrl, null, {
  77002. withCredentials: this.withCredentials
  77003. }).then(function (response) {
  77004. return response.json();
  77005. }).then(function (mapInfo) {
  77006. _this3.baseProjection = mapInfo.projection; //存储地图的名称以及描述等信息,返回给用户
  77007. _this3.mapParams = {
  77008. title: mapInfo.title,
  77009. description: mapInfo.description
  77010. };
  77011. var projectionMap = {
  77012. 'EPSG:4490': 'EPSG:4490',
  77013. 'EPSG:4214': 'EPSG:4214',
  77014. 'EPSG:4610': 'EPSG:4610',
  77015. 'EPSG:3857': 'EPSG:3857',
  77016. 'EPSG:4326': 'EPSG:4326'
  77017. }; // 坐标系异常处理
  77018. if (_this3.baseProjection in projectionMap) {
  77019. _this3._createMap(mapInfo, _this3.mapSetting);
  77020. var layers = mapInfo.layers;
  77021. _this3.map.on('load', function () {
  77022. _this3._addBaseMap(mapInfo);
  77023. if (!layers || layers.length === 0) {
  77024. _this3._sendMapToUser(0, 0);
  77025. } else {
  77026. _this3._addLayers(layers);
  77027. }
  77028. });
  77029. } else {
  77030. throw Error(Lang.i18n('msg_crsunsupport'));
  77031. }
  77032. })["catch"](function (error) {
  77033. /**
  77034. * @event mapboxgl.supermap.WebMap#getmapfailed
  77035. * @description 获取地图信息失败。
  77036. * @property {Object} error - 失败原因。
  77037. */
  77038. _this3.fire('getmapfailed', {
  77039. error: error
  77040. });
  77041. });
  77042. }
  77043. /**
  77044. * @private
  77045. * @function mapboxgl.supermap.WebMap.prototype._addBaseMap
  77046. * @description 添加底图。
  77047. * @param {Object} mapInfo - map 信息。
  77048. */
  77049. }, {
  77050. key: "_addBaseMap",
  77051. value: function _addBaseMap(mapInfo) {
  77052. this._createBaseLayer(mapInfo);
  77053. }
  77054. /**
  77055. * @private
  77056. * @function mapboxgl.supermap.WebMap.prototype._createBaseLayer
  77057. * @description 创建底图。
  77058. * @param {Object} mapInfo - map 信息。
  77059. */
  77060. }, {
  77061. key: "_createBaseLayer",
  77062. value: function _createBaseLayer(mapInfo) {
  77063. var layerInfo = mapInfo.baseLayer || mapInfo;
  77064. var layerType = layerInfo.layerType; //底图和rest地图兼容
  77065. if (layerType.indexOf('TIANDITU_VEC') > -1 || layerType.indexOf('TIANDITU_IMG') > -1 || layerType.indexOf('TIANDITU_TER') > -1) {
  77066. layerType = layerType.substr(0, 12);
  77067. }
  77068. var mapUrls = {
  77069. CLOUD: 'http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}',
  77070. CLOUD_BLACK: 'http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}',
  77071. OSM: 'http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png',
  77072. 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',
  77073. GOOGLE_CN: 'https://mt{0-3}.google.cn/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}',
  77074. JAPAN_STD: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
  77075. JAPAN_PALE: 'https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png',
  77076. JAPAN_RELIEF: 'https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png',
  77077. JAPAN_ORT: 'https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg'
  77078. },
  77079. url;
  77080. switch (layerType) {
  77081. case 'TIANDITU_VEC':
  77082. case 'TIANDITU_IMG':
  77083. case 'TIANDITU_TER':
  77084. this._createTiandituLayer(mapInfo);
  77085. break;
  77086. case 'BING':
  77087. this._createBingLayer(layerInfo.name);
  77088. break;
  77089. case 'WMS':
  77090. this._createWMSLayer(layerInfo);
  77091. break;
  77092. case 'WMTS':
  77093. this._createWMTSLayer(layerInfo);
  77094. break;
  77095. case 'TILE':
  77096. case 'SUPERMAP_REST':
  77097. this._createDynamicTiledLayer(layerInfo);
  77098. break;
  77099. case 'CLOUD':
  77100. case 'CLOUD_BLACK':
  77101. case 'OSM':
  77102. case 'JAPAN_ORT':
  77103. case 'JAPAN_RELIEF':
  77104. case 'JAPAN_PALE':
  77105. case 'JAPAN_STD':
  77106. case 'GOOGLE_CN':
  77107. case 'GOOGLE':
  77108. url = mapUrls[layerType];
  77109. this._createXYZLayer(layerInfo, url);
  77110. break;
  77111. case 'MAPBOXSTYLE':
  77112. this._createMapboxStyle(layerInfo);
  77113. break;
  77114. default:
  77115. break;
  77116. }
  77117. }
  77118. /**
  77119. * @private
  77120. * @function mapboxgl.supermap.WebMap.prototype._createMapboxStyle
  77121. * @description 创建 Mapbox 样式。
  77122. * @param {Object} mapInfo - map 信息。
  77123. */
  77124. }, {
  77125. key: "_createMapboxStyle",
  77126. value: function _createMapboxStyle(mapInfo) {
  77127. var _this = this,
  77128. _mapInfo$dataSource = mapInfo.dataSource,
  77129. dataSource = _mapInfo$dataSource === void 0 ? {} : _mapInfo$dataSource,
  77130. serverId = dataSource.serverId,
  77131. url = dataSource.url,
  77132. styleUrl;
  77133. styleUrl = serverId !== undefined ? "".concat(this.server, "web/datas/").concat(serverId, "/download") : url;
  77134. FetchRequest.get(styleUrl, null, {
  77135. withCredentials: this.withCredentials,
  77136. withoutFormatSuffix: true,
  77137. headers: {
  77138. 'Content-Type': 'application/json;chartset=uft-8'
  77139. }
  77140. }).then(function (response) {
  77141. return response.json();
  77142. }).then(function (style) {
  77143. _this._matchStyleObject(style);
  77144. _this.map.setStyle(style);
  77145. });
  77146. }
  77147. /**
  77148. * @private
  77149. * @function mapboxgl.supermap.WebMap.prototype._matchStyleObject
  77150. * @description 恢复 style 为标准格式。
  77151. * @param {Object} style - mapbox 样式。
  77152. */
  77153. }, {
  77154. key: "_matchStyleObject",
  77155. value: function _matchStyleObject(style) {
  77156. var sprite = style.sprite,
  77157. glyphs = style.glyphs;
  77158. if (sprite && WebMap_typeof(sprite) === 'object') {
  77159. style.sprite = Object.values(sprite)[0];
  77160. }
  77161. if (glyphs && WebMap_typeof(glyphs) === 'object') {
  77162. style.glyphs = Object.values(glyphs)[0];
  77163. }
  77164. }
  77165. /**
  77166. * @private
  77167. * @function mapboxgl.supermap.WebMap.prototype._createTiandituLayer
  77168. * @description 创建天地图底图。
  77169. * @param {Object} mapInfo - map 信息。
  77170. */
  77171. }, {
  77172. key: "_createTiandituLayer",
  77173. value: function _createTiandituLayer(mapInfo) {
  77174. var tiandituUrls = this._getTiandituUrl(mapInfo);
  77175. var layerType = mapInfo.baseLayer.layerType;
  77176. var isLabel = Boolean(mapInfo.baseLayer.labelLayerVisible);
  77177. var labelUrl = tiandituUrls['labelUrl'];
  77178. var tiandituUrl = tiandituUrls['tiandituUrl'];
  77179. this._addBaselayer(tiandituUrl, 'tianditu-layers-' + layerType);
  77180. isLabel && this._addBaselayer(labelUrl, 'tianditu-label-layers-' + layerType);
  77181. }
  77182. /**
  77183. * @private
  77184. * @function mapboxgl.supermap.WebMap.prototype._createWMTSLayer
  77185. * @description 创建 WMTS 底图。
  77186. * @param {Object} mapInfo - map 信息。
  77187. */
  77188. }, {
  77189. key: "_createWMTSLayer",
  77190. value: function _createWMTSLayer(layerInfo) {
  77191. var _this4 = this;
  77192. var wmtsUrl = this._getWMTSUrl(layerInfo);
  77193. this._filterWMTSIsMatched(layerInfo, function (isMatched, matchMaxZoom) {
  77194. isMatched && _this4._addBaselayer([wmtsUrl], 'wmts-layers' + layerInfo.name, 0, matchMaxZoom);
  77195. });
  77196. }
  77197. /**
  77198. * @private
  77199. * @function mapboxgl.supermap.WebMap.prototype._filterWMTSIsMatched
  77200. * @description 过滤能够跟mapboxgl匹配的wmts服务。
  77201. * @param {Object} mapInfo - map 信息。
  77202. * @callback matchedCallback
  77203. */
  77204. }, {
  77205. key: "_filterWMTSIsMatched",
  77206. value: function _filterWMTSIsMatched(mapInfo, matchedCallback) {
  77207. var _this5 = this;
  77208. var isMatched = false,
  77209. matchMaxZoom = 22,
  77210. url = mapInfo.url;
  77211. var options = {
  77212. withCredentials: false,
  77213. withoutFormatSuffix: true
  77214. };
  77215. FetchRequest.get(url, null, options).then(function (response) {
  77216. return response.text();
  77217. }).then(function (capabilitiesText) {
  77218. var converts = external_function_try_return_convert_catch_e_return_default.a ? external_function_try_return_convert_catch_e_return_default.a : window.convert;
  77219. var tileMatrixSet = JSON.parse(converts.xml2json(capabilitiesText, {
  77220. compact: true,
  77221. spaces: 4
  77222. })).Capabilities.Contents.TileMatrixSet;
  77223. if (!Array.isArray(tileMatrixSet)) {
  77224. tileMatrixSet = [tileMatrixSet];
  77225. }
  77226. for (var i = 0; i < tileMatrixSet.length; i++) {
  77227. if (tileMatrixSet[i]['ows:Identifier'] && tileMatrixSet[i]['ows:Identifier']['_text'] === mapInfo.tileMatrixSet) {
  77228. if (DEFAULT_WELLKNOWNSCALESET.indexOf(tileMatrixSet[i]['WellKnownScaleSet']['_text']) > -1) {
  77229. isMatched = true;
  77230. } else if (tileMatrixSet[i]['WellKnownScaleSet'] && tileMatrixSet[i]['WellKnownScaleSet']['_text'] === 'Custom') {
  77231. var matchedScaleDenominator = []; //坐标系判断
  77232. var defaultCRSScaleDenominators = _this5.map.crs === 'EPSG:3857' ? MB_SCALEDENOMINATOR_3857 : MB_SCALEDENOMINATOR_4326;
  77233. for (var j = 0, len = defaultCRSScaleDenominators.length; j < len; j++) {
  77234. if (!tileMatrixSet[i].TileMatrix[j]) {
  77235. break;
  77236. }
  77237. if (defaultCRSScaleDenominators[j] !== tileMatrixSet[i].TileMatrix[j]['ScaleDenominator']['_text']) {
  77238. break;
  77239. }
  77240. matchedScaleDenominator.push(defaultCRSScaleDenominators[j]);
  77241. }
  77242. matchMaxZoom = matchedScaleDenominator.length - 1;
  77243. if (matchedScaleDenominator.length !== 0) {
  77244. isMatched = true;
  77245. } else {
  77246. throw Error(Lang.i18n('msg_tilematrixsetunsupport'));
  77247. }
  77248. } else {
  77249. throw Error(Lang.i18n('msg_tilematrixsetunsupport'));
  77250. }
  77251. }
  77252. }
  77253. matchedCallback(isMatched, matchMaxZoom);
  77254. })["catch"](function (error) {
  77255. /**
  77256. * @event mapboxgl.supermap.WebMap#getwmtsfailed
  77257. * @description 获取 WMTS 图层信息失败。
  77258. * @property {Object} error - 失败原因。
  77259. * @property {mapboxgl.Map} map - MapBoxGL Map 对象。
  77260. */
  77261. _this5.fire('getwmtsfailed', {
  77262. error: error,
  77263. map: _this5.map
  77264. });
  77265. });
  77266. }
  77267. /**
  77268. * @private
  77269. * @function mapboxgl.supermap.WebMap.prototype._createBingLayer
  77270. * @description 创建 Bing 图层。
  77271. */
  77272. }, {
  77273. key: "_createBingLayer",
  77274. value: function _createBingLayer(layerName) {
  77275. 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';
  77276. this.addLayer([bingUrl], 'bing-layers-' + layerName);
  77277. }
  77278. /**
  77279. * @private
  77280. * @function mapboxgl.supermap.WebMap.prototype._createXYZLayer
  77281. * @description 创建 XYZ 底图。
  77282. * @param {String} url - url 地址。
  77283. */
  77284. }, {
  77285. key: "_createXYZLayer",
  77286. value: function _createXYZLayer(layerInfo, url) {
  77287. var urlArr = [];
  77288. if (layerInfo.layerType === 'OSM') {
  77289. var res = url.match(/\w\-\w/g)[0];
  77290. var start = res[0];
  77291. var end = res[2];
  77292. var alphabet = '';
  77293. for (var i = 97; i < 123; i++) {
  77294. alphabet += String.fromCharCode(i);
  77295. }
  77296. var alphabetArr = alphabet.split('');
  77297. var startIndex = alphabetArr.indexOf(start);
  77298. var endIndex = alphabetArr.indexOf(end);
  77299. var res3 = alphabetArr.slice(startIndex, endIndex + 1);
  77300. for (var _i = 0; _i < res3.length; _i++) {
  77301. var replaceRes = url.replace(/{\w\-\w}/g, res3[_i]);
  77302. urlArr.push(replaceRes);
  77303. }
  77304. } else if (layerInfo.layerType === 'GOOGLE_CN') {
  77305. var _res = url.match(/\d\-\d/g)[0];
  77306. var _start = _res[0];
  77307. var _end = _res[2];
  77308. for (var _i2 = _start; _i2 <= _end; _i2++) {
  77309. var _replaceRes = url.replace(/{\d\-\d}/g, _i2);
  77310. urlArr.push(_replaceRes);
  77311. }
  77312. } else {
  77313. urlArr = [url];
  77314. }
  77315. this._addBaselayer(urlArr, 'XYZ-layers-' + layerInfo.name);
  77316. }
  77317. /**
  77318. * @private
  77319. * @function mapboxgl.supermap.WebMap.prototype._createDynamicTiledLayer
  77320. * @description 创建 iserver 底图。
  77321. * @param {Object} layerInfo - 图层信息。
  77322. */
  77323. }, {
  77324. key: "_createDynamicTiledLayer",
  77325. value: function _createDynamicTiledLayer(layerInfo) {
  77326. var url = layerInfo.url;
  77327. var layerId = layerInfo.layerID || layerInfo.name;
  77328. var minzoom = layerInfo.minzoom,
  77329. maxzoom = layerInfo.maxzoom;
  77330. this._addBaselayer([url], layerId, minzoom, maxzoom, true);
  77331. }
  77332. /**
  77333. * @private
  77334. * @function mapboxgl.supermap.WebMap.prototype._createWMSLayer
  77335. * @description 创建 WMS 图层。
  77336. * @param {Object} mapInfo - map 信息。
  77337. */
  77338. }, {
  77339. key: "_createWMSLayer",
  77340. value: function _createWMSLayer(layerInfo) {
  77341. var WMSUrl = this._getWMSUrl(layerInfo);
  77342. this._addBaselayer([WMSUrl], 'WMS-layers-' + layerInfo.name);
  77343. }
  77344. /**
  77345. * @private
  77346. * @function mapboxgl.supermap.WebMap.prototype._createVectorLayer
  77347. * @description 创建 Vector 图层。
  77348. * @param {Object} layerInfo - map 信息。
  77349. * @param {Array} features - 属性 信息。
  77350. */
  77351. }, {
  77352. key: "_createVectorLayer",
  77353. value: function _createVectorLayer(layerInfo, features) {
  77354. var style = layerInfo.style;
  77355. var type = layerInfo.featureType;
  77356. var layerID = layerInfo.layerID;
  77357. var visible = layerInfo.visible;
  77358. var layerStyle = {};
  77359. layerStyle.style = this._transformStyleToMapBoxGl(style, type);
  77360. layerStyle.layout = {
  77361. visibility: visible
  77362. };
  77363. var source = {
  77364. type: 'geojson',
  77365. data: {
  77366. type: 'FeatureCollection',
  77367. features: features
  77368. }
  77369. };
  77370. this._addOverlayToMap(type, source, layerID, layerStyle); // 如果面有边框
  77371. type === 'POLYGON' && style.strokeColor && this._addStrokeLineForPoly(style, source, layerID + '-strokeLine', visible);
  77372. }
  77373. /**
  77374. * @function mapboxgl.supermap.WebMap.prototype._getTiandituUrl
  77375. * @private
  77376. * @description 创建天地图url;
  77377. * @param {Object} mapInfo - map 信息。
  77378. */
  77379. }, {
  77380. key: "_getTiandituUrl",
  77381. value: function _getTiandituUrl(mapInfo) {
  77382. var re = /t0/gi;
  77383. var tiandituUrls = {};
  77384. var layerType = mapInfo.baseLayer.layerType.split('_')[1].toLowerCase();
  77385. var isLabel = Boolean(mapInfo.baseLayer.labelLayerVisible); // let isLabel = true;
  77386. var url = 'https://t0.tianditu.gov.cn/{layer}_{proj}/wmts?';
  77387. var labelUrl = url;
  77388. var layerLabelMap = {
  77389. vec: 'cva',
  77390. ter: 'cta',
  77391. img: 'cia'
  77392. };
  77393. var tilematrixSet = this.baseProjection === 'EPSG:4326' ? 'c' : 'w';
  77394. var options = {
  77395. service: 'WMTS',
  77396. request: 'GetTile',
  77397. style: 'default',
  77398. version: '1.0.0',
  77399. layer: layerType,
  77400. tilematrixSet: tilematrixSet,
  77401. format: 'tiles',
  77402. width: 256,
  77403. height: 256
  77404. };
  77405. url += this._getParamString(options, url) + '&tilematrix={z}&tilerow={y}&tilecol={x}';
  77406. var tiandituUrl = url.replace('{layer}', layerType).replace('{proj}', tilematrixSet);
  77407. var tiandituUrlArr = [];
  77408. for (var i = 0; i < 8; i++) {
  77409. tiandituUrlArr.push(tiandituUrl.replace(re, "t".concat(i)));
  77410. }
  77411. tiandituUrls['tiandituUrl'] = tiandituUrlArr; // 如果有 label 图层
  77412. if (isLabel) {
  77413. var labelLayer = layerLabelMap[layerType];
  77414. options.layer = labelLayer;
  77415. labelUrl += this._getParamString(options, labelUrl) + '&tilematrix={z}&tilerow={y}&tilecol={x}';
  77416. labelUrl = labelUrl.replace('{layer}', labelLayer).replace('{proj}', tilematrixSet);
  77417. var labelUrlArr = [];
  77418. for (var _i3 = 0; _i3 < 8; _i3++) {
  77419. labelUrlArr.push(labelUrl.replace(re, "t".concat(_i3)));
  77420. }
  77421. tiandituUrls['labelUrl'] = labelUrlArr;
  77422. }
  77423. return tiandituUrls;
  77424. }
  77425. /**
  77426. * @function mapboxgl.supermap.WebMap.prototype._getWMSUrl
  77427. * @private
  77428. * @description 创建 WMS url;
  77429. * @param {Object} mapInfo - map 信息。
  77430. */
  77431. }, {
  77432. key: "_getWMSUrl",
  77433. value: function _getWMSUrl(mapInfo) {
  77434. var url = mapInfo.url;
  77435. url = url.split('?')[0];
  77436. var strArr = url.split('/');
  77437. var options = {
  77438. service: 'WMS',
  77439. request: 'GetMap',
  77440. layers: strArr[strArr.length - 1],
  77441. styles: '',
  77442. format: 'image/png',
  77443. transparent: 'true',
  77444. version: '1.1.1',
  77445. width: 256,
  77446. height: 256,
  77447. srs: this.baseProjection
  77448. };
  77449. var bbox = this.baseProjection === 'EPSG:4326' ? '{bbox-epsg-4326}' : '{bbox-epsg-3857}';
  77450. url += this._getParamString(options, url) + "&bbox=".concat(bbox);
  77451. return url;
  77452. }
  77453. /**
  77454. * @private
  77455. * @function mapboxgl.supermap.WebMap.prototype._addLayers
  77456. * @description 添加叠加图层。
  77457. * @param {Object} mapInfo - 图层信息。
  77458. */
  77459. }, {
  77460. key: "_addLayers",
  77461. value: function _addLayers(layers) {
  77462. var _this6 = this;
  77463. //存储地图上所有的图层对象
  77464. this.layers = layers;
  77465. var features,
  77466. layerAdded = 0,
  77467. len = layers.length;
  77468. layers.forEach(function (layer, index) {
  77469. if (layer.dataSource && layer.dataSource.serverId || layer.layerType === 'MARKER') {
  77470. // 获取 serverID
  77471. var serverId = layer.dataSource ? layer.dataSource.serverId : layer.serverId;
  77472. var url = "".concat(_this6.server, "web/datas/").concat(serverId, "/content.json?pageSize=9999999&currentPage=1"); // 获取图层数据
  77473. serverId && FetchRequest.get(url, null, {
  77474. withCredentials: _this6.withCredentials
  77475. }).then(function (response) {
  77476. return response.json();
  77477. }).then(function (data) {
  77478. if (data.succeed === false) {
  77479. //请求失败
  77480. layerAdded++;
  77481. _this6._sendMapToUser(layerAdded, len);
  77482. /**
  77483. * @event mapboxgl.supermap.WebMap#getlayersfailed
  77484. * @description 获取图层信息失败。
  77485. * @property {Object} error - 失败原因。
  77486. * @property {mapboxgl.Map} map - MapBoxGL Map 对象。
  77487. */
  77488. _this6.fire('getlayersfailed', {
  77489. error: data.error,
  77490. map: _this6.map
  77491. });
  77492. return;
  77493. }
  77494. if (data.type) {
  77495. if (data.type === 'JSON' || data.type === 'GEOJSON') {
  77496. data.content = JSON.parse(data.content.trim());
  77497. features = _this6._formatGeoJSON(data.content, layer);
  77498. } else if (data.type === 'EXCEL' || data.type === 'CSV') {
  77499. features = _this6._excelData2Feature(data.content, layer);
  77500. }
  77501. _this6._addLayer(layer, features, index);
  77502. layerAdded++;
  77503. _this6._sendMapToUser(layerAdded, len);
  77504. }
  77505. })["catch"](function (error) {
  77506. layerAdded++;
  77507. _this6._sendMapToUser(layerAdded, len);
  77508. _this6.fire('getlayersfailed', {
  77509. error: error,
  77510. map: _this6.map
  77511. });
  77512. });
  77513. } else if (layer.layerType === 'SUPERMAP_REST' || layer.layerType === 'TILE' || layer.layerType === 'WMS' || layer.layerType === 'WMTS') {
  77514. _this6._createBaseLayer(layer);
  77515. layerAdded++;
  77516. _this6._sendMapToUser(layerAdded, len);
  77517. } else if (layer.dataSource && layer.dataSource.type === 'REST_DATA') {
  77518. var dataSource = layer.dataSource; //从restData获取数据
  77519. _this6._getFeatureBySQL(dataSource.url, [dataSource.dataSourseName || layer.name], function (result) {
  77520. features = _this6._parseGeoJsonData2Feature({
  77521. allDatas: {
  77522. features: result.result.features.features
  77523. },
  77524. fileCode: layer.projection,
  77525. featureProjection: _this6.baseProjection
  77526. });
  77527. _this6._addLayer(layer, features, index);
  77528. layerAdded++;
  77529. _this6._sendMapToUser(layerAdded, len);
  77530. }, function (err) {
  77531. layerAdded++;
  77532. _this6._sendMapToUser(layerAdded, len);
  77533. /**
  77534. * @event mapboxgl.supermap.WebMap#getfeaturesfailed
  77535. * @description 获取图层要素失败。
  77536. * @property {Object} error - 失败原因。
  77537. */
  77538. _this6.fire('getfeaturesfailed', {
  77539. error: err
  77540. });
  77541. });
  77542. } else if (layer.dataSource && layer.dataSource.type === 'REST_MAP' && layer.dataSource.url) {
  77543. _this6._queryFeatureBySQL(layer.dataSource.url, layer.dataSource.layerName, 'smid=1', null, null, function (result) {
  77544. var recordsets = result && result.result.recordsets;
  77545. var recordset = recordsets && recordsets[0];
  77546. var attributes = recordset.fields;
  77547. if (recordset && attributes) {
  77548. var fileterAttrs = [];
  77549. for (var i in attributes) {
  77550. var value = attributes[i];
  77551. if (value.indexOf('Sm') !== 0 || value === 'SmID') {
  77552. fileterAttrs.push(value);
  77553. }
  77554. }
  77555. _this6._getFeatures(fileterAttrs, layer, function (features) {
  77556. _this6._addLayer(layer, features, index);
  77557. layerAdded++;
  77558. _this6._sendMapToUser(layerAdded, len);
  77559. }, function (err) {
  77560. layerAdded++;
  77561. _this6.fire('getfeaturesfailed', {
  77562. error: err,
  77563. map: _this6.map
  77564. });
  77565. });
  77566. }
  77567. }, function (err) {
  77568. _this6.fire('getlayersfailed', {
  77569. error: err,
  77570. map: _this6.map
  77571. });
  77572. });
  77573. }
  77574. }, this);
  77575. }
  77576. /**
  77577. * @private
  77578. * @function mapboxgl.supermap.WebMap.prototype._getFeatures
  77579. * @description 将单个图层添加到地图上。
  77580. * @param layerInfo 某个图层的图层信息
  77581. * @param {Array.<GeoJSON>} features - feature。
  77582. */
  77583. }, {
  77584. key: "_getFeatures",
  77585. value: function _getFeatures(fields, layerInfo, resolve, reject) {
  77586. var _this7 = this;
  77587. var source = layerInfo.dataSource; //示例数据
  77588. var fileCode = layerInfo.projection;
  77589. this._queryFeatureBySQL(source.url, source.layerName, null, fields, null, function (result) {
  77590. var recordsets = result.result.recordsets[0];
  77591. var features = recordsets.features.features;
  77592. var featuresObj = _this7._parseGeoJsonData2Feature({
  77593. allDatas: {
  77594. features: features
  77595. },
  77596. fileCode: fileCode,
  77597. featureProjection: _this7.baseProjection
  77598. }, 'JSON');
  77599. resolve(featuresObj);
  77600. }, function (err) {
  77601. reject(err);
  77602. });
  77603. }
  77604. /**
  77605. * @private
  77606. * @function mapboxgl.supermap.WebMap.prototype._addLayer
  77607. * @description 将单个图层添加到地图上。
  77608. * @param layerInfo 某个图层的图层信息
  77609. * @param {Array.<GeoJSON>} features - feature。
  77610. */
  77611. }, {
  77612. key: "_addLayer",
  77613. value: function _addLayer(layerInfo, features, index) {
  77614. var layerType = layerInfo.layerType;
  77615. layerInfo.layerID = layerType + '-' + layerInfo.name + '-' + index;
  77616. layerInfo.visible = layerInfo.visible ? 'visible' : 'none'; // mbgl 目前不能处理 geojson 复杂面情况
  77617. // mbgl isssue https://github.com/mapbox/mapbox-gl-js/issues/7023
  77618. if (features[0] && features[0].geometry.type === 'Polygon') {
  77619. features = this._handleMultyPolygon(features);
  77620. }
  77621. if (layerInfo.style && layerInfo.filterCondition) {
  77622. //将 feature 根据过滤条件进行过滤, 分段专题图和单值专题图因为要计算 styleGroup 所以暂时不过滤
  77623. if (layerType !== 'RANGE' && layerType !== 'UNIQUE') {
  77624. features = this._getFiterFeatures(layerInfo.filterCondition, features);
  77625. }
  77626. }
  77627. if (layerType === 'VECTOR') {
  77628. if (layerInfo.featureType === 'POINT') {
  77629. if (layerInfo.style.type === 'SYMBOL_POINT') {
  77630. this._createSymbolLayer(layerInfo, features);
  77631. } else {
  77632. this._createGraphicLayer(layerInfo, features);
  77633. }
  77634. } else {
  77635. //线和面
  77636. this._createVectorLayer(layerInfo, features);
  77637. }
  77638. } else if (layerType === 'UNIQUE') {
  77639. this._createUniqueLayer(layerInfo, features);
  77640. } else if (layerType === 'RANGE') {
  77641. this._createRangeLayer(layerInfo, features);
  77642. } else if (layerType === 'HEAT') {
  77643. this._createHeatLayer(layerInfo, features);
  77644. } else if (layerType === 'MARKER') {
  77645. this._createMarkerLayer(layerInfo, features);
  77646. }
  77647. if (layerInfo.labelStyle && layerInfo.labelStyle.labelField) {
  77648. // 存在标签专题图
  77649. this._addLabelLayer(layerInfo, features);
  77650. }
  77651. }
  77652. /**
  77653. * @private
  77654. * @function mapboxgl.supermap.WebMap.prototype._addLabelLayer
  77655. * @description 添加标签图层。
  77656. * @param layerInfo 某个图层的图层信息。
  77657. * @param {Array.<GeoJSON>} features - feature。
  77658. */
  77659. }, {
  77660. key: "_addLabelLayer",
  77661. value: function _addLabelLayer(layerInfo, features) {
  77662. var labelStyle = layerInfo.labelStyle;
  77663. this.map.addLayer({
  77664. id: layerInfo.layerID + 'label',
  77665. type: 'symbol',
  77666. source: {
  77667. type: 'geojson',
  77668. data: {
  77669. type: 'FeatureCollection',
  77670. features: features
  77671. }
  77672. },
  77673. paint: {
  77674. 'text-color': labelStyle.fill
  77675. },
  77676. layout: {
  77677. 'text-field': "{".concat(labelStyle.labelField, "}"),
  77678. 'text-size': parseFloat(labelStyle.fontSize) || 12,
  77679. 'text-offset': labelStyle.offsetX ? [labelStyle.offsetX / 10 || 0, labelStyle.offsetY / 10 || 0] : [0, -1.5],
  77680. 'text-font': ['DIN Offc Pro Italic', 'Arial Unicode MS Regular'],
  77681. visibility: layerInfo.visible
  77682. }
  77683. });
  77684. }
  77685. /**
  77686. * @private
  77687. * @function mapboxgl.supermap.WebMap.prototype._createSymbolLayer
  77688. * @description 添加 symbol 图层。
  77689. * @param layerInfo 某个图层的图层信息。
  77690. * @param {Array.<GeoJSON>} features - feature。
  77691. */
  77692. }, {
  77693. key: "_createSymbolLayer",
  77694. value: function _createSymbolLayer(layerInfo, features) {
  77695. //用来请求symbol_point字体文件
  77696. var target = document.getElementById("".concat(this.target));
  77697. target.classList.add('supermapol-icons-map');
  77698. var style = layerInfo.style;
  77699. var unicode = layerInfo.style.unicode;
  77700. var text = String.fromCharCode(parseInt(unicode.replace(/^&#x/, ''), 16));
  77701. var layerID = layerInfo.layerID;
  77702. this.map.addSource(layerID + '-source', {
  77703. type: 'geojson',
  77704. data: {
  77705. type: 'FeatureCollection',
  77706. features: []
  77707. }
  77708. });
  77709. this.map.addLayer({
  77710. id: layerID,
  77711. type: 'symbol',
  77712. source: layerID + '-source',
  77713. paint: {
  77714. 'text-color': style.fillColor
  77715. },
  77716. layout: {
  77717. 'text-field': text,
  77718. 'text-font': ['DIN Offc Pro Italic', 'Arial Unicode MS Regular'],
  77719. visibility: layerInfo.visible
  77720. }
  77721. });
  77722. this.map.getSource(layerID + '-source').setData({
  77723. type: 'FeatureCollection',
  77724. features: features
  77725. });
  77726. }
  77727. /**
  77728. * @private
  77729. * @function mapboxgl.supermap.WebMap.prototype._createGraphicLayer
  77730. * @description 创建 Graphic 图层。
  77731. * @param {Object} layerInfo - map 信息。
  77732. * @param {Array} features - 属性 信息。
  77733. */
  77734. }, {
  77735. key: "_createGraphicLayer",
  77736. value: function _createGraphicLayer(layerInfo, features) {
  77737. var _this8 = this;
  77738. var style = layerInfo.style;
  77739. var layerStyle = {};
  77740. var layerID = layerInfo.layerID;
  77741. var source = {
  77742. type: 'geojson',
  77743. data: {
  77744. type: 'FeatureCollection',
  77745. features: features
  77746. }
  77747. };
  77748. if (style.type === 'IMAGE_POINT') {
  77749. var imageInfo = style.imageInfo;
  77750. var imgDom = imageInfo.img;
  77751. if (!imgDom || !imgDom.src) {
  77752. //要组装成完整的url
  77753. imageInfo.url = this.server + imageInfo.url;
  77754. }
  77755. this.map.loadImage(imageInfo.url || imgDom.src, function (error, image) {
  77756. if (error) {
  77757. console.log(error);
  77758. }
  77759. var iconSize = Number.parseFloat((style.radius / image.height).toFixed(2)) * 2;
  77760. _this8.map.addImage('imageIcon', image);
  77761. _this8.map.addLayer({
  77762. id: layerID,
  77763. type: 'symbol',
  77764. source: source,
  77765. layout: {
  77766. 'icon-image': 'imageIcon',
  77767. 'icon-size': iconSize,
  77768. visibility: layerInfo.visible
  77769. }
  77770. });
  77771. });
  77772. } else if (style.type === 'SVG_POINT') {
  77773. var svg_url = style.url;
  77774. if (!this.svgDiv) {
  77775. this.svgDiv = document.createElement('div');
  77776. document.body.appendChild(this.svgDiv);
  77777. }
  77778. this._getCanvasFromSVG(svg_url, this.svgDiv, function (canvas) {
  77779. var imgUrl = canvas.toDataURL('img/png');
  77780. imgUrl && _this8.map.loadImage(imgUrl, function (error, image) {
  77781. if (error) {
  77782. console.log(error);
  77783. }
  77784. var iconSize = Number.parseFloat((style.radius / canvas.width).toFixed(2));
  77785. _this8.map.addImage('imageIcon', image);
  77786. _this8.map.addLayer({
  77787. id: layerID,
  77788. type: 'symbol',
  77789. source: source,
  77790. layout: {
  77791. 'icon-image': 'imageIcon',
  77792. 'icon-size': iconSize,
  77793. visibility: layerInfo.visible
  77794. }
  77795. });
  77796. }, _this8);
  77797. });
  77798. } else {
  77799. layerStyle.style = this._transformStyleToMapBoxGl(style, layerInfo.featureType);
  77800. layerStyle.layout = {
  77801. visibility: layerInfo.visible
  77802. };
  77803. this._addOverlayToMap('POINT', source, layerID, layerStyle);
  77804. }
  77805. }
  77806. /**
  77807. * @private
  77808. * @function mapboxgl.supermap.WebMap.prototype._createUniqueLayer
  77809. * @description 创建单值图层。
  77810. * @param layerInfo 某个图层的图层信息
  77811. * @param features 图层上的 feature
  77812. */
  77813. }, {
  77814. key: "_createUniqueLayer",
  77815. value: function _createUniqueLayer(layerInfo, features) {
  77816. var styleGroup = this._getUniqueStyleGroup(layerInfo, features);
  77817. features = this._getFiterFeatures(layerInfo.filterCondition, features);
  77818. var style = layerInfo.style;
  77819. var layerStyle = {};
  77820. var themeField = layerInfo.themeSetting.themeField;
  77821. var type = layerInfo.featureType;
  77822. var expression = ['match', ['get', 'index']];
  77823. var layerID = layerInfo.layerID;
  77824. features.forEach(function (row) {
  77825. styleGroup.forEach(function (item) {
  77826. if (item.value === row.properties[themeField]) {
  77827. expression.push(row.properties['index'], item.color);
  77828. }
  77829. });
  77830. });
  77831. expression.push('#ffffff');
  77832. layerStyle.style = this._transformStyleToMapBoxGl(style, type, expression);
  77833. var visible = layerInfo.visible;
  77834. layerStyle.layout = {
  77835. visibility: visible
  77836. };
  77837. var source = {
  77838. type: 'geojson',
  77839. data: {
  77840. type: 'FeatureCollection',
  77841. features: features
  77842. }
  77843. };
  77844. this._addOverlayToMap(type, source, layerID, layerStyle);
  77845. type === 'POLYGON' && style.strokeColor && this._addStrokeLineForPoly(style, source, layerID + '-strokeLine', visible);
  77846. }
  77847. /**
  77848. * @private
  77849. * @function mapboxgl.supermap.WebMap.prototype._getUniqueStyleGroup
  77850. * @description 获取单值的目标字段与颜色的对应数组。
  77851. * @param layerInfo 某个图层的图层信息
  77852. * @param features 图层上的 feature
  77853. */
  77854. }, {
  77855. key: "_getUniqueStyleGroup",
  77856. value: function _getUniqueStyleGroup(parameters, features) {
  77857. // 找出所有的单值
  77858. var featureType = parameters.featureType,
  77859. style = parameters.style,
  77860. themeSetting = parameters.themeSetting;
  77861. var fieldName = themeSetting.themeField,
  77862. colors = themeSetting.colors;
  77863. var names = [],
  77864. customSettings = themeSetting.customSettings;
  77865. for (var i in features) {
  77866. var properties = features[i].properties;
  77867. var name = properties[fieldName];
  77868. var isSaved = false;
  77869. for (var j in names) {
  77870. if (names[j] === name) {
  77871. isSaved = true;
  77872. break;
  77873. }
  77874. }
  77875. if (!isSaved) {
  77876. names.push(name);
  77877. }
  77878. } //获取一定量的颜色
  77879. var curentColors = colors || this.defaultParameters.colors;
  77880. curentColors = ColorsPickerUtil.getGradientColors(curentColors, names.length); //生成styleGroup
  77881. var styleGroup = [];
  77882. names.forEach(function (name, index) {
  77883. var color = curentColors[index];
  77884. if (name in customSettings) {
  77885. color = customSettings[name];
  77886. }
  77887. if (featureType === 'LINE') {
  77888. style.strokeColor = color;
  77889. } else {
  77890. style.fillColor = color;
  77891. }
  77892. styleGroup.push({
  77893. color: color,
  77894. value: name
  77895. });
  77896. }, this);
  77897. return styleGroup;
  77898. }
  77899. /**
  77900. * @private
  77901. * @function mapboxgl.supermap.WebMap.prototype._getWMTSUrl
  77902. * @description 根据传入的配置信息拼接wmts url。
  77903. * @param options 配置对象
  77904. */
  77905. }, {
  77906. key: "_getWMTSUrl",
  77907. value: function _getWMTSUrl(options) {
  77908. var obj = {
  77909. service: 'WMTS',
  77910. request: 'GetTile',
  77911. version: '1.0.0',
  77912. style: 'default',
  77913. layer: options.layer,
  77914. tilematrixSet: options.tileMatrixSet,
  77915. format: 'image/png'
  77916. };
  77917. var url = options.url;
  77918. url += this._getParamString(obj, url) + '&tilematrix={z}&tilerow={y}&tilecol={x}';
  77919. return url;
  77920. }
  77921. /**
  77922. * @private
  77923. * @function mapboxgl.supermap.WebMap.prototype._createMarkerLayer
  77924. * @description 添加标记图层。
  77925. * @param {Array.<GeoJSON>} features - feature。
  77926. */
  77927. }, {
  77928. key: "_createMarkerLayer",
  77929. value: function _createMarkerLayer(layerInfo, features) {
  77930. var _this9 = this;
  77931. features && features.forEach(function (feature) {
  77932. var geomType = feature.geometry.type.toUpperCase();
  77933. var defaultStyle = feature.dv_v5_markerStyle;
  77934. if (geomType === 'POINT' && defaultStyle.text) {
  77935. //说明是文字的feature类型
  77936. geomType = 'TEXT';
  77937. }
  77938. var featureInfo = _this9.setFeatureInfo(feature);
  77939. feature.properties['useStyle'] = defaultStyle;
  77940. feature.properties['featureInfo'] = featureInfo;
  77941. if (geomType === 'POINT' && defaultStyle.src && defaultStyle.src.indexOf('http://') === -1 && defaultStyle.src.indexOf('https://') === -1) {
  77942. //说明地址不完整
  77943. defaultStyle.src = _this9.server + defaultStyle.src;
  77944. }
  77945. var source = {
  77946. type: 'geojson',
  77947. data: feature
  77948. };
  77949. var index = feature.properties.index;
  77950. var layerID = geomType + '-' + index; // image-marker
  77951. geomType === 'POINT' && defaultStyle.src && defaultStyle.src.indexOf('svg') <= -1 && _this9.map.loadImage(defaultStyle.src, function (error, image) {
  77952. if (error) {
  77953. console.log(error);
  77954. }
  77955. _this9.map.addImage(index + '', image);
  77956. _this9.map.addLayer({
  77957. id: layerID,
  77958. type: 'symbol',
  77959. source: source,
  77960. layout: {
  77961. 'icon-image': index + '',
  77962. 'icon-size': defaultStyle.scale,
  77963. visibility: layerInfo.visible
  77964. }
  77965. });
  77966. }, _this9); // svg-marker
  77967. if (geomType === 'POINT' && defaultStyle.src && defaultStyle.src.indexOf('svg') > -1) {
  77968. if (!_this9.svgDiv) {
  77969. _this9.svgDiv = document.createElement('div');
  77970. document.body.appendChild(_this9.svgDiv);
  77971. }
  77972. _this9._getCanvasFromSVG(defaultStyle.src, _this9.svgDiv, function (canvas) {
  77973. var imgUrl = canvas.toDataURL('img/png');
  77974. imgUrl && _this9.map.loadImage(imgUrl, function (error, image) {
  77975. if (error) {
  77976. console.log(error);
  77977. }
  77978. _this9.map.addImage(index + '', image);
  77979. _this9.map.addLayer({
  77980. id: layerID,
  77981. type: 'symbol',
  77982. source: source,
  77983. layout: {
  77984. 'icon-image': index + '',
  77985. 'icon-size': defaultStyle.scale,
  77986. visibility: layerInfo.visible
  77987. }
  77988. });
  77989. }, _this9);
  77990. });
  77991. } // point-line-polygon-marker
  77992. if (!defaultStyle.src) {
  77993. var layeStyle = {
  77994. layout: {}
  77995. };
  77996. if (geomType === 'LINESTRING' && defaultStyle.lineCap) {
  77997. geomType = 'LINE';
  77998. layeStyle.layout = {
  77999. 'line-cap': defaultStyle.lineCap
  78000. };
  78001. }
  78002. var visible = layerInfo.visible;
  78003. layeStyle.layout.visibility = visible; // get style
  78004. layeStyle.style = _this9._transformStyleToMapBoxGl(defaultStyle, geomType);
  78005. _this9._addOverlayToMap(geomType, source, layerID, layeStyle); // 若面有边框
  78006. geomType === 'POLYGON' && defaultStyle.strokeColor && _this9._addStrokeLineForPoly(defaultStyle, source, layerID + '-strokeLine', visible);
  78007. }
  78008. }, this);
  78009. }
  78010. /**
  78011. * @private
  78012. * @function mapboxgl.supermap.WebMap.prototype.setFeatureInfo
  78013. * @description 设置 feature 信息。
  78014. * @param {Array.<GeoJSON>} features - feature。
  78015. */
  78016. }, {
  78017. key: "setFeatureInfo",
  78018. value: function setFeatureInfo(feature) {
  78019. var featureInfo;
  78020. var info = feature.dv_v5_markerInfo;
  78021. if (info && info.dataViz_title) {
  78022. //有featureInfo信息就不需要再添加
  78023. featureInfo = info;
  78024. } else {
  78025. // featureInfo = this.getDefaultAttribute();
  78026. return info;
  78027. }
  78028. var properties = feature.properties;
  78029. for (var key in featureInfo) {
  78030. if (properties[key]) {
  78031. featureInfo[key] = properties[key];
  78032. delete properties[key];
  78033. }
  78034. }
  78035. return featureInfo;
  78036. }
  78037. /**
  78038. * @private
  78039. * @function mapboxgl.supermap.WebMap.prototype._createHeatLayer
  78040. * @description 添加热力图。
  78041. * @param {Array.<GeoJSON>} features - feature。
  78042. */
  78043. }, {
  78044. key: "_createHeatLayer",
  78045. value: function _createHeatLayer(layerInfo, features) {
  78046. var style = layerInfo.themeSetting;
  78047. var layerOption = {};
  78048. layerOption.gradient = style.colors.slice();
  78049. layerOption.radius = parseInt(style.radius); //自定义颜色
  78050. var customSettings = style.customSettings;
  78051. for (var i in customSettings) {
  78052. layerOption.gradient[i] = customSettings[i];
  78053. } // 权重字段恢复
  78054. if (style.weight) {
  78055. this._changeWeight(features, style.weight);
  78056. }
  78057. var color = ['interpolate', ['linear'], ['heatmap-density']];
  78058. var length = layerOption.gradient.length;
  78059. var step = (1 / length).toFixed(2);
  78060. layerOption.gradient.forEach(function (item, index) {
  78061. color.push(index * step);
  78062. if (index === 0) {
  78063. item = core_Util_Util.hexToRgba(item, 0);
  78064. }
  78065. color.push(item);
  78066. });
  78067. var paint = {
  78068. 'heatmap-color': color,
  78069. 'heatmap-radius': style.radius + 15,
  78070. 'heatmap-intensity': {
  78071. base: 1,
  78072. stops: [[0, 0.8], [22, 1]]
  78073. }
  78074. };
  78075. if (features[0].weight && features.length >= 4) {
  78076. var weight = [];
  78077. features.forEach(function (item) {
  78078. weight.push(item.weight);
  78079. });
  78080. var max = ArrayStatistic.getMax(weight);
  78081. var min = ArrayStatistic.getMin(weight);
  78082. paint['heatmap-weight'] = ['interpolate', ['linear'], ['get', 'weight'], min, 0, max, 1];
  78083. }
  78084. this.map.addLayer({
  78085. id: layerInfo.layerID,
  78086. type: 'heatmap',
  78087. source: {
  78088. type: 'geojson',
  78089. data: {
  78090. type: 'FeatureCollection',
  78091. features: features
  78092. }
  78093. },
  78094. paint: paint
  78095. });
  78096. }
  78097. /**
  78098. * @private
  78099. * @function mapboxgl.supermap.WebMap.prototype._changeWeight
  78100. * @description 改变当前权重字段
  78101. * @param {Array.<GeoJSON>} features - feature。
  78102. * @param {String} weightFeild - 权重字段
  78103. */
  78104. }, {
  78105. key: "_changeWeight",
  78106. value: function _changeWeight(features, weightFeild) {
  78107. this.fieldMaxValue = {};
  78108. this._getMaxValue(features, weightFeild);
  78109. var maxValue = this.fieldMaxValue[weightFeild];
  78110. features.forEach(function (feature) {
  78111. var attributes = feature.properties;
  78112. var value = attributes[weightFeild];
  78113. feature['weight'] = value / maxValue;
  78114. });
  78115. }
  78116. /**
  78117. * @private
  78118. * @function mapboxgl.supermap.WebMap.prototype._getMaxValue
  78119. * @description 获取当前字段对应的最大值,用于计算权重。
  78120. * @param {Array.<GeoJSON>} features - feature。
  78121. * @param {String} weightFeild - 权重字段
  78122. */
  78123. }, {
  78124. key: "_getMaxValue",
  78125. value: function _getMaxValue(features, weightField) {
  78126. var values = [],
  78127. attributes;
  78128. var field = weightField;
  78129. if (this.fieldMaxValue[field]) {
  78130. return;
  78131. }
  78132. features.forEach(function (feature) {
  78133. //收集当前权重字段对应的所有值
  78134. attributes = feature.properties;
  78135. attributes && parseFloat(attributes[field]) && values.push(parseFloat(attributes[field]));
  78136. });
  78137. this.fieldMaxValue[field] = ArrayStatistic.getArrayStatistic(values, 'Maximum');
  78138. }
  78139. /**
  78140. * @private
  78141. * @function mapboxgl.supermap.WebMap.prototype._createRangeLayer
  78142. * @description 添加分段专题图。
  78143. * @param {Array.<GeoJSON>} features - feature。
  78144. */
  78145. }, {
  78146. key: "_createRangeLayer",
  78147. value: function _createRangeLayer(layerInfo, features) {
  78148. var fieldName = layerInfo.themeSetting.themeField;
  78149. var style = layerInfo.style;
  78150. var featureType = layerInfo.featureType;
  78151. var styleGroups = this._getRangeStyleGroup(layerInfo, features);
  78152. features = this._getFiterFeatures(layerInfo.filterCondition, features);
  78153. var source = {
  78154. type: 'geojson',
  78155. data: {
  78156. type: 'FeatureCollection',
  78157. features: features
  78158. }
  78159. }; // 获取 expression
  78160. var expression = ['match', ['get', 'index']];
  78161. features.forEach(function (row) {
  78162. var tartget = parseFloat(row.properties[fieldName]);
  78163. for (var i = 0; i < styleGroups.length; i++) {
  78164. if (styleGroups[i].start <= tartget && tartget < styleGroups[i].end) {
  78165. expression.push(row.properties['index'], styleGroups[i].color); // return;
  78166. }
  78167. }
  78168. !tartget && expression.push(row.properties['index'], 'rgba(0, 0, 0, 0)');
  78169. }, this);
  78170. expression.push('rgba(0, 0, 0, 0)'); // 获取样式
  78171. var layerStyle = {
  78172. layout: {}
  78173. };
  78174. if (featureType === 'LINE' && style.lineCap) {
  78175. layerStyle.layout = {
  78176. 'line-cap': style.lineCap
  78177. };
  78178. }
  78179. var visible = layerInfo.visible;
  78180. layerStyle.layout.visibility = visible;
  78181. layerStyle.style = this._transformStyleToMapBoxGl(style, featureType, expression); // 添加图层
  78182. var layerID = layerInfo.layerID;
  78183. this._addOverlayToMap(featureType, source, layerID, layerStyle); // 如果面有边框
  78184. featureType === 'POLYGON' && style.strokeColor && this._addStrokeLineForPoly(style, source, layerID + '-strokeline', visible);
  78185. }
  78186. /**
  78187. * @private
  78188. * @function mapboxgl.supermap.WebMap.prototype._getFiterFeatures
  78189. * @description 通过过滤条件查询满足的 feature。
  78190. * @param {String} filterCondition - 过滤条件。
  78191. * @param {array} allFeatures - 图层上的 feature 集合
  78192. */
  78193. }, {
  78194. key: "_getFiterFeatures",
  78195. value: function _getFiterFeatures(filterCondition, allFeatures) {
  78196. if (!filterCondition) {
  78197. return allFeatures;
  78198. }
  78199. var condition = this._replaceFilterCharacter(filterCondition);
  78200. var sql = 'select * from json where (' + condition + ')';
  78201. var filterFeatures = [];
  78202. for (var i = 0; i < allFeatures.length; i++) {
  78203. var feature = allFeatures[i];
  78204. var filterResult = false;
  78205. try {
  78206. filterResult = window.jsonsql.query(sql, {
  78207. properties: feature.properties
  78208. });
  78209. } catch (err) {
  78210. //必须把要过滤得内容封装成一个对象,主要是处理jsonsql(line : 62)中由于with语句遍历对象造成的问题
  78211. continue;
  78212. }
  78213. if (filterResult && filterResult.length > 0) {
  78214. //afterFilterFeatureIdx.push(i);
  78215. filterFeatures.push(feature);
  78216. }
  78217. }
  78218. return filterFeatures;
  78219. }
  78220. /**
  78221. * @private
  78222. * @function mapboxgl.supermap.WebMap.prototype._replaceFilterCharacter
  78223. * @description 获取过滤字符串。
  78224. * @param {String} filterString - 过滤条件。
  78225. */
  78226. }, {
  78227. key: "_replaceFilterCharacter",
  78228. value: function _replaceFilterCharacter(filterString) {
  78229. filterString = filterString.replace(/=/g, '==').replace(/AND|and/g, '&&').replace(/or|OR/g, '||').replace(/<==/g, '<=').replace(/>==/g, '>=');
  78230. return filterString;
  78231. }
  78232. /**
  78233. * @private
  78234. * @function mapboxgl.supermap.WebMap.prototype._getRangeStyleGroup
  78235. * @description 获取分段样式。
  78236. * @param {Array.<GeoJSON>} features - feature。
  78237. */
  78238. }, {
  78239. key: "_getRangeStyleGroup",
  78240. value: function _getRangeStyleGroup(layerInfo, features) {
  78241. // 找出分段值
  78242. var featureType = layerInfo.featureType;
  78243. var style = layerInfo.style;
  78244. var values = [],
  78245. attributes;
  78246. var themeSetting = layerInfo.themeSetting;
  78247. var customSettings = themeSetting.customSettings;
  78248. var fieldName = themeSetting.themeField;
  78249. var segmentCount = themeSetting.segmentCount;
  78250. features.forEach(function (feature) {
  78251. attributes = feature.properties || feature.get('Properties');
  78252. if (attributes) {
  78253. //过滤掉非数值的数据
  78254. attributes[fieldName] && core_Util_Util.isNumber(attributes[fieldName]) && values.push(parseFloat(attributes[fieldName]));
  78255. } else if (feature.get(fieldName) && core_Util_Util.isNumber(feature.get(fieldName))) {
  78256. feature.get(fieldName) && values.push(parseFloat(feature.get(fieldName)));
  78257. }
  78258. }, this);
  78259. var segements = ArrayStatistic.getArraySegments(values, themeSetting.segmentMethod, segmentCount);
  78260. if (segements) {
  78261. var itemNum = segmentCount;
  78262. if (attributes && segements[0] === segements[attributes.length - 1]) {
  78263. itemNum = 1;
  78264. segements.length = 2;
  78265. } //保留两位有效数
  78266. for (var key in segements) {
  78267. var value = segements[key];
  78268. value = key == 0 ? Math.floor(value * 100) / 100 : Math.ceil(value * 100) / 100 + 0.1; // 加0.1 解决最大值没有样式问题
  78269. segements[key] = Number(value.toFixed(2));
  78270. } //获取一定量的颜色
  78271. var curentColors = themeSetting.colors; // curentColors = ColorsPickerUtil.getGradientColors(curentColors, itemNum, 'RANGE');
  78272. for (var index = 0; index < itemNum; index++) {
  78273. if (index in customSettings) {
  78274. if (customSettings[index]['segment']['start']) {
  78275. segements[index] = customSettings[index]['segment']['start'];
  78276. }
  78277. if (customSettings[index]['segment']['end']) {
  78278. segements[index + 1] = customSettings[index]['segment']['end'];
  78279. }
  78280. }
  78281. } //生成styleGroup
  78282. var styleGroups = [];
  78283. for (var i = 0; i < itemNum; i++) {
  78284. var color = curentColors[i];
  78285. if (i in customSettings) {
  78286. if (customSettings[i].color) {
  78287. color = customSettings[i].color;
  78288. }
  78289. }
  78290. if (featureType === 'LINE') {
  78291. style.strokeColor = color;
  78292. } else {
  78293. style.fillColor = color;
  78294. }
  78295. var start = segements[i];
  78296. var end = segements[i + 1];
  78297. var styleObj = JSON.parse(JSON.stringify(style));
  78298. styleGroups.push({
  78299. style: styleObj,
  78300. color: color,
  78301. start: start,
  78302. end: end
  78303. });
  78304. }
  78305. return styleGroups;
  78306. }
  78307. }
  78308. /**
  78309. * @private
  78310. * @function mapboxgl.supermap.WebMap.prototype._formatGeoJSON
  78311. * @description 格式 GeoJSON。
  78312. * @param {GeoJSON} data - GeoJSON 数据。
  78313. */
  78314. }, {
  78315. key: "_formatGeoJSON",
  78316. value: function _formatGeoJSON(data) {
  78317. var features = data.features;
  78318. features.forEach(function (row, index) {
  78319. row.properties['index'] = index; // TODO 待优化 坐标转换
  78320. // if (fileCode !== 'EPSG:4326') {
  78321. // if(row.geometry.coordinates[0] instanceof Array){
  78322. // row.geometry.coordinates.forEach((coords, index) => {
  78323. // let lnglat = this._unproject(coords);
  78324. // row.geometry.coordinates[index] = [lnglat.lng, lnglat.lat];
  78325. // }, this)
  78326. // return;
  78327. // }
  78328. // let lnglat = this._unproject(row.geometry.coordinates);
  78329. // row.geometry.coordinates = [lnglat.lng, lnglat.lat];
  78330. // }
  78331. });
  78332. return features;
  78333. }
  78334. /**
  78335. * @private
  78336. * @function mapboxgl.supermap.WebMap.prototype._excelData2Feature将
  78337. * @description csv 和 xls 文件内容转换成 geojson
  78338. * @param content 文件内容
  78339. * @param layerInfo 图层信息
  78340. * @returns {Array} feature的数组集合
  78341. */
  78342. }, {
  78343. key: "_excelData2Feature",
  78344. value: function _excelData2Feature(dataContent) {
  78345. var fieldCaptions = dataContent.colTitles; // let fileCode = layerInfo.projection;
  78346. //位置属性处理
  78347. var xfieldIndex = -1,
  78348. yfieldIndex = -1;
  78349. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  78350. if (this._isXField(fieldCaptions[i])) {
  78351. xfieldIndex = i;
  78352. }
  78353. if (this._isYField(fieldCaptions[i])) {
  78354. yfieldIndex = i;
  78355. }
  78356. } // feature 构建后期支持坐标系 4326/3857
  78357. var features = [];
  78358. for (var _i4 = 0, _len = dataContent.rows.length; _i4 < _len; _i4++) {
  78359. var row = dataContent.rows[_i4];
  78360. var x = Number(row[xfieldIndex]),
  78361. y = Number(row[yfieldIndex]); // let coordinates = [x, y];
  78362. // TODO 待优化 坐标转换
  78363. // if (fileCode !== 'EPSG:4326') {
  78364. // if(row.geometry.coordinates[0] instanceof Array){
  78365. // row.geometry.coordinates.forEach((coords, index) => {
  78366. // let lnglat = this._unproject(coords);
  78367. // row.geometry.coordinates[index] = [lnglat.lng, lnglat.lat];
  78368. // }, this)
  78369. // return;
  78370. // }
  78371. // let lnglat = this._unproject(row.geometry.coordinates);
  78372. // row.geometry.coordinates = [lnglat.lng, lnglat.lat];
  78373. // }
  78374. //属性信息
  78375. var attributes = {};
  78376. for (var index in dataContent.colTitles) {
  78377. var key = dataContent.colTitles[index];
  78378. attributes[key] = dataContent.rows[_i4][index];
  78379. }
  78380. attributes['index'] = _i4 + ''; //目前csv 只支持处理点,所以先生成点类型的 geojson
  78381. var feature = {
  78382. type: 'Feature',
  78383. geometry: {
  78384. type: 'Point',
  78385. coordinates: [x, y]
  78386. },
  78387. properties: attributes
  78388. };
  78389. features.push(feature);
  78390. }
  78391. return features;
  78392. }
  78393. /**
  78394. * @private
  78395. * @function mapboxgl.supermap.WebMap.prototype._sendMapToUser
  78396. * @description 返回最终的 map 对象给用户,供他们操作使用。
  78397. * @param count
  78398. * @param layersLen
  78399. */
  78400. }, {
  78401. key: "_sendMapToUser",
  78402. value: function _sendMapToUser(count, layersLen) {
  78403. if (count === layersLen) {
  78404. /**
  78405. * @event mapboxgl.supermap.WebMap#addlayerssucceeded
  78406. * @description 添加图层成功。
  78407. * @property {mapboxgl.Map} map - MapBoxGL Map 对象。
  78408. * @property {Object} mapparams - 地图信息。
  78409. * @property {string} mapParams.title - 地图标题。
  78410. * @property {string} mapParams.description - 地图描述。
  78411. * @property {Array.<Object>} layers - 地图上所有的图层对象
  78412. */
  78413. this.fire('addlayerssucceeded', {
  78414. map: this.map,
  78415. mapparams: this.mapParams,
  78416. layers: this.layers
  78417. });
  78418. }
  78419. }
  78420. /**
  78421. * @function mapboxgl.supermap.WebMap.prototype._unproject
  78422. * @private
  78423. * @description 墨卡托转经纬度。
  78424. * @param {} point - 待转换的点。
  78425. */
  78426. }, {
  78427. key: "_unproject",
  78428. value: function _unproject(point) {
  78429. var d = 180 / Math.PI,
  78430. r = 6378137,
  78431. ts = Math.exp(-point[1] / r),
  78432. phi = Math.PI / 2 - 2 * Math.atan(ts);
  78433. for (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {
  78434. con = 1;
  78435. dphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;
  78436. phi += dphi;
  78437. }
  78438. return new external_mapboxgl_default.a.LngLat(point[0] * d / r, phi * d);
  78439. }
  78440. /**
  78441. * @function mapboxgl.supermap.WebMap.prototype._getParamString
  78442. * @private
  78443. * @param {Object} obj - 待添加的参数。
  78444. * @param {string} existingUrl - 待添加参数的 url。
  78445. * @param {Boolean} [uppercase] - 参数是否转换为大写。
  78446. */
  78447. }, {
  78448. key: "_getParamString",
  78449. value: function _getParamString(obj, existingUrl, uppercase) {
  78450. var params = [];
  78451. for (var i in obj) {
  78452. params.push((uppercase ? i.toUpperCase() : i) + '=' + obj[i]);
  78453. }
  78454. return (!existingUrl || existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&');
  78455. }
  78456. /**
  78457. * @private
  78458. * @description 判断是否地理X坐标
  78459. * @param data
  78460. */
  78461. }, {
  78462. key: "_isXField",
  78463. value: function _isXField(data) {
  78464. var lowerdata = data.toLowerCase();
  78465. return lowerdata === 'x' || lowerdata === 'smx' || lowerdata === 'jd' || lowerdata === '经度' || lowerdata === '东经' || lowerdata === 'longitude' || lowerdata === 'lot' || lowerdata === 'lon' || lowerdata === 'lng';
  78466. }
  78467. /**
  78468. * @private
  78469. * @description 判断是否地理Y坐标
  78470. * @param data
  78471. */
  78472. }, {
  78473. key: "_isYField",
  78474. value: function _isYField(data) {
  78475. var lowerdata = data.toLowerCase();
  78476. return lowerdata === 'y' || lowerdata === 'smy' || lowerdata === 'wd' || lowerdata === '纬度' || lowerdata === '北纬' || lowerdata === 'latitude' || lowerdata === 'lat';
  78477. }
  78478. /**
  78479. * @private
  78480. * @function mapboxgl.supermap.WebMap.prototype._transformStyleToMapBoxGl
  78481. * @description 根据图层类型将 layerInfo 中的 style 属性格式转换为 mapboxgl 中的 style 格式。
  78482. * @param {Object} style - layerInfo中的style属性
  78483. * @param {String} type - 图层类型
  78484. * @param {Array} [expression] - 存储颜色值得表达式
  78485. */
  78486. }, {
  78487. key: "_transformStyleToMapBoxGl",
  78488. value: function _transformStyleToMapBoxGl(style, type, expression) {
  78489. var transTable = {};
  78490. if ((style.type === 'POINT' || style.type === 'BASIC_POINT' || type === 'POINT') && type !== 'LINE') {
  78491. transTable = {
  78492. fillColor: 'circle-color',
  78493. strokeWidth: 'circle-stroke-width',
  78494. fillOpacity: 'circle-opacity',
  78495. radius: 'circle-radius',
  78496. strokeColor: 'circle-stroke-color',
  78497. strokeOpacity: 'circle-stroke-opacity'
  78498. };
  78499. } else if (type === 'LINE') {
  78500. transTable = {
  78501. strokeWidth: 'line-width',
  78502. strokeColor: 'line-color',
  78503. strokeOpacity: 'line-opacity'
  78504. };
  78505. } else if (type === 'POLYGON') {
  78506. transTable = {
  78507. fillColor: 'fill-color',
  78508. fillOpacity: 'fill-opacity',
  78509. strokeColor: 'fill-outline-color'
  78510. };
  78511. }
  78512. var newObj = {};
  78513. for (var item in style) {
  78514. if (transTable[item]) {
  78515. newObj[transTable[item]] = style[item];
  78516. }
  78517. }
  78518. if (expression) {
  78519. if (newObj['circle-color']) {
  78520. newObj['circle-color'] = expression;
  78521. } else if (newObj['line-color']) {
  78522. newObj['line-color'] = expression;
  78523. } else {
  78524. newObj['fill-color'] = expression;
  78525. }
  78526. }
  78527. if (style.lineDash && style.lineDash !== 'solid' && type === 'LINE') {
  78528. newObj['line-dasharray'] = this._dashStyle(style);
  78529. }
  78530. return newObj;
  78531. }
  78532. /**
  78533. * @private
  78534. * @function mapboxgl.supermap.WebMap.prototype.._dashStyle
  78535. * @description 符号样式。
  78536. * @param {Object} style - 样式参数。
  78537. * @param {number} widthFactor - 宽度系数。
  78538. */
  78539. }, {
  78540. key: "_dashStyle",
  78541. value: function _dashStyle(style) {
  78542. if (!style) {
  78543. return [];
  78544. } // var w = style.strokeWidth * widthFactor;
  78545. var w = 1;
  78546. var str = style.strokeDashstyle || style.lineDash;
  78547. switch (str) {
  78548. case 'solid':
  78549. return [];
  78550. case 'dot':
  78551. return [1, 4 * w];
  78552. case 'dash':
  78553. return [4 * w, 4 * w];
  78554. case 'dashdot':
  78555. return [4 * w, 4 * w, 1 * w, 4 * w];
  78556. case 'longdash':
  78557. return [8 * w, 4 * w];
  78558. case 'longdashdot':
  78559. return [8 * w, 4 * w, 1, 4 * w];
  78560. default:
  78561. if (!str) {
  78562. return [];
  78563. }
  78564. if (Util_Util.isArray(str)) {
  78565. return str;
  78566. }
  78567. str = StringExt.trim(str).replace(/\s+/g, ',');
  78568. return str.replace(/\[|\]/gi, '').split(',');
  78569. }
  78570. }
  78571. /**
  78572. * @private
  78573. * @description 将SVG转换成Canvas
  78574. * @param svgUrl
  78575. * @param divDom
  78576. * @param callBack
  78577. */
  78578. }, {
  78579. key: "_getCanvasFromSVG",
  78580. value: function _getCanvasFromSVG(svgUrl, divDom, callBack) {
  78581. //一个图层对应一个canvas
  78582. var canvas = document.createElement('canvas');
  78583. canvas.id = 'dataviz-canvas-' + core_Util_Util.newGuid(8);
  78584. canvas.style.display = 'none';
  78585. divDom.appendChild(canvas);
  78586. var canvgs = window.canvg ? window.canvg : external_function_try_return_canvg_catch_e_return_default.a;
  78587. canvgs(canvas.id, svgUrl, {
  78588. ignoreMouse: true,
  78589. ignoreAnimation: true,
  78590. renderCallback: function renderCallback() {
  78591. if (canvas.width > 300 || canvas.height > 300) {
  78592. return;
  78593. }
  78594. callBack(canvas);
  78595. },
  78596. forceRedraw: function forceRedraw() {
  78597. return false;
  78598. }
  78599. });
  78600. }
  78601. /**
  78602. * @private
  78603. * @function mapboxgl.supermap.WebMap.prototype._addOverlayToMap
  78604. * @description 添加基础矢量图层到 MAP
  78605. * @param {Object} style - mabgl style
  78606. * @param {String} type - 图层类型
  78607. */
  78608. }, {
  78609. key: "_addOverlayToMap",
  78610. value: function _addOverlayToMap(type, source, layerID, layerStyle) {
  78611. var mbglTypeMap = {
  78612. POINT: 'circle',
  78613. LINE: 'line',
  78614. POLYGON: 'fill'
  78615. };
  78616. type = mbglTypeMap[type];
  78617. if (type === 'circle' || type === 'line' || type === 'fill') {
  78618. this.map.addLayer({
  78619. id: layerID,
  78620. type: type,
  78621. source: source,
  78622. paint: layerStyle.style,
  78623. layout: layerStyle.layout || {}
  78624. });
  78625. }
  78626. }
  78627. }, {
  78628. key: "_addBaselayer",
  78629. value: function _addBaselayer(url, layerID) {
  78630. var minzoom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  78631. var maxzoom = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 22;
  78632. var isIserver = arguments.length > 4 ? arguments[4] : undefined;
  78633. this.map.addLayer({
  78634. id: layerID,
  78635. type: 'raster',
  78636. source: {
  78637. type: 'raster',
  78638. tiles: url,
  78639. tileSize: 256,
  78640. rasterSource: isIserver ? 'iserver' : '',
  78641. prjCoordSys: isIserver ? {
  78642. epsgCode: this.baseProjection.split(':')[1]
  78643. } : ''
  78644. },
  78645. minzoom: minzoom,
  78646. maxzoom: maxzoom
  78647. });
  78648. }
  78649. /**
  78650. * @private
  78651. * @function mapboxgl.supermap.WebMap.prototype._addStrokeLineForPoly
  78652. * @description 添加面的边框。
  78653. * @param {Object} style - mabgl style
  78654. */
  78655. }, {
  78656. key: "_addStrokeLineForPoly",
  78657. value: function _addStrokeLineForPoly(style, source, layerID, visible) {
  78658. var lineStyle = {};
  78659. lineStyle.style = this._transformStyleToMapBoxGl(style, 'LINE');
  78660. lineStyle.layout = {
  78661. visibility: visible
  78662. };
  78663. this._addOverlayToMap('LINE', source, layerID, lineStyle);
  78664. }
  78665. /**
  78666. * @private
  78667. * @function mapboxgl.supermap.WebMap.prototype._parseGeoJsonData2Feature
  78668. * @description 将从restData地址上获取的json转换成feature(从iserver中获取的json转换成feature)
  78669. * @param {object} metaData - json内容
  78670. * @returns {Array} ol.feature的数组集合
  78671. */
  78672. }, {
  78673. key: "_parseGeoJsonData2Feature",
  78674. value: function _parseGeoJsonData2Feature(metaData) {
  78675. var allFeatures = metaData.allDatas.features,
  78676. features = [];
  78677. for (var i = 0, len = allFeatures.length; i < len; i++) {
  78678. // TODO 坐标转换
  78679. var feature = allFeatures[i];
  78680. var coordinate = feature.geometry.coordinates;
  78681. if (allFeatures[i].geometry.type === 'Point') {
  78682. // 标注图层 还没有属性值时候不加
  78683. if (allFeatures[i].properties) {
  78684. allFeatures[i].properties.lon = coordinate[0];
  78685. allFeatures[i].properties.lat = coordinate[1];
  78686. }
  78687. }
  78688. features.properties['index'] = i + '';
  78689. features.push(feature);
  78690. }
  78691. return features;
  78692. }
  78693. /**
  78694. * @private
  78695. * @function mapboxgl.supermap.WebMap.prototype._getFeatureBySQL
  78696. * @description 通过 sql 方式查询数据。
  78697. */
  78698. }, {
  78699. key: "_getFeatureBySQL",
  78700. value: function _getFeatureBySQL(url, datasetNames, _processCompleted, processFaild) {
  78701. var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
  78702. getFeatureParam = new FilterParameter_FilterParameter({
  78703. name: datasetNames.join().replace(':', '@'),
  78704. attributeFilter: 'SMID > 0'
  78705. });
  78706. getFeatureBySQLParams = new GetFeaturesBySQLParameters_GetFeaturesBySQLParameters({
  78707. queryParameter: getFeatureParam,
  78708. datasetNames: datasetNames,
  78709. fromIndex: 0,
  78710. toIndex: 100000,
  78711. returnContent: true
  78712. });
  78713. var options = {
  78714. eventListeners: {
  78715. processCompleted: function processCompleted(getFeaturesEventArgs) {
  78716. _processCompleted && _processCompleted(getFeaturesEventArgs);
  78717. },
  78718. processFailed: function processFailed(e) {
  78719. processFaild && processFaild(e);
  78720. }
  78721. }
  78722. };
  78723. getFeatureBySQLService = new GetFeaturesBySQLService_GetFeaturesBySQLService(url, options);
  78724. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  78725. }
  78726. /**
  78727. * @private
  78728. * @function mapboxgl.supermap.WebMap.prototype._queryFeatureBySQL
  78729. * @description 通过 sql 方式查询数据。
  78730. */
  78731. }, {
  78732. key: "_queryFeatureBySQL",
  78733. value: function _queryFeatureBySQL(url, layerName, attributeFilter, fields, epsgCode, processCompleted, processFaild, startRecord, recordLength, onlyAttribute) {
  78734. var queryParam, queryBySQLParams, queryBySQLService;
  78735. queryParam = new FilterParameter_FilterParameter({
  78736. name: layerName,
  78737. attributeFilter: attributeFilter
  78738. });
  78739. if (fields) {
  78740. queryParam.fields = fields;
  78741. }
  78742. var params = {
  78743. queryParams: [queryParam]
  78744. };
  78745. if (onlyAttribute) {
  78746. params.queryOption = QueryOption.ATTRIBUTE;
  78747. }
  78748. startRecord && (params.startRecord = startRecord);
  78749. recordLength && (params.expectCount = recordLength);
  78750. if (epsgCode) {
  78751. params.prjCoordSys = {
  78752. epsgCode: epsgCode
  78753. };
  78754. }
  78755. queryBySQLParams = new QueryBySQLParameters_QueryBySQLParameters(params);
  78756. queryBySQLService = new external_mapboxgl_default.a.supermap.QueryService(url);
  78757. queryBySQLService.queryBySQL(queryBySQLParams, function (data) {
  78758. data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
  78759. });
  78760. }
  78761. /**
  78762. * @private
  78763. * @function mapboxgl.supermap.WebMap.prototype._handleMultyPolygon
  78764. * @description 处理复杂面情况
  78765. */
  78766. }, {
  78767. key: "_handleMultyPolygon",
  78768. value: function _handleMultyPolygon(features) {
  78769. features.forEach(function (feature) {
  78770. if (feature.geometry.type !== 'Polygon') {
  78771. return;
  78772. }
  78773. var coords = feature.geometry.coordinates;
  78774. if (coords.length > 1) {
  78775. var coordinates = [];
  78776. coords.forEach(function (coord) {
  78777. coordinates.push([coord]);
  78778. });
  78779. feature.geometry.coordinates = coordinates;
  78780. feature.geometry.type = 'MultiPolygon';
  78781. }
  78782. });
  78783. return features;
  78784. }
  78785. }, {
  78786. key: "_transformScaleToZoom",
  78787. value: function _transformScaleToZoom(scale, crs) {
  78788. var scale_0 = 295829515.2024169;
  78789. if ((crs || this.map.getCRS()).epsgCode !== 'EPSG:3857') {
  78790. scale_0 = 295295895;
  78791. }
  78792. var scaleDenominator = scale.split(':')[1];
  78793. return Math.min(24, +Math.log2(scale_0 / +scaleDenominator).toFixed(2));
  78794. }
  78795. }, {
  78796. key: "_getResolution",
  78797. value: function _getResolution(bounds) {
  78798. var tileSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 512.0;
  78799. if (bounds.leftBottom && bounds.rightTop) {
  78800. return Math.max(bounds.rightTop.x - bounds.leftBottom.x, bounds.rightTop.y - bounds.leftBottom.y) / tileSize;
  78801. }
  78802. return Math.max(bounds[2] - bounds[0], bounds[3] - bounds[1]) / tileSize;
  78803. }
  78804. }]);
  78805. return WebMap;
  78806. }(external_mapboxgl_default.a.Evented);
  78807. external_mapboxgl_default.a.supermap.WebMap = WebMap_WebMap;
  78808. // CONCATENATED MODULE: ./src/mapboxgl/mapping/index.js
  78809. // CONCATENATED MODULE: ./src/mapboxgl/index.js
  78810. /* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
  78811. * This program are made available under the terms of the Apache License, Version 2.0
  78812. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78813. /***/ }),
  78814. /* 19 */
  78815. /***/ (function(module, exports) {
  78816. // removed by extract-text-webpack-plugin
  78817. /***/ }),
  78818. /* 20 */,
  78819. /* 21 */,
  78820. /* 22 */,
  78821. /* 23 */,
  78822. /* 24 */,
  78823. /* 25 */
  78824. /***/ (function(module, exports) {
  78825. // removed by extract-text-webpack-plugin
  78826. /***/ })
  78827. /******/ ]);