iclient-classic-es6.js 453 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975
  1. /******/ (() => { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ 693:
  4. /***/ (function(module) {
  5. (function(self) {
  6. 'use strict';
  7. // if __disableNativeFetch is set to true, the it will always polyfill fetch
  8. // with Ajax.
  9. if (!self.__disableNativeFetch && self.fetch) {
  10. return
  11. }
  12. function normalizeName(name) {
  13. if (typeof name !== 'string') {
  14. name = String(name)
  15. }
  16. if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
  17. throw new TypeError('Invalid character in header field name')
  18. }
  19. return name.toLowerCase()
  20. }
  21. function normalizeValue(value) {
  22. if (typeof value !== 'string') {
  23. value = String(value)
  24. }
  25. return value
  26. }
  27. function Headers(headers) {
  28. this.map = {}
  29. if (headers instanceof Headers) {
  30. headers.forEach(function(value, name) {
  31. this.append(name, value)
  32. }, this)
  33. } else if (headers) {
  34. Object.getOwnPropertyNames(headers).forEach(function(name) {
  35. this.append(name, headers[name])
  36. }, this)
  37. }
  38. }
  39. Headers.prototype.append = function(name, value) {
  40. name = normalizeName(name)
  41. value = normalizeValue(value)
  42. var list = this.map[name]
  43. if (!list) {
  44. list = []
  45. this.map[name] = list
  46. }
  47. list.push(value)
  48. }
  49. Headers.prototype['delete'] = function(name) {
  50. delete this.map[normalizeName(name)]
  51. }
  52. Headers.prototype.get = function(name) {
  53. var values = this.map[normalizeName(name)]
  54. return values ? values[0] : null
  55. }
  56. Headers.prototype.getAll = function(name) {
  57. return this.map[normalizeName(name)] || []
  58. }
  59. Headers.prototype.has = function(name) {
  60. return this.map.hasOwnProperty(normalizeName(name))
  61. }
  62. Headers.prototype.set = function(name, value) {
  63. this.map[normalizeName(name)] = [normalizeValue(value)]
  64. }
  65. Headers.prototype.forEach = function(callback, thisArg) {
  66. Object.getOwnPropertyNames(this.map).forEach(function(name) {
  67. this.map[name].forEach(function(value) {
  68. callback.call(thisArg, value, name, this)
  69. }, this)
  70. }, this)
  71. }
  72. function consumed(body) {
  73. if (body.bodyUsed) {
  74. return Promise.reject(new TypeError('Already read'))
  75. }
  76. body.bodyUsed = true
  77. }
  78. function fileReaderReady(reader) {
  79. return new Promise(function(resolve, reject) {
  80. reader.onload = function() {
  81. resolve(reader.result)
  82. }
  83. reader.onerror = function() {
  84. reject(reader.error)
  85. }
  86. })
  87. }
  88. function readBlobAsArrayBuffer(blob) {
  89. var reader = new FileReader()
  90. reader.readAsArrayBuffer(blob)
  91. return fileReaderReady(reader)
  92. }
  93. function readBlobAsText(blob, options) {
  94. var reader = new FileReader()
  95. var contentType = options.headers.map['content-type'] ? options.headers.map['content-type'].toString() : ''
  96. var regex = /charset\=[0-9a-zA-Z\-\_]*;?/
  97. var _charset = blob.type.match(regex) || contentType.match(regex)
  98. var args = [blob]
  99. if(_charset) {
  100. args.push(_charset[0].replace(/^charset\=/, '').replace(/;$/, ''))
  101. }
  102. reader.readAsText.apply(reader, args)
  103. return fileReaderReady(reader)
  104. }
  105. var support = {
  106. blob: 'FileReader' in self && 'Blob' in self && (function() {
  107. try {
  108. new Blob();
  109. return true
  110. } catch(e) {
  111. return false
  112. }
  113. })(),
  114. formData: 'FormData' in self,
  115. arrayBuffer: 'ArrayBuffer' in self
  116. }
  117. function Body() {
  118. this.bodyUsed = false
  119. this._initBody = function(body, options) {
  120. this._bodyInit = body
  121. if (typeof body === 'string') {
  122. this._bodyText = body
  123. } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
  124. this._bodyBlob = body
  125. this._options = options
  126. } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
  127. this._bodyFormData = body
  128. } else if (!body) {
  129. this._bodyText = ''
  130. } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {
  131. // Only support ArrayBuffers for POST method.
  132. // Receiving ArrayBuffers happens via Blobs, instead.
  133. } else {
  134. throw new Error('unsupported BodyInit type')
  135. }
  136. }
  137. if (support.blob) {
  138. this.blob = function() {
  139. var rejected = consumed(this)
  140. if (rejected) {
  141. return rejected
  142. }
  143. if (this._bodyBlob) {
  144. return Promise.resolve(this._bodyBlob)
  145. } else if (this._bodyFormData) {
  146. throw new Error('could not read FormData body as blob')
  147. } else {
  148. return Promise.resolve(new Blob([this._bodyText]))
  149. }
  150. }
  151. this.arrayBuffer = function() {
  152. return this.blob().then(readBlobAsArrayBuffer)
  153. }
  154. this.text = function() {
  155. var rejected = consumed(this)
  156. if (rejected) {
  157. return rejected
  158. }
  159. if (this._bodyBlob) {
  160. return readBlobAsText(this._bodyBlob, this._options)
  161. } else if (this._bodyFormData) {
  162. throw new Error('could not read FormData body as text')
  163. } else {
  164. return Promise.resolve(this._bodyText)
  165. }
  166. }
  167. } else {
  168. this.text = function() {
  169. var rejected = consumed(this)
  170. return rejected ? rejected : Promise.resolve(this._bodyText)
  171. }
  172. }
  173. if (support.formData) {
  174. this.formData = function() {
  175. return this.text().then(decode)
  176. }
  177. }
  178. this.json = function() {
  179. return this.text().then(JSON.parse)
  180. }
  181. return this
  182. }
  183. // HTTP methods whose capitalization should be normalized
  184. var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
  185. function normalizeMethod(method) {
  186. var upcased = method.toUpperCase()
  187. return (methods.indexOf(upcased) > -1) ? upcased : method
  188. }
  189. function Request(input, options) {
  190. options = options || {}
  191. var body = options.body
  192. if (Request.prototype.isPrototypeOf(input)) {
  193. if (input.bodyUsed) {
  194. throw new TypeError('Already read')
  195. }
  196. this.url = input.url
  197. this.credentials = input.credentials
  198. if (!options.headers) {
  199. this.headers = new Headers(input.headers)
  200. }
  201. this.method = input.method
  202. this.mode = input.mode
  203. if (!body) {
  204. body = input._bodyInit
  205. input.bodyUsed = true
  206. }
  207. } else {
  208. this.url = input
  209. }
  210. this.credentials = options.credentials || this.credentials || 'omit'
  211. if (options.headers || !this.headers) {
  212. this.headers = new Headers(options.headers)
  213. }
  214. this.method = normalizeMethod(options.method || this.method || 'GET')
  215. this.mode = options.mode || this.mode || null
  216. this.referrer = null
  217. if ((this.method === 'GET' || this.method === 'HEAD') && body) {
  218. throw new TypeError('Body not allowed for GET or HEAD requests')
  219. }
  220. this._initBody(body, options)
  221. }
  222. Request.prototype.clone = function() {
  223. return new Request(this)
  224. }
  225. function decode(body) {
  226. var form = new FormData()
  227. body.trim().split('&').forEach(function(bytes) {
  228. if (bytes) {
  229. var split = bytes.split('=')
  230. var name = split.shift().replace(/\+/g, ' ')
  231. var value = split.join('=').replace(/\+/g, ' ')
  232. form.append(decodeURIComponent(name), decodeURIComponent(value))
  233. }
  234. })
  235. return form
  236. }
  237. function headers(xhr) {
  238. var head = new Headers()
  239. var pairs = xhr.getAllResponseHeaders().trim().split('\n')
  240. pairs.forEach(function(header) {
  241. var split = header.trim().split(':')
  242. var key = split.shift().trim()
  243. var value = split.join(':').trim()
  244. head.append(key, value)
  245. })
  246. return head
  247. }
  248. Body.call(Request.prototype)
  249. function Response(bodyInit, options) {
  250. if (!options) {
  251. options = {}
  252. }
  253. this._initBody(bodyInit, options)
  254. this.type = 'default'
  255. this.status = options.status
  256. this.ok = this.status >= 200 && this.status < 300
  257. this.statusText = options.statusText
  258. this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)
  259. this.url = options.url || ''
  260. }
  261. Body.call(Response.prototype)
  262. Response.prototype.clone = function() {
  263. return new Response(this._bodyInit, {
  264. status: this.status,
  265. statusText: this.statusText,
  266. headers: new Headers(this.headers),
  267. url: this.url
  268. })
  269. }
  270. Response.error = function() {
  271. var response = new Response(null, {status: 0, statusText: ''})
  272. response.type = 'error'
  273. return response
  274. }
  275. var redirectStatuses = [301, 302, 303, 307, 308]
  276. Response.redirect = function(url, status) {
  277. if (redirectStatuses.indexOf(status) === -1) {
  278. throw new RangeError('Invalid status code')
  279. }
  280. return new Response(null, {status: status, headers: {location: url}})
  281. }
  282. self.Headers = Headers;
  283. self.Request = Request;
  284. self.Response = Response;
  285. self.fetch = function(input, init) {
  286. return new Promise(function(resolve, reject) {
  287. var request
  288. if (Request.prototype.isPrototypeOf(input) && !init) {
  289. request = input
  290. } else {
  291. request = new Request(input, init)
  292. }
  293. var xhr = new XMLHttpRequest()
  294. function responseURL() {
  295. if ('responseURL' in xhr) {
  296. return xhr.responseURL
  297. }
  298. // Avoid security warnings on getResponseHeader when not allowed by CORS
  299. if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
  300. return xhr.getResponseHeader('X-Request-URL')
  301. }
  302. return;
  303. }
  304. var __onLoadHandled = false;
  305. function onload() {
  306. if (xhr.readyState !== 4) {
  307. return
  308. }
  309. var status = (xhr.status === 1223) ? 204 : xhr.status
  310. if (status < 100 || status > 599) {
  311. if (__onLoadHandled) { return; } else { __onLoadHandled = true; }
  312. reject(new TypeError('Network request failed'))
  313. return
  314. }
  315. var options = {
  316. status: status,
  317. statusText: xhr.statusText,
  318. headers: headers(xhr),
  319. url: responseURL()
  320. }
  321. var body = 'response' in xhr ? xhr.response : xhr.responseText;
  322. if (__onLoadHandled) { return; } else { __onLoadHandled = true; }
  323. resolve(new Response(body, options))
  324. }
  325. xhr.onreadystatechange = onload;
  326. xhr.onload = onload;
  327. xhr.onerror = function() {
  328. if (__onLoadHandled) { return; } else { __onLoadHandled = true; }
  329. reject(new TypeError('Network request failed'))
  330. }
  331. xhr.open(request.method, request.url, true)
  332. // `withCredentials` should be setted after calling `.open` in IE10
  333. // http://stackoverflow.com/a/19667959/1219343
  334. try {
  335. if (request.credentials === 'include') {
  336. if ('withCredentials' in xhr) {
  337. xhr.withCredentials = true;
  338. } else {
  339. console && console.warn && console.warn('withCredentials is not supported, you can ignore this warning');
  340. }
  341. }
  342. } catch (e) {
  343. console && console.warn && console.warn('set withCredentials error:' + e);
  344. }
  345. if ('responseType' in xhr && support.blob) {
  346. xhr.responseType = 'blob'
  347. }
  348. request.headers.forEach(function(value, name) {
  349. xhr.setRequestHeader(name, value)
  350. })
  351. xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
  352. })
  353. }
  354. self.fetch.polyfill = true
  355. // Support CommonJS
  356. if ( true && module.exports) {
  357. module.exports = self.fetch;
  358. }
  359. })(typeof self !== 'undefined' ? self : this);
  360. /***/ }),
  361. /***/ 144:
  362. /***/ (function(module, exports) {
  363. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  364. if (true) {
  365. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  366. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  367. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  368. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  369. } else { var mod; }
  370. })(this, function (exports, module) {
  371. 'use strict';
  372. var defaultOptions = {
  373. timeout: 5000,
  374. jsonpCallback: 'callback',
  375. jsonpCallbackFunction: null
  376. };
  377. function generateCallbackFunction() {
  378. return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
  379. }
  380. function clearFunction(functionName) {
  381. // IE8 throws an exception when you try to delete a property on window
  382. // http://stackoverflow.com/a/1824228/751089
  383. try {
  384. delete window[functionName];
  385. } catch (e) {
  386. window[functionName] = undefined;
  387. }
  388. }
  389. function removeScript(scriptId) {
  390. var script = document.getElementById(scriptId);
  391. if (script) {
  392. document.getElementsByTagName('head')[0].removeChild(script);
  393. }
  394. }
  395. function fetchJsonp(_url) {
  396. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  397. // to avoid param reassign
  398. var url = _url;
  399. var timeout = options.timeout || defaultOptions.timeout;
  400. var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
  401. var timeoutId = undefined;
  402. return new Promise(function (resolve, reject) {
  403. var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
  404. var scriptId = jsonpCallback + '_' + callbackFunction;
  405. window[callbackFunction] = function (response) {
  406. resolve({
  407. ok: true,
  408. // keep consistent with fetch API
  409. json: function json() {
  410. return Promise.resolve(response);
  411. }
  412. });
  413. if (timeoutId) clearTimeout(timeoutId);
  414. removeScript(scriptId);
  415. clearFunction(callbackFunction);
  416. };
  417. // Check if the user set their own params, and if not add a ? to start a list of params
  418. url += url.indexOf('?') === -1 ? '?' : '&';
  419. var jsonpScript = document.createElement('script');
  420. jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);
  421. if (options.charset) {
  422. jsonpScript.setAttribute('charset', options.charset);
  423. }
  424. jsonpScript.id = scriptId;
  425. document.getElementsByTagName('head')[0].appendChild(jsonpScript);
  426. timeoutId = setTimeout(function () {
  427. reject(new Error('JSONP request to ' + _url + ' timed out'));
  428. clearFunction(callbackFunction);
  429. removeScript(scriptId);
  430. window[callbackFunction] = function () {
  431. clearFunction(callbackFunction);
  432. };
  433. }, timeout);
  434. // Caught if got 404/500
  435. jsonpScript.onerror = function () {
  436. reject(new Error('JSONP request to ' + _url + ' failed'));
  437. clearFunction(callbackFunction);
  438. removeScript(scriptId);
  439. if (timeoutId) clearTimeout(timeoutId);
  440. };
  441. });
  442. }
  443. // export as global function
  444. /*
  445. let local;
  446. if (typeof global !== 'undefined') {
  447. local = global;
  448. } else if (typeof self !== 'undefined') {
  449. local = self;
  450. } else {
  451. try {
  452. local = Function('return this')();
  453. } catch (e) {
  454. throw new Error('polyfill failed because global object is unavailable in this environment');
  455. }
  456. }
  457. local.fetchJsonp = fetchJsonp;
  458. */
  459. module.exports = fetchJsonp;
  460. });
  461. /***/ }),
  462. /***/ 107:
  463. /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
  464. (function (global, factory) {
  465. true ? factory() :
  466. 0;
  467. }(this, (function () { 'use strict';
  468. /**
  469. * @this {Promise}
  470. */
  471. function finallyConstructor(callback) {
  472. var constructor = this.constructor;
  473. return this.then(
  474. function(value) {
  475. // @ts-ignore
  476. return constructor.resolve(callback()).then(function() {
  477. return value;
  478. });
  479. },
  480. function(reason) {
  481. // @ts-ignore
  482. return constructor.resolve(callback()).then(function() {
  483. // @ts-ignore
  484. return constructor.reject(reason);
  485. });
  486. }
  487. );
  488. }
  489. function allSettled(arr) {
  490. var P = this;
  491. return new P(function(resolve, reject) {
  492. if (!(arr && typeof arr.length !== 'undefined')) {
  493. return reject(
  494. new TypeError(
  495. typeof arr +
  496. ' ' +
  497. arr +
  498. ' is not iterable(cannot read property Symbol(Symbol.iterator))'
  499. )
  500. );
  501. }
  502. var args = Array.prototype.slice.call(arr);
  503. if (args.length === 0) return resolve([]);
  504. var remaining = args.length;
  505. function res(i, val) {
  506. if (val && (typeof val === 'object' || typeof val === 'function')) {
  507. var then = val.then;
  508. if (typeof then === 'function') {
  509. then.call(
  510. val,
  511. function(val) {
  512. res(i, val);
  513. },
  514. function(e) {
  515. args[i] = { status: 'rejected', reason: e };
  516. if (--remaining === 0) {
  517. resolve(args);
  518. }
  519. }
  520. );
  521. return;
  522. }
  523. }
  524. args[i] = { status: 'fulfilled', value: val };
  525. if (--remaining === 0) {
  526. resolve(args);
  527. }
  528. }
  529. for (var i = 0; i < args.length; i++) {
  530. res(i, args[i]);
  531. }
  532. });
  533. }
  534. // Store setTimeout reference so promise-polyfill will be unaffected by
  535. // other code modifying setTimeout (like sinon.useFakeTimers())
  536. var setTimeoutFunc = setTimeout;
  537. function isArray(x) {
  538. return Boolean(x && typeof x.length !== 'undefined');
  539. }
  540. function noop() {}
  541. // Polyfill for Function.prototype.bind
  542. function bind(fn, thisArg) {
  543. return function() {
  544. fn.apply(thisArg, arguments);
  545. };
  546. }
  547. /**
  548. * @constructor
  549. * @param {Function} fn
  550. */
  551. function Promise(fn) {
  552. if (!(this instanceof Promise))
  553. throw new TypeError('Promises must be constructed via new');
  554. if (typeof fn !== 'function') throw new TypeError('not a function');
  555. /** @type {!number} */
  556. this._state = 0;
  557. /** @type {!boolean} */
  558. this._handled = false;
  559. /** @type {Promise|undefined} */
  560. this._value = undefined;
  561. /** @type {!Array<!Function>} */
  562. this._deferreds = [];
  563. doResolve(fn, this);
  564. }
  565. function handle(self, deferred) {
  566. while (self._state === 3) {
  567. self = self._value;
  568. }
  569. if (self._state === 0) {
  570. self._deferreds.push(deferred);
  571. return;
  572. }
  573. self._handled = true;
  574. Promise._immediateFn(function() {
  575. var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
  576. if (cb === null) {
  577. (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
  578. return;
  579. }
  580. var ret;
  581. try {
  582. ret = cb(self._value);
  583. } catch (e) {
  584. reject(deferred.promise, e);
  585. return;
  586. }
  587. resolve(deferred.promise, ret);
  588. });
  589. }
  590. function resolve(self, newValue) {
  591. try {
  592. // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
  593. if (newValue === self)
  594. throw new TypeError('A promise cannot be resolved with itself.');
  595. if (
  596. newValue &&
  597. (typeof newValue === 'object' || typeof newValue === 'function')
  598. ) {
  599. var then = newValue.then;
  600. if (newValue instanceof Promise) {
  601. self._state = 3;
  602. self._value = newValue;
  603. finale(self);
  604. return;
  605. } else if (typeof then === 'function') {
  606. doResolve(bind(then, newValue), self);
  607. return;
  608. }
  609. }
  610. self._state = 1;
  611. self._value = newValue;
  612. finale(self);
  613. } catch (e) {
  614. reject(self, e);
  615. }
  616. }
  617. function reject(self, newValue) {
  618. self._state = 2;
  619. self._value = newValue;
  620. finale(self);
  621. }
  622. function finale(self) {
  623. if (self._state === 2 && self._deferreds.length === 0) {
  624. Promise._immediateFn(function() {
  625. if (!self._handled) {
  626. Promise._unhandledRejectionFn(self._value);
  627. }
  628. });
  629. }
  630. for (var i = 0, len = self._deferreds.length; i < len; i++) {
  631. handle(self, self._deferreds[i]);
  632. }
  633. self._deferreds = null;
  634. }
  635. /**
  636. * @constructor
  637. */
  638. function Handler(onFulfilled, onRejected, promise) {
  639. this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
  640. this.onRejected = typeof onRejected === 'function' ? onRejected : null;
  641. this.promise = promise;
  642. }
  643. /**
  644. * Take a potentially misbehaving resolver function and make sure
  645. * onFulfilled and onRejected are only called once.
  646. *
  647. * Makes no guarantees about asynchrony.
  648. */
  649. function doResolve(fn, self) {
  650. var done = false;
  651. try {
  652. fn(
  653. function(value) {
  654. if (done) return;
  655. done = true;
  656. resolve(self, value);
  657. },
  658. function(reason) {
  659. if (done) return;
  660. done = true;
  661. reject(self, reason);
  662. }
  663. );
  664. } catch (ex) {
  665. if (done) return;
  666. done = true;
  667. reject(self, ex);
  668. }
  669. }
  670. Promise.prototype['catch'] = function(onRejected) {
  671. return this.then(null, onRejected);
  672. };
  673. Promise.prototype.then = function(onFulfilled, onRejected) {
  674. // @ts-ignore
  675. var prom = new this.constructor(noop);
  676. handle(this, new Handler(onFulfilled, onRejected, prom));
  677. return prom;
  678. };
  679. Promise.prototype['finally'] = finallyConstructor;
  680. Promise.all = function(arr) {
  681. return new Promise(function(resolve, reject) {
  682. if (!isArray(arr)) {
  683. return reject(new TypeError('Promise.all accepts an array'));
  684. }
  685. var args = Array.prototype.slice.call(arr);
  686. if (args.length === 0) return resolve([]);
  687. var remaining = args.length;
  688. function res(i, val) {
  689. try {
  690. if (val && (typeof val === 'object' || typeof val === 'function')) {
  691. var then = val.then;
  692. if (typeof then === 'function') {
  693. then.call(
  694. val,
  695. function(val) {
  696. res(i, val);
  697. },
  698. reject
  699. );
  700. return;
  701. }
  702. }
  703. args[i] = val;
  704. if (--remaining === 0) {
  705. resolve(args);
  706. }
  707. } catch (ex) {
  708. reject(ex);
  709. }
  710. }
  711. for (var i = 0; i < args.length; i++) {
  712. res(i, args[i]);
  713. }
  714. });
  715. };
  716. Promise.allSettled = allSettled;
  717. Promise.resolve = function(value) {
  718. if (value && typeof value === 'object' && value.constructor === Promise) {
  719. return value;
  720. }
  721. return new Promise(function(resolve) {
  722. resolve(value);
  723. });
  724. };
  725. Promise.reject = function(value) {
  726. return new Promise(function(resolve, reject) {
  727. reject(value);
  728. });
  729. };
  730. Promise.race = function(arr) {
  731. return new Promise(function(resolve, reject) {
  732. if (!isArray(arr)) {
  733. return reject(new TypeError('Promise.race accepts an array'));
  734. }
  735. for (var i = 0, len = arr.length; i < len; i++) {
  736. Promise.resolve(arr[i]).then(resolve, reject);
  737. }
  738. });
  739. };
  740. // Use polyfill for setImmediate for performance gains
  741. Promise._immediateFn =
  742. // @ts-ignore
  743. (typeof setImmediate === 'function' &&
  744. function(fn) {
  745. // @ts-ignore
  746. setImmediate(fn);
  747. }) ||
  748. function(fn) {
  749. setTimeoutFunc(fn, 0);
  750. };
  751. Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
  752. if (typeof console !== 'undefined' && console) {
  753. console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
  754. }
  755. };
  756. /** @suppress {undefinedVars} */
  757. var globalNS = (function() {
  758. // the only reliable means to get the global object is
  759. // `Function('return this')()`
  760. // However, this causes CSP violations in Chrome apps.
  761. if (typeof self !== 'undefined') {
  762. return self;
  763. }
  764. if (typeof window !== 'undefined') {
  765. return window;
  766. }
  767. if (typeof __webpack_require__.g !== 'undefined') {
  768. return __webpack_require__.g;
  769. }
  770. throw new Error('unable to locate global object');
  771. })();
  772. // Expose the polyfill if Promise is undefined or set to a
  773. // non-function value. The latter can be due to a named HTMLElement
  774. // being exposed by browsers for legacy reasons.
  775. // https://github.com/taylorhakes/promise-polyfill/issues/114
  776. if (typeof globalNS['Promise'] !== 'function') {
  777. globalNS['Promise'] = Promise;
  778. } else {
  779. if (!globalNS.Promise.prototype['finally']) {
  780. globalNS.Promise.prototype['finally'] = finallyConstructor;
  781. }
  782. if (!globalNS.Promise.allSettled) {
  783. globalNS.Promise.allSettled = allSettled;
  784. }
  785. }
  786. })));
  787. /***/ })
  788. /******/ });
  789. /************************************************************************/
  790. /******/ // The module cache
  791. /******/ var __webpack_module_cache__ = {};
  792. /******/
  793. /******/ // The require function
  794. /******/ function __webpack_require__(moduleId) {
  795. /******/ // Check if module is in cache
  796. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  797. /******/ if (cachedModule !== undefined) {
  798. /******/ return cachedModule.exports;
  799. /******/ }
  800. /******/ // Create a new module (and put it into the cache)
  801. /******/ var module = __webpack_module_cache__[moduleId] = {
  802. /******/ // no module.id needed
  803. /******/ // no module.loaded needed
  804. /******/ exports: {}
  805. /******/ };
  806. /******/
  807. /******/ // Execute the module function
  808. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  809. /******/
  810. /******/ // Return the exports of the module
  811. /******/ return module.exports;
  812. /******/ }
  813. /******/
  814. /************************************************************************/
  815. /******/ /* webpack/runtime/compat get default export */
  816. /******/ (() => {
  817. /******/ // getDefaultExport function for compatibility with non-harmony modules
  818. /******/ __webpack_require__.n = (module) => {
  819. /******/ var getter = module && module.__esModule ?
  820. /******/ () => (module['default']) :
  821. /******/ () => (module);
  822. /******/ __webpack_require__.d(getter, { a: getter });
  823. /******/ return getter;
  824. /******/ };
  825. /******/ })();
  826. /******/
  827. /******/ /* webpack/runtime/define property getters */
  828. /******/ (() => {
  829. /******/ // define getter functions for harmony exports
  830. /******/ __webpack_require__.d = (exports, definition) => {
  831. /******/ for(var key in definition) {
  832. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  833. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  834. /******/ }
  835. /******/ }
  836. /******/ };
  837. /******/ })();
  838. /******/
  839. /******/ /* webpack/runtime/global */
  840. /******/ (() => {
  841. /******/ __webpack_require__.g = (function() {
  842. /******/ if (typeof globalThis === 'object') return globalThis;
  843. /******/ try {
  844. /******/ return this || new Function('return this')();
  845. /******/ } catch (e) {
  846. /******/ if (typeof window === 'object') return window;
  847. /******/ }
  848. /******/ })();
  849. /******/ })();
  850. /******/
  851. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  852. /******/ (() => {
  853. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  854. /******/ })();
  855. /******/
  856. /************************************************************************/
  857. var __webpack_exports__ = {};
  858. // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  859. (() => {
  860. "use strict";
  861. // UNUSED EXPORTS: AddressMatchService, BuffersAnalystJobsParameter, DatasetService, DatasourceService, ElasticSearch, GeoCodingParameter, GeoDecodingParameter, KernelDensityJobParameter, MapVLayer, MapVRenderer, MappingParameters, OutputSetting, OverlayGeoJobParameter, ProcessingService, SecurityManager, SingleObjectQueryJobsParameter, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SuperMap, TopologyValidatorJobsParameter, Util
  862. ;// CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
  863. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  864. * This program are made available under the terms of the Apache License, Version 2.0
  865. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  866. /**
  867. * @class Pixel
  868. * @deprecatedclass SuperMap.Pixel
  869. * @category BaseTypes Geometry
  870. * @classdesc 用 x,y 坐标描绘屏幕坐标(像素点)。
  871. * @param {number} [x=0.0] - x 坐标。
  872. * @param {number} [y=0.0] - y 坐标。
  873. * @param {Pixel.Mode} [mode=Pixel.Mode.LeftTop] - 坐标模式。
  874. *
  875. * @example
  876. * //单独创建一个对象
  877. * var pixcel = new Pixel(100,50);
  878. *
  879. * //依据 size 创建
  880. * var size = new Size(21,25);
  881. * var offset = new Pixel(-(size.w/2), -size.h);
  882. * @usage
  883. */
  884. class Pixel {
  885. constructor(x, y, mode) {
  886. /**
  887. * @member {number} [Pixel.prototype.x=0.0]
  888. * @description x 坐标。
  889. */
  890. this.x = x ? parseFloat(x) : 0.0;
  891. /**
  892. * @member {number} [Pixel.prototype.y=0.0]
  893. * @description y 坐标。
  894. */
  895. this.y = y ? parseFloat(y) : 0.0;
  896. /**
  897. * @member {Pixel.Mode} [Pixel.prototype.mode=Pixel.Mode.LeftTop]
  898. * @description 坐标模式,有左上、右上、右下、左下这几种模式,分别表示相对于左上角、右上角、右下角、左下角的坐标。
  899. */
  900. this.mode = mode;
  901. this.CLASS_NAME = 'SuperMap.Pixel';
  902. }
  903. /**
  904. * @function Pixel.prototype.toString
  905. * @description 返回此对象的字符串形式。
  906. * @example
  907. *
  908. * var pixcel = new Pixel(100,50);
  909. * var str = pixcel.toString();
  910. *
  911. * @returns {string} 例如: "x=200.4,y=242.2"
  912. */
  913. toString() {
  914. return 'x=' + this.x + ',y=' + this.y;
  915. }
  916. /**
  917. * @function Pixel.prototype.clone
  918. * @description 克隆当前的 pixel 对象。
  919. * @example
  920. * var pixcel = new Pixel(100,50);
  921. * var pixcel2 = pixcel.clone();
  922. * @returns {Pixel} 新的与当前 pixel 对象有相同 x、y 坐标的 pixel 对象。
  923. */
  924. clone() {
  925. return new Pixel(this.x, this.y, this.mode);
  926. }
  927. /**
  928. * @function Pixel.prototype.equals
  929. * @description 比较两 pixel 是否相等。
  930. * @example
  931. * var pixcel = new Pixel(100,50);
  932. * var pixcel2 = new Pixel(100,50);
  933. * var isEquals = pixcel.equals(pixcel2);
  934. *
  935. * @param {Pixel} px - 用于比较相等的 pixel 对象。
  936. * @returns {boolean} 如果传入的像素点和当前像素点相同返回 true,如果不同或传入参数为 NULL 则返回 false。
  937. */
  938. equals(px) {
  939. var equals = false;
  940. if (px != null) {
  941. equals = (this.x == px.x && this.y == px.y) || (isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y));
  942. }
  943. return equals;
  944. }
  945. /**
  946. * @function Pixel.prototype.distanceTo
  947. * @description 返回两个 pixel 的距离。
  948. * @example
  949. * var pixcel = new Pixel(100,50);
  950. * var pixcel2 = new Pixel(110,30);
  951. * var distance = pixcel.distanceTo(pixcel2);
  952. *
  953. * @param {Pixel} px - 需要计算的 pixel。
  954. * @returns {number} 作为参数传入的像素与当前像素点的距离。
  955. */
  956. distanceTo(px) {
  957. return Math.sqrt(Math.pow(this.x - px.x, 2) + Math.pow(this.y - px.y, 2));
  958. }
  959. /**
  960. * @function Pixel.prototype.add
  961. * @description 在原来像素坐标基础上,x 值加上传入的 x 参数,y 值加上传入的 y 参数。
  962. * @example
  963. * var pixcel = new Pixel(100,50);
  964. * //pixcel2是新的对象
  965. * var pixcel2 = pixcel.add(20,30);
  966. *
  967. * @param {number} x - 传入的 x 值。
  968. * @param {number} y - 传入的 y 值。
  969. * @returns {Pixel} 新的 pixel 对象,该 pixel 是由当前的 pixel 与传入的 x,y 相加得到。
  970. */
  971. add(x, y) {
  972. if (x == null || y == null) {
  973. throw new TypeError('Pixel.add cannot receive null values');
  974. }
  975. return new Pixel(this.x + x, this.y + y);
  976. }
  977. /**
  978. * @function Pixel.prototype.offset
  979. * @description 通过传入的 {@link Pixel} 参数对原屏幕坐标进行偏移。
  980. * @example
  981. * var pixcel = new Pixel(100,50);
  982. * var pixcel2 = new Pixel(130,20);
  983. * //pixcel3 是新的对象
  984. * var pixcel3 = pixcel.offset(pixcel2);
  985. *
  986. * @param {Pixel} px - 传入的 {@link Pixel} 对象。
  987. * @returns {Pixel} 新的 pixel,该 pixel 是由当前的 pixel 对象的 x,y 值与传入的 Pixel 对象的 x,y 值相加得到。
  988. */
  989. offset(px) {
  990. var newPx = this.clone();
  991. if (px) {
  992. newPx = this.add(px.x, px.y);
  993. }
  994. return newPx;
  995. }
  996. /**
  997. *
  998. * @function Pixel.prototype.destroy
  999. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  1000. * @example
  1001. * var pixcel = new Pixel(100,50);
  1002. * pixcel.destroy();
  1003. */
  1004. destroy() {
  1005. this.x = null;
  1006. this.y = null;
  1007. this.mode = null;
  1008. }
  1009. }
  1010. /**
  1011. * @enum Mode
  1012. * @memberOf Pixel
  1013. * @readonly
  1014. * @description 模式。
  1015. * @type {string}
  1016. */
  1017. Pixel.Mode = {
  1018. /** 左上模式。*/
  1019. LeftTop: 'lefttop',
  1020. /** 右上模式。 */
  1021. RightTop: 'righttop',
  1022. /** 右下模式。 */
  1023. RightBottom: 'rightbottom',
  1024. /** 左下模式。 */
  1025. LeftBottom: 'leftbottom'
  1026. };
  1027. ;// CONCATENATED MODULE: ./src/common/commontypes/BaseTypes.js
  1028. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  1029. * This program are made available under the terms of the Apache License, Version 2.0
  1030. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  1031. /**
  1032. * @function inherit
  1033. * @description 除了 C 和 P 两个必要参数外,可以传递任意数量的对象,这些对象都将继承C。
  1034. * @param {Object} C - 继承的类。
  1035. * @param {Object} P - 被继承的父类。
  1036. * @private
  1037. */
  1038. var inheritExt = function (C, P) {
  1039. var F = function () {
  1040. };
  1041. F.prototype = P.prototype;
  1042. C.prototype = new F;
  1043. var i, l, o;
  1044. for (i = 2, l = arguments.length; i < l; i++) {
  1045. o = arguments[i];
  1046. if (typeof o === "function") {
  1047. o = o.prototype;
  1048. }
  1049. Util.extend(C.prototype, o);
  1050. }
  1051. };
  1052. /**
  1053. * @function mixinExt
  1054. * @description 实现多重继承。
  1055. * @param {Class|Object} ...mixins - 继承的类。
  1056. * @private
  1057. */
  1058. var mixinExt = function (...mixins) {
  1059. class Mix {
  1060. constructor(options) {
  1061. for (var index = 0; index < mixins.length; index++) {
  1062. copyProperties(this, new mixins[index](options));
  1063. }
  1064. }
  1065. }
  1066. for (var index = 0; index < mixins.length; index++) {
  1067. var mixin = mixins[index];
  1068. copyProperties(Mix, mixin);
  1069. copyProperties(Mix.prototype, mixin.prototype);
  1070. copyProperties(Mix.prototype, new mixin());
  1071. }
  1072. return Mix;
  1073. function copyProperties(target, source) {
  1074. var ownKeys = Object.getOwnPropertyNames(source);
  1075. if (Object.getOwnPropertySymbols) {
  1076. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source));
  1077. }
  1078. for (var index = 0; index < ownKeys.length; index++) {
  1079. var key = ownKeys[index];
  1080. if (key !== "constructor"
  1081. && key !== "prototype"
  1082. && key !== "name" && key !== "length") {
  1083. let desc = Object.getOwnPropertyDescriptor(source, key);
  1084. if (window["ActiveXObject"]) {
  1085. Object.defineProperty(target, key, desc || {});
  1086. } else {
  1087. Object.defineProperty(target, key, desc);
  1088. }
  1089. }
  1090. }
  1091. }
  1092. };
  1093. /**
  1094. * @name String
  1095. * @namespace
  1096. * @category BaseTypes Util
  1097. * @description 字符串操作的一系列常用扩展函数。
  1098. * @private
  1099. */
  1100. var StringExt = {
  1101. /**
  1102. * @function StringExt.startsWith
  1103. * @description 判断目标字符串是否以指定的子字符串开头。
  1104. * @param {string} str - 目标字符串。
  1105. * @param {string} sub - 查找的子字符串。
  1106. * @returns {boolean} 目标字符串以指定的子字符串开头,则返回 true;否则返回 false。
  1107. */
  1108. startsWith: function (str, sub) {
  1109. return (str.indexOf(sub) == 0);
  1110. },
  1111. /**
  1112. * @function StringExt.contains
  1113. * @description 判断目标字符串是否包含指定的子字符串。
  1114. * @param {string} str - 目标字符串。
  1115. * @param {string} sub - 查找的子字符串。
  1116. * @returns {boolean} 目标字符串中包含指定的子字符串,则返回 true;否则返回 false。
  1117. */
  1118. contains: function (str, sub) {
  1119. return (str.indexOf(sub) != -1);
  1120. },
  1121. /**
  1122. * @function StringExt.trim
  1123. * @description 删除一个字符串的开头和结尾处的所有空白字符。
  1124. * @param {string} str - (可能)存在空白字符填塞的字符串。
  1125. * @returns {string} 删除开头和结尾处空白字符后的字符串。
  1126. */
  1127. trim: function (str) {
  1128. return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  1129. },
  1130. /**
  1131. * @function StringExt.camelize
  1132. * @description 骆驼式("-")连字符的字符串处理。
  1133. * 例如:"chicken-head" becomes "chickenHead",
  1134. * "-chicken-head" becomes "ChickenHead"。
  1135. * @param {string} str - 要处理的字符串,原始内容不应被修改。
  1136. * @returns {string}
  1137. */
  1138. camelize: function (str) {
  1139. var oStringList = str.split('-');
  1140. var camelizedString = oStringList[0];
  1141. for (var i = 1, len = oStringList.length; i < len; i++) {
  1142. var s = oStringList[i];
  1143. camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
  1144. }
  1145. return camelizedString;
  1146. },
  1147. /**
  1148. * @function StringExt.format
  1149. * @description 提供带 ${token} 标记的字符串, 返回 context 对象属性中指定标记的属性值。
  1150. * @example
  1151. * 示例:
  1152. * (code)
  1153. * 1、template = "${value,getValue}";
  1154. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  1155. * args = [2,23,12,36,21];
  1156. * 返回值:36
  1157. * (end)
  1158. * 示例:
  1159. * (code)
  1160. * 2、template = "$${{value,getValue}}";
  1161. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  1162. * args = [2,23,12,36,21];
  1163. * 返回值:"${36}"
  1164. * (end)
  1165. * 示例:
  1166. * (code)
  1167. * 3、template = "${a,b}";
  1168. * context = {a: {b:"format"}};
  1169. * args = null;
  1170. * 返回值:"format"
  1171. * (end)
  1172. * 示例:
  1173. * (code)
  1174. * 3、template = "${a,b}";
  1175. * context = null;
  1176. * args = null;
  1177. * 返回值:"${a.b}"
  1178. * (end)
  1179. * @param {string} template - 带标记的字符串将要被替换。参数 template 格式为"${token}",此处的 token 标记会替换为 context["token"] 属性的值。
  1180. * @param {Object} [context=window] - 带有属性的可选对象的属性用于匹配格式化字符串中的标记。如果该参数为空,将使用 window 对象。
  1181. * @param {Array.<number>} [args] - 可选参数传递给在 context 对象上找到的函数。
  1182. * @returns {string} 从 context 对象属性中替换字符串标记位的字符串。
  1183. */
  1184. format: function (template, context, args) {
  1185. if (!context) {
  1186. context = window;
  1187. }
  1188. // Example matching:
  1189. // str = ${foo.bar}
  1190. // match = foo.bar
  1191. var replacer = function (str, match) {
  1192. var replacement;
  1193. // Loop through all subs. Example: ${a.b.c}
  1194. // 0 -> replacement = context[a];
  1195. // 1 -> replacement = context[a][b];
  1196. // 2 -> replacement = context[a][b][c];
  1197. var subs = match.split(/\.+/);
  1198. for (var i = 0; i < subs.length; i++) {
  1199. if (i == 0) {
  1200. replacement = context;
  1201. }
  1202. replacement = replacement[subs[i]];
  1203. }
  1204. if (typeof replacement === "function") {
  1205. replacement = args ?
  1206. replacement.apply(null, args) :
  1207. replacement();
  1208. }
  1209. // If replacement is undefined, return the string 'undefined'.
  1210. // This is a workaround for a bugs in browsers not properly
  1211. // dealing with non-participating groups in regular expressions:
  1212. // http://blog.stevenlevithan.com/archives/npcg-javascript
  1213. if (typeof replacement == 'undefined') {
  1214. return 'undefined';
  1215. } else {
  1216. return replacement;
  1217. }
  1218. };
  1219. return template.replace(StringExt.tokenRegEx, replacer);
  1220. },
  1221. /**
  1222. * @member {RegExp} [StringExt.tokenRegEx]
  1223. * @description 寻找带 token 的字符串,默认为 tokenRegEx=/\$\{([\w.]+?)\}/g。
  1224. * @example
  1225. * Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
  1226. */
  1227. tokenRegEx: /\$\{([\w.]+?)\}/g,
  1228. /**
  1229. * @member {RegExp} [StringExt.numberRegEx]
  1230. * @description 判断一个字符串是否只包含一个数值,默认为 numberRegEx=/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/。
  1231. */
  1232. numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
  1233. /**
  1234. * @function StringExt.isNumeric
  1235. * @description 判断一个字符串是否只包含一个数值。
  1236. * @example
  1237. * (code)
  1238. * StringExt.isNumeric("6.02e23") // true
  1239. * StringExt.isNumeric("12 dozen") // false
  1240. * StringExt.isNumeric("4") // true
  1241. * StringExt.isNumeric(" 4 ") // false
  1242. * (end)
  1243. * @returns {boolean} 字符串包含唯一的数值,返回 true;否则返回 false。
  1244. */
  1245. isNumeric: function (value) {
  1246. return StringExt.numberRegEx.test(value);
  1247. },
  1248. /**
  1249. * @function StringExt.numericIf
  1250. * @description 把一个看似数值型的字符串转化为一个数值。
  1251. * @returns {(number|string)} 如果能转换为数值则返回数值,否则返回字符串本身。
  1252. */
  1253. numericIf: function (value) {
  1254. return StringExt.isNumeric(value) ? parseFloat(value) : value;
  1255. }
  1256. };
  1257. /**
  1258. * @name Number
  1259. * @namespace
  1260. * @category BaseTypes Util
  1261. * @description 数值操作的一系列常用扩展函数。
  1262. * @private
  1263. */
  1264. var NumberExt = {
  1265. /**
  1266. * @member {string} [NumberExt.decimalSeparator='.']
  1267. * @description 格式化数字时默认的小数点分隔符。
  1268. * @constant
  1269. */
  1270. decimalSeparator: ".",
  1271. /**
  1272. * @member {string} [NumberExt.thousandsSeparator=',']
  1273. * @description 格式化数字时默认的千位分隔符。
  1274. * @constant
  1275. */
  1276. thousandsSeparator: ",",
  1277. /**
  1278. * @function NumberExt.limitSigDigs
  1279. * @description 限制浮点数的有效数字位数。
  1280. * @param {number} num - 浮点数。
  1281. * @param {number} sig - 有效位数。
  1282. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  1283. */
  1284. limitSigDigs: function (num, sig) {
  1285. var fig = 0;
  1286. if (sig > 0) {
  1287. fig = parseFloat(num.toPrecision(sig));
  1288. }
  1289. return fig;
  1290. },
  1291. /**
  1292. * @function NumberExt.format
  1293. * @description 数字格式化输出。
  1294. * @param {number} num - 数字。
  1295. * @param {number} [dec=0] - 数字的小数部分四舍五入到指定的位数。设置为 null 值时小数部分不变。
  1296. * @param {string} [tsep=','] - 千位分隔符。
  1297. * @param {string} [dsep='.'] - 小数点分隔符。
  1298. * @returns {string} 数字格式化后的字符串。
  1299. */
  1300. format: function (num, dec, tsep, dsep) {
  1301. dec = (typeof dec != "undefined") ? dec : 0;
  1302. tsep = (typeof tsep != "undefined") ? tsep :
  1303. NumberExt.thousandsSeparator;
  1304. dsep = (typeof dsep != "undefined") ? dsep :
  1305. NumberExt.decimalSeparator;
  1306. if (dec != null) {
  1307. num = parseFloat(num.toFixed(dec));
  1308. }
  1309. var parts = num.toString().split(".");
  1310. if (parts.length === 1 && dec == null) {
  1311. // integer where we do not want to touch the decimals
  1312. dec = 0;
  1313. }
  1314. var integer = parts[0];
  1315. if (tsep) {
  1316. var thousands = /(-?[0-9]+)([0-9]{3})/;
  1317. while (thousands.test(integer)) {
  1318. integer = integer.replace(thousands, "$1" + tsep + "$2");
  1319. }
  1320. }
  1321. var str;
  1322. if (dec == 0) {
  1323. str = integer;
  1324. } else {
  1325. var rem = parts.length > 1 ? parts[1] : "0";
  1326. if (dec != null) {
  1327. rem = rem + new Array(dec - rem.length + 1).join("0");
  1328. }
  1329. str = integer + dsep + rem;
  1330. }
  1331. return str;
  1332. }
  1333. };
  1334. if (!Number.prototype.limitSigDigs) {
  1335. /**
  1336. * APIMethod: Number.limitSigDigs
  1337. * 限制浮点数的有效数字位数.
  1338. * @param {number} sig -有效位数。
  1339. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  1340. * 如果传入值 为 null、0、或者是负数, 返回值 0。
  1341. */
  1342. Number.prototype.limitSigDigs = function (sig) {
  1343. return NumberExt.limitSigDigs(this, sig);
  1344. };
  1345. }
  1346. /**
  1347. * @name Function
  1348. * @namespace
  1349. * @category BaseTypes Util
  1350. * @description 函数操作的一系列常用扩展函数。
  1351. * @private
  1352. */
  1353. var FunctionExt = {
  1354. /**
  1355. * @function FunctionExt.bind
  1356. * @description 绑定函数到对象。方便创建 this 的作用域。
  1357. * @param {function} func - 输入函数。
  1358. * @param {Object} object - 对象绑定到输入函数(作为输入函数的 this 对象)。
  1359. * @returns {function} object 参数作为 func 函数的 this 对象。
  1360. */
  1361. bind: function (func, object) {
  1362. // create a reference to all arguments past the second one
  1363. var args = Array.prototype.slice.apply(arguments, [2]);
  1364. return function () {
  1365. // Push on any additional arguments from the actual function call.
  1366. // These will come after those sent to the bind call.
  1367. var newArgs = args.concat(
  1368. Array.prototype.slice.apply(arguments, [0])
  1369. );
  1370. return func.apply(object, newArgs);
  1371. };
  1372. },
  1373. /**
  1374. * @function FunctionExt.bindAsEventListener
  1375. * @description 绑定函数到对象,在调用该函数时配置并使用事件对象作为第一个参数。
  1376. * @param {function} func - 用于监听事件的函数。
  1377. * @param {Object} object - this 对象的引用。
  1378. * @returns {function}
  1379. */
  1380. bindAsEventListener: function (func, object) {
  1381. return function (event) {
  1382. return func.call(object, event || window.event);
  1383. };
  1384. },
  1385. /**
  1386. * @function FunctionExt.False
  1387. * @description 该函数仅仅返回 false。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  1388. * @example
  1389. * document.onclick = FunctionExt.False;
  1390. * @returns {boolean}
  1391. */
  1392. False: function () {
  1393. return false;
  1394. },
  1395. /**
  1396. * @function FunctionExt.True
  1397. * @description 该函数仅仅返回 true。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  1398. * @example
  1399. * document.onclick = FunctionExt.True;
  1400. * @returns {boolean}
  1401. */
  1402. True: function () {
  1403. return true;
  1404. },
  1405. /**
  1406. * @function FunctionExt.Void
  1407. * @description 可重用函数,仅仅返回 "undefined"。
  1408. * @returns {undefined}
  1409. */
  1410. Void: function () {
  1411. }
  1412. };
  1413. /**
  1414. * @name Array
  1415. * @namespace
  1416. * @category BaseTypes Util
  1417. * @description 数组操作的一系列常用扩展函数。
  1418. * @private
  1419. */
  1420. var ArrayExt = {
  1421. /**
  1422. * @function ArrayExt.filter
  1423. * @description 过滤数组,提供了 ECMA-262 标准中 Array.prototype.filter 函数的扩展。详见:{@link http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter}
  1424. * @param {Array} array - 要过滤的数组。
  1425. * @param {function} callback - 数组中的每一个元素调用该函数。</br>
  1426. * 如果函数的返回值为 true,该元素将包含在返回的数组中。该函数有三个参数: 数组中的元素,元素的索引,数组自身。</br>
  1427. * 如果设置了可选参数 caller,在调用 callback 时,使用可选参数 caller 设置为 callback 的参数。</br>
  1428. * @param {Object} [caller] - 在调用 callback 时,使用参数 caller 设置为 callback 的参数。
  1429. * @returns {Array} callback 函数返回 true 时的元素将作为返回数组中的元素。
  1430. */
  1431. filter: function (array, callback, caller) {
  1432. var selected = [];
  1433. if (Array.prototype.filter) {
  1434. selected = array.filter(callback, caller);
  1435. } else {
  1436. var len = array.length;
  1437. if (typeof callback != "function") {
  1438. throw new TypeError();
  1439. }
  1440. for (var i = 0; i < len; i++) {
  1441. if (i in array) {
  1442. var val = array[i];
  1443. if (callback.call(caller, val, i, array)) {
  1444. selected.push(val);
  1445. }
  1446. }
  1447. }
  1448. }
  1449. return selected;
  1450. }
  1451. };
  1452. ;// CONCATENATED MODULE: ./src/common/commontypes/Geometry.js
  1453. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  1454. * This program are made available under the terms of the Apache License, Version 2.0
  1455. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  1456. // import {WKT} from '../format/WKT';
  1457. // import {Vector} from './Vector';
  1458. /**
  1459. * @class Geometry
  1460. * @deprecatedclass SuperMap.Geometry
  1461. * @category BaseTypes Geometry
  1462. * @classdesc 几何对象类,描述地理对象的几何图形。
  1463. * @usage
  1464. */
  1465. class Geometry {
  1466. constructor() {
  1467. this.CLASS_NAME = "SuperMap.Geometry";
  1468. /**
  1469. * @member {string} Geometry.prototype.id
  1470. * @description 几何对象的唯一标识符。
  1471. *
  1472. */
  1473. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  1474. /**
  1475. * @member {Geometry} Geometry.prototype.parent
  1476. * @description 父类几何对象。
  1477. */
  1478. this.parent = null;
  1479. /**
  1480. * @member {Bounds} Geometry.prototype.bounds
  1481. * @description 几何对象的范围。
  1482. *
  1483. */
  1484. this.bounds = null;
  1485. /**
  1486. * @member {number} Geometry.prototype.SRID
  1487. * @description 投影坐标参数。通过该参数,服务器判断 Geometry 对象的坐标参考系是否与数据集相同,如果不同,则在数据入库前进行投影变换。
  1488. * @example
  1489. * var geometry= new Geometry();
  1490. * geometry. SRID=4326;
  1491. *
  1492. */
  1493. this.SRID = null;
  1494. }
  1495. /**
  1496. * @function Geometry.prototype.destroy
  1497. * @description 解构 Geometry 类,释放资源。
  1498. */
  1499. destroy() {
  1500. this.id = null;
  1501. this.bounds = null;
  1502. this.SRID = null;
  1503. }
  1504. /**
  1505. * @function Geometry.prototype.clone
  1506. * @description 克隆几何图形。克隆的几何图形不设置非标准的属性。
  1507. * @returns {Geometry} 克隆的几何图形。
  1508. */
  1509. clone() {
  1510. return new Geometry();
  1511. }
  1512. /**
  1513. * @function Geometry.prototype.setBounds
  1514. * @description 设置几何对象的 bounds。
  1515. * @param {Bounds} bounds - 范围。
  1516. */
  1517. setBounds(bounds) {
  1518. if (bounds) {
  1519. this.bounds = bounds.clone();
  1520. }
  1521. }
  1522. /**
  1523. * @function Geometry.prototype.clearBounds
  1524. * @description 清除几何对象的 bounds。
  1525. * 如果该对象有父类,也会清除父类几何对象的 bounds。
  1526. */
  1527. clearBounds() {
  1528. this.bounds = null;
  1529. if (this.parent) {
  1530. this.parent.clearBounds();
  1531. }
  1532. }
  1533. /**
  1534. * @function Geometry.prototype.extendBounds
  1535. * @description 扩展现有边界以包含新边界。如果尚未设置几何边界,则设置新边界。
  1536. * @param {Bounds} newBounds - 几何对象的 bounds。
  1537. */
  1538. extendBounds(newBounds) {
  1539. var bounds = this.getBounds();
  1540. if (!bounds) {
  1541. this.setBounds(newBounds);
  1542. } else {
  1543. this.bounds.extend(newBounds);
  1544. }
  1545. }
  1546. /**
  1547. * @function Geometry.prototype.getBounds
  1548. * @description 获得几何图形的边界。如果没有设置边界,可通过计算获得。
  1549. * @returns {Bounds} 几何对象的边界。
  1550. */
  1551. getBounds() {
  1552. if (this.bounds == null) {
  1553. this.calculateBounds();
  1554. }
  1555. return this.bounds;
  1556. }
  1557. /**
  1558. * @function Geometry.prototype.calculateBounds
  1559. * @description 重新计算几何图形的边界(需要在子类中实现此方法)。
  1560. */
  1561. calculateBounds() {
  1562. //
  1563. // This should be overridden by subclasses.
  1564. //
  1565. }
  1566. /**
  1567. * @function Geometry.prototype.getVertices
  1568. * @description 返回几何图形的所有顶点的列表(需要在子类中实现此方法)。
  1569. * @param {boolean} [nodes] - 如果是 true,线则只返回线的末端点,如果 false,仅仅返回顶点,如果没有设置,则返回顶点。
  1570. * @returns {Array} 几何图形的顶点列表。
  1571. */
  1572. getVertices(nodes) { // eslint-disable-line no-unused-vars
  1573. }
  1574. /**
  1575. * @function Geometry.prototype.getArea
  1576. * @description 计算几何对象的面积 ,此方法需要在子类中定义。
  1577. * @returns {number} 计算后的对象面积。
  1578. */
  1579. getArea() {
  1580. //to be overridden by geometries that actually have an area
  1581. //
  1582. return 0.0;
  1583. }
  1584. // /**
  1585. // * @function Geometry.prototype.toString
  1586. // * @description 返回geometry对象的字符串表述,需要引入{@link WKTFormat}。此方法只能在子类实现,在父类使用会报错。
  1587. // * @returns {string} geometry对象的字符串表述(Well-Known Text)
  1588. // */
  1589. // toString() {
  1590. // var string;
  1591. // if (WKT) {
  1592. // var wkt = new WKT();
  1593. // string = wkt.write(new Vector(this));
  1594. // } else {
  1595. // string = Object.prototype.toString.call(this);
  1596. // }
  1597. // return string;
  1598. // }
  1599. }
  1600. ;// CONCATENATED MODULE: ./src/common/commontypes/Util.js
  1601. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  1602. * This program are made available under the terms of the Apache License, Version 2.0
  1603. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  1604. /**
  1605. * @description 浏览器名称,依赖于 userAgent 属性,BROWSER_NAME 可以是空,或者以下浏览器:
  1606. * * "opera" -- Opera
  1607. * * "msie" -- Internet Explorer
  1608. * * "safari" -- Safari
  1609. * * "firefox" -- Firefox
  1610. * * "mozilla" -- Mozilla
  1611. * @category BaseTypes Constant
  1612. * @constant {Object}
  1613. * @usage
  1614. * ```
  1615. * // 浏览器
  1616. * <script type="text/javascript" src="{cdn}"></script>
  1617. * <script>
  1618. * const result = {namespace}.Browser.name;
  1619. *
  1620. * </script>
  1621. * // ES6 Import
  1622. * import { Browser } from '{npm}';
  1623. *
  1624. * const result = Browser.name;
  1625. * ```
  1626. */
  1627. const Browser = (function () {
  1628. var name = '',
  1629. version = '',
  1630. device = 'pc',
  1631. uaMatch;
  1632. //以下进行测试
  1633. var ua = navigator.userAgent.toLowerCase();
  1634. if (ua.indexOf('msie') > -1 || (ua.indexOf('trident') > -1 && ua.indexOf('rv') > -1)) {
  1635. name = 'msie';
  1636. uaMatch = ua.match(/msie ([\d.]+)/) || ua.match(/rv:([\d.]+)/);
  1637. } else if (ua.indexOf('chrome') > -1) {
  1638. name = 'chrome';
  1639. uaMatch = ua.match(/chrome\/([\d.]+)/);
  1640. } else if (ua.indexOf('firefox') > -1) {
  1641. name = 'firefox';
  1642. uaMatch = ua.match(/firefox\/([\d.]+)/);
  1643. } else if (ua.indexOf('opera') > -1) {
  1644. name = 'opera';
  1645. uaMatch = ua.match(/version\/([\d.]+)/);
  1646. } else if (ua.indexOf('safari') > -1) {
  1647. name = 'safari';
  1648. uaMatch = ua.match(/version\/([\d.]+)/);
  1649. }
  1650. version = uaMatch ? uaMatch[1] : '';
  1651. if (ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1 || ua.indexOf('iphone') > -1) {
  1652. device = 'apple';
  1653. } else if (ua.indexOf('android') > -1) {
  1654. uaMatch = ua.match(/version\/([\d.]+)/);
  1655. version = uaMatch ? uaMatch[1] : '';
  1656. device = 'android';
  1657. }
  1658. return { name: name, version: version, device: device };
  1659. })();
  1660. const isSupportCanvas = (function () {
  1661. var checkRes = true,
  1662. broz = Browser;
  1663. if (document.createElement('canvas').getContext) {
  1664. if (broz.name === 'firefox' && parseFloat(broz.version) < 5) {
  1665. checkRes = false;
  1666. }
  1667. if (broz.name === 'safari' && parseFloat(broz.version) < 4) {
  1668. checkRes = false;
  1669. }
  1670. if (broz.name === 'opera' && parseFloat(broz.version) < 10) {
  1671. checkRes = false;
  1672. }
  1673. if (broz.name === 'msie' && parseFloat(broz.version) < 9) {
  1674. checkRes = false;
  1675. }
  1676. } else {
  1677. checkRes = false;
  1678. }
  1679. return checkRes;
  1680. })();
  1681. /**
  1682. * @description 如果 userAgent 捕获到浏览器使用的是 Gecko 引擎则返回 true。
  1683. * @constant {number}
  1684. * @private
  1685. */
  1686. const IS_GECKO = (function () {
  1687. var ua = navigator.userAgent.toLowerCase();
  1688. return ua.indexOf('webkit') === -1 && ua.indexOf('gecko') !== -1;
  1689. })();
  1690. /**
  1691. * @constant {number}
  1692. * @default
  1693. * @description 分辨率与比例尺之间转换的常量。
  1694. * @private
  1695. */
  1696. const DOTS_PER_INCH = 96;
  1697. /**
  1698. * @name CommonUtil
  1699. * @namespace
  1700. * @category BaseTypes Util
  1701. * @description common 工具类。
  1702. * @usage
  1703. * ```
  1704. * // 浏览器
  1705. * <script type="text/javascript" src="{cdn}"></script>
  1706. * <script>
  1707. * const result = {namespace}.CommonUtil.getElement();
  1708. *
  1709. * // 弃用的写法
  1710. * const result = SuperMap.Util.getElement();
  1711. *
  1712. * </script>
  1713. *
  1714. * // ES6 Import
  1715. * import { CommonUtil } from '{npm}';
  1716. *
  1717. * const result = CommonUtil.getElement();
  1718. * ```
  1719. */
  1720. const Util_Util = {
  1721. /**
  1722. * @function Util.extend
  1723. * @description 对象拷贝赋值。
  1724. * @param {Object} dest - 目标对象。
  1725. * @param {Object} arguments - 待拷贝的对象。
  1726. * @returns {Object} 赋值后的目标对象。
  1727. */
  1728. assign(dest) {
  1729. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  1730. var arg = Object.getOwnPropertyNames(arguments)[index];
  1731. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  1732. continue;
  1733. }
  1734. var obj = arguments[arg];
  1735. if (obj) {
  1736. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  1737. var key = Object.getOwnPropertyNames(obj)[j];
  1738. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  1739. continue;
  1740. }
  1741. dest[key] = obj[key];
  1742. }
  1743. }
  1744. }
  1745. return dest;
  1746. },
  1747. /**
  1748. * @memberOf CommonUtil
  1749. * @description 复制源对象的所有属性到目标对象上,源对象上的没有定义的属性在目标对象上也不会被设置。
  1750. * @example
  1751. * 要复制 Size 对象的所有属性到自定义对象上,使用方法如下:
  1752. * var size = new Size(100, 100);
  1753. * var obj = {};
  1754. * CommonUtil.extend(obj, size);
  1755. * @param {Object} [destination] - 目标对象。
  1756. * @param {Object} source - 源对象,其属性将被设置到目标对象上。
  1757. * @returns {Object} 目标对象。
  1758. */
  1759. extend: function (destination, source) {
  1760. destination = destination || {};
  1761. if (source) {
  1762. for (var property in source) {
  1763. var value = source[property];
  1764. if (value !== undefined) {
  1765. destination[property] = value;
  1766. }
  1767. }
  1768. /**
  1769. * IE doesn't include the toString property when iterating over an object's
  1770. * properties with the for(property in object) syntax. Explicitly check if
  1771. * the source has its own toString property.
  1772. */
  1773. /*
  1774. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  1775. * prototype object" when calling hawOwnProperty if the source object
  1776. * is an instance of window.Event.
  1777. */
  1778. var sourceIsEvt = typeof window.Event === 'function' && source instanceof window.Event;
  1779. if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty('toString')) {
  1780. destination.toString = source.toString;
  1781. }
  1782. }
  1783. return destination;
  1784. },
  1785. /**
  1786. * @memberOf CommonUtil
  1787. * @description 对象拷贝。
  1788. * @param {Object} [des] - 目标对象。
  1789. * @param {Object} soc - 源对象。
  1790. */
  1791. copy: function (des, soc) {
  1792. des = des || {};
  1793. var v;
  1794. if (soc) {
  1795. for (var p in des) {
  1796. v = soc[p];
  1797. if (typeof v !== 'undefined') {
  1798. des[p] = v;
  1799. }
  1800. }
  1801. }
  1802. },
  1803. /**
  1804. * @memberOf CommonUtil
  1805. * @description 销毁对象,将其属性置空。
  1806. * @param {Object} [obj] - 目标对象。
  1807. */
  1808. reset: function (obj) {
  1809. obj = obj || {};
  1810. for (var p in obj) {
  1811. if (obj.hasOwnProperty(p)) {
  1812. if (typeof obj[p] === 'object' && obj[p] instanceof Array) {
  1813. for (var i in obj[p]) {
  1814. if (obj[p][i].destroy) {
  1815. obj[p][i].destroy();
  1816. }
  1817. }
  1818. obj[p].length = 0;
  1819. } else if (typeof obj[p] === 'object' && obj[p] instanceof Object) {
  1820. if (obj[p].destroy) {
  1821. obj[p].destroy();
  1822. }
  1823. }
  1824. obj[p] = null;
  1825. }
  1826. }
  1827. },
  1828. /**
  1829. * @memberOf CommonUtil
  1830. * @description 获取 HTML 元素数组。
  1831. * @returns {Array.<HTMLElement>} HTML 元素数组。
  1832. */
  1833. getElement: function () {
  1834. var elements = [];
  1835. for (var i = 0, len = arguments.length; i < len; i++) {
  1836. var element = arguments[i];
  1837. if (typeof element === 'string') {
  1838. element = document.getElementById(element);
  1839. }
  1840. if (arguments.length === 1) {
  1841. return element;
  1842. }
  1843. elements.push(element);
  1844. }
  1845. return elements;
  1846. },
  1847. /**
  1848. * @memberOf CommonUtil
  1849. * @description instance of 的跨浏览器实现。
  1850. * @param {Object} o - 对象。
  1851. * @returns {boolean} 是否是页面元素。
  1852. */
  1853. isElement: function (o) {
  1854. return !!(o && o.nodeType === 1);
  1855. },
  1856. /**
  1857. * @memberOf CommonUtil
  1858. * @description 判断一个对象是否是数组。
  1859. * @param {Object} a - 对象。
  1860. * @returns {boolean} 是否是数组。
  1861. */
  1862. isArray: function (a) {
  1863. return Object.prototype.toString.call(a) === '[object Array]';
  1864. },
  1865. /**
  1866. * @memberOf CommonUtil
  1867. * @description 从数组中删除某一项。
  1868. * @param {Array} array - 数组。
  1869. * @param {Object} item - 数组中要删除的一项。
  1870. * @returns {Array} 执行删除操作后的数组。
  1871. */
  1872. removeItem: function (array, item) {
  1873. for (var i = array.length - 1; i >= 0; i--) {
  1874. if (array[i] === item) {
  1875. array.splice(i, 1);
  1876. //break;more than once??
  1877. }
  1878. }
  1879. return array;
  1880. },
  1881. /**
  1882. * @memberOf CommonUtil
  1883. * @description 获取某对象在数组中的索引值。
  1884. * @param {Array.<Object>} array - 数组。
  1885. * @param {Object} obj - 对象。
  1886. * @returns {number} 某对象在数组中的索引值。
  1887. */
  1888. indexOf: function (array, obj) {
  1889. if (array == null) {
  1890. return -1;
  1891. } else {
  1892. // use the build-in function if available.
  1893. if (typeof array.indexOf === 'function') {
  1894. return array.indexOf(obj);
  1895. } else {
  1896. for (var i = 0, len = array.length; i < len; i++) {
  1897. if (array[i] === obj) {
  1898. return i;
  1899. }
  1900. }
  1901. return -1;
  1902. }
  1903. }
  1904. },
  1905. /**
  1906. * @memberOf CommonUtil
  1907. * @description 修改某 DOM 元素的许多属性。
  1908. * @param {HTMLElement} element - 待修改的 DOM 元素。
  1909. * @param {string} [id] - DOM 元素的 ID。
  1910. * @param {Pixel} [px] - DOM 元素的 style 属性的 left 和 top 属性。
  1911. * @param {Size} [sz] - DOM 元素的 width 和 height 属性。
  1912. * @param {string} [position] - DOM 元素的 position 属性。
  1913. * @param {string} [border] - DOM 元素的 style 属性的 border 属性。
  1914. * @param {string} [overflow] - DOM 元素的 style 属性的 overflow 属性。
  1915. * @param {number} [opacity] - 不透明度值。取值范围为(0.0 - 1.0)。
  1916. */
  1917. modifyDOMElement: function (element, id, px, sz, position, border, overflow, opacity) {
  1918. if (id) {
  1919. element.id = id;
  1920. }
  1921. if (px) {
  1922. element.style.left = px.x + 'px';
  1923. element.style.top = px.y + 'px';
  1924. }
  1925. if (sz) {
  1926. element.style.width = sz.w + 'px';
  1927. element.style.height = sz.h + 'px';
  1928. }
  1929. if (position) {
  1930. element.style.position = position;
  1931. }
  1932. if (border) {
  1933. element.style.border = border;
  1934. }
  1935. if (overflow) {
  1936. element.style.overflow = overflow;
  1937. }
  1938. if (parseFloat(opacity) >= 0.0 && parseFloat(opacity) < 1.0) {
  1939. element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
  1940. element.style.opacity = opacity;
  1941. } else if (parseFloat(opacity) === 1.0) {
  1942. element.style.filter = '';
  1943. element.style.opacity = '';
  1944. }
  1945. },
  1946. /**
  1947. * @memberOf CommonUtil
  1948. * @description 比较两个对象并合并。
  1949. * @param {Object} [to] - 目标对象。
  1950. * @param {Object} from - 源对象。
  1951. * @returns {Object} 返回合并后的对象。
  1952. */
  1953. applyDefaults: function (to, from) {
  1954. to = to || {};
  1955. /*
  1956. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  1957. * prototype object" when calling hawOwnProperty if the source object is an
  1958. * instance of window.Event.
  1959. */
  1960. var fromIsEvt = typeof window.Event === 'function' && from instanceof window.Event;
  1961. for (var key in from) {
  1962. if (
  1963. to[key] === undefined ||
  1964. (!fromIsEvt && from.hasOwnProperty && from.hasOwnProperty(key) && !to.hasOwnProperty(key))
  1965. ) {
  1966. to[key] = from[key];
  1967. }
  1968. }
  1969. /**
  1970. * IE doesn't include the toString property when iterating over an object's
  1971. * properties with the for(property in object) syntax. Explicitly check if
  1972. * the source has its own toString property.
  1973. */
  1974. if (
  1975. !fromIsEvt &&
  1976. from &&
  1977. from.hasOwnProperty &&
  1978. from.hasOwnProperty('toString') &&
  1979. !to.hasOwnProperty('toString')
  1980. ) {
  1981. to.toString = from.toString;
  1982. }
  1983. return to;
  1984. },
  1985. /**
  1986. * @memberOf CommonUtil
  1987. * @description 将参数对象转换为 HTTP 的 GET 请求中的参数字符串。例如:"key1=value1&key2=value2&key3=value3"。
  1988. * @param {Object} params - 参数对象。
  1989. * @returns {string} HTTP 的 GET 请求中的参数字符串。
  1990. */
  1991. getParameterString: function (params) {
  1992. var paramsArray = [];
  1993. for (var key in params) {
  1994. var value = params[key];
  1995. if (value != null && typeof value !== 'function') {
  1996. var encodedValue;
  1997. if (Array.isArray(value) || value.toString() === '[object Object]') {
  1998. encodedValue = encodeURIComponent(JSON.stringify(value));
  1999. } else {
  2000. /* value is a string; simply encode */
  2001. encodedValue = encodeURIComponent(value);
  2002. }
  2003. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  2004. }
  2005. }
  2006. return paramsArray.join('&');
  2007. },
  2008. /**
  2009. * @memberOf CommonUtil
  2010. * @description 给 URL 追加查询参数。
  2011. * @param {string} url - 待追加参数的 URL 字符串。
  2012. * @param {string} paramStr - 待追加的查询参数。
  2013. * @returns {string} 新的 URL。
  2014. */
  2015. urlAppend: function (url, paramStr) {
  2016. var newUrl = url;
  2017. if (paramStr) {
  2018. if (paramStr.indexOf('?') === 0) {
  2019. paramStr = paramStr.substring(1);
  2020. }
  2021. var parts = (url + ' ').split(/[?&]/);
  2022. newUrl += parts.pop() === ' ' ? paramStr : parts.length ? '&' + paramStr : '?' + paramStr;
  2023. }
  2024. return newUrl;
  2025. },
  2026. /**
  2027. * @memberOf CommonUtil
  2028. * @description 给 URL 追加 path 参数。
  2029. * @param {string} url - 待追加参数的 URL 字符串。
  2030. * @param {string} paramStr - 待追加的path参数。
  2031. * @returns {string} 新的 URL。
  2032. */
  2033. urlPathAppend: function (url, pathStr) {
  2034. let newUrl = url;
  2035. if (!pathStr) {
  2036. return newUrl;
  2037. }
  2038. if (pathStr.indexOf('/') === 0) {
  2039. pathStr = pathStr.substring(1);
  2040. }
  2041. const parts = url.split('?');
  2042. if (parts[0].indexOf('/', parts[0].length - 1) < 0) {
  2043. parts[0] += '/';
  2044. }
  2045. newUrl = `${parts[0]}${pathStr}${parts.length > 1 ? `?${parts[1]}` : ''}`;
  2046. return newUrl;
  2047. },
  2048. /**
  2049. * @memberOf CommonUtil
  2050. * @description 为了避免浮点精度错误而保留的有效位数。
  2051. * @type {number}
  2052. * @default 14
  2053. */
  2054. DEFAULT_PRECISION: 14,
  2055. /**
  2056. * @memberOf CommonUtil
  2057. * @description 将字符串以接近的精度转换为数字。
  2058. * @param {string} number - 字符串。
  2059. * @param {number} [precision=14] - 精度。
  2060. * @returns {number} 转化后的数字。
  2061. */
  2062. toFloat: function (number, precision) {
  2063. if (precision == null) {
  2064. precision = Util_Util.DEFAULT_PRECISION;
  2065. }
  2066. if (typeof number !== 'number') {
  2067. number = parseFloat(number);
  2068. }
  2069. return precision === 0 ? number : parseFloat(number.toPrecision(precision));
  2070. },
  2071. /**
  2072. * @memberOf CommonUtil
  2073. * @description 角度转弧度。
  2074. * @param {number} x - 角度。
  2075. * @returns {number} 转化后的弧度。
  2076. */
  2077. rad: function (x) {
  2078. return (x * Math.PI) / 180;
  2079. },
  2080. /**
  2081. * @memberOf CommonUtil
  2082. * @description 从 URL 字符串中解析出参数对象。
  2083. * @param {string} url - URL。
  2084. * @returns {Object} 解析出的参数对象。
  2085. */
  2086. getParameters: function (url) {
  2087. // if no url specified, take it from the location bar
  2088. url = url === null || url === undefined ? window.location.href : url;
  2089. //parse out parameters portion of url string
  2090. var paramsString = '';
  2091. if (StringExt.contains(url, '?')) {
  2092. var start = url.indexOf('?') + 1;
  2093. var end = StringExt.contains(url, '#') ? url.indexOf('#') : url.length;
  2094. paramsString = url.substring(start, end);
  2095. }
  2096. var parameters = {};
  2097. var pairs = paramsString.split(/[&;]/);
  2098. for (var i = 0, len = pairs.length; i < len; ++i) {
  2099. var keyValue = pairs[i].split('=');
  2100. if (keyValue[0]) {
  2101. var key = keyValue[0];
  2102. try {
  2103. key = decodeURIComponent(key);
  2104. } catch (err) {
  2105. key = unescape(key);
  2106. }
  2107. // being liberal by replacing "+" with " "
  2108. var value = (keyValue[1] || '').replace(/\+/g, ' ');
  2109. try {
  2110. value = decodeURIComponent(value);
  2111. } catch (err) {
  2112. value = unescape(value);
  2113. }
  2114. // follow OGC convention of comma delimited values
  2115. value = value.split(',');
  2116. //if there's only one value, do not return as array
  2117. if (value.length == 1) {
  2118. value = value[0];
  2119. }
  2120. parameters[key] = value;
  2121. }
  2122. }
  2123. return parameters;
  2124. },
  2125. /**
  2126. * @memberOf CommonUtil
  2127. * @description 不断递增计数变量,用于生成唯一 ID。
  2128. * @type {number}
  2129. * @default 0
  2130. */
  2131. lastSeqID: 0,
  2132. /**
  2133. * @memberOf CommonUtil
  2134. * @description 创建唯一 ID 值。
  2135. * @param {string} [prefix] - 前缀。
  2136. * @returns {string} 唯一的 ID 值。
  2137. */
  2138. createUniqueID: function (prefix) {
  2139. if (prefix == null) {
  2140. prefix = 'id_';
  2141. }
  2142. Util_Util.lastSeqID += 1;
  2143. return prefix + Util_Util.lastSeqID;
  2144. },
  2145. /**
  2146. * @memberOf CommonUtil
  2147. * @description 判断并转化比例尺。
  2148. * @param {number} scale - 比例尺。
  2149. * @returns {number} 正常的 scale 值。
  2150. */
  2151. normalizeScale: function (scale) {
  2152. var normScale = scale > 1.0 ? 1.0 / scale : scale;
  2153. return normScale;
  2154. },
  2155. /**
  2156. * @memberOf CommonUtil
  2157. * @description 比例尺转分辨率。
  2158. * @param {number} scale - 比例尺。
  2159. * @param {string} [units='degrees'] - 比例尺单位。
  2160. * @returns {number} 转化后的分辨率。
  2161. */
  2162. getResolutionFromScale: function (scale, units) {
  2163. var resolution;
  2164. if (scale) {
  2165. if (units == null) {
  2166. units = 'degrees';
  2167. }
  2168. var normScale = Util_Util.normalizeScale(scale);
  2169. resolution = 1 / (normScale * INCHES_PER_UNIT[units] * DOTS_PER_INCH);
  2170. }
  2171. return resolution;
  2172. },
  2173. /**
  2174. * @memberOf CommonUtil
  2175. * @description 分辨率转比例尺。
  2176. * @param {number} resolution - 分辨率。
  2177. * @param {string} [units='degrees'] - 分辨率单位。
  2178. * @returns {number} 转化后的比例尺。
  2179. */
  2180. getScaleFromResolution: function (resolution, units) {
  2181. if (units == null) {
  2182. units = 'degrees';
  2183. }
  2184. var scale = resolution * INCHES_PER_UNIT[units] * DOTS_PER_INCH;
  2185. return scale;
  2186. },
  2187. /**
  2188. * @memberOf CommonUtil
  2189. * @description 获取浏览器相关信息。支持的浏览器包括:Opera,Internet Explorer,Safari,Firefox。
  2190. * @returns {Object} 浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
  2191. */
  2192. getBrowser: function () {
  2193. return Browser;
  2194. },
  2195. /**
  2196. * @memberOf CommonUtil
  2197. * @description 浏览器是否支持 Canvas。
  2198. * @returns {boolean} 当前浏览器是否支持 HTML5 Canvas。
  2199. */
  2200. isSupportCanvas,
  2201. /**
  2202. * @memberOf CommonUtil
  2203. * @description 判断浏览器是否支持 Canvas。
  2204. * @returns {boolean} 当前浏览器是否支持 HTML5 Canvas 。
  2205. */
  2206. supportCanvas: function () {
  2207. return Util_Util.isSupportCanvas;
  2208. },
  2209. /**
  2210. * @memberOf CommonUtil
  2211. * @description 判断一个 URL 请求是否在当前域中。
  2212. * @param {string} url - URL 请求字符串。
  2213. * @returns {boolean} URL 请求是否在当前域中。
  2214. */
  2215. isInTheSameDomain: function (url) {
  2216. if (!url) {
  2217. return true;
  2218. }
  2219. var index = url.indexOf('//');
  2220. var documentUrl = document.location.toString();
  2221. var documentIndex = documentUrl.indexOf('//');
  2222. if (index === -1) {
  2223. return true;
  2224. } else {
  2225. var protocol;
  2226. var substring = (protocol = url.substring(0, index));
  2227. var documentSubString = documentUrl.substring(documentIndex + 2);
  2228. documentIndex = documentSubString.indexOf('/');
  2229. var documentPortIndex = documentSubString.indexOf(':');
  2230. var documentDomainWithPort = documentSubString.substring(0, documentIndex);
  2231. //var documentPort;
  2232. var documentprotocol = document.location.protocol;
  2233. if (documentPortIndex !== -1) {
  2234. // documentPort = +documentSubString.substring(documentPortIndex, documentIndex);
  2235. } else {
  2236. documentDomainWithPort += ':' + (documentprotocol.toLowerCase() === 'http:' ? 80 : 443);
  2237. }
  2238. if (documentprotocol.toLowerCase() !== substring.toLowerCase()) {
  2239. return false;
  2240. }
  2241. substring = url.substring(index + 2);
  2242. var portIndex = substring.indexOf(':');
  2243. index = substring.indexOf('/');
  2244. var domainWithPort = substring.substring(0, index);
  2245. var domain;
  2246. if (portIndex !== -1) {
  2247. domain = substring.substring(0, portIndex);
  2248. } else {
  2249. domain = substring.substring(0, index);
  2250. domainWithPort += ':' + (protocol.toLowerCase() === 'http:' ? 80 : 443);
  2251. }
  2252. var documentDomain = document.domain;
  2253. if (domain === documentDomain && domainWithPort === documentDomainWithPort) {
  2254. return true;
  2255. }
  2256. }
  2257. return false;
  2258. },
  2259. /**
  2260. * @memberOf CommonUtil
  2261. * @description 计算 iServer 服务的 REST 图层的显示分辨率,需要从 iServer 的 REST 图层表述中获取 viewBounds、viewer、scale、coordUnit、datumAxis 五个参数,来进行计算。
  2262. * @param {Bounds} viewBounds - 地图的参照可视范围,即地图初始化时默认的地图显示范围。
  2263. * @param {Size} viewer - 地图初始化时默认的地图图片的尺寸。
  2264. * @param {number} scale - 地图初始化时默认的显示比例尺。
  2265. * @param {string} [coordUnit='degrees'] - 投影坐标系统的地图单位。
  2266. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则系统默认为 WGS84 参考系的椭球体长半轴 6378137。
  2267. * @returns {number} 图层显示分辨率。
  2268. */
  2269. calculateDpi: function (viewBounds, viewer, scale, coordUnit, datumAxis) {
  2270. //10000 是 0.1毫米与米的转换。DPI的计算公式:Viewer / DPI * 0.0254 * 10000 = ViewBounds * scale ,公式中的10000是为了提高计算结果的精度,以下出现的ratio皆为如此。
  2271. if (!viewBounds || !viewer || !scale) {
  2272. return;
  2273. }
  2274. var ratio = 10000,
  2275. rvbWidth = viewBounds.getWidth(),
  2276. rvbHeight = viewBounds.getHeight(),
  2277. rvWidth = viewer.w,
  2278. rvHeight = viewer.h;
  2279. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  2280. datumAxis = datumAxis || 6378137;
  2281. coordUnit = coordUnit || 'degrees';
  2282. var dpi;
  2283. if (
  2284. coordUnit.toLowerCase() === 'degree' ||
  2285. coordUnit.toLowerCase() === 'degrees' ||
  2286. coordUnit.toLowerCase() === 'dd'
  2287. ) {
  2288. let num1 = rvbWidth / rvWidth,
  2289. num2 = rvbHeight / rvHeight,
  2290. resolution = num1 > num2 ? num1 : num2;
  2291. dpi = (0.0254 * ratio) / resolution / scale / ((Math.PI * 2 * datumAxis) / 360) / ratio;
  2292. } else {
  2293. let resolution = rvbWidth / rvWidth;
  2294. dpi = (0.0254 * ratio) / resolution / scale / ratio;
  2295. }
  2296. return dpi;
  2297. },
  2298. /**
  2299. * @memberOf CommonUtil
  2300. * @description 将对象转换成 JSON 字符串。
  2301. * @param {Object} obj - 要转换成 JSON 的 Object 对象。
  2302. * @returns {string} 转换后的 JSON 对象。
  2303. */
  2304. toJSON: function (obj) {
  2305. var objInn = obj;
  2306. if (objInn == null) {
  2307. return null;
  2308. }
  2309. switch (objInn.constructor) {
  2310. case String:
  2311. //s = "'" + str.replace(/(["\\])/g, "\\$1") + "'"; string含有单引号出错
  2312. objInn = '"' + objInn.replace(/(["\\])/g, '\\$1') + '"';
  2313. objInn = objInn.replace(/\n/g, '\\n');
  2314. objInn = objInn.replace(/\r/g, '\\r');
  2315. objInn = objInn.replace('<', '&lt;');
  2316. objInn = objInn.replace('>', '&gt;');
  2317. objInn = objInn.replace(/%/g, '%25');
  2318. objInn = objInn.replace(/&/g, '%26');
  2319. return objInn;
  2320. case Array:
  2321. var arr = '';
  2322. for (var i = 0, len = objInn.length; i < len; i++) {
  2323. arr += Util_Util.toJSON(objInn[i]);
  2324. if (i !== objInn.length - 1) {
  2325. arr += ',';
  2326. }
  2327. }
  2328. return "[" + arr + "]";
  2329. case Number:
  2330. return isFinite(objInn) ? String(objInn) : null;
  2331. case Boolean:
  2332. return String(objInn);
  2333. case Date:
  2334. var dateStr =
  2335. '{' +
  2336. '\'__type\':"System.DateTime",' +
  2337. "'Year':" +
  2338. objInn.getFullYear() +
  2339. ',' +
  2340. "'Month':" +
  2341. (objInn.getMonth() + 1) +
  2342. ',' +
  2343. "'Day':" +
  2344. objInn.getDate() +
  2345. ',' +
  2346. "'Hour':" +
  2347. objInn.getHours() +
  2348. ',' +
  2349. "'Minute':" +
  2350. objInn.getMinutes() +
  2351. ',' +
  2352. "'Second':" +
  2353. objInn.getSeconds() +
  2354. ',' +
  2355. "'Millisecond':" +
  2356. objInn.getMilliseconds() +
  2357. ',' +
  2358. "'TimezoneOffset':" +
  2359. objInn.getTimezoneOffset() +
  2360. '}';
  2361. return dateStr;
  2362. default:
  2363. if (objInn['toJSON'] != null && typeof objInn['toJSON'] === 'function') {
  2364. return objInn.toJSON();
  2365. }
  2366. if (typeof objInn === 'object') {
  2367. if (objInn.length) {
  2368. let arr = [];
  2369. for (let i = 0, len = objInn.length; i < len; i++) {
  2370. arr.push(Util_Util.toJSON(objInn[i]));
  2371. }
  2372. return '[' + arr.join(',') + ']';
  2373. }
  2374. let arr = [];
  2375. for (let attr in objInn) {
  2376. //为解决Geometry类型头json时堆栈溢出的问题,attr == "parent"时不进行json转换
  2377. if (typeof objInn[attr] !== 'function' && attr !== 'CLASS_NAME' && attr !== 'parent') {
  2378. arr.push("'" + attr + "':" + Util_Util.toJSON(objInn[attr]));
  2379. }
  2380. }
  2381. if (arr.length > 0) {
  2382. return '{' + arr.join(',') + '}';
  2383. } else {
  2384. return '{}';
  2385. }
  2386. }
  2387. return objInn.toString();
  2388. }
  2389. },
  2390. /**
  2391. * @memberOf CommonUtil
  2392. * @description 根据比例尺和 DPI 计算屏幕分辨率。
  2393. * @category BaseTypes Util
  2394. * @param {number} scale - 比例尺。
  2395. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  2396. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  2397. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  2398. * @returns {number} 当前比例尺下的屏幕分辨率。
  2399. */
  2400. getResolutionFromScaleDpi: function (scale, dpi, coordUnit, datumAxis) {
  2401. var resolution = null,
  2402. ratio = 10000;
  2403. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  2404. datumAxis = datumAxis || 6378137;
  2405. coordUnit = coordUnit || '';
  2406. if (scale > 0 && dpi > 0) {
  2407. scale = Util_Util.normalizeScale(scale);
  2408. if (
  2409. coordUnit.toLowerCase() === 'degree' ||
  2410. coordUnit.toLowerCase() === 'degrees' ||
  2411. coordUnit.toLowerCase() === 'dd'
  2412. ) {
  2413. //scale = Util.normalizeScale(scale);
  2414. resolution = (0.0254 * ratio) / dpi / scale / ((Math.PI * 2 * datumAxis) / 360) / ratio;
  2415. return resolution;
  2416. } else {
  2417. resolution = (0.0254 * ratio) / dpi / scale / ratio;
  2418. return resolution;
  2419. }
  2420. }
  2421. return -1;
  2422. },
  2423. /**
  2424. * @memberOf CommonUtil
  2425. * @description 根据 resolution、dpi、coordUnit 和 datumAxis 计算比例尺。
  2426. * @param {number} resolution - 用于计算比例尺的地图分辨率。
  2427. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  2428. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  2429. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  2430. * @returns {number} 当前屏幕分辨率下的比例尺。
  2431. */
  2432. getScaleFromResolutionDpi: function (resolution, dpi, coordUnit, datumAxis) {
  2433. var scale = null,
  2434. ratio = 10000;
  2435. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  2436. datumAxis = datumAxis || 6378137;
  2437. coordUnit = coordUnit || '';
  2438. if (resolution > 0 && dpi > 0) {
  2439. if (
  2440. coordUnit.toLowerCase() === 'degree' ||
  2441. coordUnit.toLowerCase() === 'degrees' ||
  2442. coordUnit.toLowerCase() === 'dd'
  2443. ) {
  2444. scale = (0.0254 * ratio) / dpi / resolution / ((Math.PI * 2 * datumAxis) / 360) / ratio;
  2445. return scale;
  2446. } else {
  2447. scale = (0.0254 * ratio) / dpi / resolution / ratio;
  2448. return scale;
  2449. }
  2450. }
  2451. return -1;
  2452. },
  2453. /**
  2454. * @memberOf CommonUtil
  2455. * @description 转换查询结果。
  2456. * @param {Object} result - 查询结果。
  2457. * @returns {Object} 转换后的查询结果。
  2458. */
  2459. transformResult: function (result) {
  2460. if (result.responseText && typeof result.responseText === 'string') {
  2461. result = JSON.parse(result.responseText);
  2462. }
  2463. return result;
  2464. },
  2465. /**
  2466. * @memberOf CommonUtil
  2467. * @description 属性拷贝,不拷贝方法类名(CLASS_NAME)等。
  2468. * @param {Object} [destination] - 拷贝目标。
  2469. * @param {Object} source - 源对象。
  2470. *
  2471. */
  2472. copyAttributes: function (destination, source) {
  2473. destination = destination || {};
  2474. if (source) {
  2475. for (var property in source) {
  2476. var value = source[property];
  2477. if (value !== undefined && property !== 'CLASS_NAME' && typeof value !== 'function') {
  2478. destination[property] = value;
  2479. }
  2480. }
  2481. }
  2482. return destination;
  2483. },
  2484. /**
  2485. * @memberOf CommonUtil
  2486. * @description 将源对象上的属性拷贝到目标对象上。(不拷贝 CLASS_NAME 和方法)
  2487. * @param {Object} [destination] - 目标对象。
  2488. * @param {Object} source - 源对象。
  2489. * @param {Array.<string>} clip - 源对象中禁止拷贝到目标对象的属性,目的是防止目标对象上不可修改的属性被篡改。
  2490. *
  2491. */
  2492. copyAttributesWithClip: function (destination, source, clip) {
  2493. destination = destination || {};
  2494. if (source) {
  2495. for (var property in source) {
  2496. //去掉禁止拷贝的属性
  2497. var isInClip = false;
  2498. if (clip && clip.length) {
  2499. for (var i = 0, len = clip.length; i < len; i++) {
  2500. if (property === clip[i]) {
  2501. isInClip = true;
  2502. break;
  2503. }
  2504. }
  2505. }
  2506. if (isInClip === true) {
  2507. continue;
  2508. }
  2509. var value = source[property];
  2510. if (value !== undefined && property !== 'CLASS_NAME' && typeof value !== 'function') {
  2511. destination[property] = value;
  2512. }
  2513. }
  2514. }
  2515. return destination;
  2516. },
  2517. /**
  2518. * @memberOf CommonUtil
  2519. * @description 克隆一个 Object 对象。
  2520. * @param {Object} obj - 需要克隆的对象。
  2521. * @returns {Object} 对象的拷贝对象,注意是新的对象,不是指向。
  2522. */
  2523. cloneObject: function (obj) {
  2524. // Handle the 3 simple types, and null or undefined
  2525. if (null === obj || 'object' !== typeof obj) {
  2526. return obj;
  2527. }
  2528. // Handle Date
  2529. if (obj instanceof Date) {
  2530. let copy = new Date();
  2531. copy.setTime(obj.getTime());
  2532. return copy;
  2533. }
  2534. // Handle Array
  2535. if (obj instanceof Array) {
  2536. let copy = obj.slice(0);
  2537. return copy;
  2538. }
  2539. // Handle Object
  2540. if (obj instanceof Object) {
  2541. let copy = {};
  2542. for (var attr in obj) {
  2543. if (obj.hasOwnProperty(attr)) {
  2544. copy[attr] = Util_Util.cloneObject(obj[attr]);
  2545. }
  2546. }
  2547. return copy;
  2548. }
  2549. throw new Error("Unable to copy obj! Its type isn't supported.");
  2550. },
  2551. /**
  2552. * @memberOf CommonUtil
  2553. * @description 判断两条线段是不是有交点。
  2554. * @param {GeometryPoint} a1 - 第一条线段的起始节点。
  2555. * @param {GeometryPoint} a2 - 第一条线段的结束节点。
  2556. * @param {GeometryPoint} b1 - 第二条线段的起始节点。
  2557. * @param {GeometryPoint} b2 - 第二条线段的结束节点。
  2558. * @returns {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
  2559. */
  2560. lineIntersection: function (a1, a2, b1, b2) {
  2561. var intersectValue = null;
  2562. var k1;
  2563. var k2;
  2564. var b = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x);
  2565. var a = (a2.x - a1.x) * (a1.y - b1.y) - (a2.y - a1.y) * (a1.x - b1.x);
  2566. var ab = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y);
  2567. //ab==0代表两条线断的斜率一样
  2568. if (ab != 0) {
  2569. k1 = b / ab;
  2570. k2 = a / ab;
  2571. if (k1 >= 0 && k2 <= 1 && k1 <= 1 && k2 >= 0) {
  2572. intersectValue = new Geometry.Point(a1.x + k1 * (a2.x - a1.x), a1.y + k1 * (a2.y - a1.y));
  2573. } else {
  2574. intersectValue = 'No Intersection';
  2575. }
  2576. } else {
  2577. if (b == 0 && a == 0) {
  2578. var maxy = Math.max(a1.y, a2.y);
  2579. var miny = Math.min(a1.y, a2.y);
  2580. var maxx = Math.max(a1.x, a2.x);
  2581. var minx = Math.min(a1.x, a2.x);
  2582. if (
  2583. (((b1.y >= miny && b1.y <= maxy) || (b2.y >= miny && b2.y <= maxy)) && b1.x >= minx && b1.x <= maxx) ||
  2584. (b2.x >= minx && b2.x <= maxx)
  2585. ) {
  2586. intersectValue = 'Coincident'; //重合
  2587. } else {
  2588. intersectValue = 'Parallel'; //平行
  2589. }
  2590. } else {
  2591. intersectValue = 'Parallel'; //平行
  2592. }
  2593. }
  2594. return intersectValue;
  2595. },
  2596. /**
  2597. * @memberOf CommonUtil
  2598. * @description 获取文本外接矩形宽度与高度。
  2599. * @param {ThemeStyle} style - 文本样式。
  2600. * @param {string} text - 文本内容。
  2601. * @param {Object} element - DOM 元素。
  2602. * @returns {Object} 裁剪后的宽度,高度信息。
  2603. */
  2604. getTextBounds: function (style, text, element) {
  2605. document.body.appendChild(element);
  2606. element.style.width = 'auto';
  2607. element.style.height = 'auto';
  2608. if (style.fontSize) {
  2609. element.style.fontSize = style.fontSize;
  2610. }
  2611. if (style.fontFamily) {
  2612. element.style.fontFamily = style.fontFamily;
  2613. }
  2614. if (style.fontWeight) {
  2615. element.style.fontWeight = style.fontWeight;
  2616. }
  2617. element.style.position = 'relative';
  2618. element.style.visibility = 'hidden';
  2619. //fix 在某些情况下,element内的文本变成竖起排列,导致宽度计算不正确的bug
  2620. element.style.display = 'inline-block';
  2621. element.innerHTML = text;
  2622. var textWidth = element.clientWidth;
  2623. var textHeight = element.clientHeight;
  2624. document.body.removeChild(element);
  2625. return {
  2626. textWidth: textWidth,
  2627. textHeight: textHeight
  2628. };
  2629. },
  2630. /**
  2631. * @memberOf CommonUtil
  2632. * @description 获取转换后的path路径。
  2633. * @param {string} path - 待转换的path,包含`{param}`。
  2634. * @param {Object} pathParams - path中待替换的参数。
  2635. * @returns {string} 转换后的path路径。
  2636. */
  2637. convertPath: function (path, pathParams) {
  2638. if (!pathParams) {
  2639. return path;
  2640. }
  2641. return path.replace(/\{([\w-\.]+)\}/g, (fullMatch, key) => {
  2642. var value;
  2643. if (pathParams.hasOwnProperty(key)) {
  2644. value = paramToString(pathParams[key]);
  2645. } else {
  2646. value = fullMatch;
  2647. }
  2648. return encodeURIComponent(value);
  2649. });
  2650. }
  2651. };
  2652. /**
  2653. * @enum INCHES_PER_UNIT
  2654. * @description 每单位的英尺数。
  2655. * @type {number}
  2656. * @private
  2657. */
  2658. const INCHES_PER_UNIT = {
  2659. inches: 1.0,
  2660. ft: 12.0,
  2661. mi: 63360.0,
  2662. m: 39.3701,
  2663. km: 39370.1,
  2664. dd: 4374754,
  2665. yd: 36
  2666. };
  2667. INCHES_PER_UNIT['in'] = INCHES_PER_UNIT.inches;
  2668. INCHES_PER_UNIT['degrees'] = INCHES_PER_UNIT.dd;
  2669. INCHES_PER_UNIT['nmi'] = 1852 * INCHES_PER_UNIT.m;
  2670. // Units from CS-Map
  2671. const METERS_PER_INCH = 0.0254000508001016002;
  2672. Util_Util.extend(INCHES_PER_UNIT, {
  2673. Inch: INCHES_PER_UNIT.inches,
  2674. Meter: 1.0 / METERS_PER_INCH, //EPSG:9001
  2675. Foot: 0.30480060960121920243 / METERS_PER_INCH, //EPSG:9003
  2676. IFoot: 0.3048 / METERS_PER_INCH, //EPSG:9002
  2677. ClarkeFoot: 0.3047972651151 / METERS_PER_INCH, //EPSG:9005
  2678. SearsFoot: 0.30479947153867624624 / METERS_PER_INCH, //EPSG:9041
  2679. GoldCoastFoot: 0.30479971018150881758 / METERS_PER_INCH, //EPSG:9094
  2680. IInch: 0.0254 / METERS_PER_INCH,
  2681. MicroInch: 0.0000254 / METERS_PER_INCH,
  2682. Mil: 0.0000000254 / METERS_PER_INCH,
  2683. Centimeter: 0.01 / METERS_PER_INCH,
  2684. Kilometer: 1000.0 / METERS_PER_INCH, //EPSG:9036
  2685. Yard: 0.91440182880365760731 / METERS_PER_INCH,
  2686. SearsYard: 0.914398414616029 / METERS_PER_INCH, //EPSG:9040
  2687. IndianYard: 0.91439853074444079983 / METERS_PER_INCH, //EPSG:9084
  2688. IndianYd37: 0.91439523 / METERS_PER_INCH, //EPSG:9085
  2689. IndianYd62: 0.9143988 / METERS_PER_INCH, //EPSG:9086
  2690. IndianYd75: 0.9143985 / METERS_PER_INCH, //EPSG:9087
  2691. IndianFoot: 0.30479951 / METERS_PER_INCH, //EPSG:9080
  2692. IndianFt37: 0.30479841 / METERS_PER_INCH, //EPSG:9081
  2693. IndianFt62: 0.3047996 / METERS_PER_INCH, //EPSG:9082
  2694. IndianFt75: 0.3047995 / METERS_PER_INCH, //EPSG:9083
  2695. Mile: 1609.34721869443738887477 / METERS_PER_INCH,
  2696. IYard: 0.9144 / METERS_PER_INCH, //EPSG:9096
  2697. IMile: 1609.344 / METERS_PER_INCH, //EPSG:9093
  2698. NautM: 1852.0 / METERS_PER_INCH, //EPSG:9030
  2699. 'Lat-66': 110943.316488932731 / METERS_PER_INCH,
  2700. 'Lat-83': 110946.25736872234125 / METERS_PER_INCH,
  2701. Decimeter: 0.1 / METERS_PER_INCH,
  2702. Millimeter: 0.001 / METERS_PER_INCH,
  2703. Dekameter: 10.0 / METERS_PER_INCH,
  2704. Decameter: 10.0 / METERS_PER_INCH,
  2705. Hectometer: 100.0 / METERS_PER_INCH,
  2706. GermanMeter: 1.0000135965 / METERS_PER_INCH, //EPSG:9031
  2707. CaGrid: 0.999738 / METERS_PER_INCH,
  2708. ClarkeChain: 20.1166194976 / METERS_PER_INCH, //EPSG:9038
  2709. GunterChain: 20.11684023368047 / METERS_PER_INCH, //EPSG:9033
  2710. BenoitChain: 20.116782494375872 / METERS_PER_INCH, //EPSG:9062
  2711. SearsChain: 20.11676512155 / METERS_PER_INCH, //EPSG:9042
  2712. ClarkeLink: 0.201166194976 / METERS_PER_INCH, //EPSG:9039
  2713. GunterLink: 0.2011684023368047 / METERS_PER_INCH, //EPSG:9034
  2714. BenoitLink: 0.20116782494375872 / METERS_PER_INCH, //EPSG:9063
  2715. SearsLink: 0.2011676512155 / METERS_PER_INCH, //EPSG:9043
  2716. Rod: 5.02921005842012 / METERS_PER_INCH,
  2717. IntnlChain: 20.1168 / METERS_PER_INCH, //EPSG:9097
  2718. IntnlLink: 0.201168 / METERS_PER_INCH, //EPSG:9098
  2719. Perch: 5.02921005842012 / METERS_PER_INCH,
  2720. Pole: 5.02921005842012 / METERS_PER_INCH,
  2721. Furlong: 201.1684023368046 / METERS_PER_INCH,
  2722. Rood: 3.778266898 / METERS_PER_INCH,
  2723. CapeFoot: 0.3047972615 / METERS_PER_INCH,
  2724. Brealey: 375.0 / METERS_PER_INCH,
  2725. ModAmFt: 0.304812252984505969011938 / METERS_PER_INCH,
  2726. Fathom: 1.8288 / METERS_PER_INCH,
  2727. 'NautM-UK': 1853.184 / METERS_PER_INCH,
  2728. '50kilometers': 50000.0 / METERS_PER_INCH,
  2729. '150kilometers': 150000.0 / METERS_PER_INCH
  2730. });
  2731. //unit abbreviations supported by PROJ.4
  2732. Util_Util.extend(INCHES_PER_UNIT, {
  2733. mm: INCHES_PER_UNIT['Meter'] / 1000.0,
  2734. cm: INCHES_PER_UNIT['Meter'] / 100.0,
  2735. dm: INCHES_PER_UNIT['Meter'] * 100.0,
  2736. km: INCHES_PER_UNIT['Meter'] * 1000.0,
  2737. kmi: INCHES_PER_UNIT['nmi'], //International Nautical Mile
  2738. fath: INCHES_PER_UNIT['Fathom'], //International Fathom
  2739. ch: INCHES_PER_UNIT['IntnlChain'], //International Chain
  2740. link: INCHES_PER_UNIT['IntnlLink'], //International Link
  2741. 'us-in': INCHES_PER_UNIT['inches'], //U.S. Surveyor's Inch
  2742. 'us-ft': INCHES_PER_UNIT['Foot'], //U.S. Surveyor's Foot
  2743. 'us-yd': INCHES_PER_UNIT['Yard'], //U.S. Surveyor's Yard
  2744. 'us-ch': INCHES_PER_UNIT['GunterChain'], //U.S. Surveyor's Chain
  2745. 'us-mi': INCHES_PER_UNIT['Mile'], //U.S. Surveyor's Statute Mile
  2746. 'ind-yd': INCHES_PER_UNIT['IndianYd37'], //Indian Yard
  2747. 'ind-ft': INCHES_PER_UNIT['IndianFt37'], //Indian Foot
  2748. 'ind-ch': 20.11669506 / METERS_PER_INCH //Indian Chain
  2749. });
  2750. //将服务端的地图单位转成SuperMap的地图单位
  2751. INCHES_PER_UNIT['degree'] = INCHES_PER_UNIT.dd;
  2752. INCHES_PER_UNIT['meter'] = INCHES_PER_UNIT.m;
  2753. INCHES_PER_UNIT['foot'] = INCHES_PER_UNIT.ft;
  2754. INCHES_PER_UNIT['inch'] = INCHES_PER_UNIT.inches;
  2755. INCHES_PER_UNIT['mile'] = INCHES_PER_UNIT.mi;
  2756. INCHES_PER_UNIT['kilometer'] = INCHES_PER_UNIT.km;
  2757. INCHES_PER_UNIT['yard'] = INCHES_PER_UNIT.yd;
  2758. function paramToString(param) {
  2759. if (param == undefined || param == null) {
  2760. return '';
  2761. }
  2762. if (param instanceof Date) {
  2763. return param.toJSON();
  2764. }
  2765. if (canBeJsonified(param)) {
  2766. return JSON.stringify(param);
  2767. }
  2768. return param.toString();
  2769. }
  2770. function canBeJsonified(str) {
  2771. if (typeof str !== 'string' && typeof str !== 'object') {
  2772. return false;
  2773. }
  2774. try {
  2775. const type = str.toString();
  2776. return type === '[object Object]' || type === '[object Array]';
  2777. } catch (err) {
  2778. return false;
  2779. }
  2780. }
  2781. ;// CONCATENATED MODULE: ./src/common/commontypes/Event.js
  2782. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  2783. * This program are made available under the terms of the Apache License, Version 2.0
  2784. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  2785. /**
  2786. * @name Event
  2787. * @namespace
  2788. * @category BaseTypes Events
  2789. * @description 事件处理函数.
  2790. * @usage
  2791. * ```
  2792. * // 浏览器
  2793. * <script type="text/javascript" src="{cdn}"></script>
  2794. * <script>
  2795. * const element = {namespace}.Event.element();
  2796. *
  2797. * // 弃用的写法
  2798. * const result = SuperMap.Event.element();
  2799. *
  2800. * </script>
  2801. *
  2802. * // ES6 Import
  2803. * import { Event } from '{npm}';
  2804. *
  2805. * const result = Event.element();
  2806. * ```
  2807. */
  2808. var Event = {
  2809. /**
  2810. * @description 事件观察者列表。
  2811. * @type {Object}
  2812. * @default false
  2813. */
  2814. observers: false,
  2815. /**
  2816. * @description KEY_SPACE
  2817. * @type {number}
  2818. * @default 32
  2819. */
  2820. KEY_SPACE: 32,
  2821. /**
  2822. * @description KEY_BACKSPACE
  2823. * @type {number}
  2824. * @default 8
  2825. */
  2826. KEY_BACKSPACE: 8,
  2827. /**
  2828. * @description KEY_TAB
  2829. * @type {number}
  2830. * @default 9
  2831. */
  2832. KEY_TAB: 9,
  2833. /**
  2834. * @description KEY_RETURN
  2835. * @type {number}
  2836. * @default 13
  2837. */
  2838. KEY_RETURN: 13,
  2839. /**
  2840. * @description KEY_ESC
  2841. * @type {number}
  2842. * @default 27
  2843. */
  2844. KEY_ESC: 27,
  2845. /**
  2846. * @description KEY_LEFT
  2847. * @type {number}
  2848. * @default 37
  2849. */
  2850. KEY_LEFT: 37,
  2851. /**
  2852. * @description KEY_UP
  2853. * @type {number}
  2854. * @default 38
  2855. */
  2856. KEY_UP: 38,
  2857. /**
  2858. * @description KEY_RIGHT
  2859. * @type {number}
  2860. * @default 39
  2861. */
  2862. KEY_RIGHT: 39,
  2863. /**
  2864. * @description KEY_DOWN
  2865. * @type {number}
  2866. * @default 40
  2867. */
  2868. KEY_DOWN: 40,
  2869. /**
  2870. * @description KEY_DELETE
  2871. * @type {number}
  2872. * @default 46
  2873. */
  2874. KEY_DELETE: 46,
  2875. /**
  2876. * @description 监听浏览器 DOM 事件。
  2877. * @param {Event} event - Event 对象。
  2878. * @returns {HTMLElement} 触发事件的 DOM 元素。
  2879. */
  2880. element: function (event) {
  2881. return event.target || event.srcElement;
  2882. },
  2883. /**
  2884. * @description 判断事件是否由单次触摸引起。
  2885. * @param {Event} event - Event 对象。
  2886. * @returns {boolean} 是否有且只有一个当前在与触摸表面接触的 Touch 对象。
  2887. */
  2888. isSingleTouch: function (event) {
  2889. return event.touches && event.touches.length === 1;
  2890. },
  2891. /**
  2892. * @description 判断事件是否由多点触控引起。
  2893. * @param {Event} event - Event 对象。
  2894. * @returns {boolean} 是否存在多个当前在与触摸表面接触的 Touch 对象。
  2895. */
  2896. isMultiTouch: function (event) {
  2897. return event.touches && event.touches.length > 1;
  2898. },
  2899. /**
  2900. * @description 确定事件是否由左键单击引起。
  2901. * @param {Event} event - Event 对象。
  2902. * @returns {boolean} 是否点击鼠标左键。
  2903. */
  2904. isLeftClick: function (event) {
  2905. return (((event.which) && (event.which === 1)) ||
  2906. ((event.button) && (event.button === 1)));
  2907. },
  2908. /**
  2909. * @description 确定事件是否由鼠标右键单击引起。
  2910. * @param {Event} event - Event 对象。
  2911. * @returns {boolean} 是否点击鼠标右键。
  2912. */
  2913. isRightClick: function (event) {
  2914. return (((event.which) && (event.which === 3)) ||
  2915. ((event.button) && (event.button === 2)));
  2916. },
  2917. /**
  2918. * @description 阻止事件冒泡。
  2919. * @param {Event} event - Event 对象。
  2920. * @param {boolean} allowDefault - 默认为 false,表示阻止事件的默认行为。
  2921. */
  2922. stop: function (event, allowDefault) {
  2923. if (!allowDefault) {
  2924. if (event.preventDefault) {
  2925. event.preventDefault();
  2926. } else {
  2927. event.returnValue = false;
  2928. }
  2929. }
  2930. if (event.stopPropagation) {
  2931. event.stopPropagation();
  2932. } else {
  2933. event.cancelBubble = true;
  2934. }
  2935. },
  2936. /**
  2937. * @description 查询触发指定事件的 DOM 元素。
  2938. * @param {Event} event - Event 对象。
  2939. * @param {string} tagName - html 标签名。
  2940. * @returns {HTMLElement} DOM 元素。
  2941. */
  2942. findElement: function (event, tagName) {
  2943. var element = Event.element(event);
  2944. while (element.parentNode && (!element.tagName ||
  2945. (element.tagName.toUpperCase() != tagName.toUpperCase()))) {
  2946. element = element.parentNode;
  2947. }
  2948. return element;
  2949. },
  2950. /**
  2951. * @description 监听事件,注册事件处理方法。
  2952. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  2953. * @param {string} name - 监听事件的类别名称。
  2954. * @param {function} observer - 注册的事件处理方法。
  2955. * @param {boolean} [useCapture=false] - 是否捕获。
  2956. */
  2957. observe: function (elementParam, name, observer, useCapture) {
  2958. var element = Util_Util.getElement(elementParam);
  2959. useCapture = useCapture || false;
  2960. if (name === 'keypress' &&
  2961. (navigator.appVersion.match(/Konqueror|Safari|KHTML/)
  2962. || element.attachEvent)) {
  2963. name = 'keydown';
  2964. }
  2965. //if observers cache has not yet been created, create it
  2966. if (!this.observers) {
  2967. this.observers = {};
  2968. }
  2969. //if not already assigned, make a new unique cache ID
  2970. if (!element._eventCacheID) {
  2971. var idPrefix = "eventCacheID_";
  2972. if (element.id) {
  2973. idPrefix = element.id + "_" + idPrefix;
  2974. }
  2975. element._eventCacheID = Util_Util.createUniqueID(idPrefix);
  2976. }
  2977. var cacheID = element._eventCacheID;
  2978. //if there is not yet a hash entry for this element, add one
  2979. if (!this.observers[cacheID]) {
  2980. this.observers[cacheID] = [];
  2981. }
  2982. //add a new observer to this element's list
  2983. this.observers[cacheID].push({
  2984. 'element': element,
  2985. 'name': name,
  2986. 'observer': observer,
  2987. 'useCapture': useCapture
  2988. });
  2989. //add the actual browser event listener
  2990. if (element.addEventListener) {
  2991. if(name === 'mousewheel'){
  2992. // https://www.chromestatus.com/features/6662647093133312
  2993. element.addEventListener(name, observer, {useCapture: useCapture, passive: false} );
  2994. } else {
  2995. element.addEventListener(name, observer, useCapture);
  2996. }
  2997. } else if (element.attachEvent) {
  2998. element.attachEvent('on' + name, observer);
  2999. }
  3000. },
  3001. /**
  3002. * @description 移除给定 DOM 元素的监听事件。
  3003. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  3004. */
  3005. stopObservingElement: function (elementParam) {
  3006. var element = Util_Util.getElement(elementParam);
  3007. var cacheID = element._eventCacheID;
  3008. this._removeElementObservers(Event.observers[cacheID]);
  3009. },
  3010. _removeElementObservers: function (elementObservers) {
  3011. if (elementObservers) {
  3012. for (var i = elementObservers.length - 1; i >= 0; i--) {
  3013. var entry = elementObservers[i];
  3014. var args = new Array(entry.element, entry.name, entry.observer, entry.useCapture);
  3015. Event.stopObserving.apply(this, args);
  3016. }
  3017. }
  3018. },
  3019. /**
  3020. * @description 移除事件监听和注册的事件处理方法。注意:事件的移除和监听相对应,移除时的各属性信息必须监听时保持一致才能确保事件移除成功。
  3021. * @param {(HTMLElement|string)} elementParam - 被监听的 DOM 元素或者其 ID。
  3022. * @param {string} name - 需要移除的被监听事件名称。
  3023. * @param {function} observer - 需要移除的事件处理方法。
  3024. * @param {boolean} [useCapture=false] - 是否捕获。
  3025. * @returns {boolean} 监听事件是否被移除。
  3026. */
  3027. stopObserving: function (elementParam, name, observer, useCapture) {
  3028. useCapture = useCapture || false;
  3029. var element = Util_Util.getElement(elementParam);
  3030. var cacheID = element._eventCacheID;
  3031. if (name === 'keypress') {
  3032. if (navigator.appVersion.match(/Konqueror|Safari|KHTML/) ||
  3033. element.detachEvent) {
  3034. name = 'keydown';
  3035. }
  3036. }
  3037. // find element's entry in this.observers cache and remove it
  3038. var foundEntry = false;
  3039. var elementObservers = Event.observers[cacheID];
  3040. if (elementObservers) {
  3041. // find the specific event type in the element's list
  3042. var i = 0;
  3043. while (!foundEntry && i < elementObservers.length) {
  3044. var cacheEntry = elementObservers[i];
  3045. if ((cacheEntry.name === name) &&
  3046. (cacheEntry.observer === observer) &&
  3047. (cacheEntry.useCapture === useCapture)) {
  3048. elementObservers.splice(i, 1);
  3049. if (elementObservers.length == 0) {
  3050. delete Event.observers[cacheID];
  3051. }
  3052. foundEntry = true;
  3053. break;
  3054. }
  3055. i++;
  3056. }
  3057. }
  3058. //actually remove the event listener from browser
  3059. if (foundEntry) {
  3060. if (element.removeEventListener) {
  3061. element.removeEventListener(name, observer, useCapture);
  3062. } else if (element && element.detachEvent) {
  3063. element.detachEvent('on' + name, observer);
  3064. }
  3065. }
  3066. return foundEntry;
  3067. },
  3068. /**
  3069. * @description 移除缓存中的监听事件。
  3070. */
  3071. unloadCache: function () {
  3072. // check for Event before checking for observers, because
  3073. // Event may be undefined in IE if no map instance was
  3074. // created
  3075. if (Event && Event.observers) {
  3076. for (var cacheID in Event.observers) {
  3077. var elementObservers = Event.observers[cacheID];
  3078. Event._removeElementObservers.apply(this,
  3079. [elementObservers]);
  3080. }
  3081. Event.observers = false;
  3082. }
  3083. },
  3084. CLASS_NAME: "SuperMap.Event"
  3085. };
  3086. /* prevent memory leaks in IE */
  3087. Event.observe(window, 'resize', Event.unloadCache, false);
  3088. ;// CONCATENATED MODULE: ./src/common/commontypes/Events.js
  3089. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  3090. * This program are made available under the terms of the Apache License, Version 2.0
  3091. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  3092. /**
  3093. * @class Events
  3094. * @deprecatedclass SuperMap.Events
  3095. * @classdesc 事件类。
  3096. * @category BaseTypes Events
  3097. * @param {Object} object - 当前事件对象被添加到的 JS 对象。
  3098. * @param {HTMLElement} element - 响应浏览器事件的 DOM 元素。
  3099. * @param {Array.<string>} eventTypes - 自定义应用事件的数组。
  3100. * @param {boolean} [fallThrough=false] - 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  3101. * @param {Object} options - 事件对象选项。
  3102. * @usage
  3103. */
  3104. class Events {
  3105. constructor(object, element, eventTypes, fallThrough, options) {
  3106. /**
  3107. * @member {Array.<string>} Events.prototype.BROWSER_EVENTS
  3108. * @description 支持的事件。
  3109. * @constant
  3110. * @default [
  3111. "mouseover", "mouseout","mousedown", "mouseup", "mousemove",
  3112. "click", "dblclick", "rightclick", "dblrightclick","resize",
  3113. "focus", "blur","touchstart", "touchmove", "touchend","keydown",
  3114. "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup",
  3115. "MSGestureStart", "MSGestureChange", "MSGestureEnd","contextmenu"
  3116. ]
  3117. */
  3118. this.BROWSER_EVENTS = [
  3119. "mouseover", "mouseout",
  3120. "mousedown", "mouseup", "mousemove",
  3121. "click", "dblclick", "rightclick", "dblrightclick",
  3122. "resize", "focus", "blur",
  3123. "touchstart", "touchmove", "touchend",
  3124. "keydown", "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup",
  3125. "MSGestureStart", "MSGestureChange", "MSGestureEnd",
  3126. "contextmenu"
  3127. ];
  3128. /**
  3129. * @member {Object} Events.prototype.listeners
  3130. * @description 事件监听器函数。
  3131. */
  3132. this.listeners = {};
  3133. /**
  3134. * @member {Object} Events.prototype.object
  3135. * @description 发布应用程序事件的对象。
  3136. */
  3137. this.object = object;
  3138. /**
  3139. * @member {HTMLElement} Events.prototype.element
  3140. * @description 接受浏览器事件的 DOM 节点。
  3141. */
  3142. this.element = null;
  3143. /**
  3144. * @member {Array.<string>} Events.prototype.eventTypes
  3145. * @description 支持的事件类型列表。
  3146. */
  3147. this.eventTypes = [];
  3148. /**
  3149. * @member {function} Events.prototype.eventHandler
  3150. * @description 绑定在元素上的事件处理器对象。
  3151. */
  3152. this.eventHandler = null;
  3153. /**
  3154. * @member {boolean} [Events.prototype.fallThrough=false]
  3155. * @description 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  3156. */
  3157. this.fallThrough = fallThrough;
  3158. /**
  3159. * @member {boolean} [Events.prototype.includeXY=false]
  3160. * @description 判断是否让 xy 属性自动创建到浏览器上的鼠标事件,一般设置为 false,如果设置为 true,鼠标事件将会在事件传递过程中自动产生 xy 属性。可根据事件对象的 'evt.object' 属性在相关的事件句柄上调用 getMousePosition 函数。这个选项习惯默认为 false 的原因在于,当创建一个事件对象,其主要目的是管理。在一个 div 的相对定位的鼠标事件,将其设为 true 也是有意义的。这个选项也可以用来控制是否抵消缓存。如果设为 false 不抵消,如果设为 true,用 this.clearMouseCache() 清除缓存偏移(边界元素偏移,元素在页面的位置偏移)。
  3161. * @example
  3162. * function named(evt) {
  3163. * this.xy = this.object.events.getMousePosition(evt);
  3164. * }
  3165. */
  3166. this.includeXY = false;
  3167. /**
  3168. * @member {Object} Events.prototype.extensions
  3169. * @description 事件扩展。Keys 代表事件类型,values 代表事件对象。
  3170. */
  3171. this.extensions = {};
  3172. /**
  3173. * @member {Object} Events.prototype.extensionCount
  3174. * @description 事件扩展数量。
  3175. */
  3176. this.extensionCount = {};
  3177. /**
  3178. * @member {Object} Events.prototype.clearMouseListener
  3179. * @description 待移除的鼠标监听事件。
  3180. */
  3181. this.clearMouseListener = null;
  3182. Util_Util.extend(this, options);
  3183. if (eventTypes != null) {
  3184. for (var i = 0, len = eventTypes.length; i < len; i++) {
  3185. this.addEventType(eventTypes[i]);
  3186. }
  3187. }
  3188. if (element != null) {
  3189. this.attachToElement(element);
  3190. }
  3191. this.CLASS_NAME = "SuperMap.Events";
  3192. }
  3193. /**
  3194. * @function Events.prototype.destroy
  3195. * @description 移除当前要素 element 上的所有事件监听和处理。
  3196. */
  3197. destroy() {
  3198. for (var e in this.extensions) {
  3199. if (typeof this.extensions[e] !== "boolean") {
  3200. this.extensions[e].destroy();
  3201. }
  3202. }
  3203. this.extensions = null;
  3204. if (this.element) {
  3205. Event.stopObservingElement(this.element);
  3206. if (this.element.hasScrollEvent) {
  3207. Event.stopObserving(
  3208. window, "scroll", this.clearMouseListener
  3209. );
  3210. }
  3211. }
  3212. this.element = null;
  3213. this.listeners = null;
  3214. this.object = null;
  3215. this.eventTypes = null;
  3216. this.fallThrough = null;
  3217. this.eventHandler = null;
  3218. }
  3219. /**
  3220. * @function Events.prototype.addEventType
  3221. * @description 在此事件对象中添加新的事件类型,如果这个事件类型已经添加过了,则不做任何事情。
  3222. * @param {string} eventName - 事件名。
  3223. */
  3224. addEventType(eventName) {
  3225. if (!this.listeners[eventName]) {
  3226. this.eventTypes.push(eventName);
  3227. this.listeners[eventName] = [];
  3228. }
  3229. }
  3230. /**
  3231. * @function Events.prototype.attachToElement
  3232. * @description 给 DOM 元素绑定浏览器事件。
  3233. * @param {HTMLElement} element - 绑定浏览器事件的 DOM 元素。
  3234. */
  3235. attachToElement(element) {
  3236. if (this.element) {
  3237. Event.stopObservingElement(this.element);
  3238. } else {
  3239. // keep a bound copy of handleBrowserEvent() so that we can
  3240. // pass the same function to both Event.observe() and .stopObserving()
  3241. this.eventHandler = FunctionExt.bindAsEventListener(
  3242. this.handleBrowserEvent, this
  3243. );
  3244. // to be used with observe and stopObserving
  3245. this.clearMouseListener = FunctionExt.bind(
  3246. this.clearMouseCache, this
  3247. );
  3248. }
  3249. this.element = element;
  3250. for (var i = 0, len = this.BROWSER_EVENTS.length; i < len; i++) {
  3251. var eventType = this.BROWSER_EVENTS[i];
  3252. // every browser event has a corresponding application event
  3253. // (whether it's listened for or not).
  3254. this.addEventType(eventType);
  3255. // use Prototype to register the event cross-browser
  3256. Event.observe(element, eventType, this.eventHandler);
  3257. }
  3258. // disable dragstart in IE so that mousedown/move/up works normally
  3259. Event.observe(element, "dragstart", Event.stop);
  3260. }
  3261. /**
  3262. * @function Events.prototype.on
  3263. * @description 在一个相同的范围内注册监听器的方法,此方法调用 register 函数。
  3264. * @example
  3265. * // 注册一个 "loadstart" 监听事件
  3266. * events.on({"loadstart": loadStartListener});
  3267. *
  3268. * // 同样注册一个 "loadstart" 监听事件
  3269. * events.register("loadstart", undefined, loadStartListener);
  3270. *
  3271. * // 同时为对象注册多个监听事件
  3272. * events.on({
  3273. * "loadstart": loadStartListener,
  3274. * "loadend": loadEndListener,
  3275. * scope: object
  3276. * });
  3277. *
  3278. * // 同时为对象注册多个监听事件,多次调用 register 方法
  3279. * events.register("loadstart", object, loadStartListener);
  3280. * events.register("loadend", object, loadEndListener);
  3281. *
  3282. *
  3283. * @param {Object} object - 添加监听的对象。
  3284. */
  3285. on(object) {
  3286. for (var type in object) {
  3287. if (type !== "scope" && object.hasOwnProperty(type)) {
  3288. this.register(type, object.scope, object[type]);
  3289. }
  3290. }
  3291. }
  3292. /**
  3293. * @function Events.prototype.register
  3294. * @description 在事件对象上注册一个事件。当事件被触发时,'func' 函数被调用,假设我们触发一个事件,
  3295. * 指定 Bounds 作为 "obj",当事件被触发时,回调函数的上下文作为 Bounds 对象。
  3296. * @param {string} type - 事件注册者的名字。
  3297. * @param {Object} [obj=this.object] - 对象绑定的回调。
  3298. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  3299. * @param {(boolean|Object)} [priority] - 当为 true 时将新的监听加在事件队列的前面。
  3300. */
  3301. register(type, obj, func, priority) {
  3302. if (type in Events && !this.extensions[type]) {
  3303. this.extensions[type] = new Events[type](this);
  3304. }
  3305. if ((func != null) &&
  3306. (Util_Util.indexOf(this.eventTypes, type) !== -1)) {
  3307. if (obj == null) {
  3308. obj = this.object;
  3309. }
  3310. var listeners = this.listeners[type];
  3311. if (!listeners) {
  3312. listeners = [];
  3313. this.listeners[type] = listeners;
  3314. this.extensionCount[type] = 0;
  3315. }
  3316. var listener = {obj: obj, func: func};
  3317. if (priority) {
  3318. listeners.splice(this.extensionCount[type], 0, listener);
  3319. if (typeof priority === "object" && priority.extension) {
  3320. this.extensionCount[type]++;
  3321. }
  3322. } else {
  3323. listeners.push(listener);
  3324. }
  3325. }
  3326. }
  3327. /**
  3328. * @function Events.prototype.registerPriority
  3329. * @description 相同的注册方法,但是在前面增加新的监听者事件查询而代替到方法的结束。
  3330. * @param {string} type - 事件注册者的名字。
  3331. * @param {Object} [obj=this.object] - 对象绑定的回调。
  3332. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  3333. */
  3334. registerPriority(type, obj, func) {
  3335. this.register(type, obj, func, true);
  3336. }
  3337. /**
  3338. * @function Events.prototype.un
  3339. * @description 在一个相同的范围内取消注册监听器的方法,此方法调用 unregister 函数。
  3340. * @example
  3341. * // 移除 "loadstart" 事件监听
  3342. * events.un({"loadstart": loadStartListener});
  3343. *
  3344. * // 使用 "unregister" 方法移除 "loadstart" 事件监听
  3345. * events.unregister("loadstart", undefined, loadStartListener);
  3346. *
  3347. * // 取消对象多个事件监听
  3348. * events.un({
  3349. * "loadstart": loadStartListener,
  3350. * "loadend": loadEndListener,
  3351. * scope: object
  3352. * });
  3353. *
  3354. * // 取消对象多个事件监听,多次调用unregister方法。
  3355. * events.unregister("loadstart", object, loadStartListener);
  3356. * events.unregister("loadend", object, loadEndListener);
  3357. *
  3358. * @param {Object} object - 移除监听的对象。
  3359. */
  3360. un(object) {
  3361. for (var type in object) {
  3362. if (type !== "scope" && object.hasOwnProperty(type)) {
  3363. this.unregister(type, object.scope, object[type]);
  3364. }
  3365. }
  3366. }
  3367. /**
  3368. * @function Events.prototype.unregister
  3369. * @description 取消注册。
  3370. * @param {string} type - 事件类型。
  3371. * @param {Object} [obj=this.object] - 对象绑定的回调。
  3372. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  3373. */
  3374. unregister(type, obj, func) {
  3375. if (obj == null) {
  3376. obj = this.object;
  3377. }
  3378. var listeners = this.listeners[type];
  3379. if (listeners != null) {
  3380. for (var i = 0, len = listeners.length; i < len; i++) {
  3381. if (listeners[i].obj === obj && listeners[i].func === func) {
  3382. listeners.splice(i, 1);
  3383. break;
  3384. }
  3385. }
  3386. }
  3387. }
  3388. /**
  3389. * @function Events.prototype.remove
  3390. * @description 删除某个事件类型的所有监听,如果该事件类型没有注册,则不做任何操作。
  3391. * @param {string} type - 事件类型。
  3392. */
  3393. remove(type) {
  3394. if (this.listeners[type] != null) {
  3395. this.listeners[type] = [];
  3396. }
  3397. }
  3398. /**
  3399. * @function Events.prototype.triggerEvent
  3400. * @description 触发一个特定的注册事件。
  3401. * @param {string} type - 触发事件类型。
  3402. * @param {Event} evt - 事件对象。
  3403. * @returns {Event|boolean} 监听对象,如果返回是 false,则停止监听。
  3404. */
  3405. triggerEvent(type, evt) {
  3406. var listeners = this.listeners[type];
  3407. // fast path
  3408. if (!listeners || listeners.length == 0) {
  3409. return undefined;
  3410. }
  3411. // prep evt object with object & div references
  3412. if (evt == null) {
  3413. evt = {};
  3414. }
  3415. evt.object = this.object;
  3416. evt.element = this.element;
  3417. if (!evt.type) {
  3418. evt.type = type;
  3419. }
  3420. // execute all callbacks registered for specified type
  3421. // get a clone of the listeners array to
  3422. // allow for splicing during callbacks
  3423. listeners = listeners.slice();
  3424. var continueChain;
  3425. for (var i = 0, len = listeners.length; i < len; i++) {
  3426. var callback = listeners[i];
  3427. // bind the context to callback.obj
  3428. continueChain = callback.func.apply(callback.obj, [evt]);
  3429. if ((continueChain != undefined) && (continueChain === false)) {
  3430. // if callback returns false, execute no more callbacks.
  3431. break;
  3432. }
  3433. }
  3434. // don't fall through to other DOM elements
  3435. if (!this.fallThrough) {
  3436. Event.stop(evt, true);
  3437. }
  3438. return continueChain;
  3439. }
  3440. /**
  3441. * @function Events.prototype.handleBrowserEvent
  3442. * @description 对 triggerEvent 函数的包装,给事件对象设置了 xy 属性(即当前鼠标点的 xy 坐标)。
  3443. * @param {Event} evt - 事件对象。
  3444. */
  3445. handleBrowserEvent(evt) {
  3446. var type = evt.type, listeners = this.listeners[type];
  3447. if (!listeners || listeners.length == 0) {
  3448. // noone's listening, bail out
  3449. return;
  3450. }
  3451. // add clientX & clientY to all events - corresponds to average x, y
  3452. var touches = evt.touches;
  3453. if (touches && touches[0]) {
  3454. var x = 0;
  3455. var y = 0;
  3456. var num = touches.length;
  3457. var touch;
  3458. for (var i = 0; i < num; ++i) {
  3459. touch = touches[i];
  3460. x += touch.clientX;
  3461. y += touch.clientY;
  3462. }
  3463. evt.clientX = x / num;
  3464. evt.clientY = y / num;
  3465. }
  3466. if (this.includeXY) {
  3467. evt.xy = this.getMousePosition(evt);
  3468. }
  3469. this.triggerEvent(type, evt);
  3470. }
  3471. /**
  3472. * @function Events.prototype.clearMouseCache
  3473. * @description 清除鼠标缓存。
  3474. */
  3475. clearMouseCache() {
  3476. this.element.scrolls = null;
  3477. this.element.lefttop = null;
  3478. var body = document.body;
  3479. if (body && !((body.scrollTop != 0 || body.scrollLeft != 0) &&
  3480. navigator.userAgent.match(/iPhone/i))) {
  3481. this.element.offsets = null;
  3482. }
  3483. }
  3484. /**
  3485. * @function Events.prototype.getMousePosition
  3486. * @description 获取当前鼠标的位置。
  3487. * @param {Event} evt - 事件对象。
  3488. * @returns {Pixel} 当前的鼠标的 xy 坐标点。
  3489. */
  3490. getMousePosition(evt) {
  3491. if (!this.includeXY) {
  3492. this.clearMouseCache();
  3493. } else if (!this.element.hasScrollEvent) {
  3494. Event.observe(window, "scroll", this.clearMouseListener);
  3495. this.element.hasScrollEvent = true;
  3496. }
  3497. if (!this.element.scrolls) {
  3498. var viewportElement = Util_Util.getViewportElement();
  3499. this.element.scrolls = [
  3500. viewportElement.scrollLeft,
  3501. viewportElement.scrollTop
  3502. ];
  3503. }
  3504. if (!this.element.lefttop) {
  3505. this.element.lefttop = [
  3506. (document.documentElement.clientLeft || 0),
  3507. (document.documentElement.clientTop || 0)
  3508. ];
  3509. }
  3510. if (!this.element.offsets) {
  3511. this.element.offsets = Util_Util.pagePosition(this.element);
  3512. }
  3513. return new Pixel(
  3514. (evt.clientX + this.element.scrolls[0]) - this.element.offsets[0]
  3515. - this.element.lefttop[0],
  3516. (evt.clientY + this.element.scrolls[1]) - this.element.offsets[1]
  3517. - this.element.lefttop[1]
  3518. );
  3519. }
  3520. }
  3521. Events.prototype.BROWSER_EVENTS = [
  3522. "mouseover", "mouseout",
  3523. "mousedown", "mouseup", "mousemove",
  3524. "click", "dblclick", "rightclick", "dblrightclick",
  3525. "resize", "focus", "blur",
  3526. "touchstart", "touchmove", "touchend",
  3527. "keydown", "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup",
  3528. "MSGestureStart", "MSGestureChange", "MSGestureEnd",
  3529. "contextmenu"
  3530. ];
  3531. ;// CONCATENATED MODULE: external "function(){try{return elasticsearch}catch(e){return {}}}()"
  3532. const external_function_try_return_elasticsearch_catch_e_return_namespaceObject = function(){try{return elasticsearch}catch(e){return {}}}();
  3533. var external_function_try_return_elasticsearch_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_elasticsearch_catch_e_return_namespaceObject);
  3534. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/ElasticSearch.js
  3535. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  3536. * This program are made available under the terms of the Apache License, Version 2.0
  3537. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  3538. /**
  3539. * @class ElasticSearch
  3540. * @deprecatedclass SuperMap.ElasticSearch
  3541. * @classdesc ElasticSearch服务类。
  3542. * @category ElasticSearch
  3543. * @modulecategory Services
  3544. * @param {string} url - ElasticSearch服务地址。
  3545. * @param {Object} options - 参数。
  3546. * @param {function} [options.change] - 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  3547. * @param {boolean} [options.openGeoFence=false] - 是否开启地理围栏验证,默认为不开启。
  3548. * @param {function} [options.outOfGeoFence] - 数据超出地理围栏后执行的函数。
  3549. * @param {Object} [options.geoFence] - 地理围栏。
  3550. * @description
  3551. * <h3 style="font-size: 20px;margin-top: 20px;margin-bottom: 10px;">11.1.0</h3>
  3552. * 该功能依赖<a href="https://github.com/elastic/elasticsearch">@elastic/elasticsearch</a>, webpack5或其他不包含Node.js Polyfills的打包工具,需要加入相关配置,以webpack为例:<br/>
  3553. <p style="margin-top:10px;">首先安装相关Polyfills</p><pre><code>npm i stream-http https-browserify stream-browserify tty-browserify browserify-zlib os-browserify buffer url assert process -D</code></pre>
  3554. 然后配置webpack<pre><code>module.exports: {
  3555. resolve: {
  3556. alias: {
  3557. process: 'process/browser',
  3558. },
  3559. mainFields: ['browser', 'main'],
  3560. fallback: {
  3561. fs: false,
  3562. http: require.resolve('stream-http'),
  3563. https: require.resolve('https-browserify'),
  3564. os: require.resolve('os-browserify/browser'),
  3565. stream: require.resolve('stream-browserify'),
  3566. tty: require.resolve('tty-browserify'),
  3567. zlib: require.resolve('browserify-zlib')
  3568. }
  3569. }
  3570. plugins: [
  3571. new webpack.ProvidePlugin({
  3572. process: 'process/browser',
  3573. Buffer: ['buffer', 'Buffer']
  3574. }),
  3575. ]
  3576. }</code></pre>
  3577. * @usage
  3578. */
  3579. class ElasticSearch {
  3580. constructor(url, options) {
  3581. options = options || {};
  3582. /**
  3583. * @member {string} ElasticSearch.prototype.url
  3584. * @description ElasticSearch服务地址。
  3585. */
  3586. this.url = url;
  3587. /**
  3588. * @member {Object} ElasticSearch.prototype.client
  3589. * @description client ES客户端。
  3590. */
  3591. try {
  3592. // 老版本
  3593. this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
  3594. host: this.url
  3595. });
  3596. } catch (e) {
  3597. // 新版本
  3598. this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
  3599. node: {
  3600. url: new URL(this.url)
  3601. }
  3602. });
  3603. }
  3604. /**
  3605. * @deprecated
  3606. * @member {function} [ElasticSearch.prototype.change]
  3607. * @description 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  3608. */
  3609. this.change = null;
  3610. /**
  3611. * @member {boolean} [ElasticSearch.prototype.openGeoFence=false]
  3612. * @description 是否开启地理围栏验证,默认为不开启。
  3613. */
  3614. this.openGeoFence = false;
  3615. /**
  3616. * @member {function} [ElasticSearch.prototype.outOfGeoFence]
  3617. * @description 数据超出地理围栏后执行的函数。
  3618. */
  3619. this.outOfGeoFence = null;
  3620. /**
  3621. * @member {Object} [ElasticSearch.prototype.geoFence]
  3622. * @description 地理围栏。
  3623. * @example {
  3624. * radius: 1000,//单位是m
  3625. * center: [104.40, 30.43],
  3626. * unit: 'meter|degree'
  3627. * }
  3628. */
  3629. this.geoFence = null;
  3630. /*
  3631. * Constant: EVENT_TYPES
  3632. * {Array.<String>}
  3633. * 此类支持的事件类型。
  3634. *
  3635. */
  3636. this.EVENT_TYPES = ['change', 'error', 'outOfGeoFence'];
  3637. /**
  3638. * @member {Events} ElasticSearch.prototype.events
  3639. * @description 事件。
  3640. */
  3641. this.events = new Events(this, null, this.EVENT_TYPES);
  3642. /**
  3643. * @member {Object} ElasticSearch.prototype.eventListeners
  3644. * @description 监听器对象,在构造函数中设置此参数(可选),对 MapService 支持的两个事件 processCompleted 、processFailed 进行监听,
  3645. * 相当于调用 Events.on(eventListeners)。
  3646. */
  3647. this.eventListeners = null;
  3648. Util_Util.extend(this, options);
  3649. if (this.eventListeners instanceof Object) {
  3650. this.events.on(this.eventListeners);
  3651. }
  3652. }
  3653. /**
  3654. * @function ElasticSearch.prototype.setGeoFence
  3655. * @description 设置地理围栏,openGeoFence参数为true的时候,设置的地理围栏才生效。
  3656. * @param {Geometry} geoFence - 地理围栏。
  3657. */
  3658. setGeoFence(geoFence) {
  3659. this.geoFence = geoFence;
  3660. }
  3661. /**
  3662. * @function ElasticSearch.prototype.bulk
  3663. * @description 批量操作API,允许执行多个索引/删除操作。
  3664. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk}</br>
  3665. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html}</br>
  3666. * @param {Object} params - 参数。
  3667. * @param {function} callback - 回调函数。
  3668. */
  3669. bulk(params, callback) {
  3670. return this.client.bulk(params, this._handleCallback(callback));
  3671. }
  3672. /**
  3673. * @function ElasticSearch.prototype.clearScroll
  3674. * @description 通过指定scroll参数进行查询来清除已经创建的scroll请求。
  3675. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-clearscroll}</br>
  3676. *更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  3677. * @param {Object} params - 参数。
  3678. * @param {function} callback - 回调函数。
  3679. */
  3680. clearScroll(params, callback) {
  3681. return this.client.clearScroll(params, this._handleCallback(callback));
  3682. }
  3683. /**
  3684. * @function ElasticSearch.prototype.count
  3685. * @description 获取集群、索引、类型或查询的文档个数。
  3686. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-count}</br>
  3687. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html}</br>
  3688. * @param {Object} params - 参数。
  3689. * @param {function} callback - 回调函数。
  3690. */
  3691. count(params, callback) {
  3692. return this.client.count(params, this._handleCallback(callback));
  3693. }
  3694. /**
  3695. * @function ElasticSearch.prototype.create
  3696. * @description 在特定索引中添加一个类型化的JSON文档,使其可搜索。如果具有相同index,type且ID已经存在的文档将发生错误。</br>
  3697. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-create}
  3698. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}
  3699. * @param {Object} params - 参数。
  3700. * @param {function} callback - 回调函数。
  3701. */
  3702. create(params, callback) {
  3703. return this.client.create(params, this._handleCallback(callback));
  3704. }
  3705. /**
  3706. * @function ElasticSearch.prototype.delete
  3707. * @description 根据其ID从特定索引中删除键入的JSON文档。
  3708. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-delete}</br>
  3709. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html}</br>
  3710. * @param {Object} params - 参数。
  3711. * @param {function} callback - 回调函数。
  3712. */
  3713. delete(params, callback) {
  3714. return this.client.delete(params, this._handleCallback(callback));
  3715. }
  3716. /**
  3717. * @function ElasticSearch.prototype.deleteByQuery
  3718. * @description 根据其ID从特定索引中删除键入的JSON文档。
  3719. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletebyquery}</br>
  3720. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html}</br>
  3721. * @param {Object} params - 参数。
  3722. * @param {function} callback - 回调函数。
  3723. */
  3724. deleteByQuery(params, callback) {
  3725. return this.client.deleteByQuery(params, this._handleCallback(callback));
  3726. }
  3727. /**
  3728. * @function ElasticSearch.prototype.deleteScript
  3729. * @description 根据其ID删除脚本。</br>
  3730. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletescript}</br>
  3731. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  3732. * @param {Object} params - 参数。
  3733. * @param {function} callback - 回调函数。
  3734. */
  3735. deleteScript(params, callback) {
  3736. return this.client.deleteScript(params, this._handleCallback(callback));
  3737. }
  3738. /**
  3739. * @function ElasticSearch.prototype.deleteTemplate
  3740. * @description 根据其ID删除模板。</br>
  3741. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletetemplate}</br>
  3742. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  3743. * @param {Object} params - 参数。
  3744. * @param {function} callback - 回调函数。
  3745. */
  3746. deleteTemplate(params, callback) {
  3747. return this.client.deleteTemplate(params, this._handleCallback(callback));
  3748. }
  3749. /**
  3750. * @function ElasticSearch.prototype.exists
  3751. * @description 检查给定文档是否存在。</br>
  3752. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-exists}</br>
  3753. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  3754. * @param {Object} params - 参数。
  3755. * @param {function} callback - 回调函数。
  3756. */
  3757. exists(params, callback) {
  3758. return this.client.exists(params, this._handleCallback(callback));
  3759. }
  3760. /**
  3761. * @function ElasticSearch.prototype.existsSource
  3762. * @description 检查资源是否存在。</br>
  3763. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-existssource}</br>
  3764. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  3765. * @param {Object} params - 参数。
  3766. * @param {function} callback - 回调函数。
  3767. */
  3768. existsSource(params, callback) {
  3769. return this.client.existsSource(params, this._handleCallback(callback));
  3770. }
  3771. /**
  3772. * @function ElasticSearch.prototype.explain
  3773. * @description 提供与特定查询相关的特定文档分数的详细信息。它还会告诉您文档是否与指定的查询匹配。</br>
  3774. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-explain}</br>
  3775. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html}</br>
  3776. * @param {Object} params - 参数。
  3777. * @param {function} callback - 回调函数。
  3778. */
  3779. explain(params, callback) {
  3780. return this.client.explain(params, this._handleCallback(callback));
  3781. }
  3782. /**
  3783. * @function ElasticSearch.prototype.fieldCaps
  3784. * @description 允许检索多个索引之间的字段的功能。(实验性API,可能会在未来版本中删除)</br>
  3785. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-fieldcaps}</br>
  3786. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html}</br>
  3787. * @param {Object} params - 参数。
  3788. * @param {function} callback - 回调函数。
  3789. */
  3790. fieldCaps(params, callback) {
  3791. return this.client.fieldCaps(params, this._handleCallback(callback));
  3792. }
  3793. /**
  3794. * @function ElasticSearch.prototype.get
  3795. * @description 从索引获取一个基于其ID的类型的JSON文档。</br>
  3796. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-get}</br>
  3797. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  3798. * @param {Object} params - 参数。
  3799. * @param {function} callback - 回调函数。
  3800. */
  3801. get(params, callback) {
  3802. return this.client.get(params, this._handleCallback(callback));
  3803. }
  3804. /**
  3805. * @function ElasticSearch.prototype.getScript
  3806. * @description 获取脚本。</br>
  3807. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getscript}</br>
  3808. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  3809. * @param {Object} params - 参数。
  3810. * @param {function} callback - 回调函数。
  3811. */
  3812. getScript(params, callback) {
  3813. return this.client.getScript(params, this._handleCallback(callback));
  3814. }
  3815. /**
  3816. * @function ElasticSearch.prototype.getSource
  3817. * @description 通过索引,类型和ID获取文档的源。</br>
  3818. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getsource}</br>
  3819. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  3820. * @param {Object} params - 参数。
  3821. * @param {function} callback - 回调函数。
  3822. */
  3823. getSource(params, callback) {
  3824. return this.client.getSource(params, this._handleCallback(callback));
  3825. }
  3826. /**
  3827. * @function ElasticSearch.prototype.getTemplate
  3828. * @description 获取模板。</br>
  3829. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-gettemplate}</br>
  3830. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  3831. * @param {Object} params - 参数。
  3832. * @param {function} callback - 回调函数。
  3833. */
  3834. getTemplate(params, callback) {
  3835. return this.client.getTemplate(params, this._handleCallback(callback));
  3836. }
  3837. /**
  3838. * @function ElasticSearch.prototype.index
  3839. * @description 在索引中存储一个键入的JSON文档,使其可搜索。</br>
  3840. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-index}</br>
  3841. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}</br>
  3842. * @param {Object} params - 参数。
  3843. * @param {function} callback - 回调函数。
  3844. */
  3845. index(params, callback) {
  3846. return this.client.index(params, this._handleCallback(callback));
  3847. }
  3848. /**
  3849. * @function ElasticSearch.prototype.info
  3850. * @description 从当前集群获取基本信息。</br>
  3851. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-info}</br>
  3852. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  3853. * @param {Object} params - 参数。
  3854. * @param {function} callback - 回调函数。
  3855. */
  3856. info(params, callback) {
  3857. return this.client.info(params, this._handleCallback(callback));
  3858. }
  3859. /**
  3860. * @function ElasticSearch.prototype.mget
  3861. * @description 根据索引,类型(可选)和ids来获取多个文档。mget所需的主体可以采用两种形式:文档位置数组或文档ID数组。</br>
  3862. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mget}</br>
  3863. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html}</br>
  3864. * @param {Object} params - 参数。
  3865. * @param {function} callback - 回调函数。
  3866. */
  3867. mget(params, callback) {
  3868. return this.client.mget(params, this._handleCallback(callback));
  3869. }
  3870. /**
  3871. * @function ElasticSearch.prototype.msearch
  3872. * @description 在同一请求中执行多个搜索请求。</br>
  3873. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch}</br>
  3874. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html}</br>
  3875. * @param {Object} params - 参数。
  3876. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  3877. * 回调参数:error,response,结果存储在response.responses中。
  3878. */
  3879. msearch(params, callback) {
  3880. let me = this;
  3881. return me.client.msearch(params)
  3882. .then(function (resp) {
  3883. resp = resp.body || resp;
  3884. me._update(resp.responses, callback);
  3885. return resp;
  3886. }, function (err) {
  3887. callback(err);
  3888. me.events.triggerEvent('error', {error: err});
  3889. return err;
  3890. });
  3891. }
  3892. /**
  3893. * @function ElasticSearch.prototype.msearchTemplate
  3894. * @description 在同一请求中执行多个搜索模板请求。</br>
  3895. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearchtemplate}</br>
  3896. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  3897. * @param {Object} params - 参数。
  3898. * @param {function} callback - 回调函数。
  3899. */
  3900. msearchTemplate(params, callback) {
  3901. return this.client.msearchTemplate(params, this._handleCallback(callback));
  3902. }
  3903. /**
  3904. * @function ElasticSearch.prototype.mtermvectors
  3905. * @description 多termvectors API允许一次获得多个termvectors。</br>
  3906. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mtermvectors}</br>
  3907. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html}</br>
  3908. * @param {Object} params - 参数。
  3909. * @param {function} callback - 回调函数。
  3910. */
  3911. mtermvectors(params, callback) {
  3912. return this.client.mtermvectors(params, this._handleCallback(callback));
  3913. }
  3914. /**
  3915. * @function ElasticSearch.prototype.ping
  3916. * @description 测试连接。</br>
  3917. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-ping}</br>
  3918. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  3919. * @param {Object} params - 参数。
  3920. * @param {function} callback - 回调函数。
  3921. */
  3922. ping(params, callback) {
  3923. return this.client.ping(params, this._handleCallback(callback));
  3924. }
  3925. /**
  3926. * @function ElasticSearch.prototype.putScript
  3927. * @description 添加脚本。</br>
  3928. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-putscript}</br>
  3929. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  3930. * @param {Object} params - 参数。
  3931. * @param {function} callback - 回调函数。
  3932. */
  3933. putScript(params, callback) {
  3934. return this.client.putScript(params, this._handleCallback(callback));
  3935. }
  3936. /**
  3937. * @function ElasticSearch.prototype.putTemplate
  3938. * @description 添加模板。</br>
  3939. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-puttemplate}</br>
  3940. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  3941. * @param {Object} params - 参数。
  3942. * @param {function} callback - 回调函数。
  3943. */
  3944. putTemplate(params, callback) {
  3945. return this.client.putTemplate(params, this._handleCallback(callback));
  3946. }
  3947. /**
  3948. * @function ElasticSearch.prototype.reindex
  3949. * @description 重新索引。</br>
  3950. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindex}</br>
  3951. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  3952. * @param {Object} params - 参数。
  3953. * @param {function} callback - 回调函数。
  3954. */
  3955. reindex(params, callback) {
  3956. return this.client.reindex(params, this._handleCallback(callback));
  3957. }
  3958. /**
  3959. * @function ElasticSearch.prototype.reindexRessrottle
  3960. * @description 重新索引。</br>
  3961. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindexrethrottle}</br>
  3962. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  3963. * @param {Object} params - 参数。
  3964. * @param {function} callback - 回调函数。
  3965. */
  3966. reindexRessrottle(params, callback) {
  3967. return this.client.reindexRessrottle(params, this._handleCallback(callback));
  3968. }
  3969. /**
  3970. * @function ElasticSearch.prototype.renderSearchTemplate
  3971. * @description 搜索模板。</br>
  3972. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-rendersearchtemplate}</br>
  3973. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  3974. * @param {Object} params - 参数。
  3975. * @param {function} callback - 回调函数。
  3976. */
  3977. renderSearchTemplate(params, callback) {
  3978. return this.client.renderSearchTemplate(params, this._handleCallback(callback));
  3979. }
  3980. /**
  3981. * @function ElasticSearch.prototype.scroll
  3982. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。</br>
  3983. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-scroll}</br>
  3984. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  3985. * @param {Object} params - 参数。
  3986. * @param {function} callback - 回调函数。
  3987. */
  3988. scroll(params, callback) {
  3989. return this.client.scroll(params, this._handleCallback(callback));
  3990. }
  3991. /**
  3992. * @function ElasticSearch.prototype.search
  3993. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。
  3994. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search}</br>
  3995. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html}</br>
  3996. * @param {Object} params - 参数。
  3997. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  3998. * 回调参数:error,response,结果存储在response.responses中。
  3999. */
  4000. search(params, callback) {
  4001. let me = this;
  4002. return me.client.search(params)
  4003. .then(function (resp) {
  4004. resp = resp.body || resp;
  4005. me._update(resp, callback);
  4006. return resp;
  4007. }, function (err) {
  4008. callback && callback(err);
  4009. me.events.triggerEvent('error', {error: err});
  4010. return err;
  4011. });
  4012. }
  4013. /**
  4014. * @function ElasticSearch.prototype.searchShards
  4015. * @description 返回要执行搜索请求的索引和分片。
  4016. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchshards}</br>
  4017. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shards.html}</br>
  4018. * @param {Object} params - 参数。
  4019. * @param {function} callback - 回调函数。
  4020. */
  4021. searchShards(params, callback) {
  4022. return this.client.searchShards(params, this._handleCallback(callback));
  4023. }
  4024. /**
  4025. * @function ElasticSearch.prototype.searchTemplate
  4026. * @description 搜索模板。
  4027. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchtemplate}</br>
  4028. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  4029. * @param {Object} params - 参数。
  4030. * @param {function} callback - 回调函数。
  4031. */
  4032. searchTemplate(params, callback) {
  4033. return this.client.searchTemplate(params, this._handleCallback(callback));
  4034. }
  4035. /**
  4036. * @function ElasticSearch.prototype.suggest
  4037. * @description 该建议功能通过使用特定的建议者,基于所提供的文本来建议类似的术语。
  4038. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-suggest}</br>
  4039. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  4040. * @param {Object} params - 参数。
  4041. * @param {function} callback - 回调函数。
  4042. */
  4043. suggest(params, callback) {
  4044. return this.client.suggest(params, this._handleCallback(callback));
  4045. }
  4046. /**
  4047. * @function ElasticSearch.prototype.termvectors
  4048. * @description 返回有关特定文档字段中的术语的信息和统计信息。
  4049. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-termvectors}</br>
  4050. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html}</br>
  4051. * @param {Object} params - 参数。
  4052. * @param {function} callback - 回调函数。
  4053. */
  4054. termvectors(params, callback) {
  4055. return this.client.termvectors(params, this._handleCallback(callback));
  4056. }
  4057. /**
  4058. * @function ElasticSearch.prototype.update
  4059. * @description 更新文档的部分。
  4060. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-update}</br>
  4061. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html}</br>
  4062. * @param {Object} params - 参数。
  4063. * @param {function} callback - 回调函数。
  4064. */
  4065. update(params, callback) {
  4066. return this.client.update(params, this._handleCallback(callback));
  4067. }
  4068. /**
  4069. * @function ElasticSearch.prototype.updateByQuery
  4070. * @description 通过查询API来更新文档。
  4071. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-updatebyquery}</br>
  4072. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html}</br>
  4073. * @param {Object} params - 参数。
  4074. * @param {function} callback - 回调函数。
  4075. */
  4076. updateByQuery(params, callback) {
  4077. return this.client.updateByQuery(params, this._handleCallback(callback));
  4078. }
  4079. /**
  4080. * @function ElasticSearch.prototype._handleCallback
  4081. * @description 处理ElasticSearch 16.x和5.x的callback兼容。 5.x的回调参数多包了一层body
  4082. * @param {function} callback - 回调函数。
  4083. * @private
  4084. */
  4085. _handleCallback(callback) {
  4086. return function () {
  4087. let args = Array.from(arguments);
  4088. const error = args.shift();
  4089. let resp = args.shift();
  4090. const body = resp && resp.body;
  4091. if (body) {
  4092. const { statusCode, headers } = resp;
  4093. args = [statusCode, headers];
  4094. resp = body;
  4095. }
  4096. callback.call(this, error, resp, ...args);
  4097. };
  4098. }
  4099. _update(data, callback) {
  4100. let me = this;
  4101. if (!data) {
  4102. return;
  4103. }
  4104. me.data = data;
  4105. if (me.openGeoFence && me.geoFence) {
  4106. me._validateDatas(data);
  4107. }
  4108. me.events.triggerEvent('change', {data: me.data});
  4109. //change方法已废弃,不建议使用。建议使用search方法的第二个参数传入请求成功的回调
  4110. if (me.change) {
  4111. me.change && me.change(data);
  4112. } else {
  4113. //加responses是为了保持跟原来es自身的数据结构一致
  4114. callback && callback(undefined, {responses: data});
  4115. }
  4116. }
  4117. _validateDatas(datas) {
  4118. if (!datas) {
  4119. return;
  4120. }
  4121. if (!(datas instanceof Array)) {
  4122. datas = [datas];
  4123. }
  4124. var i, len = datas.length;
  4125. for (i = 0; i < len; i++) {
  4126. this._validateData(datas[i]);
  4127. }
  4128. }
  4129. _validateData(data) {
  4130. let me = this;
  4131. data.hits.hits.map(function (source) {
  4132. let content = source._source;
  4133. let meterUnit = me._getMeterPerMapUnit(me.geoFence.unit);
  4134. let geoFenceCX = me.geoFence.center[0] * meterUnit;
  4135. let geoFenceCY = me.geoFence.center[1] * meterUnit;
  4136. let contentX = content.x * meterUnit;
  4137. let contentY = content.y * meterUnit;
  4138. let distance = me._distance(contentX, contentY, geoFenceCX, geoFenceCY);
  4139. let radius = me.geoFence.radius;
  4140. if (distance > radius) {
  4141. me.outOfGeoFence && me.outOfGeoFence(data);
  4142. me.events.triggerEvent('outOfGeoFence', {data: data});
  4143. }
  4144. return source;
  4145. });
  4146. }
  4147. _distance(x1, y1, x2, y2) {
  4148. return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
  4149. }
  4150. _getMeterPerMapUnit(mapUnit) {
  4151. let earchRadiusInMeters = 6378137;
  4152. let meterPerMapUnit;
  4153. if (mapUnit === 'meter') {
  4154. meterPerMapUnit = 1;
  4155. } else if (mapUnit === 'degree') {
  4156. // 每度表示多少米。
  4157. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  4158. }
  4159. return meterPerMapUnit;
  4160. }
  4161. }
  4162. // EXTERNAL MODULE: ./node_modules/promise-polyfill/dist/polyfill.js
  4163. var polyfill = __webpack_require__(107);
  4164. // EXTERNAL MODULE: ./node_modules/fetch-ie8/fetch.js
  4165. var fetch = __webpack_require__(693);
  4166. // EXTERNAL MODULE: ./node_modules/fetch-jsonp/build/fetch-jsonp.js
  4167. var fetch_jsonp = __webpack_require__(144);
  4168. var fetch_jsonp_default = /*#__PURE__*/__webpack_require__.n(fetch_jsonp);
  4169. ;// CONCATENATED MODULE: ./src/common/util/FetchRequest.js
  4170. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  4171. * This program are made available under the terms of the Apache License, Version 2.0
  4172. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  4173. let FetchRequest_fetch = window.fetch;
  4174. var setFetch = function (newFetch) {
  4175. FetchRequest_fetch = newFetch;
  4176. }
  4177. var RequestJSONPPromise = {
  4178. limitLength: 1500,
  4179. queryKeys: [],
  4180. queryValues: [],
  4181. supermap_callbacks: {},
  4182. addQueryStrings: function (values) {
  4183. var me = this;
  4184. for (var key in values) {
  4185. me.queryKeys.push(key);
  4186. if (typeof values[key] !== 'string') {
  4187. values[key] = Util_Util.toJSON(values[key]);
  4188. }
  4189. var tempValue = encodeURIComponent(values[key]);
  4190. me.queryValues.push(tempValue);
  4191. }
  4192. },
  4193. issue: function (config) {
  4194. var me = this,
  4195. uid = me.getUid(),
  4196. url = config.url,
  4197. splitQuestUrl = [];
  4198. // me.addQueryStrings({
  4199. // callback: "RequestJSONPPromise.supermap_callbacks[" + uid + "]"
  4200. // });
  4201. var sectionURL = url,
  4202. keysCount = 0; //此次sectionURL中有多少个key
  4203. var length = me.queryKeys ? me.queryKeys.length : 0;
  4204. for (var i = 0; i < length; i++) {
  4205. if (sectionURL.length + me.queryKeys[i].length + 2 >= me.limitLength) {
  4206. //+2 for ("&"or"?")and"="
  4207. if (keysCount == 0) {
  4208. return false;
  4209. }
  4210. splitQuestUrl.push(sectionURL);
  4211. sectionURL = url;
  4212. keysCount = 0;
  4213. i--;
  4214. } else {
  4215. if (sectionURL.length + me.queryKeys[i].length + 2 + me.queryValues[i].length > me.limitLength) {
  4216. var leftValue = me.queryValues[i];
  4217. while (leftValue.length > 0) {
  4218. var leftLength = me.limitLength - sectionURL.length - me.queryKeys[i].length - 2; //+2 for ("&"or"?")and"="
  4219. if (sectionURL.indexOf('?') > -1) {
  4220. sectionURL += '&';
  4221. } else {
  4222. sectionURL += '?';
  4223. }
  4224. var tempLeftValue = leftValue.substring(0, leftLength);
  4225. //避免 截断sectionURL时,将类似于%22这样的符号截成两半,从而导致服务端组装sectionURL时发生错误
  4226. if (tempLeftValue.substring(leftLength - 1, leftLength) === '%') {
  4227. leftLength -= 1;
  4228. tempLeftValue = leftValue.substring(0, leftLength);
  4229. } else if (tempLeftValue.substring(leftLength - 2, leftLength - 1) === '%') {
  4230. leftLength -= 2;
  4231. tempLeftValue = leftValue.substring(0, leftLength);
  4232. }
  4233. sectionURL += me.queryKeys[i] + '=' + tempLeftValue;
  4234. leftValue = leftValue.substring(leftLength);
  4235. if (tempLeftValue.length > 0) {
  4236. splitQuestUrl.push(sectionURL);
  4237. sectionURL = url;
  4238. keysCount = 0;
  4239. }
  4240. }
  4241. } else {
  4242. keysCount++;
  4243. if (sectionURL.indexOf('?') > -1) {
  4244. sectionURL += '&';
  4245. } else {
  4246. sectionURL += '?';
  4247. }
  4248. sectionURL += me.queryKeys[i] + '=' + me.queryValues[i];
  4249. }
  4250. }
  4251. }
  4252. splitQuestUrl.push(sectionURL);
  4253. return me.send(
  4254. splitQuestUrl,
  4255. 'SuperMapJSONPCallbacks_' + uid,
  4256. config && config.proxy
  4257. );
  4258. },
  4259. getUid: function () {
  4260. var uid = new Date().getTime(),
  4261. random = Math.floor(Math.random() * 1e17);
  4262. return uid * 1000 + random;
  4263. },
  4264. send: function (splitQuestUrl, callback, proxy) {
  4265. var len = splitQuestUrl.length;
  4266. if (len > 0) {
  4267. return new Promise((resolve) => {
  4268. var jsonpUserID = new Date().getTime();
  4269. for (var i = 0; i < len; i++) {
  4270. var url = splitQuestUrl[i];
  4271. if (url.indexOf('?') > -1) {
  4272. url += '&';
  4273. } else {
  4274. url += '?';
  4275. }
  4276. url += 'sectionCount=' + len;
  4277. url += '&sectionIndex=' + i;
  4278. url += '&jsonpUserID=' + jsonpUserID;
  4279. if (proxy) {
  4280. url = decodeURIComponent(url);
  4281. url = proxy + encodeURIComponent(url);
  4282. }
  4283. fetch_jsonp_default()(url, {
  4284. jsonpCallbackFunction: callback,
  4285. timeout: 30000
  4286. }).then((result) => {
  4287. resolve(result.json());
  4288. });
  4289. }
  4290. })
  4291. }
  4292. },
  4293. GET: function (config) {
  4294. var me = this;
  4295. me.queryKeys.length = 0;
  4296. me.queryValues.length = 0;
  4297. me.addQueryStrings(config.params);
  4298. return me.issue(config);
  4299. },
  4300. POST: function (config) {
  4301. var me = this;
  4302. me.queryKeys.length = 0;
  4303. me.queryValues.length = 0;
  4304. me.addQueryStrings({
  4305. requestEntity: config.data
  4306. });
  4307. return me.issue(config);
  4308. },
  4309. PUT: function (config) {
  4310. var me = this;
  4311. me.queryKeys.length = 0;
  4312. me.queryValues.length = 0;
  4313. me.addQueryStrings({
  4314. requestEntity: config.data
  4315. });
  4316. return me.issue(config);
  4317. },
  4318. DELETE: function (config) {
  4319. var me = this;
  4320. me.queryKeys.length = 0;
  4321. me.queryValues.length = 0;
  4322. me.addQueryStrings({
  4323. requestEntity: config.data
  4324. });
  4325. return me.issue(config);
  4326. }
  4327. };
  4328. var CORS;
  4329. var RequestTimeout;
  4330. /**
  4331. * @function setCORS
  4332. * @description 设置是否允许跨域请求,全局配置,优先级低于 service 下的 crossOring 参数。
  4333. * @category BaseTypes Util
  4334. * @param {boolean} cors - 是否允许跨域请求。
  4335. * @usage
  4336. * ```
  4337. * // 浏览器
  4338. * <script type="text/javascript" src="{cdn}"></script>
  4339. * <script>
  4340. * {namespace}.setCORS(cors);
  4341. *
  4342. * // 弃用的写法
  4343. * SuperMap.setCORS(cors);
  4344. *
  4345. * </script>
  4346. *
  4347. * // ES6 Import
  4348. * import { setCORS } from '{npm}';
  4349. *
  4350. * setCORS(cors);
  4351. * ```
  4352. */
  4353. var setCORS = function (cors) {
  4354. CORS = cors;
  4355. }
  4356. /**
  4357. * @function isCORS
  4358. * @description 是是否允许跨域请求。
  4359. * @category BaseTypes Util
  4360. * @returns {boolean} 是否允许跨域请求。
  4361. * @usage
  4362. * ```
  4363. * // 浏览器
  4364. * <script type="text/javascript" src="{cdn}"></script>
  4365. * <script>
  4366. * const result = {namespace}.isCORS();
  4367. *
  4368. * // 弃用的写法
  4369. * const result = SuperMap.isCORS();
  4370. *
  4371. * </script>
  4372. *
  4373. * // ES6 Import
  4374. * import { isCORS } from '{npm}';
  4375. *
  4376. * const result = isCORS();
  4377. * ```
  4378. */
  4379. var isCORS = function () {
  4380. if (CORS != undefined) {
  4381. return CORS;
  4382. }
  4383. return window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest();
  4384. }
  4385. /**
  4386. * @function setRequestTimeout
  4387. * @category BaseTypes Util
  4388. * @description 设置请求超时时间。
  4389. * @param {number} [timeout=45] - 请求超时时间,单位秒。
  4390. * @usage
  4391. * ```
  4392. * // 浏览器
  4393. <script type="text/javascript" src="{cdn}"></script>
  4394. <script>
  4395. {namespace}.setRequestTimeout(timeout);
  4396. // 弃用的写法
  4397. SuperMap.setRequestTimeout(timeout);
  4398. </script>
  4399. // ES6 Import
  4400. import { setRequestTimeout } from '{npm}';
  4401. setRequestTimeout(timeout);
  4402. * ```
  4403. */
  4404. var setRequestTimeout = function (timeout) {
  4405. return RequestTimeout = timeout;
  4406. }
  4407. /**
  4408. * @function getRequestTimeout
  4409. * @category BaseTypes Util
  4410. * @description 获取请求超时时间。
  4411. * @returns {number} 请求超时时间。
  4412. * @usage
  4413. * ```
  4414. * // 浏览器
  4415. <script type="text/javascript" src="{cdn}"></script>
  4416. <script>
  4417. {namespace}.getRequestTimeout();
  4418. // 弃用的写法
  4419. SuperMap.getRequestTimeout();
  4420. </script>
  4421. // ES6 Import
  4422. import { getRequestTimeout } from '{npm}';
  4423. getRequestTimeout();
  4424. * ```
  4425. */
  4426. var getRequestTimeout = function () {
  4427. return RequestTimeout || 45000;
  4428. }
  4429. /**
  4430. * @name FetchRequest
  4431. * @namespace
  4432. * @category BaseTypes Util
  4433. * @description 获取请求。
  4434. * @usage
  4435. * ```
  4436. * // 浏览器
  4437. * <script type="text/javascript" src="{cdn}"></script>
  4438. * <script>
  4439. * const result = {namespace}.FetchRequest.commit(method, url, params, options);
  4440. *
  4441. * </script>
  4442. *
  4443. * // ES6 Import
  4444. * import { FetchRequest } from '{npm}';
  4445. *
  4446. * const result = FetchRequest.commit(method, url, params, options);
  4447. *
  4448. * ```
  4449. */
  4450. var FetchRequest = {
  4451. /**
  4452. * @function FetchRequest.commit
  4453. * @description commit 请求。
  4454. * @param {string} method - 请求方法。
  4455. * @param {string} url - 请求地址。
  4456. * @param {string} params - 请求参数。
  4457. * @param {Object} options - 请求的配置属性。
  4458. * @returns {Promise} Promise 对象。
  4459. */
  4460. commit: function (method, url, params, options) {
  4461. method = method ? method.toUpperCase() : method;
  4462. switch (method) {
  4463. case 'GET':
  4464. return this.get(url, params, options);
  4465. case 'POST':
  4466. return this.post(url, params, options);
  4467. case 'PUT':
  4468. return this.put(url, params, options);
  4469. case 'DELETE':
  4470. return this.delete(url, params, options);
  4471. default:
  4472. return this.get(url, params, options);
  4473. }
  4474. },
  4475. /**
  4476. * @function FetchRequest.supportDirectRequest
  4477. * @description supportDirectRequest 请求。
  4478. * @param {string} url - 请求地址。
  4479. * @param {Object} options - 请求的配置属性。
  4480. * @returns {boolean} 是否允许跨域请求。
  4481. */
  4482. supportDirectRequest: function (url, options) {
  4483. if (Util_Util.isInTheSameDomain(url)) {
  4484. return true;
  4485. }
  4486. if (options.crossOrigin != undefined) {
  4487. return options.crossOrigin;
  4488. } else {
  4489. return isCORS() || options.proxy;
  4490. }
  4491. },
  4492. /**
  4493. * @function FetchRequest.get
  4494. * @description get 请求。
  4495. * @param {string} url - 请求地址。
  4496. * @param {string} params - 请求参数。
  4497. * @param {Object} options - 请求的配置属性。
  4498. * @returns {Promise} Promise 对象。
  4499. */
  4500. get: function (url, params, options) {
  4501. options = options || {};
  4502. var type = 'GET';
  4503. url = Util_Util.urlAppend(url, this._getParameterString(params || {}));
  4504. url = this._processUrl(url, options);
  4505. if (!this.supportDirectRequest(url, options)) {
  4506. url = url.replace('.json', '.jsonp');
  4507. var config = {
  4508. url: url,
  4509. data: params
  4510. };
  4511. return RequestJSONPPromise.GET(config);
  4512. }
  4513. if (!this.urlIsLong(url)) {
  4514. return this._fetch(url, params, options, type);
  4515. } else {
  4516. return this._postSimulatie(type, url.substring(0, url.indexOf('?')), params, options);
  4517. }
  4518. },
  4519. /**
  4520. * @function FetchRequest.delete
  4521. * @description delete 请求。
  4522. * @param {string} url - 请求地址。
  4523. * @param {string} params - 请求参数。
  4524. * @param {Object} options -请求的配置属性。
  4525. * @returns {Promise} Promise 对象。
  4526. */
  4527. delete: function (url, params, options) {
  4528. options = options || {};
  4529. var type = 'DELETE';
  4530. url = Util_Util.urlAppend(url, this._getParameterString(params || {}));
  4531. url = this._processUrl(url, options);
  4532. if (!this.supportDirectRequest(url, options)) {
  4533. url = url.replace('.json', '.jsonp');
  4534. var config = {
  4535. url: url += "&_method=DELETE",
  4536. data: params
  4537. };
  4538. return RequestJSONPPromise.DELETE(config);
  4539. }
  4540. if (this.urlIsLong(url)) {
  4541. return this._postSimulatie(type, url.substring(0, url.indexOf('?')), params, options);
  4542. }
  4543. return this._fetch(url, params, options, type);
  4544. },
  4545. /**
  4546. * @function FetchRequest.post
  4547. * @description post 请求。
  4548. * @param {string} url - 请求地址。
  4549. * @param {string} params - 请求参数。
  4550. * @param {Object} options - 请求的配置属性。
  4551. * @returns {Promise} Promise 对象。
  4552. */
  4553. post: function (url, params, options) {
  4554. options = options || {};
  4555. url = this._processUrl(url, options);
  4556. if (!this.supportDirectRequest(url, options)) {
  4557. url = url.replace('.json', '.jsonp');
  4558. var config = {
  4559. url: Util_Util.urlAppend(url, "_method=POST"),
  4560. data: params
  4561. };
  4562. return RequestJSONPPromise.POST(config);
  4563. }
  4564. return this._fetch(url, params, options, 'POST');
  4565. },
  4566. /**
  4567. * @function FetchRequest.put
  4568. * @description put 请求。
  4569. * @param {string} url - 请求地址。
  4570. * @param {string} params - 请求参数。
  4571. * @param {Object} options - 请求的配置属性。
  4572. * @returns {Promise} Promise 对象。
  4573. */
  4574. put: function (url, params, options) {
  4575. options = options || {};
  4576. url = this._processUrl(url, options);
  4577. if (!this.supportDirectRequest(url, options)) {
  4578. url = url.replace('.json', '.jsonp');
  4579. var config = {
  4580. url: url += "&_method=PUT",
  4581. data: params
  4582. };
  4583. return RequestJSONPPromise.PUT(config);
  4584. }
  4585. return this._fetch(url, params, options, 'PUT');
  4586. },
  4587. /**
  4588. * @function FetchRequest.urlIsLong
  4589. * @description URL 的字节长度是否太长。
  4590. * @param {string} url - 请求地址。
  4591. * @returns {boolean} URL 的字节长度是否太长。
  4592. */
  4593. urlIsLong: function (url) {
  4594. //当前url的字节长度。
  4595. var totalLength = 0,
  4596. charCode = null;
  4597. for (var i = 0, len = url.length; i < len; i++) {
  4598. //转化为Unicode编码
  4599. charCode = url.charCodeAt(i);
  4600. if (charCode < 0x007f) {
  4601. totalLength++;
  4602. } else if ((0x0080 <= charCode) && (charCode <= 0x07ff)) {
  4603. totalLength += 2;
  4604. } else if ((0x0800 <= charCode) && (charCode <= 0xffff)) {
  4605. totalLength += 3;
  4606. }
  4607. }
  4608. return totalLength < 2000 ? false : true;
  4609. },
  4610. _postSimulatie: function (type, url, params, options) {
  4611. var separator = url.indexOf('?') > -1 ? '&' : '?';
  4612. url += separator + '_method=' + type;
  4613. if (typeof params !== 'string') {
  4614. params = JSON.stringify(params);
  4615. }
  4616. return this.post(url, params, options);
  4617. },
  4618. _processUrl: function (url, options) {
  4619. if (this._isMVTRequest(url)) {
  4620. return url;
  4621. }
  4622. if (url.indexOf('.json') === -1 && !options.withoutFormatSuffix) {
  4623. if (url.indexOf('?') < 0) {
  4624. url += '.json';
  4625. } else {
  4626. var urlArrays = url.split('?');
  4627. if (urlArrays.length === 2) {
  4628. url = urlArrays[0] + '.json?' + urlArrays[1];
  4629. }
  4630. }
  4631. }
  4632. if (options && options.proxy) {
  4633. if (typeof options.proxy === 'function') {
  4634. url = options.proxy(url);
  4635. } else {
  4636. url = decodeURIComponent(url);
  4637. url = options.proxy + encodeURIComponent(url);
  4638. }
  4639. }
  4640. return url;
  4641. },
  4642. _fetch: function (url, params, options, type) {
  4643. options = options || {};
  4644. options.headers = options.headers || {};
  4645. if (!options.headers['Content-Type'] && !FormData.prototype.isPrototypeOf(params)) {
  4646. options.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
  4647. }
  4648. if (options.timeout) {
  4649. return this._timeout(
  4650. options.timeout,
  4651. FetchRequest_fetch(url, {
  4652. method: type,
  4653. headers: options.headers,
  4654. body: type === 'PUT' || type === 'POST' ? params : undefined,
  4655. credentials: this._getWithCredentials(options),
  4656. mode: 'cors',
  4657. timeout: getRequestTimeout()
  4658. }).then(function (response) {
  4659. return response;
  4660. })
  4661. );
  4662. }
  4663. return FetchRequest_fetch(url, {
  4664. method: type,
  4665. body: type === 'PUT' || type === 'POST' ? params : undefined,
  4666. headers: options.headers,
  4667. credentials: this._getWithCredentials(options),
  4668. mode: 'cors',
  4669. timeout: getRequestTimeout()
  4670. }).then(function (response) {
  4671. return response;
  4672. });
  4673. },
  4674. _getWithCredentials: function (options) {
  4675. if (options.withCredentials === true) {
  4676. return 'include';
  4677. }
  4678. if (options.withCredentials === false) {
  4679. return 'omit';
  4680. }
  4681. return 'same-origin';
  4682. },
  4683. _fetchJsonp: function (url, options) {
  4684. options = options || {};
  4685. return fetch_jsonp_default()(url, {
  4686. method: 'GET',
  4687. timeout: options.timeout
  4688. }).then(function (response) {
  4689. return response;
  4690. });
  4691. },
  4692. _timeout: function (seconds, promise) {
  4693. return new Promise(function (resolve, reject) {
  4694. setTimeout(function () {
  4695. reject(new Error('timeout'));
  4696. }, seconds);
  4697. promise.then(resolve, reject);
  4698. });
  4699. },
  4700. _getParameterString: function (params) {
  4701. var paramsArray = [];
  4702. for (var key in params) {
  4703. var value = params[key];
  4704. if (value != null && typeof value !== 'function') {
  4705. var encodedValue;
  4706. if (Array.isArray(value) || value.toString() === '[object Object]') {
  4707. encodedValue = encodeURIComponent(JSON.stringify(value));
  4708. } else {
  4709. encodedValue = encodeURIComponent(value);
  4710. }
  4711. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  4712. }
  4713. }
  4714. return paramsArray.join('&');
  4715. },
  4716. _isMVTRequest: function (url) {
  4717. return url.indexOf('.mvt') > -1 || url.indexOf('.pbf') > -1;
  4718. }
  4719. }
  4720. ;// CONCATENATED MODULE: ./src/common/commontypes/Credential.js
  4721. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  4722. * This program are made available under the terms of the Apache License, Version 2.0
  4723. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  4724. /**
  4725. * @class Credential
  4726. * @deprecatedclass SuperMap.Credential
  4727. * @category Security
  4728. * @classdesc SuperMap 的安全证书类,其中包括 token 等安全验证信息。</br>
  4729. * 需要使用用户名和密码在:"http://localhost:8090/iserver/services/security/tokens" 下申请 value。</br>
  4730. * 获得形如:"2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.." 的 value。</br>
  4731. * 目前支持的功能包括:地图服务、专题图、量算、查询、公交换乘、空间分析、网络分析,不支持轮询功能。</br>
  4732. * @param {string} value - 访问受安全限制的服务时用于通过安全认证的验证信息。
  4733. * @param {string} [name='token'] - 验证信息前缀,name=value 部分的 name 部分。
  4734. * @example
  4735. * var pixcel = new Credential("valueString","token");
  4736. * pixcel.destroy();
  4737. * @usage
  4738. */
  4739. class Credential {
  4740. constructor(value, name) {
  4741. /**
  4742. * @member {string} Credential.prototype.value
  4743. * @description 访问受安全限制的服务时用于通过安全认证的验证信息。
  4744. */
  4745. this.value = value ? value : "";
  4746. /**
  4747. * @member {string} [Credential.prototype.name='token']
  4748. * @description 验证信息前缀,name=value 部分的 name 部分。
  4749. */
  4750. this.name = name ? name : "token";
  4751. this.CLASS_NAME = "SuperMap.Credential";
  4752. }
  4753. /**
  4754. * @function Credential.prototype.getUrlParameters
  4755. * @description 获取 name=value 的表达式。
  4756. * @example
  4757. * var credential = new Credential("valueString","token");
  4758. * //这里 str = "token=valueString";
  4759. * var str = credential.getUrlParameters();
  4760. * @returns {string} 安全信息组成的 url 片段。
  4761. */
  4762. getUrlParameters() {
  4763. //当需要其他安全信息的时候,则需要return this.name + "=" + this.value + "&" + "...";的形式添加。
  4764. return this.name + "=" + this.value;
  4765. }
  4766. /**
  4767. * @function Credential.prototype.getValue
  4768. * @description 获取 value。
  4769. * @example
  4770. * var credential = new Credential("2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..","token");
  4771. * //这里 str = "2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..";
  4772. * var str = credential.getValue();
  4773. * @returns {string} value 字符串,在 iServer 服务下该 value 值即为 token 值。
  4774. */
  4775. getValue() {
  4776. return this.value;
  4777. }
  4778. /**
  4779. *
  4780. * @function Credential.prototype.destroy
  4781. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  4782. * @example
  4783. * var credential = new Credential("valueString","token");
  4784. * credential.destroy();
  4785. */
  4786. destroy() {
  4787. this.value = null;
  4788. this.name = null;
  4789. }
  4790. }
  4791. /**
  4792. * @member {Credential} Credential.CREDENTIAL
  4793. * @description 这个对象保存一个安全类的实例,在服务端需要安全验证的时候必须进行设置。
  4794. * @example
  4795. * 代码实例:
  4796. * // 当iServer启用服务安全的时候,下边的代码是必须的。安全证书类能够接收一个value和一个name参数。
  4797. * var value = "(以iServer为例,这里是申请的token值)";
  4798. * var name = "token";
  4799. * // 默认name参数为token,所以当使用iServer服务的时候可以不进行设置。
  4800. * Credential.CREDENTIAL = new Credential(value, name);
  4801. *
  4802. */
  4803. Credential.CREDENTIAL = null;
  4804. ;// CONCATENATED MODULE: ./src/common/security/SecurityManager.js
  4805. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  4806. * This program are made available under the terms of the Apache License, Version 2.0
  4807. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  4808. /**
  4809. * @class SecurityManager
  4810. * @deprecatedclass SuperMap.SecurityManager
  4811. * @category Security
  4812. * @classdesc 安全管理中心,提供 iServer,iPortal,Online 统一权限认证管理。
  4813. * > 使用说明:
  4814. * > 创建任何一个服务之前调用 {@link SecurityManager.registerToken}或
  4815. * > {@link SecurityManager.registerKey}注册凭据。
  4816. * > 发送请求时根据 URL 或者服务 ID 获取相应的 key 或者 token 并自动添加到服务地址中。
  4817. * @usage
  4818. */
  4819. class SecurityManager {
  4820. /**
  4821. * @description 从服务器获取一个token,在此之前要注册服务器信息。
  4822. * @function SecurityManager.generateToken
  4823. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  4824. * @param {TokenServiceParameter} tokenParam - token 申请参数。
  4825. * @returns {Promise} 包含 token 信息的 Promise 对象。
  4826. */
  4827. static generateToken(url, tokenParam) {
  4828. var serverInfo = this.servers[url];
  4829. if (!serverInfo) {
  4830. return;
  4831. }
  4832. return FetchRequest.post(serverInfo.tokenServiceUrl, JSON.stringify(tokenParam.toJSON())).then(function(
  4833. response
  4834. ) {
  4835. return response.text();
  4836. });
  4837. }
  4838. /**
  4839. * @description 注册安全服务器相关信息。
  4840. * @function SecurityManager.registerServers
  4841. * @param {ServerInfo} serverInfos - 服务器信息。
  4842. */
  4843. static registerServers(serverInfos) {
  4844. this.servers = this.servers || {};
  4845. if (!Util_Util.isArray(serverInfos)) {
  4846. serverInfos = [serverInfos];
  4847. }
  4848. for (var i = 0; i < serverInfos.length; i++) {
  4849. var serverInfo = serverInfos[i];
  4850. this.servers[serverInfo.server] = serverInfo;
  4851. }
  4852. }
  4853. /**
  4854. * @description 服务请求都会自动带上这个 token。
  4855. * @function SecurityManager.registerToken
  4856. * @param {string} url -服务器域名+端口:如http://localhost:8090。
  4857. * @param {string} token - token。
  4858. */
  4859. static registerToken(url, token) {
  4860. this.tokens = this.tokens || {};
  4861. if (!url || !token) {
  4862. return;
  4863. }
  4864. var domain = this._getTokenStorageKey(url);
  4865. this.tokens[domain] = token;
  4866. }
  4867. /**
  4868. * @description 注册 key,ids 为数组(存在一个 key 对应多个服务)。
  4869. * @function SecurityManager.registerKey
  4870. * @param {Array} ids - 可以是服务 ID 数组或者 URL 地址数组或者 webAPI 类型数组。
  4871. * @param {string} key - key。
  4872. */
  4873. static registerKey(ids, key) {
  4874. this.keys = this.keys || {};
  4875. if (!ids || ids.length < 1 || !key) {
  4876. return;
  4877. }
  4878. ids = Util_Util.isArray(ids) ? ids : [ids];
  4879. for (var i = 0; i < ids.length; i++) {
  4880. var id = this._getUrlRestString(ids[0]) || ids[0];
  4881. this.keys[id] = key;
  4882. }
  4883. }
  4884. /**
  4885. * @description 获取服务器信息。
  4886. * @function SecurityManager.getServerInfo
  4887. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  4888. * @returns {ServerInfo} 服务器信息。
  4889. */
  4890. static getServerInfo(url) {
  4891. this.servers = this.servers || {};
  4892. return this.servers[url];
  4893. }
  4894. /**
  4895. * @description 根据 URL 获取token。
  4896. * @function SecurityManager.getToken
  4897. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  4898. * @returns {string} token。
  4899. */
  4900. static getToken(url) {
  4901. if (!url) {
  4902. return;
  4903. }
  4904. this.tokens = this.tokens || {};
  4905. var domain = this._getTokenStorageKey(url);
  4906. return this.tokens[domain];
  4907. }
  4908. /**
  4909. * @description 根据 URL 获取 key。
  4910. * @function SecurityManager.getKey
  4911. * @param {string} id - ID。
  4912. * @returns {string} key。
  4913. */
  4914. static getKey(id) {
  4915. this.keys = this.keys || {};
  4916. var key = this._getUrlRestString(id) || id;
  4917. return this.keys[key];
  4918. }
  4919. /**
  4920. * @description iServer 登录验证。
  4921. * @function SecurityManager.loginiServer
  4922. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  4923. * @param {string} username - 用户名。
  4924. * @param {string} password - 密码。
  4925. * @param {boolean} [rememberme=false] - 是否记住。
  4926. * @returns {Promise} 包含 iServer 登录请求结果的 Promise 对象。
  4927. */
  4928. static loginiServer(url, username, password, rememberme) {
  4929. url = Util_Util.urlPathAppend(url, 'services/security/login');
  4930. var loginInfo = {
  4931. username: username && username.toString(),
  4932. password: password && password.toString(),
  4933. rememberme: rememberme
  4934. };
  4935. loginInfo = JSON.stringify(loginInfo);
  4936. var requestOptions = {
  4937. headers: {
  4938. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  4939. }
  4940. };
  4941. return FetchRequest.post(url, loginInfo, requestOptions).then(function(response) {
  4942. return response.json();
  4943. });
  4944. }
  4945. /**
  4946. * @description iServer登出。
  4947. * @function SecurityManager.logoutiServer
  4948. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  4949. * @returns {Promise} 是否登出成功。
  4950. */
  4951. static logoutiServer(url) {
  4952. url = Util_Util.urlPathAppend(url, 'services/security/logout');
  4953. var requestOptions = {
  4954. headers: {
  4955. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  4956. },
  4957. withoutFormatSuffix: true
  4958. };
  4959. return FetchRequest.get(url, '', requestOptions)
  4960. .then(function() {
  4961. return true;
  4962. })
  4963. .catch(function() {
  4964. return false;
  4965. });
  4966. }
  4967. /**
  4968. * @description Online 登录验证。
  4969. * @function SecurityManager.loginOnline
  4970. * @param {string} callbackLocation - 跳转位置。
  4971. * @param {boolean} [newTab=true] - 是否新窗口打开。
  4972. */
  4973. static loginOnline(callbackLocation, newTab) {
  4974. var loginUrl = SecurityManager.SSO + '/login?service=' + callbackLocation;
  4975. this._open(loginUrl, newTab);
  4976. }
  4977. /**
  4978. * @description iPortal登录验证。
  4979. * @function SecurityManager.loginiPortal
  4980. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  4981. * @param {string} username - 用户名。
  4982. * @param {string} password - 密码。
  4983. * @returns {Promise} 包含 iPortal 登录请求结果的 Promise 对象。
  4984. */
  4985. static loginiPortal(url, username, password) {
  4986. url = Util_Util.urlPathAppend(url, 'web/login');
  4987. var loginInfo = {
  4988. username: username && username.toString(),
  4989. password: password && password.toString()
  4990. };
  4991. loginInfo = JSON.stringify(loginInfo);
  4992. var requestOptions = {
  4993. headers: {
  4994. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  4995. },
  4996. withCredentials: true
  4997. };
  4998. return FetchRequest.post(url, loginInfo, requestOptions).then(function(response) {
  4999. return response.json();
  5000. });
  5001. }
  5002. /**
  5003. * @description iPortal 登出。
  5004. * @function SecurityManager.logoutiPortal
  5005. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  5006. * @returns {Promise} 如果登出成功,返回 true;否则返回 false。
  5007. */
  5008. static logoutiPortal(url) {
  5009. url = Util_Util.urlPathAppend(url, 'services/security/logout');
  5010. var requestOptions = {
  5011. headers: {
  5012. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  5013. },
  5014. withCredentials: true,
  5015. withoutFormatSuffix: true
  5016. };
  5017. return FetchRequest.get(url, '', requestOptions)
  5018. .then(function() {
  5019. return true;
  5020. })
  5021. .catch(function() {
  5022. return false;
  5023. });
  5024. }
  5025. /**
  5026. * @description iManager 登录验证。
  5027. * @function SecurityManager.loginManager
  5028. * @param {string} url - iManager 地址。地址参数为 iManager 首页地址,如: http://localhost:8390/imanager。
  5029. * @param {Object} [loginInfoParams] - iManager 登录参数。
  5030. * @param {string} loginInfoParams.userName - 用户名。
  5031. * @param {string} loginInfoParams.password - 密码。
  5032. * @param {Object} options
  5033. * @param {boolean} [options.isNewTab=true] - 不同域时是否在新窗口打开登录页面。
  5034. * @returns {Promise} 包含 iManager 登录请求结果的 Promise 对象。
  5035. */
  5036. static loginManager(url, loginInfoParams, options) {
  5037. if (!Util_Util.isInTheSameDomain(url)) {
  5038. var isNewTab = options ? options.isNewTab : true;
  5039. this._open(url, isNewTab);
  5040. return;
  5041. }
  5042. var requestUrl = Util_Util.urlPathAppend(url, 'icloud/security/tokens');
  5043. var params = loginInfoParams || {};
  5044. var loginInfo = {
  5045. username: params.userName && params.userName.toString(),
  5046. password: params.password && params.password.toString()
  5047. };
  5048. loginInfo = JSON.stringify(loginInfo);
  5049. var requestOptions = {
  5050. headers: {
  5051. Accept: '*/*',
  5052. 'Content-Type': 'application/json'
  5053. }
  5054. };
  5055. var me = this;
  5056. return FetchRequest.post(requestUrl, loginInfo, requestOptions).then(function(response) {
  5057. response.text().then(function(result) {
  5058. me.imanagerToken = result;
  5059. return result;
  5060. });
  5061. });
  5062. }
  5063. /**
  5064. * @description 清空全部验证信息。
  5065. * @function SecurityManager.destroyAllCredentials
  5066. */
  5067. static destroyAllCredentials() {
  5068. this.keys = null;
  5069. this.tokens = null;
  5070. this.servers = null;
  5071. }
  5072. /**
  5073. * @description 清空令牌信息。
  5074. * @function SecurityManager.destroyToken
  5075. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  5076. */
  5077. static destroyToken(url) {
  5078. if (!url) {
  5079. return;
  5080. }
  5081. var domain = this._getTokenStorageKey(url);
  5082. this.tokens = this.tokens || {};
  5083. if (this.tokens[domain]) {
  5084. delete this.tokens[domain];
  5085. }
  5086. }
  5087. /**
  5088. * @description 清空服务授权码。
  5089. * @function SecurityManager.destroyKey
  5090. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  5091. */
  5092. static destroyKey(url) {
  5093. if (!url) {
  5094. return;
  5095. }
  5096. this.keys = this.keys || {};
  5097. var key = this._getUrlRestString(url) || url;
  5098. if (this.keys[key]) {
  5099. delete this.keys[key];
  5100. }
  5101. }
  5102. /**
  5103. * @description 服务URL追加授权信息,授权信息需先通过SecurityManager.registerKey或SecurityManager.registerToken注册。
  5104. * @version 10.1.2
  5105. * @function SecurityManager.appendCredential
  5106. * @param {string} url - 服务URL。
  5107. * @returns {string} 绑定了token或者key的服务URL。
  5108. */
  5109. static appendCredential(url) {
  5110. var newUrl = url;
  5111. var value = this.getToken(url);
  5112. var credential = value ? new Credential(value, 'token') : null;
  5113. if (!credential) {
  5114. value = this.getKey(url);
  5115. credential = value ? new Credential(value, 'key') : null;
  5116. }
  5117. if (credential) {
  5118. newUrl = Util_Util.urlAppend(newUrl, credential.getUrlParameters());
  5119. }
  5120. return newUrl;
  5121. }
  5122. static _open(url, newTab) {
  5123. newTab = newTab != null ? newTab : true;
  5124. var offsetX = window.screen.availWidth / 2 - this.INNER_WINDOW_WIDTH / 2;
  5125. var offsetY = window.screen.availHeight / 2 - this.INNER_WINDOW_HEIGHT / 2;
  5126. var options =
  5127. 'height=' +
  5128. this.INNER_WINDOW_HEIGHT +
  5129. ', width=' +
  5130. this.INNER_WINDOW_WIDTH +
  5131. ',top=' +
  5132. offsetY +
  5133. ', left=' +
  5134. offsetX +
  5135. ',toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no';
  5136. if (newTab) {
  5137. window.open(url, 'login');
  5138. } else {
  5139. window.open(url, 'login', options);
  5140. }
  5141. }
  5142. static _getTokenStorageKey(url) {
  5143. var patten = /(.*?):\/\/([^\/]+)/i;
  5144. var result = url.match(patten);
  5145. if (!result) {
  5146. return url;
  5147. }
  5148. return result[0];
  5149. }
  5150. static _getUrlRestString(url) {
  5151. if (!url) {
  5152. return url;
  5153. }
  5154. // var patten = /http:\/\/(.*\/rest)/i;
  5155. var patten = /(http|https):\/\/(.*\/rest)/i;
  5156. var result = url.match(patten);
  5157. if (!result) {
  5158. return url;
  5159. }
  5160. return result[0];
  5161. }
  5162. }
  5163. SecurityManager.INNER_WINDOW_WIDTH = 600;
  5164. SecurityManager.INNER_WINDOW_HEIGHT = 600;
  5165. SecurityManager.SSO = 'https://sso.supermap.com';
  5166. SecurityManager.ONLINE = 'https://www.supermapol.com';
  5167. ;// CONCATENATED MODULE: ./src/common/REST.js
  5168. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  5169. * This program are made available under the terms of the Apache License, Version 2.0
  5170. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5171. /**
  5172. * @enum DataFormat
  5173. * @description 服务请求返回结果数据类型
  5174. * @category BaseTypes Constant
  5175. * @type {string}
  5176. * @usage
  5177. * ```
  5178. * // 浏览器
  5179. * <script type="text/javascript" src="{cdn}"></script>
  5180. * <script>
  5181. * const result = {namespace}.DataFormat.GEOJSON;
  5182. *
  5183. * </script>
  5184. * // ES6 Import
  5185. * import { DataFormat } from '{npm}';
  5186. *
  5187. * const result = DataFormat.GEOJSON;
  5188. * ```
  5189. */
  5190. var DataFormat = {
  5191. /** GEOJSON */
  5192. GEOJSON: "GEOJSON",
  5193. /** ISERVER */
  5194. ISERVER: "ISERVER",
  5195. /** FGB */
  5196. FGB: "FGB"
  5197. };
  5198. /**
  5199. * @enum ServerType
  5200. * @description 服务器类型
  5201. * @category BaseTypes Constant
  5202. * @type {string}
  5203. * @usage
  5204. * ```
  5205. * // 浏览器
  5206. * <script type="text/javascript" src="{cdn}"></script>
  5207. * <script>
  5208. * const result = {namespace}.ServerType.ISERVER;
  5209. *
  5210. * </script>
  5211. * // ES6 Import
  5212. * import { ServerType } from '{npm}';
  5213. *
  5214. * const result = ServerType.ISERVER;
  5215. * ```
  5216. */
  5217. var ServerType = {
  5218. /** ISERVER */
  5219. ISERVER: "ISERVER",
  5220. /** IPORTAL */
  5221. IPORTAL: "IPORTAL",
  5222. /** ONLINE */
  5223. ONLINE: "ONLINE"
  5224. };
  5225. /**
  5226. * @enum GeometryType
  5227. * @description 几何对象枚举,定义了一系列几何对象类型。
  5228. * @category BaseTypes Constant
  5229. * @type {string}
  5230. * @usage
  5231. * ```
  5232. * // 浏览器
  5233. * <script type="text/javascript" src="{cdn}"></script>
  5234. * <script>
  5235. * const result = {namespace}.GeometryType.LINE;
  5236. *
  5237. * </script>
  5238. * // ES6 Import
  5239. * import { GeometryType } from '{npm}';
  5240. *
  5241. * const result = GeometryType.LINE;
  5242. * ```
  5243. */
  5244. var GeometryType = {
  5245. /** 线几何对象类型。 */
  5246. LINE: "LINE",
  5247. /** 路由对象。 */
  5248. LINEM: "LINEM",
  5249. /** 点几何对象类型。 */
  5250. POINT: "POINT",
  5251. /** 面几何对象类型。 */
  5252. REGION: "REGION",
  5253. /** EPS点几何对象。 */
  5254. POINTEPS: "POINTEPS",
  5255. /** EPS线几何对象。 */
  5256. LINEEPS: "LINEEPS",
  5257. /** EPS面几何对象。 */
  5258. REGIONEPS: "REGIONEPS",
  5259. /** 椭圆。 */
  5260. ELLIPSE: "ELLIPSE",
  5261. /** 圆。 */
  5262. CIRCLE: "CIRCLE",
  5263. /** 文本几何对象类型。 */
  5264. TEXT: "TEXT",
  5265. /** 矩形。 */
  5266. RECTANGLE: "RECTANGLE",
  5267. /** 未定义。 */
  5268. UNKNOWN: "UNKNOWN",
  5269. /** 复合几何对象类型。 */
  5270. GEOCOMPOUND:"GEOCOMPOUND"
  5271. };
  5272. /**
  5273. * @enum QueryOption
  5274. * @description 查询结果类型枚举,描述查询结果返回类型,包括只返回属性、只返回几何实体以及返回属性和几何实体。
  5275. * @category BaseTypes Constant
  5276. * @type {string}
  5277. * @usage
  5278. * ```
  5279. * // 浏览器
  5280. * <script type="text/javascript" src="{cdn}"></script>
  5281. * <script>
  5282. * const result = {namespace}.QueryOption.ATTRIBUTE;
  5283. *
  5284. * </script>
  5285. * // ES6 Import
  5286. * import { QueryOption } from '{npm}';
  5287. *
  5288. * const result = QueryOption.ATTRIBUTE;
  5289. * ```
  5290. */
  5291. var QueryOption = {
  5292. /** 属性。 */
  5293. ATTRIBUTE: "ATTRIBUTE",
  5294. /** 属性和几何对象。 */
  5295. ATTRIBUTEANDGEOMETRY: "ATTRIBUTEANDGEOMETRY",
  5296. /** 几何对象。 */
  5297. GEOMETRY: "GEOMETRY"
  5298. };
  5299. /**
  5300. * @enum JoinType
  5301. * @description 关联查询时的关联类型常量。
  5302. * 该类定义了两个表之间的连接类型常量,决定了对两个表之间进行连接查询时,查询结果中得到的记录的情况。
  5303. * @category BaseTypes Constant
  5304. * @type {string}
  5305. * @usage
  5306. * ```
  5307. * // 浏览器
  5308. * <script type="text/javascript" src="{cdn}"></script>
  5309. * <script>
  5310. * const result = {namespace}.JoinType.INNERJOIN;
  5311. *
  5312. * </script>
  5313. * // ES6 Import
  5314. * import { JoinType } from '{npm}';
  5315. *
  5316. * const result = JoinType.INNERJOIN;
  5317. * ```
  5318. */
  5319. var JoinType = {
  5320. /** 内连接。 */
  5321. INNERJOIN: "INNERJOIN",
  5322. /** 左连接。 */
  5323. LEFTJOIN: "LEFTJOIN"
  5324. };
  5325. /**
  5326. * @enum SpatialQueryMode
  5327. * @description 空间查询模式枚举。该类定义了空间查询操作模式常量。
  5328. * @category BaseTypes Constant
  5329. * @type {string}
  5330. * @usage
  5331. * ```
  5332. * // 浏览器
  5333. * <script type="text/javascript" src="{cdn}"></script>
  5334. * <script>
  5335. * const result = {namespace}.SpatialQueryMode.CONTAIN;
  5336. *
  5337. * </script>
  5338. * // ES6 Import
  5339. * import { SpatialQueryMode } from '{npm}';
  5340. *
  5341. * const result = SpatialQueryMode.CONTAIN;
  5342. * ```
  5343. */
  5344. var SpatialQueryMode = {
  5345. /** 包含空间查询模式。 */
  5346. CONTAIN: "CONTAIN",
  5347. /** 交叉空间查询模式。 */
  5348. CROSS: "CROSS",
  5349. /** 分离空间查询模式。 */
  5350. DISJOINT: "DISJOINT",
  5351. /** 重合空间查询模式。 */
  5352. IDENTITY: "IDENTITY",
  5353. /** 相交空间查询模式。 */
  5354. INTERSECT: "INTERSECT",
  5355. /** 无空间查询。 */
  5356. NONE: "NONE",
  5357. /** 叠加空间查询模式。 */
  5358. OVERLAP: "OVERLAP",
  5359. /** 邻接空间查询模式。 */
  5360. TOUCH: "TOUCH",
  5361. /** 被包含空间查询模式。 */
  5362. WITHIN: "WITHIN"
  5363. };
  5364. /**
  5365. * @enum SpatialRelationType
  5366. * @description 数据集对象间的空间关系枚举。
  5367. * 该类定义了数据集对象间的空间关系类型常量。
  5368. * @category BaseTypes Constant
  5369. * @type {string}
  5370. * @usage
  5371. * ```
  5372. * // 浏览器
  5373. * <script type="text/javascript" src="{cdn}"></script>
  5374. * <script>
  5375. * const result = {namespace}.SpatialRelationType.CONTAIN;
  5376. *
  5377. * </script>
  5378. * // ES6 Import
  5379. * import { SpatialRelationType } from '{npm}';
  5380. *
  5381. * const result = {namespace}.SpatialRelationType.CONTAIN;
  5382. * ```
  5383. */
  5384. var SpatialRelationType = {
  5385. /** 包含关系。 */
  5386. CONTAIN: "CONTAIN",
  5387. /** 相交关系。 */
  5388. INTERSECT: "INTERSECT",
  5389. /** 被包含关系。 */
  5390. WITHIN: "WITHIN"
  5391. };
  5392. /**
  5393. * @enum MeasureMode
  5394. * @type {string}
  5395. * @description 量算模式枚举。
  5396. * @category BaseTypes Constant
  5397. * 该类定义了两种测量模式:距离测量和面积测量。
  5398. * @usage
  5399. * ```
  5400. * // 浏览器
  5401. * <script type="text/javascript" src="{cdn}"></script>
  5402. * <script>
  5403. * const result = {namespace}.MeasureMode.DISTANCE;
  5404. *
  5405. * </script>
  5406. * // ES6 Import
  5407. * import { MeasureMode } from '{npm}';
  5408. *
  5409. * const result = MeasureMode.DISTANCE;
  5410. * ```
  5411. */
  5412. var MeasureMode = {
  5413. /** 距离测量。 */
  5414. DISTANCE: "DISTANCE",
  5415. /** 面积测量。 */
  5416. AREA: "AREA"
  5417. };
  5418. /**
  5419. * @enum Unit
  5420. * @description 距离单位枚举。
  5421. * 该类定义了一系列距离单位类型。
  5422. * @category BaseTypes Constant
  5423. * @type {string}
  5424. * @usage
  5425. * ```
  5426. * // 浏览器
  5427. * <script type="text/javascript" src="{cdn}"></script>
  5428. * <script>
  5429. * const result = {namespace}.Unit.METER;
  5430. *
  5431. * </script>
  5432. * // ES6 Import
  5433. * import { Unit } from '{npm}';
  5434. *
  5435. * const result = Unit.METER;
  5436. * ```
  5437. */
  5438. var Unit = {
  5439. /** 米。 */
  5440. METER: "METER",
  5441. /** 千米。 */
  5442. KILOMETER: "KILOMETER",
  5443. /** 英里。 */
  5444. MILE: "MILE",
  5445. /** 码。 */
  5446. YARD: "YARD",
  5447. /** 度。 */
  5448. DEGREE: "DEGREE",
  5449. /** 毫米。 */
  5450. MILLIMETER: "MILLIMETER",
  5451. /** 厘米。 */
  5452. CENTIMETER: "CENTIMETER",
  5453. /** 英寸。 */
  5454. INCH: "INCH",
  5455. /** 分米。 */
  5456. DECIMETER: "DECIMETER",
  5457. /** 英尺。 */
  5458. FOOT: "FOOT",
  5459. /** 秒。 */
  5460. SECOND: "SECOND",
  5461. /** 分。 */
  5462. MINUTE: "MINUTE",
  5463. /** 弧度。 */
  5464. RADIAN: "RADIAN"
  5465. };
  5466. /**
  5467. * @enum BufferRadiusUnit
  5468. * @description 缓冲区距离单位枚举。该类定义了一系列缓冲距离单位类型。
  5469. * @category BaseTypes Constant
  5470. * @type {string}
  5471. * @usage
  5472. * ```
  5473. * // 浏览器
  5474. * <script type="text/javascript" src="{cdn}"></script>
  5475. * <script>
  5476. * const result = {namespace}.BufferRadiusUnit.CENTIMETER;
  5477. *
  5478. * </script>
  5479. * // ES6 Import
  5480. * import { BufferRadiusUnit } from '{npm}';
  5481. *
  5482. * const result = BufferRadiusUnit.CENTIMETER;
  5483. * ```
  5484. */
  5485. var BufferRadiusUnit = {
  5486. /** 厘米。 */
  5487. CENTIMETER: "CENTIMETER",
  5488. /** 分米。 */
  5489. DECIMETER: "DECIMETER",
  5490. /** 英尺。 */
  5491. FOOT: "FOOT",
  5492. /** 英寸。 */
  5493. INCH: "INCH",
  5494. /** 千米。 */
  5495. KILOMETER: "KILOMETER",
  5496. /** 米。 */
  5497. METER: "METER",
  5498. /** 英里。 */
  5499. MILE: "MILE",
  5500. /** 毫米。 */
  5501. MILLIMETER: "MILLIMETER",
  5502. /** 码。 */
  5503. YARD: "YARD"
  5504. }
  5505. /**
  5506. * @enum EngineType
  5507. * @description 数据源引擎类型枚举。
  5508. * @category BaseTypes Constant
  5509. * @type {string}
  5510. * @usage
  5511. * ```
  5512. * // 浏览器
  5513. * <script type="text/javascript" src="{cdn}"></script>
  5514. * <script>
  5515. * const result = {namespace}.EngineType.IMAGEPLUGINS;
  5516. *
  5517. * </script>
  5518. * // ES6 Import
  5519. * import { EngineType } from '{npm}';
  5520. *
  5521. * const result = EngineType.IMAGEPLUGINS;
  5522. * ```
  5523. */
  5524. var EngineType = {
  5525. /** 影像只读引擎类型,文件引擎,针对通用影像格式如 BMP,JPG,TIFF 以及超图自定义影像格式 SIT 等。 */
  5526. IMAGEPLUGINS: "IMAGEPLUGINS",
  5527. /** OGC 引擎类型,针对于 Web 数据源,Web 引擎,目前支持的类型有 WMS,WFS,WCS。 */
  5528. OGC: "OGC",
  5529. /** Oracle 引擎类型,针对 Oracle 数据源,数据库引擎。 */
  5530. ORACLEPLUS: "ORACLEPLUS",
  5531. /** SDB 引擎类型,文件引擎,即 SDB 数据源。 */
  5532. SDBPLUS: "SDBPLUS",
  5533. /** SQL Server 引擎类型,针对 SQL Server 数据源,数据库引擎。 */
  5534. SQLPLUS: "SQLPLUS",
  5535. /** UDB 引擎类型,文件引擎。 */
  5536. UDB: "UDB"
  5537. };
  5538. /**
  5539. * @enum ThemeGraphTextFormat
  5540. * @description 统计专题图文本显示格式枚举。
  5541. * @category BaseTypes Constant
  5542. * @type {string}
  5543. * @usage
  5544. * ```
  5545. * // 浏览器
  5546. * <script type="text/javascript" src="{cdn}"></script>
  5547. * <script>
  5548. * const result = {namespace}.ThemeGraphTextFormat.CAPTION;
  5549. *
  5550. * </script>
  5551. * // ES6 Import
  5552. * import { ThemeGraphTextFormat } from '{npm}';
  5553. *
  5554. * const result = ThemeGraphTextFormat.CAPTION;
  5555. * ```
  5556. */
  5557. var ThemeGraphTextFormat = {
  5558. /** 标题。以各子项的标题来进行标注。 */
  5559. CAPTION: "CAPTION",
  5560. /** 标题 + 百分数。以各子项的标题和所占的百分比来进行标注。 */
  5561. CAPTION_PERCENT: "CAPTION_PERCENT",
  5562. /** 标题 + 实际数值。以各子项的标题和真实数值来进行标注。 */
  5563. CAPTION_VALUE: "CAPTION_VALUE",
  5564. /** 百分数。以各子项所占的百分比来进行标注。 */
  5565. PERCENT: "PERCENT",
  5566. /** 实际数值。以各子项的真实数值来进行标注。 */
  5567. VALUE: "VALUE"
  5568. };
  5569. /**
  5570. * @enum ThemeGraphType
  5571. * @description 统计专题图类型枚举。
  5572. * @category BaseTypes Constant
  5573. * @type {string}
  5574. * @usage
  5575. * ```
  5576. * // 浏览器
  5577. * <script type="text/javascript" src="{cdn}"></script>
  5578. * <script>
  5579. * const result = {namespace}.ThemeGraphType.AREA;
  5580. *
  5581. * </script>
  5582. * // ES6 Import
  5583. * import { ThemeGraphType } from '{npm}';
  5584. *
  5585. * const result = ThemeGraphType.AREA;
  5586. * ```
  5587. */
  5588. var ThemeGraphType = {
  5589. /** 面积图。 */
  5590. AREA: "AREA",
  5591. /** 柱状图。 */
  5592. BAR: "BAR",
  5593. /** 三维柱状图。 */
  5594. BAR3D: "BAR3D",
  5595. /** 折线图。 */
  5596. LINE: "LINE",
  5597. /** 饼图。 */
  5598. PIE: "PIE",
  5599. /** 三维饼图。 */
  5600. PIE3D: "PIE3D",
  5601. /** 点状图。 */
  5602. POINT: "POINT",
  5603. /** 环状图。 */
  5604. RING: "RING",
  5605. /** 玫瑰图。 */
  5606. ROSE: "ROSE",
  5607. /** 三维玫瑰图。 */
  5608. ROSE3D: "ROSE3D",
  5609. /** 堆叠柱状图。 */
  5610. STACK_BAR: "STACK_BAR",
  5611. /** 三维堆叠柱状图。 */
  5612. STACK_BAR3D: "STACK_BAR3D",
  5613. /** 阶梯图。 */
  5614. STEP: "STEP"
  5615. };
  5616. /**
  5617. * @enum GraphAxesTextDisplayMode
  5618. * @description 统计专题图坐标轴文本显示模式。
  5619. * @category BaseTypes Constant
  5620. * @type {string}
  5621. * @usage
  5622. * ```
  5623. * // 浏览器
  5624. * <script type="text/javascript" src="{cdn}"></script>
  5625. * <script>
  5626. * const result = {namespace}.GraphAxesTextDisplayMode.ALL;
  5627. *
  5628. * </script>
  5629. * // ES6 Import
  5630. * import { GraphAxesTextDisplayMode } from '{npm}';
  5631. *
  5632. * const result = GraphAxesTextDisplayMode.ALL;
  5633. * ```
  5634. */
  5635. var GraphAxesTextDisplayMode = {
  5636. /** 显示全部文本。 */
  5637. ALL: "ALL",
  5638. /** 不显示。 */
  5639. NONE: "NONE",
  5640. /** 显示Y轴的文本。 */
  5641. YAXES: "YAXES"
  5642. };
  5643. /**
  5644. * @enum GraduatedMode
  5645. * @description 专题图分级模式枚举。
  5646. * @category BaseTypes Constant
  5647. * @type {string}
  5648. * @usage
  5649. * ```
  5650. * // 浏览器
  5651. * <script type="text/javascript" src="{cdn}"></script>
  5652. * <script>
  5653. * const result = {namespace}.GraduatedMode.CONSTANT;
  5654. *
  5655. * </script>
  5656. * // ES6 Import
  5657. * import { GraduatedMode } from '{npm}';
  5658. *
  5659. * const result = GraduatedMode.CONSTANT;
  5660. * ```
  5661. */
  5662. var GraduatedMode = {
  5663. /** 常量分级模式。 */
  5664. CONSTANT: "CONSTANT",
  5665. /** 对数分级模式。 */
  5666. LOGARITHM: "LOGARITHM",
  5667. /** 平方根分级模式。 */
  5668. SQUAREROOT: "SQUAREROOT"
  5669. };
  5670. /**
  5671. * @enum RangeMode
  5672. * @description 范围分段专题图分段方式枚举。
  5673. * @category BaseTypes Constant
  5674. * @type {string}
  5675. * @usage
  5676. * ```
  5677. * // 浏览器
  5678. * <script type="text/javascript" src="{cdn}"></script>
  5679. * <script>
  5680. * const result = {namespace}.RangeMode.CUSTOMINTERVAL;
  5681. *
  5682. * </script>
  5683. * // ES6 Import
  5684. * import { RangeMode } from '{npm}';
  5685. *
  5686. * const result = RangeMode.CUSTOMINTERVAL;
  5687. * ```
  5688. */
  5689. var RangeMode = {
  5690. /** 自定义分段法。 */
  5691. CUSTOMINTERVAL: "CUSTOMINTERVAL",
  5692. /** 等距离分段法。 */
  5693. EQUALINTERVAL: "EQUALINTERVAL",
  5694. /** 对数分段法。 */
  5695. LOGARITHM: "LOGARITHM",
  5696. /** 等计数分段法。 */
  5697. QUANTILE: "QUANTILE",
  5698. /** 平方根分段法。 */
  5699. SQUAREROOT: "SQUAREROOT",
  5700. /** 标准差分段法。 */
  5701. STDDEVIATION: "STDDEVIATION"
  5702. };
  5703. /**
  5704. * @enum ThemeType
  5705. * @description 专题图类型枚举。
  5706. * @category BaseTypes Constant
  5707. * @type {string}
  5708. * @usage
  5709. * ```
  5710. * // 浏览器
  5711. * <script type="text/javascript" src="{cdn}"></script>
  5712. * <script>
  5713. * const result = {namespace}.ThemeType.DOTDENSITY;
  5714. *
  5715. * </script>
  5716. * // ES6 Import
  5717. * import { ThemeType } from '{npm}';
  5718. *
  5719. * const result = ThemeType.DOTDENSITY;
  5720. * ```
  5721. */
  5722. var ThemeType = {
  5723. /** 点密度专题图。 */
  5724. DOTDENSITY: "DOTDENSITY",
  5725. /** 等级符号专题图。 */
  5726. GRADUATEDSYMBOL: "GRADUATEDSYMBOL",
  5727. /** 统计专题图。 */
  5728. GRAPH: "GRAPH",
  5729. /** 标签专题图。 */
  5730. LABEL: "LABEL",
  5731. /** 分段专题图。 */
  5732. RANGE: "RANGE",
  5733. /** 単值专题图。 */
  5734. UNIQUE: "UNIQUE"
  5735. };
  5736. /**
  5737. * @enum ColorGradientType
  5738. * @description 渐变颜色枚举。
  5739. * @category BaseTypes Constant
  5740. * @type {string}
  5741. * @usage
  5742. * ```
  5743. * // 浏览器
  5744. * <script type="text/javascript" src="{cdn}"></script>
  5745. * <script>
  5746. * const result = {namespace}.ColorGradientType.BLACK_WHITE;
  5747. *
  5748. * </script>
  5749. * // ES6 Import
  5750. * import { ColorGradientType } from '{npm}';
  5751. *
  5752. * const result = ColorGradientType.BLACK_WHITE;
  5753. * ```
  5754. */
  5755. var ColorGradientType = {
  5756. /** 黑白渐变色。 */
  5757. BLACK_WHITE: "BLACKWHITE",
  5758. /** 蓝黑渐变色。 */
  5759. BLUE_BLACK: "BLUEBLACK",
  5760. /** 蓝红渐变色。 */
  5761. BLUE_RED: "BLUERED",
  5762. /** 蓝白渐变色。 */
  5763. BLUE_WHITE: "BLUEWHITE",
  5764. /** 青黑渐变色。 */
  5765. CYAN_BLACK: "CYANBLACK",
  5766. /** 青蓝渐变色。 */
  5767. CYAN_BLUE: "CYANBLUE",
  5768. /** 青绿渐变色。 */
  5769. CYAN_GREEN: "CYANGREEN",
  5770. /** 青白渐变色。 */
  5771. CYAN_WHITE: "CYANWHITE",
  5772. /** 绿黑渐变色。 */
  5773. GREEN_BLACK: "GREENBLACK",
  5774. /** 绿蓝渐变色。 */
  5775. GREEN_BLUE: "GREENBLUE",
  5776. /** 绿橙紫渐变色。 */
  5777. GREEN_ORANGE_VIOLET: "GREENORANGEVIOLET",
  5778. /** 绿红渐变色。 */
  5779. GREEN_RED: "GREENRED",
  5780. /** 蓝红渐变色。 */
  5781. GREEN_WHITE: "GREENWHITE",
  5782. /** 粉黑渐变色。 */
  5783. PINK_BLACK: "PINKBLACK",
  5784. /** 粉蓝渐变色。 */
  5785. PINK_BLUE: "PINKBLUE",
  5786. /** 粉红渐变色。 */
  5787. PINK_RED: "PINKRED",
  5788. /** 粉白渐变色。 */
  5789. PINK_WHITE: "PINKWHITE",
  5790. /** 彩虹色。 */
  5791. RAIN_BOW: "RAINBOW",
  5792. /** 红黑渐变色。 */
  5793. RED_BLACK: "REDBLACK",
  5794. /** 红白渐变色。 */
  5795. RED_WHITE: "REDWHITE",
  5796. /** 光谱渐变。 */
  5797. SPECTRUM: "SPECTRUM",
  5798. /** 地形渐变,用于三维显示效果较好。 */
  5799. TERRAIN: "TERRAIN",
  5800. /** 黄黑渐变色。 */
  5801. YELLOW_BLACK: "YELLOWBLACK",
  5802. /** 黄蓝渐变色。 */
  5803. YELLOW_BLUE: "YELLOWBLUE",
  5804. /** 黄绿渐变色。 */
  5805. YELLOW_GREEN: "YELLOWGREEN",
  5806. /** 黄红渐变色。 */
  5807. YELLOW_RED: "YELLOWRED",
  5808. /** 黄白渐变色。 */
  5809. YELLOW_WHITE: "YELLOWWHITE"
  5810. };
  5811. /**
  5812. * @enum TextAlignment
  5813. * @description 文本对齐枚举。
  5814. * @category BaseTypes Constant
  5815. * @type {string}
  5816. * @usage
  5817. * ```
  5818. * // 浏览器
  5819. * <script type="text/javascript" src="{cdn}"></script>
  5820. * <script>
  5821. * const result = {namespace}.TextAlignment.TOPLEFT;
  5822. *
  5823. * </script>
  5824. * // ES6 Import
  5825. * import { TextAlignment } from '{npm}';
  5826. *
  5827. * const result = TextAlignment.TOPLEFT;
  5828. * ```
  5829. */
  5830. var TextAlignment = {
  5831. /** 左上角对齐。 */
  5832. TOPLEFT: "TOPLEFT",
  5833. /** 顶部居中对齐。 */
  5834. TOPCENTER: "TOPCENTER",
  5835. /** 右上角对齐。 */
  5836. TOPRIGHT: "TOPRIGHT",
  5837. /** 基准线左对齐。 */
  5838. BASELINELEFT: "BASELINELEFT",
  5839. /** 基准线居中对齐。 */
  5840. BASELINECENTER: "BASELINECENTER",
  5841. /** 基准线右对齐。 */
  5842. BASELINERIGHT: "BASELINERIGHT",
  5843. /** 左下角对齐。 */
  5844. BOTTOMLEFT: "BOTTOMLEFT",
  5845. /** 底部居中对齐。 */
  5846. BOTTOMCENTER: "BOTTOMCENTER",
  5847. /** 右下角对齐。 */
  5848. BOTTOMRIGHT: "BOTTOMRIGHT",
  5849. /** 左中对齐。 */
  5850. MIDDLELEFT: "MIDDLELEFT",
  5851. /** 中心对齐。 */
  5852. MIDDLECENTER: "MIDDLECENTER",
  5853. /** 右中对齐。 */
  5854. MIDDLERIGHT: "MIDDLERIGHT"
  5855. };
  5856. /**
  5857. * @enum FillGradientMode
  5858. * @description 渐变填充风格的渐变类型枚举。
  5859. * @category BaseTypes Constant
  5860. * @type {string}
  5861. * @usage
  5862. * ```
  5863. * // 浏览器
  5864. * <script type="text/javascript" src="{cdn}"></script>
  5865. * <script>
  5866. * const result = {namespace}.FillGradientMode.NONE;
  5867. *
  5868. * </script>
  5869. * // ES6 Import
  5870. * import { FillGradientMode } from '{npm}';
  5871. *
  5872. * const result = FillGradientMode.NONE;
  5873. * ```
  5874. */
  5875. var FillGradientMode = {
  5876. /** 无渐变。 */
  5877. NONE: "NONE",
  5878. /** 线性渐变填充。 */
  5879. LINEAR: "LINEAR",
  5880. /** 辐射渐变填充。 */
  5881. RADIAL: "RADIAL",
  5882. /** 圆锥渐变填充。 */
  5883. CONICAL: "CONICAL",
  5884. /** 四角渐变填充。 */
  5885. SQUARE: "SQUARE"
  5886. };
  5887. /**
  5888. * @enum AlongLineDirection
  5889. * @description 标签沿线标注方向枚举。
  5890. * @category BaseTypes Constant
  5891. * @type {string}
  5892. * @usage
  5893. * ```
  5894. * // 浏览器
  5895. * <script type="text/javascript" src="{cdn}"></script>
  5896. * <script>
  5897. * const result = {namespace}.AlongLineDirection.NORMAL;
  5898. *
  5899. * </script>
  5900. * // ES6 Import
  5901. * import { AlongLineDirection } from '{npm}';
  5902. *
  5903. * const result = AlongLineDirection.NORMAL;
  5904. * ```
  5905. */
  5906. var AlongLineDirection = {
  5907. /** 沿线的法线方向放置标签。 */
  5908. NORMAL: "ALONG_LINE_NORMAL",
  5909. /** 从下到上,从左到右放置。 */
  5910. LB_TO_RT: "LEFT_BOTTOM_TO_RIGHT_TOP",
  5911. /** 从上到下,从左到右放置。 */
  5912. LT_TO_RB: "LEFT_TOP_TO_RIGHT_BOTTOM",
  5913. /** 从下到上,从右到左放置。 */
  5914. RB_TO_LT: "RIGHT_BOTTOM_TO_LEFT_TOP",
  5915. /** 从上到下,从右到左放置。 */
  5916. RT_TO_LB: "RIGHT_TOP_TO_LEFT_BOTTOM"
  5917. };
  5918. /**
  5919. * @enum LabelBackShape
  5920. * @description 标签专题图中标签背景的形状枚举。
  5921. * @category BaseTypes Constant
  5922. * @type {string}
  5923. * @usage
  5924. * ```
  5925. * // 浏览器
  5926. * <script type="text/javascript" src="{cdn}"></script>
  5927. * <script>
  5928. * const result = {namespace}.LabelBackShape.DIAMOND;
  5929. *
  5930. * </script>
  5931. * // ES6 Import
  5932. * import { LabelBackShape } from '{npm}';
  5933. *
  5934. * const result = LabelBackShape.DIAMOND;
  5935. * ```
  5936. */
  5937. var LabelBackShape = {
  5938. /** 菱形背景,即标签背景的形状为菱形。 */
  5939. DIAMOND: "DIAMOND",
  5940. /** 椭圆形背景,即标签背景的行状为椭圆形。 */
  5941. ELLIPSE: "ELLIPSE",
  5942. /** 符号背景,即标签背景的形状为设定的符号。 */
  5943. MARKER: "MARKER",
  5944. /** 空背景,即不使用任何形状作为标签的背景。 */
  5945. NONE: "NONE",
  5946. /** 矩形背景,即标签背景的形状为矩形。 */
  5947. RECT: "RECT",
  5948. /** 圆角矩形背景,即标签背景的形状为圆角矩形。 */
  5949. ROUNDRECT: "ROUNDRECT",
  5950. /** 三角形背景,即标签背景的形状为三角形。 */
  5951. TRIANGLE: "TRIANGLE"
  5952. };
  5953. /**
  5954. * @enum LabelOverLengthMode
  5955. * @description 标签专题图中超长标签的处理模式枚举。
  5956. * @category BaseTypes Constant
  5957. * @type {string}
  5958. * @usage
  5959. * ```
  5960. * // 浏览器
  5961. * <script type="text/javascript" src="{cdn}"></script>
  5962. * <script>
  5963. * const result = {namespace}.LabelOverLengthMode.NEWLINE;
  5964. *
  5965. * </script>
  5966. * // ES6 Import
  5967. * import { LabelOverLengthMode } from '{npm}';
  5968. *
  5969. * const result = LabelOverLengthMode.NEWLINE;
  5970. * ```
  5971. */
  5972. var LabelOverLengthMode = {
  5973. /** 换行显示。 */
  5974. NEWLINE: "NEWLINE",
  5975. /** 对超长标签不进行处理。 */
  5976. NONE: "NONE",
  5977. /** 省略超出部分。 */
  5978. OMIT: "OMIT"
  5979. };
  5980. /**
  5981. * @enum DirectionType
  5982. * @description 网络分析中方向枚举。
  5983. * 在行驶引导子项中使用。
  5984. * @category BaseTypes Constant
  5985. * @type {string}
  5986. * @usage
  5987. * ```
  5988. * // 浏览器
  5989. * <script type="text/javascript" src="{cdn}"></script>
  5990. * <script>
  5991. * const result = {namespace}.DirectionType.EAST;
  5992. *
  5993. * </script>
  5994. * // ES6 Import
  5995. * import { DirectionType } from '{npm}';
  5996. *
  5997. * const result = DirectionType.EAST;
  5998. * ```
  5999. */
  6000. var DirectionType = {
  6001. /** 东。 */
  6002. EAST: "EAST",
  6003. /** 无方向。 */
  6004. NONE: "NONE",
  6005. /** 北。 */
  6006. NORTH: "NORTH",
  6007. /** 南。 */
  6008. SOURTH: "SOURTH",
  6009. /** 西。 */
  6010. WEST: "WEST"
  6011. };
  6012. /**
  6013. * @enum SideType
  6014. * @description 行驶位置枚举。
  6015. * 表示在行驶在路的左边、右边或者路上的枚举,该类用在行驶导引子项类中。
  6016. * @category BaseTypes Constant
  6017. * @type {string}
  6018. * @usage
  6019. * ```
  6020. * // 浏览器
  6021. * <script type="text/javascript" src="{cdn}"></script>
  6022. * <script>
  6023. * const result = {namespace}.SideType.LEFT;
  6024. *
  6025. * </script>
  6026. * // ES6 Import
  6027. * import { SideType } from '{npm}';
  6028. *
  6029. * const result = SideType.LEFT;
  6030. * ```
  6031. */
  6032. var SideType = {
  6033. /** 路的左侧。 */
  6034. LEFT: "LEFT",
  6035. /** 在路上(即路的中间)。 */
  6036. MIDDLE: "MIDDLE",
  6037. /** 无效值。 */
  6038. NONE: "NONE",
  6039. /** 路的右侧。 */
  6040. RIGHT: "RIGHT"
  6041. };
  6042. /**
  6043. * @enum SupplyCenterType
  6044. * @description 资源供给中心类型枚举。
  6045. * 该枚举定义了网络分析中资源中心点的类型,主要用于资源分配和选址分区。
  6046. * 资源供给中心点的类型包括非中心,固定中心和可选中心。固定中心用于资源分配分析;固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  6047. * @category BaseTypes Constant
  6048. * @type {string}
  6049. * @usage
  6050. * ```
  6051. * // 浏览器
  6052. * <script type="text/javascript" src="{cdn}"></script>
  6053. * <script>
  6054. * const result = {namespace}.SupplyCenterType.FIXEDCENTER;
  6055. *
  6056. * </script>
  6057. * // ES6 Import
  6058. * import { SupplyCenterType } from '{npm}';
  6059. *
  6060. * const result = SupplyCenterType.FIXEDCENTER;
  6061. * ```
  6062. */
  6063. var SupplyCenterType = {
  6064. /** 固定中心点。 */
  6065. FIXEDCENTER: "FIXEDCENTER",
  6066. /** 非中心点。 */
  6067. NULL: "NULL",
  6068. /** 可选中心点。 */
  6069. OPTIONALCENTER: "OPTIONALCENTER"
  6070. };
  6071. /**
  6072. * @enum TurnType
  6073. * @description 转弯方向枚举。
  6074. * 用在行驶引导子项类中,表示转弯的方向。
  6075. * @category BaseTypes Constant
  6076. * @type {string}
  6077. * @usage
  6078. * ```
  6079. * // 浏览器
  6080. * <script type="text/javascript" src="{cdn}"></script>
  6081. * <script>
  6082. * const result = {namespace}.TurnType.AHEAD;
  6083. *
  6084. * </script>
  6085. * // ES6 Import
  6086. * import { TurnType } from '{npm}';
  6087. *
  6088. * const result = TurnType.AHEAD;
  6089. * ```
  6090. */
  6091. var TurnType = {
  6092. /** 向前直行。 */
  6093. AHEAD: "AHEAD",
  6094. /** 掉头。 */
  6095. BACK: "BACK",
  6096. /** 终点,不拐弯。 */
  6097. END: "END",
  6098. /** 左转弯。 */
  6099. LEFT: "LEFT",
  6100. /** 无效值。 */
  6101. NONE: "NONE",
  6102. /** 右转弯。 */
  6103. RIGHT: "RIGHT"
  6104. };
  6105. /**
  6106. * @enum BufferEndType
  6107. * @description 缓冲区分析BufferEnd类型。
  6108. * @category BaseTypes Constant
  6109. * @type {string}
  6110. * @usage
  6111. * ```
  6112. * // 浏览器
  6113. * <script type="text/javascript" src="{cdn}"></script>
  6114. * <script>
  6115. * const result = {namespace}.BufferEndType.FLAT;
  6116. *
  6117. * </script>
  6118. * // ES6 Import
  6119. * import { BufferEndType } from '{npm}';
  6120. *
  6121. * const result = BufferEndType.FLAT;
  6122. * ```
  6123. */
  6124. var BufferEndType = {
  6125. /** 平头缓冲。 */
  6126. FLAT: "FLAT",
  6127. /** 圆头缓冲。 */
  6128. ROUND: "ROUND"
  6129. };
  6130. /**
  6131. * @enum OverlayOperationType
  6132. * @description 叠加分析类型枚举。
  6133. * @category BaseTypes Constant
  6134. * @type {string}
  6135. * @usage
  6136. * ```
  6137. * // 浏览器
  6138. * <script type="text/javascript" src="{cdn}"></script>
  6139. * <script>
  6140. * const result = {namespace}.OverlayOperationType.CLIP;
  6141. *
  6142. * </script>
  6143. * // ES6 Import
  6144. * import { OverlayOperationType } from '{npm}';
  6145. *
  6146. * const result = OverlayOperationType.CLIP;
  6147. * ```
  6148. */
  6149. var OverlayOperationType = {
  6150. /** 操作数据集(几何对象)裁剪被操作数据集(几何对象)。 */
  6151. CLIP: "CLIP",
  6152. /** 在被操作数据集(几何对象)上擦除掉与操作数据集(几何对象)相重合的部分。 */
  6153. ERASE: "ERASE",
  6154. /**对被操作数据集(几何对象)进行同一操作,即操作执行后,被操作数据集(几何对象)包含来自操作数据集(几何对象)的几何形状。 */
  6155. IDENTITY: "IDENTITY",
  6156. /** 对两个数据集(几何对象)求交,返回两个数据集(几何对象)的交集。 */
  6157. INTERSECT: "INTERSECT",
  6158. /** 对两个面数据集(几何对象)进行合并操作。 */
  6159. UNION: "UNION",
  6160. /** 对两个面数据集(几何对象)进行更新操作。 */
  6161. UPDATE: "UPDATE",
  6162. /** 对两个面数据集(几何对象)进行对称差操作。 */
  6163. XOR: "XOR"
  6164. };
  6165. /**
  6166. * @enum OutputType
  6167. * @description 分布式分析输出类型枚举。
  6168. * @category BaseTypes Constant
  6169. * @type {string}
  6170. * @usage
  6171. * ```
  6172. * // 浏览器
  6173. * <script type="text/javascript" src="{cdn}"></script>
  6174. * <script>
  6175. * const result = {namespace}.OutputType.INDEXEDHDFS;
  6176. *
  6177. * </script>
  6178. * // ES6 Import
  6179. * import { OutputType } from '{npm}';
  6180. *
  6181. * const result = OutputType.INDEXEDHDFS;
  6182. * ```
  6183. */
  6184. var OutputType = {
  6185. /** INDEXEDHDFS */
  6186. INDEXEDHDFS: "INDEXEDHDFS",
  6187. /** UDB */
  6188. UDB: "UDB",
  6189. /** MONGODB */
  6190. MONGODB: "MONGODB",
  6191. /** PG */
  6192. PG: "PG"
  6193. };
  6194. /**
  6195. * @enum SmoothMethod
  6196. * @description 光滑方法枚举。
  6197. * 用于从Grid 或DEM数据生成等值线或等值面时对等值线或者等值面的边界线进行平滑处理的方法。
  6198. * @category BaseTypes Constant
  6199. * @type {string}
  6200. * @usage
  6201. * ```
  6202. * // 浏览器
  6203. * <script type="text/javascript" src="{cdn}"></script>
  6204. * <script>
  6205. * const result = {namespace}.SmoothMethod.BSPLINE;
  6206. *
  6207. * </script>
  6208. * // ES6 Import
  6209. * import { SmoothMethod } from '{npm}';
  6210. *
  6211. * const result = SmoothMethod.BSPLINE;
  6212. * ```
  6213. */
  6214. var SmoothMethod = {
  6215. /** B 样条法。 */
  6216. BSPLINE: "BSPLINE",
  6217. /** 磨角法。 */
  6218. POLISH: "POLISH"
  6219. };
  6220. /**
  6221. * @enum SurfaceAnalystMethod
  6222. * @description 表面分析方法枚举。
  6223. * 通过对数据进行表面分析,能够挖掘原始数据所包含的信息,使某些细节明显化,易于分析。
  6224. * @category BaseTypes Constant
  6225. * @type {string}
  6226. * @usage
  6227. * ```
  6228. * // 浏览器
  6229. * <script type="text/javascript" src="{cdn}"></script>
  6230. * <script>
  6231. * const result = {namespace}.SurfaceAnalystMethod.ISOLINE;
  6232. *
  6233. * </script>
  6234. * // ES6 Import
  6235. * import { SurfaceAnalystMethod } from '{npm}';
  6236. *
  6237. * const result = SurfaceAnalystMethod.ISOLINE;
  6238. * ```
  6239. */
  6240. var SurfaceAnalystMethod = {
  6241. /** 等值线提取。 */
  6242. ISOLINE: "ISOLINE",
  6243. /** 等值面提取。 */
  6244. ISOREGION: "ISOREGION"
  6245. };
  6246. /**
  6247. * @enum DataReturnMode
  6248. * @description 数据返回模式枚举。
  6249. * 该枚举用于指定空间分析返回结果模式,包含返回数据集标识和记录集、只返回数据集标识(数据集名称@数据源名称)及只返回记录集三种模式。
  6250. * @category BaseTypes Constant
  6251. * @type {string}
  6252. * @usage
  6253. * ```
  6254. * // 浏览器
  6255. * <script type="text/javascript" src="{cdn}"></script>
  6256. * <script>
  6257. * const result = {namespace}.DataReturnMode.DATASET_AND_RECORDSET;
  6258. *
  6259. * </script>
  6260. * // ES6 Import
  6261. * import { DataReturnMode } from '{npm}';
  6262. *
  6263. * const result = DataReturnMode.DATASET_AND_RECORDSET;
  6264. * ```
  6265. */
  6266. var DataReturnMode = {
  6267. /** 返回结果数据集标识(数据集名称@数据源名称)和记录集(RecordSet)。 */
  6268. DATASET_AND_RECORDSET: "DATASET_AND_RECORDSET",
  6269. /** 只返回数据集标识(数据集名称@数据源名称)。 */
  6270. DATASET_ONLY: "DATASET_ONLY",
  6271. /** 只返回记录集(RecordSet)。 */
  6272. RECORDSET_ONLY: "RECORDSET_ONLY"
  6273. };
  6274. /**
  6275. * @enum EditType
  6276. * @description 要素集更新模式枚举。
  6277. * 该枚举用于指定数据服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  6278. * @category BaseTypes Constant
  6279. * @type {string}
  6280. * @usage
  6281. * ```
  6282. * // 浏览器
  6283. * <script type="text/javascript" src="{cdn}"></script>
  6284. * <script>
  6285. * const result = {namespace}.EditType.ADD;
  6286. *
  6287. * </script>
  6288. * // ES6 Import
  6289. * import { EditType } from '{npm}';
  6290. *
  6291. * const result = {namespace}.EditType.ADD;
  6292. * ```
  6293. */
  6294. var EditType = {
  6295. /** 增加操作。 */
  6296. ADD: "add",
  6297. /** 修改操作。 */
  6298. UPDATE: "update",
  6299. /** 删除操作。 */
  6300. DELETE: "delete"
  6301. };
  6302. /**
  6303. * @enum TransferTactic
  6304. * @description 公交换乘策略枚举。
  6305. * 该枚举用于指定公交服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  6306. * @category BaseTypes Constant
  6307. * @type {string}
  6308. * @usage
  6309. * ```
  6310. * // 浏览器
  6311. * <script type="text/javascript" src="{cdn}"></script>
  6312. * <script>
  6313. * const result = {namespace}.TransferTactic.LESS_TIME;
  6314. *
  6315. * </script>
  6316. * // ES6 Import
  6317. * import { TransferTactic } from '{npm}';
  6318. *
  6319. * const result = TransferTactic.LESS_TIME;
  6320. * ```
  6321. */
  6322. var TransferTactic = {
  6323. /** 时间短。 */
  6324. LESS_TIME: "LESS_TIME",
  6325. /** 少换乘。 */
  6326. LESS_TRANSFER: "LESS_TRANSFER",
  6327. /** 少步行。 */
  6328. LESS_WALK: "LESS_WALK",
  6329. /** 距离最短。 */
  6330. MIN_DISTANCE: "MIN_DISTANCE"
  6331. };
  6332. /**
  6333. * @enum TransferPreference
  6334. * @description 公交换乘策略枚举。
  6335. * 该枚举用于指定交通换乘服务中设置地铁优先、公交优先、不乘地铁、无偏好等偏好设置。
  6336. * @category BaseTypes Constant
  6337. * @type {string}
  6338. * @usage
  6339. * ```
  6340. * // 浏览器
  6341. * <script type="text/javascript" src="{cdn}"></script>
  6342. * <script>
  6343. * const result = {namespace}.TransferPreference.BUS;
  6344. *
  6345. * </script>
  6346. * // ES6 Import
  6347. * import { TransferPreference } from '{npm}';
  6348. *
  6349. * const result = TransferPreference.BUS;
  6350. * ```
  6351. */
  6352. var TransferPreference = {
  6353. /** 公交汽车优先。 */
  6354. BUS: "BUS",
  6355. /** 地铁优先。 */
  6356. SUBWAY: "SUBWAY",
  6357. /** 不乘坐地铁。 */
  6358. NO_SUBWAY: "NO_SUBWAY",
  6359. /** 无乘车偏好。 */
  6360. NONE: "NONE"
  6361. };
  6362. /**
  6363. * @enum GridType
  6364. * @description 地图背景格网类型枚举。
  6365. * @category BaseTypes Constant
  6366. * @type {string}
  6367. * @usage
  6368. * ```
  6369. * // 浏览器
  6370. * <script type="text/javascript" src="{cdn}"></script>
  6371. * <script>
  6372. * const result = {namespace}.GridType.CROSS;
  6373. *
  6374. * </script>
  6375. * // ES6 Import
  6376. * import { GridType } from '{npm}';
  6377. *
  6378. * const result = GridType.CROSS;
  6379. * ```
  6380. */
  6381. var GridType = {
  6382. /** 十字叉丝。 */
  6383. CROSS: "CROSS",
  6384. /** 网格线。 */
  6385. GRID: "GRID",
  6386. /** 点。 */
  6387. POINT: "POINT"
  6388. };
  6389. /**
  6390. * @enum ColorSpaceType
  6391. * @description 色彩空间枚举。
  6392. * 由于成色原理的不同,决定了显示器、投影仪这类靠色光直接合成颜色的颜色设备和打印机、
  6393. * 印刷机这类靠使用颜料的印刷设备在生成颜色方式上的区别。
  6394. * 针对上述不同成色方式,SuperMap 提供两种色彩空间,
  6395. * 分别为 RGB 和 CMYK。RGB 主要用于显示系统中,CMYK 主要用于印刷系统中。
  6396. * @category BaseTypes Constant
  6397. * @type {string}
  6398. * @usage
  6399. * ```
  6400. * // 浏览器
  6401. * <script type="text/javascript" src="{cdn}"></script>
  6402. * <script>
  6403. * const result = {namespace}.ColorSpaceType.CMYK;
  6404. *
  6405. * </script>
  6406. * // ES6 Import
  6407. * import { ColorSpaceType } from '{npm}';
  6408. *
  6409. * const result = ColorSpaceType.CMYK;
  6410. * ```
  6411. */
  6412. var ColorSpaceType = {
  6413. /** 该类型主要在印刷系统使用。 */
  6414. CMYK: "CMYK",
  6415. /** 该类型主要在显示系统中使用。 */
  6416. RGB: "RGB"
  6417. };
  6418. /**
  6419. * @enum LayerType
  6420. * @description 图层类型。
  6421. * @category BaseTypes Constant
  6422. * @type {string}
  6423. * @usage
  6424. * ```
  6425. * // 浏览器
  6426. * <script type="text/javascript" src="{cdn}"></script>
  6427. * <script>
  6428. * const result = {namespace}.LayerType.UGC;
  6429. *
  6430. * </script>
  6431. * // ES6 Import
  6432. * import { LayerType } from '{npm}';
  6433. *
  6434. * const result = LayerType.UGC;
  6435. * ```
  6436. */
  6437. var LayerType = {
  6438. /** SuperMap UGC 类型图层。如矢量图层、栅格(Grid)图层、影像图层。 */
  6439. UGC: "UGC",
  6440. /** WMS 图层。 */
  6441. WMS: "WMS",
  6442. /** WFS 图层。 */
  6443. WFS: "WFS",
  6444. /** 自定义图层。 */
  6445. CUSTOM: "CUSTOM"
  6446. };
  6447. /**
  6448. * @enum UGCLayerType
  6449. * @description SuperMap 图层类型。
  6450. * @category BaseTypes Constant
  6451. * @type {string}
  6452. * @usage
  6453. * ```
  6454. * // 浏览器
  6455. * <script type="text/javascript" src="{cdn}"></script>
  6456. * <script>
  6457. * const result = {namespace}.UGCLayerType.THEME;
  6458. *
  6459. * </script>
  6460. * // ES6 Import
  6461. * import { UGCLayerType } from '{npm}';
  6462. *
  6463. * const result = UGCLayerType.THEME;
  6464. * ```
  6465. */
  6466. var UGCLayerType = {
  6467. /** 专题图层。 */
  6468. THEME: "THEME",
  6469. /** 矢量图层。 */
  6470. VECTOR: "VECTOR",
  6471. /** 栅格图层。 */
  6472. GRID: "GRID",
  6473. /** 影像图层。 */
  6474. IMAGE: "IMAGE"
  6475. };
  6476. /**
  6477. * @enum StatisticMode
  6478. * @description 字段统计方法类型。
  6479. * @category BaseTypes Constant
  6480. * @type {string}
  6481. * @usage
  6482. * ```
  6483. * // 浏览器
  6484. * <script type="text/javascript" src="{cdn}"></script>
  6485. * <script>
  6486. * const result = {namespace}.StatisticMode.AVERAGE;
  6487. *
  6488. * </script>
  6489. * // ES6 Import
  6490. * import { StatisticMode } from '{npm}';
  6491. *
  6492. * const result = StatisticMode.AVERAGE;
  6493. * ```
  6494. */
  6495. var StatisticMode = {
  6496. /** 统计所选字段的平均值。 */
  6497. AVERAGE: "AVERAGE",
  6498. /** 统计所选字段的最大值。 */
  6499. MAX: "MAX",
  6500. /** 统计所选字段的最小值。 */
  6501. MIN: "MIN",
  6502. /** 统计所选字段的标准差 */
  6503. STDDEVIATION: "STDDEVIATION",
  6504. /** 统计所选字段的总和。 */
  6505. SUM: "SUM",
  6506. /** 统计所选字段的方差。 */
  6507. VARIANCE: "VARIANCE"
  6508. };
  6509. /**
  6510. * @enum PixelFormat
  6511. * @description 栅格与影像数据存储的像素格式枚举。
  6512. * @category BaseTypes Constant
  6513. * @type {string}
  6514. * @usage
  6515. * ```
  6516. * // 浏览器
  6517. * <script type="text/javascript" src="{cdn}"></script>
  6518. * <script>
  6519. * const result = {namespace}.PixelFormat.BIT16;
  6520. *
  6521. * </script>
  6522. * // ES6 Import
  6523. * import { PixelFormat } from '{npm}';
  6524. *
  6525. * const result = PixelFormat.BIT16;
  6526. * ```
  6527. */
  6528. var PixelFormat = {
  6529. /** 每个像元用16个比特(即2个字节)表示。 */
  6530. BIT16: "BIT16",
  6531. /** 每个像元用32个比特(即4个字节)表示。 */
  6532. BIT32: "BIT32",
  6533. /** 每个像元用64个比特(即8个字节)表示,只提供给栅格数据集使用。 */
  6534. BIT64: "BIT64",
  6535. /** 每个像元用4个字节来表示,只提供给栅格数据集使用。 */
  6536. SINGLE: "SINGLE",
  6537. /** 每个像元用8个字节来表示,只提供给栅格数据集使用。 */
  6538. DOUBLE: "DOUBLE",
  6539. /** 每个像元用1个比特表示。 */
  6540. UBIT1: "UBIT1",
  6541. /** 每个像元用4个比特来表示。 */
  6542. UBIT4: "UBIT4",
  6543. /** 每个像元用8个比特(即1个字节)来表示。 */
  6544. UBIT8: "UBIT8",
  6545. /** 每个像元用24个比特(即3个字节)来表示。 */
  6546. UBIT24: "UBIT24",
  6547. /** 每个像元用32个比特(即4个字节)来表示。 */
  6548. UBIT32: "UBIT32"
  6549. };
  6550. /**
  6551. * @enum SearchMode
  6552. * @description 内插时使用的样本点的查找方式枚举。
  6553. * @category BaseTypes Constant
  6554. * @type {string}
  6555. * @usage
  6556. * ```
  6557. * // 浏览器
  6558. * <script type="text/javascript" src="{cdn}"></script>
  6559. * <script>
  6560. * const result = {namespace}.SearchMode.KDTREE_FIXED_COUNT;
  6561. *
  6562. * </script>
  6563. * // ES6 Import
  6564. * import { SearchMode } from '{npm}';
  6565. *
  6566. * const result = SearchMode.KDTREE_FIXED_COUNT;
  6567. * ```
  6568. */
  6569. var SearchMode = {
  6570. /** 使用 KDTREE 的固定点数方式查找参与内插分析的点。 */
  6571. KDTREE_FIXED_COUNT: "KDTREE_FIXED_COUNT",
  6572. /** 使用 KDTREE 的定长方式查找参与内插分析的点。 */
  6573. KDTREE_FIXED_RADIUS: "KDTREE_FIXED_RADIUS",
  6574. /** 不进行查找,使用所有的输入点进行内插分析。 */
  6575. NONE: "NONE",
  6576. /** 使用 QUADTREE 方式查找参与内插分析的点,仅对样条(RBF)插值和普通克吕金(Kriging)有用。 */
  6577. QUADTREE: "QUADTREE"
  6578. };
  6579. /**
  6580. * @enum InterpolationAlgorithmType
  6581. * @description 插值分析的算法的类型。
  6582. * @category BaseTypes Constant
  6583. * @type {string}
  6584. * @usage
  6585. * ```
  6586. * // 浏览器
  6587. * <script type="text/javascript" src="{cdn}"></script>
  6588. * <script>
  6589. * const result = {namespace}.InterpolationAlgorithmType.KRIGING;
  6590. *
  6591. * </script>
  6592. * // ES6 Import
  6593. * import { InterpolationAlgorithmType } from '{npm}';
  6594. *
  6595. * const result = InterpolationAlgorithmType.KRIGING;
  6596. * ```
  6597. */
  6598. var InterpolationAlgorithmType = {
  6599. /** 普通克吕金插值法。 */
  6600. KRIGING: "KRIGING",
  6601. /** 简单克吕金插值法。 */
  6602. SimpleKriging: "SimpleKriging",
  6603. /** 泛克吕金插值法。 */
  6604. UniversalKriging: "UniversalKriging"
  6605. };
  6606. /**
  6607. * @enum VariogramMode
  6608. * @description 克吕金(Kriging)插值时的半变函数类型枚举。
  6609. * @category BaseTypes Constant
  6610. * @type {string}
  6611. * @usage
  6612. * ```
  6613. * // 浏览器
  6614. * <script type="text/javascript" src="{cdn}"></script>
  6615. * <script>
  6616. * const result = {namespace}.VariogramMode.EXPONENTIAL;
  6617. *
  6618. * </script>
  6619. * // ES6 Import
  6620. * import { VariogramMode } from '{npm}';
  6621. *
  6622. * const result = VariogramMode.EXPONENTIAL;
  6623. * ```
  6624. */
  6625. var VariogramMode = {
  6626. /** 指数函数。 */
  6627. EXPONENTIAL: "EXPONENTIAL",
  6628. /** 高斯函数。 */
  6629. GAUSSIAN: "GAUSSIAN",
  6630. /** 球型函数。 */
  6631. SPHERICAL: "SPHERICAL"
  6632. };
  6633. /**
  6634. * @enum Exponent
  6635. * @description 定义了泛克吕金(UniversalKriging)插值时样点数据中趋势面方程的阶数。
  6636. * @category BaseTypes Constant
  6637. * @type {string}
  6638. * @usage
  6639. * ```
  6640. * // 浏览器
  6641. * <script type="text/javascript" src="{cdn}"></script>
  6642. * <script>
  6643. * const result = {namespace}.Exponent.EXP1;
  6644. *
  6645. * </script>
  6646. * // ES6 Import
  6647. * import { Exponent } from '{npm}';
  6648. *
  6649. * const result = Exponent.EXP1;
  6650. * ```
  6651. */
  6652. var Exponent = {
  6653. /** 阶数为1。 */
  6654. EXP1: "EXP1",
  6655. /** 阶数为2。 */
  6656. EXP2: "EXP2"
  6657. };
  6658. /**
  6659. * @enum ClientType
  6660. * @description token申请的客户端标识类型。
  6661. * @category BaseTypes Constant
  6662. * @type {string}
  6663. * @usage
  6664. * ```
  6665. * // 浏览器
  6666. * <script type="text/javascript" src="{cdn}"></script>
  6667. * <script>
  6668. * const result = {namespace}.ClientType.IP;
  6669. *
  6670. * </script>
  6671. * // ES6 Import
  6672. * import { ClientType } from '{npm}';
  6673. *
  6674. * const result = ClientType.IP;
  6675. * ```
  6676. */
  6677. var ClientType = {
  6678. /** 指定的 IP 地址。 */
  6679. IP: "IP",
  6680. /** 指定的 URL。 */
  6681. REFERER: "Referer",
  6682. /** 发送申请令牌请求的客户端 IP。 */
  6683. REQUESTIP: "RequestIP",
  6684. /** 不做任何验证。 */
  6685. NONE: "NONE",
  6686. /** SERVER。 */
  6687. SERVER: "SERVER",
  6688. /** WEB。 */
  6689. WEB: "WEB"
  6690. };
  6691. /**
  6692. * @enum ChartType
  6693. * @description 客户端专题图图表类型。
  6694. * @category BaseTypes Constant
  6695. * @type {string}
  6696. * @usage
  6697. * ```
  6698. * // 浏览器
  6699. * <script type="text/javascript" src="{cdn}"></script>
  6700. * <script>
  6701. * const result = {namespace}.ChartType.BAR;
  6702. *
  6703. * </script>
  6704. * // ES6 Import
  6705. * import { ChartType } from '{npm}';
  6706. *
  6707. * const result = ChartType.BAR;
  6708. * ```
  6709. */
  6710. var ChartType = {
  6711. /** 柱状图。 */
  6712. BAR: "Bar",
  6713. /** 三维柱状图。 */
  6714. BAR3D: "Bar3D",
  6715. /** 圆形图。 */
  6716. CIRCLE: "Circle",
  6717. /** 饼图。 */
  6718. PIE: "Pie",
  6719. /** 散点图。 */
  6720. POINT: "Point",
  6721. /** 折线图。 */
  6722. LINE: "Line",
  6723. /** 环状图。 */
  6724. RING: "Ring"
  6725. };
  6726. /**
  6727. * @enum ClipAnalystMode
  6728. * @description 裁剪分析模式
  6729. * @category BaseTypes Constant
  6730. * @type {string}
  6731. * @usage
  6732. * ```
  6733. * // 浏览器
  6734. * <script type="text/javascript" src="{cdn}"></script>
  6735. * <script>
  6736. * const result = {namespace}.ClipAnalystMode.CLIP;
  6737. *
  6738. * </script>
  6739. * // ES6 Import
  6740. * import { ClipAnalystMode } from '{npm}';
  6741. *
  6742. * const result = ClipAnalystMode.CLIP;
  6743. * ```
  6744. */
  6745. var ClipAnalystMode = {
  6746. /** CLIP。 */
  6747. CLIP: "clip",
  6748. /** INTERSECT。 */
  6749. INTERSECT: "intersect"
  6750. };
  6751. /**
  6752. * @enum AnalystAreaUnit
  6753. * @description 分布式分析面积单位。
  6754. * @category BaseTypes Constant
  6755. * @type {string}
  6756. * @usage
  6757. * ```
  6758. * // 浏览器
  6759. * <script type="text/javascript" src="{cdn}"></script>
  6760. * <script>
  6761. * const result = {namespace}.AnalystAreaUnit.SQUAREMETER;
  6762. *
  6763. * </script>
  6764. * // ES6 Import
  6765. * import { AnalystAreaUnit } from '{npm}';
  6766. *
  6767. * const result = AnalystAreaUnit.SQUAREMETER;
  6768. * ```
  6769. */
  6770. var AnalystAreaUnit = {
  6771. /** 平方米。 */
  6772. "SQUAREMETER": "SquareMeter",
  6773. /** 平方千米。 */
  6774. "SQUAREKILOMETER": "SquareKiloMeter",
  6775. /** 公顷。 */
  6776. "HECTARE": "Hectare",
  6777. /** 公亩。 */
  6778. "ARE": "Are",
  6779. /** 英亩。 */
  6780. "ACRE": "Acre",
  6781. /** 平方英尺。 */
  6782. "SQUAREFOOT": "SquareFoot",
  6783. /** 平方码。 */
  6784. "SQUAREYARD": "SquareYard",
  6785. /** 平方英里。 */
  6786. "SQUAREMILE": "SquareMile"
  6787. };
  6788. /**
  6789. * @enum AnalystSizeUnit
  6790. * @description 分布式分析单位。
  6791. * @category BaseTypes Constant
  6792. * @type {string}
  6793. * @usage
  6794. * ```
  6795. * // 浏览器
  6796. * <script type="text/javascript" src="{cdn}"></script>
  6797. * <script>
  6798. * const result = {namespace}.AnalystSizeUnit.METER;
  6799. *
  6800. * </script>
  6801. * // ES6 Import
  6802. * import { AnalystSizeUnit } from '{npm}';
  6803. *
  6804. * const result = AnalystSizeUnit.METER;
  6805. * ```
  6806. */
  6807. var AnalystSizeUnit = {
  6808. /** 米。 */
  6809. "METER": "Meter",
  6810. /** 千米。 */
  6811. "KILOMETER": "Kilometer",
  6812. /** 码。 */
  6813. "YARD": "Yard",
  6814. /** 英尺。 */
  6815. "FOOT": "Foot",
  6816. /** 英里。 */
  6817. "MILE": "Mile"
  6818. };
  6819. /**
  6820. * @enum StatisticAnalystMode
  6821. * @description 分布式分析统计模式。
  6822. * @category BaseTypes Constant
  6823. * @type {string}
  6824. * @usage
  6825. * ```
  6826. * // 浏览器
  6827. * <script type="text/javascript" src="{cdn}"></script>
  6828. * <script>
  6829. * const result = {namespace}.StatisticAnalystMode.MAX;
  6830. *
  6831. * </script>
  6832. * // ES6 Import
  6833. * import { StatisticAnalystMode } from '{npm}';
  6834. *
  6835. * const result = StatisticAnalystMode.MAX;
  6836. * ```
  6837. */
  6838. var StatisticAnalystMode = {
  6839. /** 统计所选字段的最大值。 */
  6840. "MAX": "max",
  6841. /** 统计所选字段的最小值。 */
  6842. "MIN": "min",
  6843. /** 统计所选字段的平均值。 */
  6844. "AVERAGE": "average",
  6845. /** 统计所选字段的总和。 */
  6846. "SUM": "sum",
  6847. /** 统计所选字段的方差。 */
  6848. "VARIANCE": "variance",
  6849. /** 统计所选字段的标准差。 */
  6850. "STDDEVIATION": "stdDeviation"
  6851. };
  6852. /**
  6853. * @enum SummaryType
  6854. * @description 分布式分析聚合类型。
  6855. * @category BaseTypes Constant
  6856. * @type {string}
  6857. * @usage
  6858. * ```
  6859. * // 浏览器
  6860. * <script type="text/javascript" src="{cdn}"></script>
  6861. * <script>
  6862. * const result = {namespace}.SummaryType.SUMMARYMESH;
  6863. *
  6864. * </script>
  6865. * // ES6 Import
  6866. * import { SummaryType } from '{npm}';
  6867. *
  6868. * const result = SummaryType.SUMMARYMESH;
  6869. * ```
  6870. */
  6871. var SummaryType = {
  6872. /** 格网聚合。 */
  6873. "SUMMARYMESH": "SUMMARYMESH",
  6874. /** 多边形聚合。 */
  6875. "SUMMARYREGION": "SUMMARYREGION"
  6876. };
  6877. /**
  6878. * @enum TopologyValidatorRule
  6879. * @description 拓扑检查模式枚举。该类定义了拓扑检查操作模式常量。
  6880. * @category BaseTypes Constant
  6881. * @type {string}
  6882. * @usage
  6883. * ```
  6884. * // 浏览器
  6885. * <script type="text/javascript" src="{cdn}"></script>
  6886. * <script>
  6887. * const result = {namespace}.TopologyValidatorRule.REGIONNOOVERLAP;
  6888. *
  6889. * </script>
  6890. * // ES6 Import
  6891. * import { TopologyValidatorRule } from '{npm}';
  6892. *
  6893. * const result = TopologyValidatorRule.REGIONNOOVERLAP;
  6894. * ```
  6895. */
  6896. var TopologyValidatorRule = {
  6897. /** 面内无重叠,用于对面数据进行拓扑检查。 */
  6898. REGIONNOOVERLAP: "REGIONNOOVERLAP",
  6899. /** 面与面无重叠,用于对面数据进行拓扑检查。 */
  6900. REGIONNOOVERLAPWITH: "REGIONNOOVERLAPWITH",
  6901. /** 面被面包含,用于对面数据进行拓扑检查。 */
  6902. REGIONCONTAINEDBYREGION: "REGIONCONTAINEDBYREGION",
  6903. /** 面被面覆盖,用于对面数据进行拓扑检查。 */
  6904. REGIONCOVEREDBYREGION: "REGIONCOVEREDBYREGION",
  6905. /** 线与线无重叠,用于对线数据进行拓扑检查。 */
  6906. LINENOOVERLAP: "LINENOOVERLAP",
  6907. /** 线内无重叠,用于对线数据进行拓扑检查。 */
  6908. LINENOOVERLAPWITH: "LINENOOVERLAPWITH",
  6909. /** 点不相同,用于对点数据进行拓扑检查。 */
  6910. POINTNOIDENTICAL: "POINTNOIDENTICAL"
  6911. };
  6912. /**
  6913. * @enum BucketAggType
  6914. * @description 格网聚合查询枚举类,该类定义了Elasticsearch数据服务中聚合查询模式常量
  6915. * @category BaseTypes Constant
  6916. * @type {string}
  6917. * @usage
  6918. * ```
  6919. * // 浏览器
  6920. * <script type="text/javascript" src="{cdn}"></script>
  6921. * <script>
  6922. * const result = {namespace}.BucketAggType.GEOHASH_GRID;
  6923. *
  6924. * </script>
  6925. * // ES6 Import
  6926. * import { BucketAggType } from '{npm}';
  6927. *
  6928. * const result = BucketAggType.GEOHASH_GRID;
  6929. * ```
  6930. */
  6931. var BucketAggType = {
  6932. /** 格网聚合类型。 */
  6933. GEOHASH_GRID: "geohash_grid"
  6934. };
  6935. /**
  6936. * @enum MetricsAggType
  6937. * @description 指标聚合类型枚举类,该类定义了Elasticsearch数据服务中聚合查询模式常量。
  6938. * @category BaseTypes Constant
  6939. * @type {string}
  6940. * @usage
  6941. * ```
  6942. * // 浏览器
  6943. * <script type="text/javascript" src="{cdn}"></script>
  6944. * <script>
  6945. * const result = {namespace}.MetricsAggType.AVG;
  6946. *
  6947. * </script>
  6948. * // ES6 Import
  6949. * import { MetricsAggType } from '{npm}';
  6950. *
  6951. * const result = MetricsAggType.AVG;
  6952. * ```
  6953. */
  6954. var MetricsAggType = {
  6955. /** 平均值聚合类型。 */
  6956. AVG:'avg',
  6957. /** 最大值聚合类型。 */
  6958. MAX:'max',
  6959. /** 最小值聚合类型。 */
  6960. MIN:'min',
  6961. /** 求和聚合类型。 */
  6962. SUM:'sum'
  6963. };
  6964. /**
  6965. * @enum GetFeatureMode
  6966. * @description feature 查询方式。
  6967. * @category BaseTypes Constant
  6968. * @type {string}
  6969. * @usage
  6970. * ```
  6971. * // 浏览器
  6972. * <script type="text/javascript" src="{cdn}"></script>
  6973. * <script>
  6974. * const result = {namespace}.GetFeatureMode.BOUNDS;
  6975. *
  6976. * </script>
  6977. * // ES6 Import
  6978. * import { GetFeatureMode } from '{npm}';
  6979. *
  6980. * const result = GetFeatureMode.BOUNDS;
  6981. * ```
  6982. */
  6983. var GetFeatureMode = {
  6984. /** 通过范围查询来获取要素。 */
  6985. BOUNDS: "BOUNDS",
  6986. /** 通过几何对象的缓冲区来获取要素。 */
  6987. BUFFER: "BUFFER",
  6988. /** 通过 ID 来获取要素。 */
  6989. ID: "ID",
  6990. /** 通过空间查询模式来获取要素。 */
  6991. SPATIAL: "SPATIAL",
  6992. /** 通过 SQL 查询来获取要素。 */
  6993. SQL: 'SQL'
  6994. }
  6995. /**
  6996. * @enum RasterFunctionType
  6997. * @description 栅格分析方法。
  6998. * @category BaseTypes Constant
  6999. * @type {string}
  7000. * @usage
  7001. * ```
  7002. * // 浏览器
  7003. * <script type="text/javascript" src="{cdn}"></script>
  7004. * <script>
  7005. * const result = {namespace}.GetFeatureMode.NDVI;
  7006. *
  7007. * </script>
  7008. * // ES6 Import
  7009. * import { GetFeatureMode } from '{npm}';
  7010. *
  7011. * const result = GetFeatureMode.NDVI;
  7012. * ```
  7013. */
  7014. var RasterFunctionType = {
  7015. /** 归一化植被指数。 */
  7016. NDVI: "NDVI",
  7017. /** 阴影面分析。 */
  7018. HILLSHADE: "HILLSHADE"
  7019. }
  7020. /**
  7021. * @enum ResourceType
  7022. * @description iportal资源类型。
  7023. * @category BaseTypes Constant
  7024. * @version 10.0.1
  7025. * @type {string}
  7026. * @usage
  7027. * ```
  7028. * // 浏览器
  7029. * <script type="text/javascript" src="{cdn}"></script>
  7030. * <script>
  7031. * const result = {namespace}.GetFeatureMode.MAP;
  7032. *
  7033. * </script>
  7034. * // ES6 Import
  7035. * import { GetFeatureMode } from '{npm}';
  7036. *
  7037. * const result = GetFeatureMode.MAP;
  7038. * ```
  7039. */
  7040. var ResourceType = {
  7041. /** 地图。 */
  7042. MAP: "MAP",
  7043. /** 服务。 */
  7044. SERVICE: "SERVICE",
  7045. /** 场景。 */
  7046. SCENE: "SCENE",
  7047. /** 数据。 */
  7048. DATA: "DATA",
  7049. /** 洞察。 */
  7050. INSIGHTS_WORKSPACE: "INSIGHTS_WORKSPACE",
  7051. /** 大屏。 */
  7052. MAP_DASHBOARD: "MAP_DASHBOARD"
  7053. }
  7054. /**
  7055. * @enum OrderBy
  7056. * @description iportal资源排序字段。
  7057. * @category BaseTypes Constant
  7058. * @version 10.0.1
  7059. * @type {string}
  7060. * @usage
  7061. * ```
  7062. * // 浏览器
  7063. * <script type="text/javascript" src="{cdn}"></script>
  7064. * <script>
  7065. * const result = {namespace}.OrderBy.UPDATETIME;
  7066. *
  7067. * </script>
  7068. * // ES6 Import
  7069. * import { OrderBy } from '{npm}';
  7070. *
  7071. * const result = OrderBy.UPDATETIME;
  7072. * ```
  7073. */
  7074. var OrderBy = {
  7075. /** 按更新时间排序。 */
  7076. UPDATETIME: "UPDATETIME",
  7077. /** 按热度(可能是访问量、下载量)排序。 */
  7078. HEATLEVEL: "HEATLEVEL",
  7079. /** 按相关性排序。 */
  7080. RELEVANCE: "RELEVANCE"
  7081. }
  7082. /**
  7083. * @enum OrderType
  7084. * @description iportal资源升序还是降序过滤。
  7085. * @category BaseTypes Constant
  7086. * @version 10.0.1
  7087. * @type {string}
  7088. * @usage
  7089. * ```
  7090. * // 浏览器
  7091. * <script type="text/javascript" src="{cdn}"></script>
  7092. * <script>
  7093. * const result = {namespace}.OrderType.ASC;
  7094. *
  7095. * </script>
  7096. * // ES6 Import
  7097. * import { OrderType } from '{npm}';
  7098. *
  7099. * const result = OrderType.ASC;
  7100. * ```
  7101. */
  7102. var OrderType = {
  7103. /** 升序。 */
  7104. ASC: "ASC",
  7105. /** 降序。 */
  7106. DESC: "DESC"
  7107. }
  7108. /**
  7109. * @enum SearchType
  7110. * @description iportal资源查询的范围进行过滤。
  7111. * @category BaseTypes Constant
  7112. * @version 10.0.1
  7113. * @type {string}
  7114. * @usage
  7115. * ```
  7116. * // 浏览器
  7117. * <script type="text/javascript" src="{cdn}"></script>
  7118. * <script>
  7119. * const result = {namespace}.SearchType.PUBLIC;
  7120. *
  7121. * </script>
  7122. * // ES6 Import
  7123. * import { SearchType } from '{npm}';
  7124. *
  7125. * const result = SearchType.PUBLIC;
  7126. * ```
  7127. */
  7128. var SearchType = {
  7129. /** 公开资源。 */
  7130. PUBLIC: "PUBLIC",
  7131. /** 我的资源。 */
  7132. MY_RES: "MY_RES",
  7133. /** 我的群组资源。 */
  7134. MYGROUP_RES: "MYGROUP_RES",
  7135. /** 我的部门资源。 */
  7136. MYDEPARTMENT_RES: "MYDEPARTMENT_RES",
  7137. /** 分享给我的资源。 */
  7138. SHARETOME_RES: "SHARETOME_RES"
  7139. }
  7140. /**
  7141. * @enum AggregationTypes
  7142. * @description iportal资源聚合查询的类型。
  7143. * @category BaseTypes Constant
  7144. * @version 10.0.1
  7145. * @type {string}
  7146. * @usage
  7147. * ```
  7148. * // 浏览器
  7149. * <script type="text/javascript" src="{cdn}"></script>
  7150. * <script>
  7151. * const result = {namespace}.AggregationTypes.TAG;
  7152. *
  7153. * </script>
  7154. * // ES6 Import
  7155. * import { AggregationTypes } from '{npm}';
  7156. *
  7157. * const result = AggregationTypes.TAG;
  7158. * ```
  7159. */
  7160. var AggregationTypes = {
  7161. /** 标签。 */
  7162. TAG: "TAG",
  7163. /** 资源类型。 */
  7164. TYPE: "TYPE"
  7165. }
  7166. /**
  7167. * @enum PermissionType
  7168. * @description iportal资源权限类型。
  7169. * @category BaseTypes Constant
  7170. * @version 10.0.1
  7171. * @type {string}
  7172. * @usage
  7173. * ```
  7174. * // 浏览器
  7175. * <script type="text/javascript" src="{cdn}"></script>
  7176. * <script>
  7177. * const result = {namespace}.PermissionType.SEARCH;
  7178. *
  7179. * </script>
  7180. * // ES6 Import
  7181. * import { PermissionType } from '{npm}';
  7182. *
  7183. * const result = PermissionType.SEARCH;
  7184. * ```
  7185. */
  7186. var PermissionType = {
  7187. /** 可检索。 */
  7188. SEARCH:"SEARCH",
  7189. /** 可查看。 */
  7190. READ: "READ",
  7191. /** 可编辑。 */
  7192. READWRITE: "READWRITE",
  7193. /** 可删除。 */
  7194. DELETE: "DELETE",
  7195. /** 可下载,包括可读、可检索。 */
  7196. DOWNLOAD:"DOWNLOAD"
  7197. }
  7198. /**
  7199. * @enum EntityType
  7200. * @description iportal资源实体类型。
  7201. * @category BaseTypes Constant
  7202. * @version 10.0.1
  7203. * @type {string}
  7204. * @usage
  7205. * ```
  7206. * // 浏览器
  7207. * <script type="text/javascript" src="{cdn}"></script>
  7208. * <script>
  7209. * const result = {namespace}.EntityType.DEPARTMENT;
  7210. *
  7211. * </script>
  7212. * // ES6 Import
  7213. * import { EntityType } from '{npm}';
  7214. *
  7215. * const result = EntityType.DEPARTMENT;
  7216. * ```
  7217. */
  7218. var EntityType = {
  7219. /** 部门。 */
  7220. DEPARTMENT: "DEPARTMENT",
  7221. /** 用户组。 */
  7222. GROUP: "GROUP",
  7223. /** 群组。 */
  7224. IPORTALGROUP: "IPORTALGROUP",
  7225. /** 角色。 */
  7226. ROLE: "ROLE",
  7227. /** 用户。 */
  7228. USER: "USER"
  7229. }
  7230. /**
  7231. * @enum DataItemType
  7232. * @description iportal数据类型。
  7233. * @category BaseTypes Constant
  7234. * @version 10.0.1
  7235. * @type {string}
  7236. * @usage
  7237. * ```
  7238. * // 浏览器
  7239. * <script type="text/javascript" src="{cdn}"></script>
  7240. * <script>
  7241. * const result = {namespace}.DataItemType.GEOJSON;
  7242. *
  7243. * </script>
  7244. * // ES6 Import
  7245. * import { DataItemType } from '{npm}';
  7246. *
  7247. * const result = DataItemType.GEOJSON;
  7248. * ```
  7249. */
  7250. var DataItemType = {
  7251. /** geojson 数据。 */
  7252. GEOJSON: "GEOJSON",
  7253. /** UGCV5_MVT。 */
  7254. UGCV5_MVT: "UGCV5_MVT",
  7255. /** json数据。 */
  7256. JSON: "JSON",
  7257. /** 音频文件。 */
  7258. AUDIO: "AUDIO",
  7259. /** Color 颜色。 */
  7260. COLOR: "COLOR",
  7261. /** ColorScheme 颜色方案。 */
  7262. COLORSCHEME: "COLORSCHEME",
  7263. /** CSV 数据。 */
  7264. CSV: "CSV",
  7265. /** EXCEL 数据。 */
  7266. EXCEL: "EXCEL",
  7267. /** FillSymbol 填充符号库。 */
  7268. FILLSYMBOL: "FILLSYMBOL",
  7269. /** 图片类型。 */
  7270. IMAGE: "IMAGE",
  7271. /** LayerTemplate 图层模板。 */
  7272. LAYERTEMPLATE: "LAYERTEMPLATE",
  7273. /** LayoutTemplate 布局模板。 */
  7274. LAYOUTTEMPLATE: "LAYOUTTEMPLATE",
  7275. /** LineSymbol 线符号库。 */
  7276. LINESYMBOL: "LINESYMBOL",
  7277. /** MapTemplate 地图模板。 */
  7278. MAPTEMPLATE: "MAPTEMPLATE",
  7279. /** MarkerSymbol 点符号库。 */
  7280. MARKERSYMBOL: "MARKERSYMBOL",
  7281. /** MBTILES。 */
  7282. MBTILES: "MBTILES",
  7283. /** 照片。 */
  7284. PHOTOS: "PHOTOS",
  7285. /** SHP 空间数据。 */
  7286. SHP: "SHP",
  7287. /** SMTILES。 */
  7288. SMTILES: "SMTILES",
  7289. /** SVTILES。 */
  7290. SVTILES: "SVTILES",
  7291. /** ThemeTemplate 专题图模板。 */
  7292. THEMETEMPLATE: "THEMETEMPLATE",
  7293. /** TPK。 */
  7294. TPK: "TPK",
  7295. /** UDB 数据源。 */
  7296. UDB: "UDB",
  7297. /** UGCV5。 */
  7298. UGCV5: "UGCV5",
  7299. /** 其他类型(普通文件)。 */
  7300. UNKNOWN: "UNKNOWN",
  7301. /** 视频文件。 */
  7302. VIDEO: "VIDEO",
  7303. /** WorkEnviroment 工作环境。 */
  7304. WORKENVIRONMENT: "WORKENVIRONMENT",
  7305. /** 工作空间。 */
  7306. WORKSPACE: "WORKSPACE"
  7307. }
  7308. /**
  7309. * @enum WebExportFormatType
  7310. * @description Web 打印输出的格式。
  7311. * @category BaseTypes Constant
  7312. * @version 10.0.1
  7313. * @type {string}
  7314. * @usage
  7315. * ```
  7316. * // 浏览器
  7317. * <script type="text/javascript" src="{cdn}"></script>
  7318. * <script>
  7319. * const result = {namespace}.WebExportFormatType.PNG;
  7320. *
  7321. * </script>
  7322. * // ES6 Import
  7323. * import { WebExportFormatType } from '{npm}';
  7324. *
  7325. * const result = WebExportFormatType.PNG;
  7326. * ```
  7327. */
  7328. var WebExportFormatType = {
  7329. /** PNG */
  7330. PNG: "PNG",
  7331. /** PDF */
  7332. PDF: "PDF"
  7333. }
  7334. /**
  7335. * @enum WebScaleOrientationType
  7336. * @description Web 比例尺的方位样式。
  7337. * @category BaseTypes Constant
  7338. * @version 10.0.1
  7339. * @type {string}
  7340. * @usage
  7341. * ```
  7342. * // 浏览器
  7343. * <script type="text/javascript" src="{cdn}"></script>
  7344. * <script>
  7345. * const result = {namespace}.WebScaleOrientationType.HORIZONTALLABELSBELOW;
  7346. *
  7347. * </script>
  7348. * // ES6 Import
  7349. * import { WebScaleOrientationType } from '{npm}';
  7350. *
  7351. * const result = WebScaleOrientationType.HORIZONTALLABELSBELOW;
  7352. * ```
  7353. */
  7354. var WebScaleOrientationType = {
  7355. /** horizontal labels below. */
  7356. HORIZONTALLABELSBELOW: "HORIZONTALLABELSBELOW",
  7357. /** horizontal labels above. */
  7358. HORIZONTALLABELSABOVE: "HORIZONTALLABELSABOVE",
  7359. /** vertical labels left. */
  7360. VERTICALLABELSLEFT: "VERTICALLABELSLEFT",
  7361. /** vertical labels right. */
  7362. VERTICALLABELSRIGHT: "VERTICALLABELSRIGHT"
  7363. }
  7364. /**
  7365. * @enum WebScaleType
  7366. * @description Web 比例尺的样式。
  7367. * @category BaseTypes Constant
  7368. * @version 10.0.1
  7369. * @type {string}
  7370. * @usage
  7371. * ```
  7372. * // 浏览器
  7373. * <script type="text/javascript" src="{cdn}"></script>
  7374. * <script>
  7375. * const result = {namespace}.WebScaleType.LINE;
  7376. *
  7377. * </script>
  7378. * // ES6 Import
  7379. * import { WebScaleType } from '{npm}';
  7380. *
  7381. * const result = WebScaleType.LINE;
  7382. * ```
  7383. */
  7384. var WebScaleType = {
  7385. /** line. */
  7386. LINE: "LINE",
  7387. /** bar. */
  7388. BAR: "BAR",
  7389. /** bar sub. */
  7390. BAR_SUB: "BAR_SUB"
  7391. }
  7392. /**
  7393. * @enum WebScaleUnit
  7394. * @description Web 比例尺的单位制。
  7395. * @category BaseTypes Constant
  7396. * @version 10.0.1
  7397. * @type {string}
  7398. * @usage
  7399. * ```
  7400. * // 浏览器
  7401. * <script type="text/javascript" src="{cdn}"></script>
  7402. * <script>
  7403. * const result = {namespace}.WebScaleUnit.METER;
  7404. *
  7405. * </script>
  7406. * // ES6 Import
  7407. * import { WebScaleUnit } from '{npm}';
  7408. *
  7409. * const result = WebScaleUnit.METER;
  7410. * ```
  7411. */
  7412. var WebScaleUnit = {
  7413. /** 米。 */
  7414. METER: "METER",
  7415. /** 英尺。 */
  7416. FOOT: "FOOT",
  7417. /** 度。 */
  7418. DEGREES: "DEGREES"
  7419. }
  7420. ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceConnectionInfo.js
  7421. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  7422. * This program are made available under the terms of the Apache License, Version 2.0
  7423. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7424. // eslint-disable-line no-unused-vars
  7425. /**
  7426. * @class DatasourceConnectionInfo
  7427. * @deprecatedclass SuperMap.DatasourceConnectionInfo
  7428. * @category iServer Data Datasource
  7429. * @classdesc 数据源连接信息类。该类包括了进行数据源连接的所有信息,如所要连接的服务器名称、数据库名称、用户名以及密码等。
  7430. * 当保存为工作空间时,工作空间中的数据源的连接信息都将存储到工作空间文件中。对于不同类型的数据源,其连接信息有所区别。
  7431. * 所以在使用该类所包含的成员时,请注意该成员所适用的数据源类型。对于从数据源对象中返回的数据连接信息对象,只有 connect 方法可以被修改,
  7432. * 其他内容是不可以被修改的。对于用户创建的数据源连接信息对象,其内容都可以修改。
  7433. * @param {Object} options - 参数。
  7434. * @param {string} options.alias - 数据源别名。
  7435. * @param {string} options.dataBase - 数据源连接的数据库名。
  7436. * @param {boolean} [options.connect] - 数据源是否自动连接数据。
  7437. * @param {string} [options.driver] - 使用 ODBC(Open Database Connectivity,开放数据库互连)的数据库的驱动程序名。
  7438. * @param {EngineType} [options.engineType] - 数据源连接的引擎类型。
  7439. * @param {boolean} [options.exclusive] - 是否以独占方式打开数据源。
  7440. * @param {boolean} [options.OpenLinkTable] - 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  7441. * @param {string} [options.password] - 登录数据源连接的数据库或文件的密码。
  7442. * @param {boolean} [options.readOnly] - 是否以只读方式打开数据源。
  7443. * @param {string} [options.server] - 数据库服务器名或 SDB 文件名。
  7444. * @param {string} [options.user] - 登录数据库的用户名。
  7445. * @usage
  7446. */
  7447. class DatasourceConnectionInfo {
  7448. constructor(options) {
  7449. /**
  7450. * @member {string} DatasourceConnectionInfo.prototype.alias
  7451. * @description 数据源别名。
  7452. */
  7453. this.alias = null;
  7454. /**
  7455. * @member {boolean} [DatasourceConnectionInfo.prototype.connect]
  7456. * @description 数据源是否自动连接数据。
  7457. */
  7458. this.connect = null;
  7459. /**
  7460. * @member {string} DatasourceConnectionInfo.prototype.dataBase
  7461. * @description 数据源连接的数据库名。
  7462. */
  7463. this.dataBase = null;
  7464. /**
  7465. * @member {string} [DatasourceConnectionInfo.prototype.driver]
  7466. * @description 使用 ODBC(Open Database Connectivity,开放数据库互连) 的数据库的驱动程序名。
  7467. * 其中,对于 SQL Server 数据库与 iServer 发布的 WMTS 服务,此为必设参数。
  7468. * 对于 SQL Server 数据库,它使用 ODBC 连接,所设置的驱动程序名为 "SQL Server" 或 "SQL Native Client";
  7469. * 对于 iServer 发布的 WMTS 服务,设置的驱动名称为 "WMTS"。
  7470. */
  7471. this.driver = null;
  7472. /**
  7473. * @member {EngineType} [DatasourceConnectionInfo.prototype.engineType]
  7474. * @description 数据源连接的引擎类型。
  7475. */
  7476. this.engineType = null;
  7477. /**
  7478. * @member {boolean} [DatasourceConnectionInfo.prototype.exclusive]
  7479. * @description 是否以独占方式打开数据源。
  7480. */
  7481. this.exclusive = null;
  7482. /**
  7483. * @member {boolean} [DatasourceConnectionInfo.prototype.OpenLinkTable]
  7484. * @description 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  7485. */
  7486. this.OpenLinkTable = null;
  7487. /**
  7488. * @member {string} [DatasourceConnectionInfo.prototype.password]
  7489. * @description 登录数据源连接的数据库或文件的密码。
  7490. */
  7491. this.password = null;
  7492. /**
  7493. * @member {boolean} [DatasourceConnectionInfo.prototype.readOnly]
  7494. * @description 是否以只读方式打开数据源。
  7495. */
  7496. this.readOnly = null;
  7497. /**
  7498. * @member {string} [DatasourceConnectionInfo.prototype.server]
  7499. * @description 数据库服务器名、文件名或服务地址。
  7500. * 1.对于 SDB 和 UDB 文件,为其文件的绝对路径。注意:当绝对路径的长度超过 UTF-8 编码格式的 260 字节长度,该数据源无法打开。
  7501. * 2.对于 Oracle 数据库,其服务器名为其 TNS 服务名称。
  7502. * 3.对于 SQL Server 数据库,其服务器名为其系统的 DSN(Database Source Name) 名称。
  7503. * 4.对于 PostgreSQL 数据库,其服务器名为 “IP:端口号”,默认的端口号是 5432。
  7504. * 5.对于 DB2 数据库,已经进行了编目,所以不需要进行服务器的设置。
  7505. * 6.对于 Kingbase 数据库,其服务器名为其 IP 地址。
  7506. * 7.对于 GoogleMaps 数据源,其服务器地址,默认设置为 “{@link http://maps.google.com}”,且不可更改。
  7507. * 8.对于 SuperMapCould 数据源,为其服务地址。
  7508. * 9.对于 MAPWORLD 数据源,为其服务地址,默认设置为 “{@link http://www.tianditu.cn}”,且不可更改。
  7509. * 10.对于 OGC 和 REST 数据源,为其服务地址。
  7510. */
  7511. this.server = null;
  7512. /**
  7513. * @member {string} DatasourceConnectionInfo.prototype.user
  7514. * @description 登录数据库的用户名。
  7515. */
  7516. this.user = null;
  7517. if (options) {
  7518. Util_Util.extend(this, options);
  7519. }
  7520. this.CLASS_NAME = "SuperMap.DatasourceConnectionInfo";
  7521. }
  7522. /**
  7523. * @function DatasourceConnectionInfo.prototype.destroy
  7524. * @description 释放资源,将引用资源的属性置空。
  7525. */
  7526. destroy() {
  7527. var me = this;
  7528. me.alias = null;
  7529. me.connect = null;
  7530. me.dataBase = null;
  7531. me.driver = null;
  7532. me.engineType = null;
  7533. me.exclusive = null;
  7534. me.OpenLinkTable = null;
  7535. me.password = null;
  7536. me.readOnly = null;
  7537. me.server = null;
  7538. me.user = null;
  7539. }
  7540. }
  7541. ;// CONCATENATED MODULE: ./src/common/iServer/OutputSetting.js
  7542. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  7543. * This program are made available under the terms of the Apache License, Version 2.0
  7544. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7545. /**
  7546. * @class OutputSetting
  7547. * @deprecatedclass SuperMap.OutputSetting
  7548. * @category iServer ProcessingService
  7549. * @classdesc 分布式分析输出类型设置类。
  7550. * @param {Object} options - 参数。
  7551. * @param {DatasourceConnectionInfo} options.datasourceInfo - 数据源连接信息。
  7552. * @param {string} [options.datasetName='analystResult'] - 结果数据集名称。
  7553. * @param {OutputType} [options.type=OutputType.UDB] - 输出类型。
  7554. * @param {string} [options.outputPath] - 分析结果输出路径。
  7555. * @usage
  7556. */
  7557. class OutputSetting {
  7558. constructor(options) {
  7559. /**
  7560. * @member {OutputType} OutputSetting.prototype.type
  7561. * @description 分布式分析的输出类型。
  7562. */
  7563. this.type = OutputType.UDB;
  7564. /**
  7565. * @member {string} [OutputSetting.prototype.datasetName='analystResult']
  7566. * @description 分布式分析的输出结果数据集名称。
  7567. */
  7568. this.datasetName = "analystResult";
  7569. /**
  7570. * @member {DatasourceConnectionInfo} OutputSetting.prototype.datasourceInfo
  7571. * @description 分布式分析的输出结果数据源连接信息。
  7572. */
  7573. this.datasourceInfo = null;
  7574. /**
  7575. * @member {string} [OutputSetting.prototype.outputPath]
  7576. * @description 分布式分析的分析结果输出路径。
  7577. */
  7578. this.outputPath = "";
  7579. Util_Util.extend(this, options);
  7580. this.CLASS_NAME = "SuperMap.OutputSetting";
  7581. }
  7582. /**
  7583. * @function OutputSetting.prototype.destroy
  7584. * @description 释放资源,将引用资源的属性置空。
  7585. */
  7586. destroy() {
  7587. var me = this;
  7588. me.type = null;
  7589. me.datasetName = null;
  7590. me.outputPath = null;
  7591. if (me.datasourceInfo instanceof DatasourceConnectionInfo) {
  7592. me.datasourceInfo.destroy();
  7593. me.datasourceInfo = null;
  7594. }
  7595. }
  7596. }
  7597. ;// CONCATENATED MODULE: ./src/common/iServer/MappingParameters.js
  7598. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  7599. * This program are made available under the terms of the Apache License, Version 2.0
  7600. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7601. /**
  7602. * @class MappingParameters
  7603. * @deprecatedclass SuperMap.MappingParameters
  7604. * @category iServer ProcessingService
  7605. * @classdesc 分析后结果可视化的参数类。
  7606. * @param {Object} options - 参数。
  7607. * @param {Array.<ThemeGridRangeItem>} [options.items] - 栅格分段专题图子项数组。
  7608. * @param {number} [options.numericPrecision=1] - 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  7609. * @param {RangeMode} [options.rangeMode=RangeMode.EQUALINTERVAL] - 专题图分段模式。
  7610. * @param {number} [options.rangeCount] - 专题图分段个数。
  7611. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 专题图颜色渐变模式。
  7612. * @usage
  7613. */
  7614. class MappingParameters {
  7615. constructor(options) {
  7616. /**
  7617. * @member {Array.<ThemeGridRangeItem>} [MappingParameters.prototype.items]
  7618. * @description 栅格分段专题图子项数组。
  7619. */
  7620. this.items = null;
  7621. /**
  7622. * @member {number} [MappingParameters.prototype.numericPrecision=1]
  7623. * @description 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  7624. */
  7625. this.numericPrecision = 1;
  7626. /**
  7627. * @member {RangeMode} [MappingParameters.prototype.RangeMode=RangeMode.EQUALINTERVAL]
  7628. * @description 专题图分段模式。
  7629. */
  7630. this.rangeMode = RangeMode.EQUALINTERVAL;
  7631. /**
  7632. * @member {number} [MappingParameters.prototype.rangeCount]
  7633. * @description 专题图分段个数。
  7634. */
  7635. this.rangeCount = "";
  7636. /**
  7637. * @member {ColorGradientType} [MappingParameters.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  7638. * @description 专题图颜色渐变模式。
  7639. */
  7640. this.colorGradientType = ColorGradientType.YELLOW_RED;
  7641. Util_Util.extend(this, options);
  7642. this.CLASS_NAME = "SuperMap.MappingParameters";
  7643. }
  7644. /**
  7645. * @function MappingParameters.prototype.destroy
  7646. * @description 释放资源,将引用资源的属性置空。
  7647. */
  7648. destroy() {
  7649. var me = this;
  7650. if (me.items) {
  7651. if (me.items.length > 0) {
  7652. for (var item in me.items) {
  7653. me.items[item].destroy();
  7654. me.items[item] = null;
  7655. }
  7656. }
  7657. me.items = null;
  7658. }
  7659. me.numericPrecision = null;
  7660. me.rangeMode = null;
  7661. me.rangeCount = null;
  7662. me.colorGradientType = null;
  7663. }
  7664. }
  7665. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobParameter.js
  7666. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  7667. * This program are made available under the terms of the Apache License, Version 2.0
  7668. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7669. /**
  7670. * @class KernelDensityJobParameter
  7671. * @deprecatedclass SuperMap.KernelDensityJobParameter
  7672. * @category iServer ProcessingService DensityAnalyst
  7673. * @classdesc 核密度分析服务参数类。
  7674. * @param {Object} options - 参数。
  7675. * @param {string} options.datasetName - 数据集名。
  7676. * @param {string} options.fields - 权重索引。
  7677. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  7678. * @param {number} [options.resolution=80] - 分辨率。
  7679. * @param {number} [options.method=0] - 分析方法。
  7680. * @param {number} [options.meshType=0] - 分析类型。
  7681. * @param {number} [options.radius=300] - 分析的影响半径。
  7682. * @param {AnalystSizeUnit} [options.meshSizeUnit=AnalystSizeUnit.METER] - 网格大小单位。
  7683. * @param {AnalystSizeUnit} [options.radiusUnit=AnalystSizeUnit.METER] - 搜索半径单位。
  7684. * @param {AnalystAreaUnit} [options.areaUnit=AnalystAreaUnit.SQUAREMILE] - 面积单位。
  7685. * @param {OutputSetting} [options.output] - 输出参数设置。
  7686. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  7687. * @usage
  7688. */
  7689. class KernelDensityJobParameter {
  7690. constructor(options) {
  7691. if (!options) {
  7692. return;
  7693. }
  7694. /**
  7695. * @member {string} KernelDensityJobParameter.prototype.datasetName
  7696. * @description 数据集名。
  7697. */
  7698. this.datasetName = "";
  7699. /**
  7700. * @member {SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject} [KernelDensityJobParameter.prototype.query]
  7701. * @description 分析范围。
  7702. */
  7703. this.query = "";
  7704. /**
  7705. * @member {number} [KernelDensityJobParameter.prototype.resolution=80]
  7706. * @description 网格大小。
  7707. */
  7708. this.resolution = 80;
  7709. /**
  7710. * @member {number} [KernelDensityJobParameter.prototype.method=0]
  7711. * @description 分析方法。
  7712. */
  7713. this.method = 0;
  7714. /**
  7715. * @member {number} [KernelDensityJobParameter.prototype.meshType=0]
  7716. * @description 分析类型。
  7717. */
  7718. this.meshType = 0;
  7719. /**
  7720. * @member {string} KernelDensityJobParameter.prototype.fields
  7721. * @description 权重索引。
  7722. */
  7723. this.fields = "";
  7724. /**
  7725. * @member {number} [KernelDensityJobParameter.prototype.radius=300]
  7726. * @description 分析的影响半径。
  7727. */
  7728. this.radius = 300;
  7729. /**
  7730. * @member {AnalystSizeUnit} [KernelDensityJobParameter.prototype.meshSizeUnit=AnalystSizeUnit.METER]
  7731. * @description 网格大小单位。
  7732. */
  7733. this.meshSizeUnit = AnalystSizeUnit.METER;
  7734. /**
  7735. * @member {AnalystSizeUnit} [KernelDensityJobParameter.prototype.radiusUnit=AnalystSizeUnit.METER]
  7736. * @description 搜索半径单位。
  7737. */
  7738. this.radiusUnit = AnalystSizeUnit.METER;
  7739. /**
  7740. * @member {AnalystAreaUnit} [KernelDensityJobParameter.prototype.areaUnit=AnalystAreaUnit.SQUAREMILE]
  7741. * @description 面积单位。
  7742. */
  7743. this.areaUnit = AnalystAreaUnit.SQUAREMILE;
  7744. /**
  7745. * @member {OutputSetting} KernelDensityJobParameter.prototype.output
  7746. * @description 输出参数设置类。
  7747. */
  7748. this.output = null;
  7749. /**
  7750. * @member {MappingParameters} [KernelDensityJobParameter.prototype.mappingParameters]
  7751. * @description 分析后结果可视化的参数类。
  7752. */
  7753. this.mappingParameters = null;
  7754. Util_Util.extend(this, options);
  7755. this.CLASS_NAME = "SuperMap.KernelDensityJobParameter";
  7756. }
  7757. /**
  7758. * @function KernelDensityJobParameter.prototype.destroy
  7759. * @description 释放资源,将引用资源的属性置空。
  7760. */
  7761. destroy() {
  7762. this.datasetName = null;
  7763. this.query = null;
  7764. this.resolution = null;
  7765. this.method = null;
  7766. this.radius = null;
  7767. this.meshType = null;
  7768. this.fields = null;
  7769. this.meshSizeUnit = null;
  7770. this.radiusUnit = null;
  7771. this.areaUnit = null;
  7772. if (this.output instanceof OutputSetting) {
  7773. this.output.destroy();
  7774. this.output = null;
  7775. }
  7776. if (this.mappingParameters instanceof MappingParameters) {
  7777. this.mappingParameters.destroy();
  7778. this.mappingParameters = null;
  7779. }
  7780. }
  7781. /**
  7782. * @function KernelDensityJobParameter.toObject
  7783. * @param {KernelDensityJobParameter} kernelDensityJobParameter - 核密度分析服务参数类。
  7784. * @param {KernelDensityJobParameter} tempObj - 核密度分析服务参数对象。
  7785. * @description 将核密度分析服务参数对象转换为 JSON 对象。
  7786. * @returns JSON 对象。
  7787. */
  7788. static toObject(kernelDensityJobParameter, tempObj) {
  7789. for (var name in kernelDensityJobParameter) {
  7790. if (name === "datasetName") {
  7791. tempObj['input'] = tempObj['input'] || {};
  7792. tempObj['input'][name] = kernelDensityJobParameter[name];
  7793. continue;
  7794. }
  7795. if (name === "output") {
  7796. tempObj['output'] = tempObj['output'] || {};
  7797. tempObj['output'] = kernelDensityJobParameter[name];
  7798. continue;
  7799. }
  7800. tempObj['analyst'] = tempObj['analyst'] || {};
  7801. if (name === 'query' && kernelDensityJobParameter[name]) {
  7802. tempObj['analyst'][name] = kernelDensityJobParameter[name].toBBOX();
  7803. } else {
  7804. tempObj['analyst'][name] = kernelDensityJobParameter[name];
  7805. }
  7806. if (name === 'mappingParameters') {
  7807. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  7808. tempObj['analyst']['mappingParameters'] = kernelDensityJobParameter[name];
  7809. }
  7810. }
  7811. }
  7812. }
  7813. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsParameter.js
  7814. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  7815. * This program are made available under the terms of the Apache License, Version 2.0
  7816. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7817. /**
  7818. * @class SingleObjectQueryJobsParameter
  7819. * @deprecatedclass SuperMap.SingleObjectQueryJobsParameter
  7820. * @category iServer ProcessingService Query
  7821. * @classdesc 单对象空间查询分析任务参数类。
  7822. * @param {Object} options - 参数。
  7823. * @param {string} options.datasetName - 数据集名。
  7824. * @param {string} options.datasetQuery - 查询对象所在的数据集名称。
  7825. * @param {SpatialQueryMode} [options.mode=SpatialQueryMode.CONTAIN] - 空间查询模式。
  7826. * @param {OutputSetting} [options.output] - 输出参数设置。
  7827. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  7828. * @usage
  7829. */
  7830. class SingleObjectQueryJobsParameter {
  7831. constructor(options) {
  7832. if (!options) {
  7833. return;
  7834. }
  7835. /**
  7836. * @member {string} SingleObjectQueryJobsParameter.prototype.datasetName
  7837. * @description 数据集名。
  7838. */
  7839. this.datasetName = "";
  7840. /**
  7841. * @member {string} SingleObjectQueryJobsParameter.prototype.datasetQuery
  7842. * @description 查询对象所在的数据集名称。
  7843. */
  7844. this.datasetQuery = "";
  7845. /**
  7846. * @member {string} SingleObjectQueryJobsParameter.prototype.geometryQuery
  7847. * @description 查询对象所在的几何对象。
  7848. */
  7849. this.geometryQuery = "";
  7850. /**
  7851. * @member {SpatialQueryMode} [SingleObjectQueryJobsParameter.prototype.mode=SpatialQueryMode.CONTAIN]
  7852. * @description 空间查询模式 。
  7853. */
  7854. this.mode = SpatialQueryMode.CONTAIN;
  7855. /**
  7856. * @member {OutputSetting} [SingleObjectQueryJobsParameter.prototype.output]
  7857. * @description 输出参数设置类。
  7858. */
  7859. this.output = null;
  7860. /**
  7861. * @member {MappingParameters} [SingleObjectQueryJobsParameter.prototype.mappingParameters]
  7862. * @description 分析后结果可视化的参数类。
  7863. */
  7864. this.mappingParameters = null;
  7865. Util_Util.extend(this, options);
  7866. this.CLASS_NAME = "SuperMap.SingleObjectQueryJobsParameter";
  7867. }
  7868. /**
  7869. * @function SingleObjectQueryJobsParameter.prototype.destroy
  7870. * @description 释放资源,将引用资源的属性置空。
  7871. */
  7872. destroy() {
  7873. this.datasetName = null;
  7874. this.datasetQuery = null;
  7875. this.geometryQuery = null;
  7876. this.mode = null;
  7877. if (this.output instanceof OutputSetting) {
  7878. this.output.destroy();
  7879. this.output = null;
  7880. }
  7881. if (this.mappingParameters instanceof MappingParameters){
  7882. this.mappingParameters.destroy();
  7883. this.mappingParameters = null;
  7884. }
  7885. }
  7886. /**
  7887. * @function SingleObjectQueryJobsParameter.toObject
  7888. * @param {Object} singleObjectQueryJobsParameter - 单对象空间查询分析任务参数。
  7889. * @param {Object} tempObj - 目标对象。
  7890. * @description 生成单对象空间查询分析任务对象。
  7891. */
  7892. static toObject(singleObjectQueryJobsParameter, tempObj) {
  7893. for (var name in singleObjectQueryJobsParameter) {
  7894. if (name === "datasetName") {
  7895. tempObj['input'] = tempObj['input'] || {};
  7896. tempObj['input'][name] = singleObjectQueryJobsParameter[name];
  7897. continue;
  7898. }
  7899. if (name === "output"){
  7900. tempObj['output'] = tempObj['output'] || {};
  7901. tempObj['output'] = singleObjectQueryJobsParameter[name];
  7902. continue;
  7903. }
  7904. tempObj['analyst'] = tempObj['analyst'] || {};
  7905. tempObj['analyst'][name] = singleObjectQueryJobsParameter[name];
  7906. if(name === 'mappingParameters'){
  7907. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  7908. tempObj['analyst']['mappingParameters'] = singleObjectQueryJobsParameter[name];
  7909. }
  7910. }
  7911. }
  7912. }
  7913. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsParameter.js
  7914. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  7915. * This program are made available under the terms of the Apache License, Version 2.0
  7916. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7917. /**
  7918. * @class SummaryAttributesJobsParameter
  7919. * @deprecatedclass SuperMap.SummaryAttributesJobsParameter
  7920. * @category iServer ProcessingService SummaryAttributes
  7921. * @classdesc 属性汇总分析任务参数类。
  7922. * @param {Object} options - 参数。
  7923. * @param {string} options.datasetName - 数据集名。
  7924. * @param {string} options.groupField - 分组字段。
  7925. * @param {string} options.attributeField - 属性字段。
  7926. * @param {string} options.statisticModes - 统计模式。
  7927. * @param {OutputSetting} [options.output] -输出参数设置。
  7928. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  7929. * @usage
  7930. */
  7931. class SummaryAttributesJobsParameter {
  7932. constructor(options) {
  7933. if (!options) {
  7934. return;
  7935. }
  7936. /**
  7937. * @member {string} SummaryAttributesJobsParameter.prototype.datasetName
  7938. * @description 汇总数据集名称。
  7939. */
  7940. this.datasetName = "";
  7941. /**
  7942. * @member {string} SummaryAttributesJobsParameter.prototype.groupField
  7943. * @description 分组字段。
  7944. */
  7945. this.groupField = "";
  7946. /**
  7947. * @member {string} SummaryAttributesJobsParameter.prototype.attributeField
  7948. * @description 属性字段。
  7949. */
  7950. this.attributeField = "";
  7951. /**
  7952. * @member {string} SummaryAttributesJobsParameter.prototype.statisticModes
  7953. * @description 属性汇总统计模式。
  7954. */
  7955. this.statisticModes = "";
  7956. /**
  7957. * @member {OutputSetting} SummaryAttributesJobsParameter.prototype.output
  7958. * @description 输出参数设置类。
  7959. */
  7960. this.output = null;
  7961. /**
  7962. * @member {MappingParameters} [SummaryAttributesJobsParameter.prototype.mappingParameters]
  7963. * @description 分析后结果可视化的参数类。
  7964. */
  7965. this.mappingParameters = null;
  7966. Util_Util.extend(this, options);
  7967. this.CLASS_NAME = "SuperMap.SummaryAttributesJobsParameter";
  7968. }
  7969. /**
  7970. * @function SummaryAttributesJobsParameter.prototype.destroy
  7971. * @description 释放资源,将资源的属性置空。
  7972. */
  7973. destroy() {
  7974. this.datasetName = null;
  7975. this.groupField = null;
  7976. this.attributeField = null;
  7977. this.statisticModes = null;
  7978. if (this.output instanceof OutputSetting) {
  7979. this.output.destroy();
  7980. this.output = null;
  7981. }
  7982. if (this.mappingParameters instanceof MappingParameters){
  7983. this.mappingParameters.destroy();
  7984. this.mappingParameters = null;
  7985. }
  7986. }
  7987. /**
  7988. * @function SummaryAttributesJobsParameter.toObject
  7989. * @param {Object} SummaryAttributesJobsParameter - 属性汇总任务参数。
  7990. * @param {Object} tempObj - 目标对象。
  7991. * @description 生成属性汇总分析任务对象。
  7992. */
  7993. static toObject(SummaryAttributesJobsParameter, tempObj) {
  7994. for (var name in SummaryAttributesJobsParameter) {
  7995. if (name === "datasetName") {
  7996. tempObj['input'] = tempObj['input'] || {};
  7997. tempObj['input'][name] = SummaryAttributesJobsParameter[name];
  7998. continue;
  7999. }
  8000. if (name === "output") {
  8001. tempObj['output'] = tempObj['output'] || {};
  8002. tempObj['output'] = SummaryAttributesJobsParameter[name];
  8003. continue;
  8004. }
  8005. tempObj['analyst'] = tempObj['analyst'] || {};
  8006. tempObj['analyst'][name] = SummaryAttributesJobsParameter[name];
  8007. if(name === 'mappingParameters'){
  8008. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  8009. tempObj['analyst']['mappingParameters'] = SummaryAttributesJobsParameter[name];
  8010. }
  8011. }
  8012. }
  8013. }
  8014. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobParameter.js
  8015. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8016. * This program are made available under the terms of the Apache License, Version 2.0
  8017. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8018. /**
  8019. * @class SummaryMeshJobParameter
  8020. * @deprecatedclass SuperMap.SummaryMeshJobParameter
  8021. * @category iServer ProcessingService AggregatePoints
  8022. * @classdesc 点聚合分析任务参数类。
  8023. * @param {Object} options - 参数。
  8024. * @param {string} options.datasetName - 数据集名。
  8025. * @param {string} [options.regionDataset ] - 聚合面数据集(聚合类型为多边形聚合时使用的参数)
  8026. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  8027. * @param {number} options.fields - 权重索引。
  8028. * @param {number} [options.resolution=100] - 分辨率。
  8029. * @param {StatisticAnalystMode} [options.statisticModes=StatisticAnalystMode.AVERAGE] - 分析模式。
  8030. * @param {number} [options.meshType=0] - 分析类型。
  8031. * @param {SummaryType} [options.type=SummaryType.SUMMARYMESH] - 聚合类型。
  8032. * @param {OutputSetting} [options.output] - 输出参数设置。
  8033. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  8034. * @usage
  8035. */
  8036. class SummaryMeshJobParameter {
  8037. constructor(options) {
  8038. if (!options) {
  8039. return;
  8040. }
  8041. /**
  8042. * @member {string} SummaryMeshJobParameter.prototype.datasetName
  8043. * @description 数据集名。
  8044. */
  8045. this.datasetName = "";
  8046. /**
  8047. * @member {string} SummaryMeshJobParameter.prototype.regionDataset
  8048. * @description 聚合面数据集(聚合类型为多边形聚合时使用的参数)。
  8049. */
  8050. this.regionDataset = "";
  8051. /**
  8052. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} SummaryMeshJobParameter.prototype.query
  8053. * @description 分析范围(聚合类型为网格面聚合时使用的参数)。
  8054. */
  8055. this.query = "";
  8056. /**
  8057. * @member {number} [SummaryMeshJobParameter.prototype.resolution=100]
  8058. * @description 分辨率(聚合类型为网格面聚合时使用的参数)。
  8059. */
  8060. this.resolution = 100;
  8061. /**
  8062. * @member {number} [SummaryMeshJobParameter.prototype.meshType=0]
  8063. * @description 网格面类型(聚合类型为网格面聚合时使用的参数),取值:0 或 1。
  8064. */
  8065. this.meshType = 0;
  8066. /**
  8067. * @member {StatisticAnalystMode} [SummaryMeshJobParameter.prototype.statisticModes=StatisticAnalystMode.AVERAGE]
  8068. * @description 统计模式。
  8069. */
  8070. this.statisticModes = StatisticAnalystMode.AVERAGE;
  8071. /**
  8072. * @member {number} SummaryMeshJobParameter.prototype.fields
  8073. * @description 权重字段。
  8074. */
  8075. this.fields = "";
  8076. /**
  8077. * @member {SummaryType} [SummaryMeshJobParameter.prototype.type=SummaryType.SUMMARYMESH]
  8078. * @description 聚合类型。
  8079. */
  8080. this.type = SummaryType.SUMMARYMESH;
  8081. /**
  8082. * @member {OutputSetting} [SummaryMeshJobParameter.prototype.output]
  8083. * @description 输出参数设置类。
  8084. */
  8085. this.output = null;
  8086. /**
  8087. * @member {MappingParameters} [SummaryMeshJobParameter.prototype.mappingParameters]
  8088. * @description 分析后结果可视化的参数类。
  8089. */
  8090. this.mappingParameters = null;
  8091. Util_Util.extend(this, options);
  8092. this.CLASS_NAME = "SuperMap.SummaryMeshJobParameter";
  8093. }
  8094. /**
  8095. * @function SummaryMeshJobParameter.prototype.destroy
  8096. * @description 释放资源,将资源的属性置空。
  8097. */
  8098. destroy() {
  8099. this.datasetName = null;
  8100. this.query = null;
  8101. this.resolution = null;
  8102. this.statisticModes = null;
  8103. this.meshType = null;
  8104. this.fields = null;
  8105. this.regionDataset = null;
  8106. this.type = null;
  8107. if (this.output instanceof OutputSetting) {
  8108. this.output.destroy();
  8109. this.output = null;
  8110. }
  8111. if (this.mappingParameters instanceof MappingParameters){
  8112. this.mappingParameters.destroy();
  8113. this.mappingParameters = null;
  8114. }
  8115. }
  8116. /**
  8117. * @function SummaryMeshJobParameter.toObject
  8118. * @param {Object} summaryMeshJobParameter - 点聚合分析任务参数。
  8119. * @param {Object} tempObj - 目标对象。
  8120. * @description 生成点聚合分析任务对象。
  8121. */
  8122. static toObject(summaryMeshJobParameter, tempObj) {
  8123. for (var name in summaryMeshJobParameter) {
  8124. if (name === "datasetName") {
  8125. tempObj['input'] = tempObj['input'] || {};
  8126. tempObj['input'][name] = summaryMeshJobParameter[name];
  8127. continue;
  8128. }
  8129. if (name === "type") {
  8130. tempObj['type'] = summaryMeshJobParameter[name];
  8131. continue;
  8132. }
  8133. if (name === "output") {
  8134. tempObj['output'] = tempObj['output'] || {};
  8135. tempObj['output'] = summaryMeshJobParameter[name];
  8136. continue;
  8137. }
  8138. if (summaryMeshJobParameter.type === 'SUMMARYMESH' && name !== 'regionDataset' || summaryMeshJobParameter.type === 'SUMMARYREGION' && !contains(['meshType', 'resolution', 'query'], name)) {
  8139. tempObj['analyst'] = tempObj['analyst'] || {};
  8140. if (name === 'query' && summaryMeshJobParameter[name]) {
  8141. tempObj['analyst'][name] = summaryMeshJobParameter[name].toBBOX();
  8142. } else {
  8143. tempObj['analyst'][name] = summaryMeshJobParameter[name];
  8144. }
  8145. if(name === 'mappingParameters'){
  8146. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  8147. tempObj['analyst']['mappingParameters'] = summaryMeshJobParameter[name];
  8148. }
  8149. }
  8150. }
  8151. function contains(arr, obj) {
  8152. var i = arr.length;
  8153. while (i--) {
  8154. if (arr[i] === obj) {
  8155. return true;
  8156. }
  8157. }
  8158. return false;
  8159. }
  8160. }
  8161. }
  8162. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobParameter.js
  8163. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8164. * This program are made available under the terms of the Apache License, Version 2.0
  8165. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8166. /**
  8167. * @class SummaryRegionJobParameter
  8168. * @deprecatedclass SuperMap.SummaryRegionJobParameter
  8169. * @category iServer ProcessingService SummaryRegion
  8170. * @classdesc 区域汇总分析任务参数类。
  8171. * @param {Object} options - 参数。
  8172. * @param {string} options.datasetName - 数据集名。
  8173. * @param {string} [options.regionDataset] - 汇总数据源(多边形汇总时用到的参数)。
  8174. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  8175. * @param {string} [options.standardFields] - 标准属性字段名称。
  8176. * @param {string} [options.weightedFields] - 权重字段名称。
  8177. * @param {StatisticAnalystMode} [options.standardStatisticModes] - 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  8178. * @param {StatisticAnalystMode} [options.weightedStatisticModes] - 权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  8179. * @param {boolean} [options.sumShape=true] - 是否统计长度或面积。
  8180. * @param {boolean} [options.standardSummaryFields=false] - 是否以标准属性字段统计。
  8181. * @param {boolean} [options.weightedSummaryFields=false] - 是否以权重字段统计。
  8182. * @param {number} [options.resolution=100] - 网格大小。
  8183. * @param {number} [options.meshType=0] - 网格面汇总类型。
  8184. * @param {AnalystSizeUnit} [options.meshSizeUnit=AnalystSizeUnit.METER] - 网格大小单位。
  8185. * @param {SummaryType} [options.type=SummaryType.SUMMARYMESH] - 汇总类型。
  8186. * @param {OutputSetting} [options.output] - 输出参数设置。
  8187. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  8188. * @usage
  8189. */
  8190. class SummaryRegionJobParameter {
  8191. constructor(options) {
  8192. if (!options) {
  8193. return;
  8194. }
  8195. /**
  8196. * @member {string} SummaryRegionJobParameter.prototype.datasetName
  8197. * @description 数据集名。
  8198. */
  8199. this.datasetName = "";
  8200. /**
  8201. * @member {string} SummaryRegionJobParameter.prototype.regionDataset
  8202. * @description 汇总数据源(多边形汇总时用到的参数)。
  8203. */
  8204. this.regionDataset = "";
  8205. /**
  8206. * @member {boolean} [SummaryRegionJobParameter.prototype.sumShape=true]
  8207. * @description 是否统计长度或面积。
  8208. */
  8209. this.sumShape = true;
  8210. /**
  8211. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} SummaryRegionJobParameter.prototype.query
  8212. * @description 分析范围。
  8213. */
  8214. this.query = "";
  8215. /**
  8216. * @member {boolean} [SummaryRegionJobParameter.prototype.standardSummaryFields=false]
  8217. * @description 是否以标准属字段统计。
  8218. */
  8219. this.standardSummaryFields = false;
  8220. /**
  8221. * @member {string} SummaryRegionJobParameter.prototype.standardFields
  8222. * @description 标准属性字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。standardSummaryFields 为 true 时必填。
  8223. */
  8224. this.standardFields = "";
  8225. /**
  8226. * @member {StatisticAnalystMode} SummaryRegionJobParameter.prototype.standardStatisticModes
  8227. * @description 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  8228. */
  8229. this.standardStatisticModes = "";
  8230. /**
  8231. * @member {boolean} [SummaryRegionJobParameter.prototype.weightedSummaryFields=false]
  8232. * @description 是否以权重字段统计。
  8233. */
  8234. this.weightedSummaryFields = false;
  8235. /**
  8236. * @member {string} SummaryRegionJobParameter.prototype.weightedFields
  8237. * @description 权重字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。weightedSummaryFields 为 true 时必填。
  8238. */
  8239. this.weightedFields = "";
  8240. /**
  8241. * @member {StatisticAnalystMode} SummaryRegionJobParameter.prototype.weightedStatisticModes
  8242. * @description 以权重字段统计的统计模式。权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  8243. */
  8244. this.weightedStatisticModes = "";
  8245. /**
  8246. * @member {number} [SummaryRegionJobParameter.prototype.meshType=0]
  8247. * @description 网格面汇总类型。
  8248. */
  8249. this.meshType = 0;
  8250. /**
  8251. * @member {number} [SummaryRegionJobParameter.prototype.resolution=100]
  8252. * @description 网格大小。
  8253. */
  8254. this.resolution = 100;
  8255. /**
  8256. * @member {AnalystSizeUnit} [SummaryRegionJobParameter.prototype.meshSizeUnit=AnalystSizeUnit.METER]
  8257. * @description 网格大小单位。
  8258. */
  8259. this.meshSizeUnit = AnalystSizeUnit.METER;
  8260. /**
  8261. * @member {SummaryType} [SummaryRegionJobParameter.prototype.type=SummaryType.SUMMARYMESH]
  8262. * @description 汇总类型。
  8263. */
  8264. this.type = SummaryType.SUMMARYMESH;
  8265. /**
  8266. * @member {OutputSetting} SummaryRegionJobParameter.prototype.output
  8267. * @description 输出参数设置类。
  8268. */
  8269. this.output = null;
  8270. /**
  8271. * @member {MappingParameters} [SummaryRegionJobParameter.prototype.mappingParameters]
  8272. * @description 分析后结果可视化的参数类。
  8273. */
  8274. this.mappingParameters = null;
  8275. Util_Util.extend(this, options);
  8276. this.CLASS_NAME = "SuperMap.SummaryRegionJobParameter";
  8277. }
  8278. /**
  8279. * @function SummaryRegionJobParameter.prototype.destroy
  8280. * @description 释放资源,将引用资源的属性置空。
  8281. */
  8282. destroy() {
  8283. this.datasetName = null;
  8284. this.sumShape = null;
  8285. this.regionDataset = null;
  8286. this.query = null;
  8287. this.standardSummaryFields = null;
  8288. this.standardFields = null;
  8289. this.standardStatisticModes = null;
  8290. this.weightedSummaryFields = null;
  8291. this.weightedFields = null;
  8292. this.weightedStatisticModes = null;
  8293. this.meshType = null;
  8294. this.resolution = null;
  8295. this.meshSizeUnit = null;
  8296. this.type = null;
  8297. if (this.output instanceof OutputSetting) {
  8298. this.output.destroy();
  8299. this.output = null;
  8300. }
  8301. if (this.mappingParameters instanceof MappingParameters){
  8302. this.mappingParameters.destroy();
  8303. this.mappingParameters = null;
  8304. }
  8305. }
  8306. /**
  8307. * @function SummaryRegionJobParameter.toObject
  8308. * @param {Object} summaryRegionJobParameter - 矢量裁剪分析任务参数。
  8309. * @param {Object} tempObj - 目标对象。
  8310. * @description 生成区域汇总分析服务对象。
  8311. */
  8312. static toObject(summaryRegionJobParameter, tempObj) {
  8313. for (var name in summaryRegionJobParameter) {
  8314. if (name === "datasetName") {
  8315. tempObj['input'] = tempObj['input'] || {};
  8316. tempObj['input'][name] = summaryRegionJobParameter[name];
  8317. continue;
  8318. }
  8319. if (name === "type") {
  8320. tempObj['type'] = summaryRegionJobParameter[name];
  8321. continue;
  8322. }
  8323. if (name === "type") {
  8324. tempObj['type'] = summaryRegionJobParameter[name];
  8325. continue;
  8326. }
  8327. if (name === "output") {
  8328. tempObj['output'] = tempObj['output'] || {};
  8329. tempObj['output'] = summaryRegionJobParameter[name];
  8330. continue;
  8331. }
  8332. if (summaryRegionJobParameter.type === "SUMMARYREGION" || summaryRegionJobParameter.type === "SUMMARYMESH" && name !== "regionDataset") {
  8333. tempObj['analyst'] = tempObj['analyst'] || {};
  8334. if (name === 'query' && summaryRegionJobParameter[name]) {
  8335. tempObj['analyst'][name] = summaryRegionJobParameter[name].toBBOX();
  8336. } else {
  8337. tempObj['analyst'][name] = summaryRegionJobParameter[name];
  8338. }
  8339. if(name === 'mappingParameters'){
  8340. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  8341. tempObj['analyst']['mappingParameters'] = summaryRegionJobParameter[name];
  8342. }
  8343. }
  8344. }
  8345. }
  8346. }
  8347. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobParameter.js
  8348. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8349. * This program are made available under the terms of the Apache License, Version 2.0
  8350. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8351. /**
  8352. * @class OverlayGeoJobParameter
  8353. * @deprecatedclass SuperMap.OverlayGeoJobParameter
  8354. * @category iServer ProcessingService OverlayAnalyst
  8355. * @classdesc 叠加分析任务参数类。
  8356. * @param {Object} options - 参数。
  8357. * @param {string} options.datasetName - 数据集名。
  8358. * @param {string} options.datasetOverlay - 叠加对象所在的数据集名称。
  8359. * @param {string} options.srcFields - 输入数据需要保留的字段。
  8360. * @param {string} [options.overlayFields] - 叠加数据需要保留的字段。对分析模式为 clip、update、erase 时,此参数无效。
  8361. * @param {string} [options.mode] - 叠加分析模式。
  8362. * @param {OutputSetting} [options.output] - 输出参数设置。
  8363. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  8364. * @usage
  8365. */
  8366. class OverlayGeoJobParameter {
  8367. constructor(options) {
  8368. if (!options) {
  8369. return;
  8370. }
  8371. /**
  8372. * @member {string} OverlayGeoJobParameter.prototype.datasetName
  8373. * @description 数据集名。
  8374. */
  8375. this.datasetName = "";
  8376. /**
  8377. * @member {string} OverlayGeoJobParameter.prototype.datasetOverlay
  8378. * @description 叠加对象所在的数据集名称。
  8379. */
  8380. this.datasetOverlay = "";
  8381. /**
  8382. * @member {string} [OverlayGeoJobParameter.prototype.mode]
  8383. * @description 叠加分析模式。
  8384. */
  8385. this.mode = "";
  8386. /**
  8387. * @member {string} OverlayGeoJobParameter.prototype.srcFields
  8388. * @description 输入数据需要保留的字段。
  8389. */
  8390. this.srcFields = "";
  8391. /**
  8392. * @member {string} OverlayGeoJobParameter.prototype.overlayFields
  8393. * @description 叠加数据需要保留的字段,对分析模式为 clip、update、erase 时,此参数无效。
  8394. */
  8395. this.overlayFields = "";
  8396. /**
  8397. * @member {OutputSetting} [OverlayGeoJobParameter.prototype.output]
  8398. * @description 输出参数设置类。
  8399. */
  8400. this.output = null;
  8401. /**
  8402. * @member {MappingParameters} [OverlayGeoJobParameter.prototype.mappingParameters]
  8403. * @description 分析后结果可视化的参数类。
  8404. */
  8405. this.mappingParameters = null;
  8406. Util_Util.extend(this, options);
  8407. this.CLASS_NAME = "SuperMap.OverlayGeoJobParameter";
  8408. }
  8409. /**
  8410. * @function OverlayGeoJobParameter.prototype.destroy
  8411. * @description 释放资源,将资源的属性置空。
  8412. */
  8413. destroy() {
  8414. this.datasetName = null;
  8415. this.datasetOverlay = null;
  8416. this.mode = null;
  8417. this.srcFields = null;
  8418. this.overlayFields = null;
  8419. if (this.output instanceof OutputSetting) {
  8420. this.output.destroy();
  8421. this.output = null;
  8422. }
  8423. if (this.mappingParameters instanceof MappingParameters) {
  8424. this.mappingParameters.destroy();
  8425. this.mappingParameters = null;
  8426. }
  8427. }
  8428. /**
  8429. * @function OverlayGeoJobParameter.toObject
  8430. * @param {Object} OverlayGeoJobParameter - 点聚合分析任务参数。
  8431. * @param {Object} tempObj - 目标对象。
  8432. * @description 生成点聚合分析任务对象。
  8433. */
  8434. static toObject(OverlayGeoJobParameter, tempObj) {
  8435. for (var name in OverlayGeoJobParameter) {
  8436. if (name == "datasetName") {
  8437. tempObj['input'] = tempObj['input'] || {};
  8438. tempObj['input'][name] = OverlayGeoJobParameter[name];
  8439. continue;
  8440. }
  8441. if (name === "output") {
  8442. tempObj['output'] = tempObj['output'] || {};
  8443. tempObj['output'] = OverlayGeoJobParameter[name];
  8444. continue;
  8445. }
  8446. tempObj['analyst'] = tempObj['analyst'] || {};
  8447. tempObj['analyst'][name] = OverlayGeoJobParameter[name];
  8448. if(name === 'mappingParameters'){
  8449. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  8450. tempObj['analyst']['mappingParameters'] = OverlayGeoJobParameter[name];
  8451. }
  8452. }
  8453. }
  8454. }
  8455. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsParameter.js
  8456. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8457. * This program are made available under the terms of the Apache License, Version 2.0
  8458. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8459. /**
  8460. * @class BuffersAnalystJobsParameter
  8461. * @deprecatedclass SuperMap.BuffersAnalystJobsParameter
  8462. * @category iServer ProcessingService BufferAnalyst
  8463. * @classdesc 缓冲区分析任务参数类。
  8464. * @param {Object} options - 参数。
  8465. * @param {string} options.datasetName - 数据集名。
  8466. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.bounds] - 分析范围(默认为全图范围)。
  8467. * @param {string} [options.distance='15'] - 缓冲距离,或缓冲区半径。
  8468. * @param {string} [options.distanceField='pickup_latitude'] - 缓冲区分析距离字段。
  8469. * @param {AnalystSizeUnit} [options.distanceUnit=AnalystSizeUnit.METER] - 缓冲距离单位单位。
  8470. * @param {OutputSetting} [options.output] - 输出参数设置。
  8471. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  8472. * @usage
  8473. */
  8474. class BuffersAnalystJobsParameter {
  8475. constructor(options) {
  8476. /**
  8477. * @member {string} BuffersAnalystJobsParameter.prototype.datasetName
  8478. * @description 数据集名。
  8479. */
  8480. this.datasetName = '';
  8481. /**
  8482. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} BuffersAnalystJobsParameter.prototype.bounds
  8483. * @description 分析范围。
  8484. */
  8485. this.bounds = '';
  8486. /**
  8487. * @member {string} [BuffersAnalystJobsParameter.prototype.distance='15']
  8488. * @description 缓冲距离,或称为缓冲区半径。当缓冲距离字段为空时,此参数有效。
  8489. */
  8490. this.distance = '';
  8491. /**
  8492. * @member {string} [BuffersAnalystJobsParameter.prototype.distanceField='pickup_latitude']
  8493. * @description 缓冲距离字段。
  8494. */
  8495. this.distanceField = '';
  8496. /**
  8497. * @member {AnalystSizeUnit} [BuffersAnalystJobsParameter.prototype.distanceUnit=AnalystSizeUnit.METER]
  8498. * @description 缓冲距离单位。
  8499. */
  8500. this.distanceUnit = AnalystSizeUnit.METER;
  8501. /**
  8502. * @member {string} BuffersAnalystJobsParameter.prototype.dissolveField
  8503. * @description 融合字段,根据字段值对缓冲区结果面对象进行融合。
  8504. */
  8505. this.dissolveField = '';
  8506. /**
  8507. * @member {OutputSetting} [BuffersAnalystJobsParameter.prototype.output]
  8508. * @description 输出参数设置类。
  8509. */
  8510. this.output = null;
  8511. /**
  8512. * @member {MappingParameters} [BuffersAnalystJobsParameter.prototype.mappingParameters]
  8513. * @description 分析后结果可视化的参数类。
  8514. */
  8515. this.mappingParameters = null;
  8516. if (!options) {
  8517. return this;
  8518. }
  8519. Util_Util.extend(this, options);
  8520. this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsParameter';
  8521. }
  8522. /**
  8523. * @function BuffersAnalystJobsParameter.prototype.destroy
  8524. * @description 释放资源,将引用资源的属性置空。
  8525. */
  8526. destroy() {
  8527. this.datasetName = null;
  8528. this.bounds = null;
  8529. this.distance = null;
  8530. this.distanceField = null;
  8531. this.distanceUnit = null;
  8532. this.dissolveField = null;
  8533. if (this.output instanceof OutputSetting) {
  8534. this.output.destroy();
  8535. this.output = null;
  8536. }
  8537. if (this.mappingParameters instanceof MappingParameters) {
  8538. this.mappingParameters.destroy();
  8539. this.mappingParameters = null;
  8540. }
  8541. }
  8542. /**
  8543. * @function BuffersAnalystJobsParameter.toObject
  8544. * @param {BuffersAnalystJobsParameter} BuffersAnalystJobsParameter - 缓冲区分析任务参数。
  8545. * @param {Object} tempObj - 目标对象。
  8546. * @description 生成缓冲区分析任务对象。
  8547. */
  8548. static toObject(BuffersAnalystJobsParameter, tempObj) {
  8549. for (var name in BuffersAnalystJobsParameter) {
  8550. if (name === 'datasetName') {
  8551. tempObj['input'] = tempObj['input'] || {};
  8552. tempObj['input'][name] = BuffersAnalystJobsParameter[name];
  8553. continue;
  8554. }
  8555. if (name === 'output') {
  8556. tempObj['output'] = tempObj['output'] || {};
  8557. tempObj['output'] = BuffersAnalystJobsParameter[name];
  8558. continue;
  8559. }
  8560. tempObj['analyst'] = tempObj['analyst'] || {};
  8561. if (name === 'bounds' && BuffersAnalystJobsParameter[name]) {
  8562. tempObj['analyst'][name] = BuffersAnalystJobsParameter[name].toBBOX();
  8563. } else {
  8564. tempObj['analyst'][name] = BuffersAnalystJobsParameter[name];
  8565. }
  8566. if (name === 'mappingParameters') {
  8567. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  8568. tempObj['analyst']['mappingParameters'] = BuffersAnalystJobsParameter[name];
  8569. }
  8570. }
  8571. }
  8572. }
  8573. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsParameter.js
  8574. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8575. * This program are made available under the terms of the Apache License, Version 2.0
  8576. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8577. /**
  8578. * @class TopologyValidatorJobsParameter
  8579. * @deprecatedclass SuperMap.TopologyValidatorJobsParameter
  8580. * @category iServer ProcessingService TopologyValidator
  8581. * @classdesc 拓扑检查分析任务参数类。
  8582. * @param {Object} options - 参数。
  8583. * @param {string} options.datasetName - 数据集名。
  8584. * @param {string} options.datasetTopology -检查对象所在的数据集名称。
  8585. * @param {TopologyValidatorRule} [options.rule=TopologyValidatorRule.REGIONNOOVERLAP] - 拓扑检查规则。
  8586. * @param {string} [options.tolerance] - 容限。
  8587. * @param {OutputSetting} [options.output] - 输出参数设置。
  8588. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  8589. * @usage
  8590. */
  8591. class TopologyValidatorJobsParameter {
  8592. constructor(options) {
  8593. if (!options) {
  8594. return;
  8595. }
  8596. /**
  8597. * @member {string} TopologyValidatorJobsParameter.prototype.datasetName
  8598. * @description 数据集名。
  8599. */
  8600. this.datasetName = "";
  8601. /**
  8602. * @member {string} TopologyValidatorJobsParameter.prototype.datasetTopology
  8603. * @description 拓扑检查对象所在的数据集名称。
  8604. */
  8605. this.datasetTopology = "";
  8606. /**
  8607. * @member {string} [TopologyValidatorJobsParameter.prototype.tolerance]
  8608. * @description 容限,指定的拓扑错误检查时使用的容限。
  8609. */
  8610. this.tolerance = "";
  8611. /**
  8612. * @member {TopologyValidatorRule} [TopologyValidatorJobsParameter.prototype.rule=TopologyValidatorRule.REGIONNOOVERLAP]
  8613. * @description 拓扑检查模式。
  8614. */
  8615. this.rule = TopologyValidatorRule.REGIONNOOVERLAP;
  8616. /**
  8617. * @member {OutputSetting} [TopologyValidatorJobsParameter.prototype.output]
  8618. * @description 输出参数设置类。
  8619. */
  8620. this.output = null;
  8621. /**
  8622. * @member {MappingParameters} [TopologyValidatorJobsParameter.prototype.mappingParameters]
  8623. * @description 分析后结果可视化的参数类。
  8624. */
  8625. this.mappingParameters = null;
  8626. Util_Util.extend(this, options);
  8627. this.CLASS_NAME = "SuperMap.TopologyValidatorJobsParameter";
  8628. }
  8629. /**
  8630. * @function TopologyValidatorJobsParameter.prototype.destroy
  8631. * @description 释放资源,将引用资源的属性置空。
  8632. */
  8633. destroy() {
  8634. this.datasetName = null;
  8635. this.datasetTopology = null;
  8636. this.tolerance = null;
  8637. this.rule = null;
  8638. if (this.output instanceof OutputSetting) {
  8639. this.output.destroy();
  8640. this.output = null;
  8641. }
  8642. if (this.mappingParameters instanceof MappingParameters) {
  8643. this.mappingParameters.destroy();
  8644. this.mappingParameters = null;
  8645. }
  8646. }
  8647. /**
  8648. * @function TopologyValidatorJobsParameter.toObject
  8649. * @param {Object} TopologyValidatorJobsParameter -拓扑检查分析任务参数。
  8650. * @param {Object} tempObj - 目标对象。
  8651. * @description 生成拓扑检查分析任务对象。
  8652. */
  8653. static toObject(TopologyValidatorJobsParameter, tempObj) {
  8654. for (var name in TopologyValidatorJobsParameter) {
  8655. if (name === "datasetName") {
  8656. tempObj['input'] = tempObj['input'] || {};
  8657. tempObj['input'][name] = TopologyValidatorJobsParameter[name];
  8658. continue;
  8659. }
  8660. if (name === "output") {
  8661. tempObj['output'] = tempObj['output'] || {};
  8662. tempObj['output'] = TopologyValidatorJobsParameter[name];
  8663. continue;
  8664. }
  8665. tempObj['analyst'] = tempObj['analyst'] || {};
  8666. tempObj['analyst'][name] = TopologyValidatorJobsParameter[name];
  8667. if(name === 'mappingParameters'){
  8668. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  8669. tempObj['analyst']['mappingParameters'] = TopologyValidatorJobsParameter[name];
  8670. }
  8671. }
  8672. }
  8673. }
  8674. ;// CONCATENATED MODULE: ./src/common/iServer/GeoCodingParameter.js
  8675. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8676. * This program are made available under the terms of the Apache License, Version 2.0
  8677. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8678. /**
  8679. * @class GeoCodingParameter
  8680. * @deprecatedclass SuperMap.GeoCodingParameter
  8681. * @category iServer AddressMatch
  8682. * @classdesc 地理正向匹配参数类。
  8683. * @param {Object} options - 参数。
  8684. * @param {string} options.address - 地点关键词。
  8685. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  8686. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  8687. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  8688. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  8689. * @param {number} [options.maxReturn] - 最大返回结果数。
  8690. * @usage
  8691. */
  8692. class GeoCodingParameter {
  8693. constructor(options) {
  8694. if (options.filters && typeof(options.filters) === 'string') {
  8695. options.filters = options.filters.split(',');
  8696. }
  8697. /**
  8698. * @member {string} GeoCodingParameter.prototype.address
  8699. * @description 地点关键词。
  8700. */
  8701. this.address = null;
  8702. /**
  8703. * @member {number} [GeoCodingParameter.prototype.fromIndex]
  8704. * @description 设置返回对象的起始索引值。
  8705. */
  8706. this.fromIndex = null;
  8707. /**
  8708. * @member {number} [GeoCodingParameter.prototype.toIndex]
  8709. * @description 设置返回对象的结束索引值。
  8710. */
  8711. this.toIndex = null;
  8712. /**
  8713. * @member {Array.<string>} [GeoCodingParameter.prototype.filters]
  8714. * @description 过滤字段,限定查询区域。
  8715. */
  8716. this.filters = null;
  8717. /**
  8718. * @member {string} [GeoCodingParameter.prototype.prjCoordSys]
  8719. * @description 查询结果的坐标系。
  8720. */
  8721. this.prjCoordSys = null;
  8722. /**
  8723. * @member {number} [GeoCodingParameter.prototype.maxReturn]
  8724. * @description 最大返回结果数。
  8725. */
  8726. this.maxReturn = null;
  8727. Util_Util.extend(this, options);
  8728. }
  8729. /**
  8730. * @function GeoCodingParameter.prototype.destroy
  8731. * @description 释放资源,将引用资源的属性置空。
  8732. */
  8733. destroy() {
  8734. this.address = null;
  8735. this.fromIndex = null;
  8736. this.toIndex = null;
  8737. this.filters = null;
  8738. this.prjCoordSys = null;
  8739. this.maxReturn = null;
  8740. }
  8741. }
  8742. ;// CONCATENATED MODULE: ./src/common/iServer/GeoDecodingParameter.js
  8743. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  8744. * This program are made available under the terms of the Apache License, Version 2.0
  8745. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8746. /**
  8747. * @class GeoDecodingParameter
  8748. * @deprecatedclass SuperMap.GeoDecodingParameter
  8749. * @category iServer AddressMatch
  8750. * @classdesc 地理反向匹配参数类。
  8751. * @param {Object} options - 参数。
  8752. * @param {number} options.x - 查询位置的横坐标。
  8753. * @param {number} options.y - 查询位置的纵坐标。
  8754. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  8755. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  8756. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  8757. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  8758. * @param {number} [options.maxReturn] - 最大返回结果数。
  8759. * @param {number} [options.geoDecodingRadius] - 查询半径。
  8760. * @usage
  8761. */
  8762. class GeoDecodingParameter {
  8763. constructor(options) {
  8764. if (options.filters) {
  8765. options.filters = options.filters.split(',');
  8766. }
  8767. /**
  8768. * @member {number} GeoDecodingParameter.prototype.x
  8769. * @description 查询位置的横坐标。
  8770. */
  8771. this.x = null;
  8772. /**
  8773. * @member {number} GeoDecodingParameter.prototype.y
  8774. * @description 查询位置的纵坐标。
  8775. */
  8776. this.y = null;
  8777. /**
  8778. * @member {number} [GeoDecodingParameter.prototype.fromIndex]
  8779. * @description 设置返回对象的起始索引值。
  8780. */
  8781. this.fromIndex = null;
  8782. /**
  8783. * @member {number} [GeoDecodingParameter.prototype.toIndex]
  8784. * @description 设置返回对象的结束索引值。
  8785. */
  8786. this.toIndex = null;
  8787. /**
  8788. * @member {Array.<string>} [GeoDecodingParameter.prototype.filters]
  8789. * @description 过滤字段,限定查询区域。
  8790. */
  8791. this.filters = null;
  8792. /**
  8793. * @member {string} [GeoDecodingParameter.prototype.prjCoordSys]
  8794. * @description 查询结果的坐标系。
  8795. */
  8796. this.prjCoordSys = null;
  8797. /**
  8798. * @member {number} [GeoDecodingParameter.prototype.maxReturn]
  8799. * @description 最大返回结果数。
  8800. */
  8801. this.maxReturn = null;
  8802. /**
  8803. * @member {number} GeoDecodingParameter.prototype.geoDecodingRadius
  8804. * @description 查询半径。
  8805. */
  8806. this.geoDecodingRadius = null;
  8807. Util_Util.extend(this, options);
  8808. }
  8809. /**
  8810. * @function GeoDecodingParameter.prototype.destroy
  8811. * @description 释放资源,将引用资源的属性置空。
  8812. */
  8813. destroy() {
  8814. this.x = null;
  8815. this.y = null;
  8816. this.fromIndex = null;
  8817. this.toIndex = null;
  8818. this.filters = null;
  8819. this.prjCoordSys = null;
  8820. this.maxReturn = null;
  8821. this.geoDecodingRadius = null;
  8822. }
  8823. }
  8824. ;// CONCATENATED MODULE: ./src/classic/SuperMap.js
  8825. var SuperMap = window.SuperMap = window.SuperMap || {};
  8826. SuperMap.REST = SuperMap.REST || {};
  8827. ;// CONCATENATED MODULE: external "function(){try{return mapv}catch(e){return {}}}()"
  8828. const external_function_try_return_mapv_catch_e_return_namespaceObject = function(){try{return mapv}catch(e){return {}}}();
  8829. ;// CONCATENATED MODULE: ./src/common/util/MapCalculateUtil.js
  8830. /**
  8831. * @function getMeterPerMapUnit
  8832. * @description 单位换算,把米|度|千米|英寸|英尺换成米。
  8833. * @category BaseTypes Util
  8834. * @param {string} mapUnit 地图单位。
  8835. * @returns {number} 返回地图的距离单位。
  8836. * @usage
  8837. * ```
  8838. * // 浏览器
  8839. * <script type="text/javascript" src="{cdn}"></script>
  8840. * <script>
  8841. * const result = {namespace}.getMeterPerMapUnit(mapUnit);
  8842. *
  8843. * </script>
  8844. *
  8845. * // ES6 Import
  8846. * import { getMeterPerMapUnit } from '{npm}';
  8847. *
  8848. * const result = getMeterPerMapUnit(mapUnit);
  8849. * ```
  8850. */
  8851. var getMeterPerMapUnit = function(mapUnit) {
  8852. var earchRadiusInMeters = 6378137;
  8853. var meterPerMapUnit;
  8854. if (mapUnit === Unit.METER) {
  8855. meterPerMapUnit = 1;
  8856. } else if (mapUnit === Unit.DEGREE) {
  8857. // 每度表示多少米。
  8858. meterPerMapUnit = (Math.PI * 2 * earchRadiusInMeters) / 360;
  8859. } else if (mapUnit === Unit.KILOMETER) {
  8860. meterPerMapUnit = 1.0e-3;
  8861. } else if (mapUnit === Unit.INCH) {
  8862. meterPerMapUnit = 1 / 2.5399999918e-2;
  8863. } else if (mapUnit === Unit.FOOT) {
  8864. meterPerMapUnit = 0.3048;
  8865. } else {
  8866. return meterPerMapUnit;
  8867. }
  8868. return meterPerMapUnit;
  8869. };
  8870. /**
  8871. * @function getWrapNum
  8872. * @description 获取该坐标系的经纬度范围的经度或纬度。
  8873. * @category BaseTypes Util
  8874. * @param {number} x 经度或纬度。
  8875. * @param {boolean} includeMax 是否获取经度或纬度的最大值。
  8876. * @param {boolean} includeMin 是否获取经度或纬度的最小值。
  8877. * @param {number} range 坐标系的经纬度范围。
  8878. * @returns {number} 返回经度或纬度的值。
  8879. * @usage
  8880. * ```
  8881. * // 浏览器
  8882. * <script type="text/javascript" src="{cdn}"></script>
  8883. * <script>
  8884. * const result = {namespace}.getWrapNum(x, includeMax, includeMin, range);
  8885. *
  8886. * </script>
  8887. *
  8888. * // ES6 Import
  8889. * import { getWrapNum } from '{npm}';
  8890. *
  8891. * const result = getWrapNum(x, includeMax, includeMin, range);
  8892. * ```
  8893. */
  8894. function getWrapNum(x, includeMax = true, includeMin = true, range = [-180, 180]) {
  8895. var max = range[1],
  8896. min = range[0],
  8897. d = max - min;
  8898. if (x === max && includeMax) {
  8899. return x;
  8900. }
  8901. if (x === min && includeMin) {
  8902. return x;
  8903. }
  8904. var tmp = (((x - min) % d) + d) % d;
  8905. if (tmp === 0 && includeMax) {
  8906. return max;
  8907. }
  8908. return ((((x - min) % d) + d) % d) + min;
  8909. }
  8910. /**
  8911. * @function conversionDegree
  8912. * @description 转换经纬度。
  8913. * @category BaseTypes Util
  8914. * @param {number} degrees 经度或纬度。
  8915. * @returns {string} 返回度分秒。
  8916. * @usage
  8917. * ```
  8918. * // 浏览器
  8919. * <script type="text/javascript" src="{cdn}"></script>
  8920. * <script>
  8921. * const result = {namespace}.conversionDegree(degrees);
  8922. *
  8923. * </script>
  8924. *
  8925. * // ES6 Import
  8926. * import { conversionDegree } from '{npm}';
  8927. *
  8928. * const result = conversionDegree(degrees);
  8929. * ```
  8930. */
  8931. function conversionDegree(degrees) {
  8932. const degree = parseInt(degrees);
  8933. let fraction = parseInt((degrees - degree) * 60);
  8934. let second = parseInt(((degrees - degree) * 60 - fraction) * 60);
  8935. fraction = parseInt(fraction / 10) === 0 ? `0${fraction}` : fraction;
  8936. second = parseInt(second / 10) === 0 ? `0${second}` : second;
  8937. return `${degree}°${fraction}'${second}`;
  8938. }
  8939. /**
  8940. * @function scalesToResolutions
  8941. * @description 通过比例尺数组计算分辨率数组,没有传入比例尺数组时通过地图范围与地图最大级别进行计算。
  8942. * @version 11.0.1
  8943. * @param {Array} scales - 比例尺数组。
  8944. * @param {Object} bounds - 地图范围。
  8945. * @param {number} dpi - 屏幕分辨率。
  8946. * @param {string} mapUnit - 地图单位。
  8947. * @param {number} [level=22] - 地图最大级别。
  8948. * @returns {number} 分辨率。
  8949. * @usage
  8950. * ```
  8951. * // 浏览器
  8952. * <script type="text/javascript" src="{cdn}"></script>
  8953. * <script>
  8954. * const result = {namespace}.scalesToResolutions(scales, bounds, dpi, mapUnit);
  8955. *
  8956. * </script>
  8957. *
  8958. * // ES6 Import
  8959. * import { scalesToResolutions } from '{npm}';
  8960. *
  8961. * const result = scalesToResolutions(scales, bounds, dpi, mapUnit);
  8962. * ```
  8963. */
  8964. function scalesToResolutions(scales, bounds, dpi, mapUnit, level = 22) {
  8965. var resolutions = [];
  8966. if (scales && scales.length > 0) {
  8967. for (let i = 0; i < scales.length; i++) {
  8968. resolutions.push(scaleToResolution(scales[i], dpi, mapUnit));
  8969. }
  8970. } else {
  8971. const maxReolution = Math.abs(bounds.left - bounds.right) / 256;
  8972. for (let i = 0; i < level; i++) {
  8973. resolutions.push(maxReolution / Math.pow(2, i));
  8974. }
  8975. }
  8976. return resolutions.sort(function (a, b) {
  8977. return b - a;
  8978. });
  8979. }
  8980. /**
  8981. * @function getZoomByResolution
  8982. * @description 通过分辨率获取地图级别。
  8983. * @version 11.0.1
  8984. * @param {number} resolution - 分辨率。
  8985. * @param {Array} resolutions - 分辨率数组。
  8986. * @returns {number} 地图级别。
  8987. * @usage
  8988. * ```
  8989. * // 浏览器
  8990. * <script type="text/javascript" src="{cdn}"></script>
  8991. * <script>
  8992. * const result = {namespace}.getZoomByResolution(resolution, resolutions);
  8993. *
  8994. * </script>
  8995. *
  8996. * // ES6 Import
  8997. * import { getZoomByResolution } from '{npm}';
  8998. *
  8999. * const result = getZoomByResolution(resolution, resolutions);
  9000. * ```
  9001. */
  9002. function getZoomByResolution(resolution, resolutions) {
  9003. let zoom = 0;
  9004. let minDistance;
  9005. for (let i = 0; i < resolutions.length; i++) {
  9006. if (i === 0) {
  9007. minDistance = Math.abs(resolution - resolutions[i]);
  9008. }
  9009. if (minDistance > Math.abs(resolution - resolutions[i])) {
  9010. minDistance = Math.abs(resolution - resolutions[i]);
  9011. zoom = i;
  9012. }
  9013. }
  9014. return zoom;
  9015. }
  9016. /**
  9017. * @function scaleToResolution
  9018. * @description 通过比例尺计算分辨率。
  9019. * @version 11.0.1
  9020. * @param {number} scale - 比例尺。
  9021. * @param {number} dpi - 屏幕分辨率。
  9022. * @param {string} mapUnit - 地图单位。
  9023. * @returns {number} 分辨率。
  9024. * @usage
  9025. * ```
  9026. * // 浏览器
  9027. * <script type="text/javascript" src="{cdn}"></script>
  9028. * <script>
  9029. * const result = {namespace}.scaleToResolution(scale, dpi, mapUnit);
  9030. *
  9031. * </script>
  9032. *
  9033. * // ES6 Import
  9034. * import { scaleToResolution } from '{npm}';
  9035. *
  9036. * const result = scaleToResolution(scale, dpi, mapUnit);
  9037. * ```
  9038. */
  9039. function scaleToResolution(scale, dpi, mapUnit) {
  9040. const inchPerMeter = 1 / 0.0254;
  9041. const meterPerMapUnitValue = getMeterPerMapUnit(mapUnit);
  9042. const resolution = 1 / (scale * dpi * inchPerMeter * meterPerMapUnitValue);
  9043. return resolution;
  9044. }
  9045. /**
  9046. * 范围是否相交
  9047. * @param {Array} extent1 范围1
  9048. * @param {Array} extent2 范围2
  9049. * @return {boolean} 范围是否相交。
  9050. */
  9051. function intersects(extent1, extent2) {
  9052. return (
  9053. extent1[0] <= extent2[2] &&
  9054. extent1[2] >= extent2[0] &&
  9055. extent1[1] <= extent2[3] &&
  9056. extent1[3] >= extent2[1]
  9057. );
  9058. }
  9059. /**
  9060. * 获取两个范围的交集
  9061. * @param {Array} extent1 Extent 1
  9062. * @param {Array} extent2 Extent 2
  9063. * @return {Array} 相交范围数组.
  9064. * @api
  9065. */
  9066. function getIntersection(extent1, extent2) {
  9067. const intersection = [];
  9068. if (intersects(extent1, extent2)) {
  9069. if (extent1[0] > extent2[0]) {
  9070. intersection[0] = extent1[0];
  9071. } else {
  9072. intersection[0] = extent2[0];
  9073. }
  9074. if (extent1[1] > extent2[1]) {
  9075. intersection[1] = extent1[1];
  9076. } else {
  9077. intersection[1] = extent2[1];
  9078. }
  9079. if (extent1[2] < extent2[2]) {
  9080. intersection[2] = extent1[2];
  9081. } else {
  9082. intersection[2] = extent2[2];
  9083. }
  9084. if (extent1[3] < extent2[3]) {
  9085. intersection[3] = extent1[3];
  9086. } else {
  9087. intersection[3] = extent2[3];
  9088. }
  9089. }
  9090. return intersection;
  9091. }
  9092. ;// CONCATENATED MODULE: ./src/classic/overlay/mapv/MapVRenderer.js
  9093. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  9094. * This program are made available under the terms of the Apache License, Version 2.0
  9095. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9096. /**
  9097. * @class MapVRenderer
  9098. * @classdesc MapV渲染器。
  9099. * @private
  9100. * @extends {mapv.baiduMapLayer}
  9101. * @param {SuperMap.Map} map - 待渲染的地图。
  9102. * @param {SuperMap.Layer.MapVLayer} layer - 待渲染的图层。
  9103. * @param {Mapv.DataSet} dataSet - 待渲染的数据集,数据所属坐标系要求与 map 保持一致。
  9104. * @param {Object} options - 渲染的参数。
  9105. */
  9106. var MapVBaseLayer = external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer ? external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer.__proto__ : Function;
  9107. class MapVRenderer extends MapVBaseLayer {
  9108. constructor(map, layer, dataSet, options) {
  9109. super(map, dataSet, options);
  9110. if (!MapVBaseLayer) {
  9111. return this;
  9112. }
  9113. var self = this;
  9114. options = options || {};
  9115. self.init(options);
  9116. self.argCheck(options);
  9117. this.canvasLayer = layer;
  9118. this.clickEvent = this.clickEvent.bind(this);
  9119. this.mousemoveEvent = this.mousemoveEvent.bind(this);
  9120. this.bindEvent();
  9121. }
  9122. /**
  9123. * @function MapvRenderer.prototype.clickEvent
  9124. * @description 点击事件。
  9125. * @param {Object} e - 触发对象。
  9126. */
  9127. clickEvent(e) {
  9128. var pixel = e.xy;
  9129. var devicePixelRatio = this.devicePixelRatio || 1;
  9130. super.clickEvent({ x: pixel.x / devicePixelRatio, y: pixel.y / devicePixelRatio }, e);
  9131. }
  9132. /**
  9133. * @function MapvRenderer.prototype.mousemoveEvent
  9134. * @description 鼠标移动事件。
  9135. * @param {Object} e - 触发对象。
  9136. */
  9137. mousemoveEvent(e) {
  9138. var pixel = e.xy;
  9139. super.mousemoveEvent(pixel, e);
  9140. }
  9141. /**
  9142. * @function MapvRenderer.prototype.bindEvent
  9143. * @description 绑定鼠标移动和鼠标点击事件。
  9144. */
  9145. bindEvent() {
  9146. var map = this.map;
  9147. if (this.options.methods) {
  9148. if (this.options.methods.click) {
  9149. map.events.on({ click: this.clickEvent });
  9150. }
  9151. if (this.options.methods.mousemove) {
  9152. map.events.on({ mousemove: this.mousemoveEvent });
  9153. }
  9154. }
  9155. }
  9156. /**
  9157. * @function MapvRenderer.prototype.unbindEvent
  9158. * @description 解绑鼠标移动和鼠标滑动触发的事件。
  9159. */
  9160. unbindEvent() {
  9161. var map = this.map;
  9162. if (this.options.methods) {
  9163. if (this.options.methods.click) {
  9164. map.events.un({ click: this.clickEvent });
  9165. }
  9166. if (this.options.methods.mousemove) {
  9167. map.events.un({ mousemove: this.mousemoveEvent });
  9168. }
  9169. }
  9170. }
  9171. /**
  9172. * @function MapvRenderer.prototype.getContext
  9173. * @description 获取信息。
  9174. */
  9175. getContext() {
  9176. return this.canvasLayer && this.canvasLayer.canvasContext;
  9177. }
  9178. /**
  9179. * @function MapvRenderer.prototype.addData
  9180. * @description 追加数据
  9181. * @param {Object} data - 待添加的数据。
  9182. * @param {Object} options - 待添加的数据信息。
  9183. */
  9184. addData(data, options) {
  9185. var _data = data;
  9186. if (data && data.get) {
  9187. _data = data.get();
  9188. }
  9189. this.dataSet.add(_data);
  9190. this.update({ options: options });
  9191. }
  9192. /**
  9193. * @function MapvRenderer.prototype.updateData
  9194. * @description 更新覆盖原数据。
  9195. * @param {Object} data - 待更新的数据。
  9196. * @param {Object} options - 待更新的数据信息。
  9197. */
  9198. setData(data, options) {
  9199. var _data = data;
  9200. if (data && data.get) {
  9201. _data = data.get();
  9202. }
  9203. this.dataSet = this.dataSet || new external_function_try_return_mapv_catch_e_return_namespaceObject.DataSet();
  9204. this.dataSet.set(_data);
  9205. this.update({ options: options });
  9206. }
  9207. /**
  9208. * @function MapvRenderer.prototype.getData
  9209. * @description 获取数据。
  9210. */
  9211. getData() {
  9212. return this.dataSet;
  9213. }
  9214. /**
  9215. * @function MapvRenderer.prototype.removeData
  9216. * @description 删除符合过滤条件的数据。
  9217. * @param {function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  9218. */
  9219. removeData(filter) {
  9220. if (!this.dataSet) {
  9221. return;
  9222. }
  9223. var newData = this.dataSet.get({
  9224. filter: function (data) {
  9225. return filter != null && typeof filter === 'function' ? !filter(data) : true;
  9226. }
  9227. });
  9228. this.dataSet.set(newData);
  9229. this.update({ options: null });
  9230. }
  9231. /**
  9232. * @function MapvRenderer.prototype.clearData
  9233. * @description 清除数据。
  9234. */
  9235. clearData() {
  9236. this.dataSet && this.dataSet.clear();
  9237. this.update({ options: null });
  9238. }
  9239. /**
  9240. * @function MapvRenderer.prototype.render
  9241. * @description 着色。
  9242. * @param {number} time
  9243. */
  9244. render(time) {
  9245. this._canvasUpdate(time);
  9246. }
  9247. /**
  9248. * @function MapvRenderer.prototype.transferToMercator
  9249. * @description 墨卡托坐标为经纬度。
  9250. * @deprecated
  9251. */
  9252. transferToMercator() {
  9253. if (this.options.coordType && ['bd09mc', 'coordinates_mercator'].indexOf(this.options.coordType) > -1) {
  9254. var data = this.dataSet.get();
  9255. data = this.dataSet.transferCoordinate(
  9256. data,
  9257. function (coordinates) {
  9258. var pixel = SuperMap.Projection.transform(
  9259. {
  9260. x: coordinates[0],
  9261. y: coordinates[1]
  9262. },
  9263. 'EPSG:3857',
  9264. 'EPSG:4326'
  9265. );
  9266. return [pixel.x, pixel.y];
  9267. },
  9268. 'coordinates',
  9269. 'coordinates'
  9270. );
  9271. this.dataSet._set(data);
  9272. }
  9273. }
  9274. _canvasUpdate(time) {
  9275. if (!this.canvasLayer) {
  9276. return;
  9277. }
  9278. var self = this;
  9279. var animationOptions = self.options.animation;
  9280. var context = this.getContext();
  9281. var map = this.map;
  9282. if (self.isEnabledTime()) {
  9283. if (time === undefined) {
  9284. this.clear(context);
  9285. return;
  9286. }
  9287. if (this.context === '2d') {
  9288. context.save();
  9289. context.globalCompositeOperation = 'destination-out';
  9290. context.fillStyle = 'rgba(0, 0, 0, .1)';
  9291. context.fillRect(0, 0, context.canvas.width, context.canvas.height);
  9292. context.restore();
  9293. }
  9294. } else {
  9295. this.clear(context);
  9296. }
  9297. if (this.context === '2d') {
  9298. for (var key in self.options) {
  9299. context[key] = self.options[key];
  9300. }
  9301. } else {
  9302. context.clear(context.COLOR_BUFFER_BIT);
  9303. }
  9304. if (
  9305. (self.options.minZoom && map.getZoom() < self.options.minZoom) ||
  9306. (self.options.maxZoom && map.getZoom() > self.options.maxZoom)
  9307. ) {
  9308. return;
  9309. }
  9310. var layer = self.canvasLayer;
  9311. var dataGetOptions = {
  9312. fromColumn: 'coordinates',
  9313. transferCoordinate: function (coordinate) {
  9314. var coord = { lon: coordinate[0], lat: coordinate[1] };
  9315. var worldPoint = map.getViewPortPxFromLonLat(coord);
  9316. return [worldPoint.x, worldPoint.y];
  9317. }
  9318. };
  9319. if (time !== undefined) {
  9320. dataGetOptions.filter = function (item) {
  9321. var trails = animationOptions.trails || 10;
  9322. return time && item.time > time - trails && item.time < time;
  9323. };
  9324. }
  9325. var data = self.dataSet.get(dataGetOptions);
  9326. this.processData(data);
  9327. // 一个像素是多少米
  9328. var zoomUnit = map.getResolution() * getMeterPerMapUnit('DEGREE');
  9329. // // 兼容unit为'm'的情况
  9330. if (self.options.unit === 'm') {
  9331. if (self.options.size) {
  9332. self.options._size = self.options.size / zoomUnit;
  9333. }
  9334. if (self.options.width) {
  9335. self.options._width = self.options.width / zoomUnit;
  9336. }
  9337. if (self.options.height) {
  9338. self.options._height = self.options.height / zoomUnit;
  9339. }
  9340. } else {
  9341. self.options._size = self.options.size;
  9342. self.options._height = self.options.height;
  9343. self.options._width = self.options.width;
  9344. }
  9345. var worldPoint = map.getViewPortPxFromLonLat(layer.transferToMapLatLng({ lon: 0, lat: 0 }));
  9346. this.drawContext(context, data, self.options, worldPoint);
  9347. self.options.updateCallback && self.options.updateCallback(time);
  9348. }
  9349. init(options) {
  9350. var self = this;
  9351. self.options = options;
  9352. this.initDataRange(options);
  9353. this.context = self.options.context || '2d';
  9354. if (self.options.zIndex) {
  9355. this.canvasLayer && this.canvasLayer.setZIndex(self.options.zIndex);
  9356. }
  9357. this.initAnimator();
  9358. }
  9359. /**
  9360. * @function MapvRenderer.prototype.addAnimatorEvent
  9361. * @description 添加动画事件。
  9362. */
  9363. addAnimatorEvent() {
  9364. this.map.events.on({ movestart: this.animatorMovestartEvent.bind(this) });
  9365. this.map.events.on({ moveend: this.animatorMoveendEvent.bind(this) });
  9366. }
  9367. /**
  9368. * @function MapvRenderer.prototype.clear
  9369. * @description 清除环境。
  9370. * @param {Object} context - 当前环境。
  9371. */
  9372. clear(context) {
  9373. context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  9374. }
  9375. /**
  9376. * @function MapvRenderer.prototype.show
  9377. * @description 展示渲染效果。
  9378. */
  9379. show() {
  9380. this.map.addLayer(this.canvasLayer);
  9381. }
  9382. /**
  9383. * @function MapvRenderer.prototype.hide
  9384. * @description 隐藏渲染效果。
  9385. */
  9386. hide() {
  9387. this.map.removeLayer(this.canvasLayer);
  9388. }
  9389. /**
  9390. * @function MapvRenderer.prototype.draw
  9391. * @description 渲染绘制。
  9392. */
  9393. draw() {
  9394. this.canvasLayer.redraw();
  9395. }
  9396. }
  9397. ;// CONCATENATED MODULE: ./src/classic/overlay/MapVLayer.js
  9398. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  9399. * This program are made available under the terms of the Apache License, Version 2.0
  9400. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9401. /**
  9402. * @class SuperMap.Layer.MapVLayer
  9403. * @category Visualization MapV
  9404. * @classdesc MapV 图层类。
  9405. * @modulecategory Overlay
  9406. * @extends {SuperMap.Layer}
  9407. * @param {string} name - 图层名。
  9408. * @param {Object} options - 可选参数。
  9409. * @param {Mapv.DataSet} options.dataSet - MapV 的 dataSet 对象。
  9410. * @param {Object} options.options - MapV 绘图风格配置信息。
  9411. */
  9412. class MapVLayer extends SuperMap.Layer {
  9413. constructor(name, options) {
  9414. super(name, options);
  9415. /**
  9416. * @member {Mapv.DataSet} SuperMap.Layer.MapVLayer.prototype.dataSet
  9417. * @description MapV 的 dataset 对象。
  9418. */
  9419. this.dataSet = null;
  9420. /**
  9421. * @member {Object} SuperMap.Layer.MapVLayer.prototype.options
  9422. * @description MapV 绘图风格配置信息。
  9423. */
  9424. this.options = null;
  9425. /**
  9426. * @member {boolean} [SuperMap.Layer.MapVLayer.prototype.supported=false]
  9427. * @description 当前浏览器是否支持 canvas 绘制。决定了 MapV 图是否可用,内部判断使用。
  9428. */
  9429. this.supported = false;
  9430. /**
  9431. * @member {HTMLCanvasElement} SuperMap.Layer.MapVLayer.prototype.canvas
  9432. * @description MapV 图主绘制面板。
  9433. */
  9434. this.canvas = null;
  9435. /**
  9436. * @private
  9437. * @member {CanvasContext} SuperMap.Layer.MapVLayer.prototype.canvasContext
  9438. * @description MapV 图主绘制对象。
  9439. */
  9440. this.canvasContext = null;
  9441. if (options) {
  9442. SuperMap.Util.extend(this, options);
  9443. }
  9444. //MapV图要求使用canvas绘制,判断是否支持
  9445. this.canvas = document.createElement('canvas');
  9446. if (!this.canvas.getContext) {
  9447. return;
  9448. }
  9449. this.supported = true;
  9450. //构建绘图面板
  9451. this.canvas.style.position = 'absolute';
  9452. this.canvas.style.top = 0 + 'px';
  9453. this.canvas.style.left = 0 + 'px';
  9454. this.div.appendChild(this.canvas);
  9455. var context = (this.options && this.options.context) || '2d';
  9456. this.canvasContext = this.canvas.getContext(context);
  9457. var global$2 = typeof window === 'undefined' ? {} : window;
  9458. var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio || 1;
  9459. if (context === '2d') {
  9460. this.canvasContext.scale(devicePixelRatio, devicePixelRatio);
  9461. }
  9462. this.attribution =
  9463. "© 2018 百度 <a href='https://mapv.baidu.com' target='_blank'>MapV</a> with <span>© <a target='_blank' href='https://iclient.supermap.io' " +
  9464. "style='color: #08c;text-decoration: none;'>SuperMap iClient</a></span>";
  9465. this.CLASS_NAME = 'SuperMap.Layer.MapVLayer';
  9466. }
  9467. /**
  9468. * @function SuperMap.Layer.MapVLayer.prototype.destroy
  9469. * @description 销毁此图层,销毁后此图层的所有属性为 null。
  9470. * @override
  9471. */
  9472. destroy() {
  9473. if (this.renderer && this.renderer.animator) {
  9474. this.renderer.animator.stop();
  9475. this.renderer.animator = null;
  9476. }
  9477. this.dataSet = null;
  9478. this.options = null;
  9479. this.renderer = null;
  9480. this.supported = null;
  9481. this.canvas = null;
  9482. this.canvasContext = null;
  9483. this.maxWidth = null;
  9484. this.maxHeight = null;
  9485. super.destroy();
  9486. }
  9487. /**
  9488. * @function SuperMap.Layer.MapVLayer.prototype.addData
  9489. * @description 追加数据。
  9490. * @param {Mapv.DataSet} dataSet - MapV 的 dataSet 对象。
  9491. * @param {Object} options - MapV 绘图风格配置信息。
  9492. */
  9493. addData(dataSet, options) {
  9494. this.renderer && this.renderer.addData(dataSet, options);
  9495. }
  9496. /**
  9497. * @function SuperMap.Layer.MapVLayer.prototype.
  9498. * @description 设置数据。
  9499. * @param {Mapv.DataSet} dataSet - MapV 的 dataSet 对象。
  9500. * @param {Object} options - MapV 绘图风格配置信息。
  9501. */
  9502. setData(dataSet, options) {
  9503. this.renderer && this.renderer.setData(dataSet, options);
  9504. }
  9505. /**
  9506. * @function SuperMap.Layer.MapVLayer.prototype.getData
  9507. * @description 获取数据。
  9508. * @returns {Mapv.DataSet} MapV 的 dataSet 对象。
  9509. */
  9510. getData() {
  9511. if (this.renderer) {
  9512. this.dataSet = this.renderer.getData();
  9513. }
  9514. return this.dataSet;
  9515. }
  9516. /**
  9517. * @function SuperMap.Layer.MapVLayer.prototype.removeData
  9518. * @description 删除符合过滤条件的数据。
  9519. * @param {function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  9520. * @example
  9521. * filter=function(data){
  9522. * if(data.id=="1"){
  9523. * return true
  9524. * }
  9525. * return false;
  9526. * }
  9527. */
  9528. removeData(filter) {
  9529. this.renderer && this.renderer.removeData(filter);
  9530. }
  9531. /**
  9532. * @function SuperMap.Layer.MapVLayer.prototype.clearData
  9533. * @description 清除数据。
  9534. */
  9535. clearData() {
  9536. this.renderer.clearData();
  9537. }
  9538. /**
  9539. * @function SuperMap.Layer.MapVLayer.prototype.setMap
  9540. * @description 图层已经添加到 Map 中。
  9541. * 如果当前浏览器支持 canvas,则开始渲染要素;如果不支持则移除图层。
  9542. * @param {SuperMap.Map} map - 需要绑定的 map 对象。
  9543. */
  9544. setMap(map) {
  9545. super.setMap(map);
  9546. this.renderer = new MapVRenderer(map, this, this.dataSet, this.options);
  9547. this.renderer.devicePixelRatio = this.devicePixelRatio;
  9548. if (!this.supported) {
  9549. this.map.removeLayer(this);
  9550. } else {
  9551. this.redraw();
  9552. }
  9553. }
  9554. /**
  9555. * @function SuperMap.Layer.MapVLayer.prototype.moveTo
  9556. * @description 重置当前 MapV 图层的 div,再一次与 Map 控件保持一致。
  9557. * 修改当前显示范围,当平移或者缩放结束后开始重绘 MapV 图的渲染效果。
  9558. * @param {SuperMap.Bounds} bounds - 图层范围。
  9559. * @param {boolean} [zoomChanged] - 缩放级别是否改变。
  9560. * @param {boolean} [dragging] - 是否拖动。
  9561. */
  9562. moveTo(bounds, zoomChanged, dragging) {
  9563. super.moveTo(bounds, zoomChanged, dragging);
  9564. if (!this.supported) {
  9565. return;
  9566. }
  9567. this.zoomChanged = zoomChanged;
  9568. if (!dragging) {
  9569. this.div.style.visibility = 'hidden';
  9570. this.div.style.left = -parseInt(this.map.layerContainerDiv.style.left) + 'px';
  9571. this.div.style.top = -parseInt(this.map.layerContainerDiv.style.top) + 'px';
  9572. /*this.canvas.style.left = this.div.style.left;
  9573. this.canvas.style.top = this.div.style.top;*/
  9574. var size = this.map.getSize();
  9575. this.div.style.width = parseInt(size.w) + 'px';
  9576. this.div.style.height = parseInt(size.h) + 'px';
  9577. if (this.options.draw === 'heatmap') {
  9578. this.canvas.width = parseInt(size.w) * this.devicePixelRatio;
  9579. this.canvas.height = parseInt(size.h) * this.devicePixelRatio;
  9580. } else {
  9581. this.canvas.width = parseInt(size.w);
  9582. this.canvas.height = parseInt(size.h);
  9583. }
  9584. this.canvas.style.width = this.div.style.width;
  9585. this.canvas.style.height = this.div.style.height;
  9586. this.maxWidth = size.w;
  9587. this.maxHeight = size.h;
  9588. this.div.style.visibility = '';
  9589. if (!zoomChanged) {
  9590. this.renderer && this.renderer.render();
  9591. }
  9592. }
  9593. if (zoomChanged) {
  9594. this.renderer && this.renderer.render();
  9595. }
  9596. }
  9597. /**
  9598. * @function SuperMap.Layer.MapVLayer.prototype.transferToMapLatLng
  9599. * @description 将经纬度转成底图的投影坐标。
  9600. * @param {SuperMap.LonLat} latLng - 经纬度坐标。
  9601. * @deprecated
  9602. */
  9603. transferToMapLatLng(latLng) {
  9604. var source = 'EPSG:4326',
  9605. dest = 'EPSG:4326';
  9606. var unit = this.map.getUnits() || 'degree';
  9607. if (['m', 'meter'].indexOf(unit.toLowerCase()) > -1) {
  9608. dest = 'EPSG:3857';
  9609. }
  9610. return new SuperMap.LonLat(latLng.lon, latLng.lat).transform(source, dest);
  9611. }
  9612. }
  9613. SuperMap.Layer.MapVLayer = MapVLayer;
  9614. ;// CONCATENATED MODULE: ./src/classic/overlay/mapv/index.js
  9615. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  9616. * This program are made available under the terms of the Apache License, Version 2.0
  9617. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9618. ;// CONCATENATED MODULE: ./src/classic/overlay/index.js
  9619. /* Copyright© 2000 - 2023 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. ;// CONCATENATED MODULE: ./src/common/format/Format.js
  9623. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  9624. * This program are made available under the terms of the Apache License, Version 2.0
  9625. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9626. /**
  9627. * @class Format
  9628. * @deprecatedclass SuperMap.Format
  9629. * @classdesc 读写各种格式的格式类基类。其子类应该包含并实现 read 和 write 方法。
  9630. * @category BaseTypes Format
  9631. * @param {Object} options - 可选参数。
  9632. * @param {boolean} [options.keepData=false] - 如果设置为 true, data 属性会指向被解析的对象(例如 JSON 或 xml 数据对象)。
  9633. * @param {Object} [options.data] - 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  9634. * @usage
  9635. */
  9636. class Format {
  9637. constructor(options) {
  9638. /**
  9639. * @member {Object} Format.prototype.data
  9640. * @description 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  9641. */
  9642. this.data = null;
  9643. /**
  9644. * @member {Object} [Format.prototype.keepData=false]
  9645. * @description 保持最近读到的数据的引用(通过 data 属性)。
  9646. */
  9647. this.keepData = false;
  9648. Util_Util.extend(this, options);
  9649. this.options = options;
  9650. this.CLASS_NAME = "SuperMap.Format";
  9651. }
  9652. /**
  9653. * @function Format.prototype.destroy
  9654. * @description 销毁该格式类,释放相关资源。
  9655. */
  9656. destroy() {
  9657. //用来销毁该格式类,释放相关资源
  9658. }
  9659. /**
  9660. * @function Format.prototype.read
  9661. * @description 来从字符串中读取数据。
  9662. * @param {string} data - 读取的数据。
  9663. */
  9664. read(data) { // eslint-disable-line no-unused-vars
  9665. //用来从字符串中读取数据
  9666. }
  9667. /**
  9668. * @function Format.prototype.write
  9669. * @description 将对象写成字符串。
  9670. * @param {Object} object - 可序列化的对象。
  9671. * @returns {string} 对象转化后的字符串。
  9672. */
  9673. write(object) { // eslint-disable-line no-unused-vars
  9674. //用来写字符串
  9675. }
  9676. }
  9677. ;// CONCATENATED MODULE: ./src/common/format/JSON.js
  9678. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  9679. * This program are made available under the terms of the Apache License, Version 2.0
  9680. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9681. /**
  9682. * @class JSONFormat
  9683. * @aliasclass Format.JSON
  9684. * @deprecatedclass SuperMap.Format.JSON
  9685. * @classdesc 安全的读写 JSON 的解析类。使用 {@link JSONFormat} 构造函数创建新实例。
  9686. * @category BaseTypes Format
  9687. * @param {Object} [options] - 可选参数。
  9688. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  9689. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  9690. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  9691. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  9692. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  9693. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  9694. * @extends {Format}
  9695. * @usage
  9696. */
  9697. class JSONFormat extends Format {
  9698. constructor(options) {
  9699. super(options);
  9700. /**
  9701. * @member {string} [JSONFormat.prototype.indent=" "]
  9702. * @description 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  9703. */
  9704. this.indent = " ";
  9705. /**
  9706. * @member {string} [JSONFormat.prototype.space=" "]
  9707. * @description 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  9708. */
  9709. this.space = " ";
  9710. /**
  9711. * @member {string} [JSONFormat.prototype.newline="\n"]
  9712. * @description 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  9713. */
  9714. this.newline = "\n";
  9715. /**
  9716. * @member {number} [JSONFormat.prototype.level=0]
  9717. * @description 用于格式化输出, 表示的是缩进级别。
  9718. */
  9719. this.level = 0;
  9720. /**
  9721. * @member {boolean} [JSONFormat.prototype.pretty=false]
  9722. * @description 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  9723. */
  9724. this.pretty = false;
  9725. /**
  9726. * @member {boolean} JSONFormat.prototype.nativeJSON
  9727. * @description 判断浏览器是否原生支持 JSON 格式数据。
  9728. */
  9729. this.nativeJSON = (function () {
  9730. return !!(window.JSON && typeof JSON.parse === "function" && typeof JSON.stringify === "function");
  9731. })();
  9732. this.CLASS_NAME = "SuperMap.Format.JSON";
  9733. /**
  9734. * @member JSONFormat.prototype.serialize
  9735. * @description 提供一些类型对象转 JSON 字符串的方法。
  9736. */
  9737. this.serialize = {
  9738. /**
  9739. * @function JSONFormat.serialize.object
  9740. * @description 把对象转换为 JSON 字符串。
  9741. * @param {Object} object - 可序列化的对象。
  9742. * @returns {string} JSON 字符串。
  9743. */
  9744. 'object': function (object) {
  9745. // three special objects that we want to treat differently
  9746. if (object == null) {
  9747. return "null";
  9748. }
  9749. if (object.constructor === Date) {
  9750. return this.serialize.date.apply(this, [object]);
  9751. }
  9752. if (object.constructor === Array) {
  9753. return this.serialize.array.apply(this, [object]);
  9754. }
  9755. var pieces = ['{'];
  9756. this.level += 1;
  9757. var key, keyJSON, valueJSON;
  9758. var addComma = false;
  9759. for (key in object) {
  9760. if (object.hasOwnProperty(key)) {
  9761. // recursive calls need to allow for sub-classing
  9762. keyJSON = this.write.apply(this,
  9763. [key, this.pretty]);
  9764. valueJSON = this.write.apply(this,
  9765. [object[key], this.pretty]);
  9766. if (keyJSON != null && valueJSON != null) {
  9767. if (addComma) {
  9768. pieces.push(',');
  9769. }
  9770. pieces.push(this.writeNewline(), this.writeIndent(),
  9771. keyJSON, ':', this.writeSpace(), valueJSON);
  9772. addComma = true;
  9773. }
  9774. }
  9775. }
  9776. this.level -= 1;
  9777. pieces.push(this.writeNewline(), this.writeIndent(), '}');
  9778. return pieces.join('');
  9779. },
  9780. /**
  9781. * @function JSONFormat.serialize.array
  9782. * @description 把数组转换成 JSON 字符串。
  9783. * @param {Array} array - 可序列化的数组。
  9784. * @returns {string} JSON 字符串。
  9785. */
  9786. 'array': function (array) {
  9787. var json;
  9788. var pieces = ['['];
  9789. this.level += 1;
  9790. for (var i = 0, len = array.length; i < len; ++i) {
  9791. // recursive calls need to allow for sub-classing
  9792. json = this.write.apply(this,
  9793. [array[i], this.pretty]);
  9794. if (json != null) {
  9795. if (i > 0) {
  9796. pieces.push(',');
  9797. }
  9798. pieces.push(this.writeNewline(), this.writeIndent(), json);
  9799. }
  9800. }
  9801. this.level -= 1;
  9802. pieces.push(this.writeNewline(), this.writeIndent(), ']');
  9803. return pieces.join('');
  9804. },
  9805. /**
  9806. * @function JSONFormat.serialize.string
  9807. * @description 把字符串转换成 JSON 字符串。
  9808. * @param {string} string - 可序列化的字符串。
  9809. * @returns {string} JSON 字符串。
  9810. */
  9811. 'string': function (string) {
  9812. // If the string contains no control characters, no quote characters, and no
  9813. // backslash characters, then we can simply slap some quotes around it.
  9814. // Otherwise we must also replace the offending characters with safe
  9815. // sequences.
  9816. var m = {
  9817. '\b': '\\b',
  9818. '\t': '\\t',
  9819. '\n': '\\n',
  9820. '\f': '\\f',
  9821. '\r': '\\r',
  9822. '"': '\\"',
  9823. '\\': '\\\\'
  9824. };
  9825. /*eslint-disable no-control-regex*/
  9826. if (/["\\\x00-\x1f]/.test(string)) {
  9827. return '"' + string.replace(/([\x00-\x1f\\"])/g, function (a, b) {
  9828. var c = m[b];
  9829. if (c) {
  9830. return c;
  9831. }
  9832. c = b.charCodeAt();
  9833. return '\\u00' +
  9834. Math.floor(c / 16).toString(16) +
  9835. (c % 16).toString(16);
  9836. }) + '"';
  9837. }
  9838. return '"' + string + '"';
  9839. },
  9840. /**
  9841. * @function JSONFormat.serialize.number
  9842. * @description 把数字转换成 JSON 字符串。
  9843. * @param {number} number - 可序列化的数字。
  9844. * @returns {string} JSON 字符串。
  9845. */
  9846. 'number': function (number) {
  9847. return isFinite(number) ? String(number) : "null";
  9848. },
  9849. /**
  9850. * @function JSONFormat.serialize.boolean
  9851. * @description Transform a boolean into a JSON string.
  9852. * @param {boolean} bool - The boolean to be serialized.
  9853. * @returns {string} A JSON string representing the boolean.
  9854. */
  9855. 'boolean': function (bool) {
  9856. return String(bool);
  9857. },
  9858. /**
  9859. * @function JSONFormat.serialize.object
  9860. * @description 将日期对象转换成 JSON 字符串。
  9861. * @param {Date} date - 可序列化的日期对象。
  9862. * @returns {string} JSON 字符串。
  9863. */
  9864. 'date': function (date) {
  9865. function format(number) {
  9866. // Format integers to have at least two digits.
  9867. return (number < 10) ? '0' + number : number;
  9868. }
  9869. return '"' + date.getFullYear() + '-' +
  9870. format(date.getMonth() + 1) + '-' +
  9871. format(date.getDate()) + 'T' +
  9872. format(date.getHours()) + ':' +
  9873. format(date.getMinutes()) + ':' +
  9874. format(date.getSeconds()) + '"';
  9875. }
  9876. };
  9877. }
  9878. /**
  9879. * @function JSONFormat.prototype.read
  9880. * @description 将一个符合 JSON 结构的字符串进行解析。
  9881. * @param {string} json - 符合 JSON 结构的字符串。
  9882. * @param {function} filter - 过滤方法,最终结果的每一个键值对都会调用该过滤方法,并在对应的值的位置替换成该方法返回的值。
  9883. * @returns {(Object|string|Array|number|boolean)} 对象,数组,字符串或数字。
  9884. */
  9885. read(json, filter) {
  9886. var object;
  9887. if (this.nativeJSON) {
  9888. try {
  9889. object = JSON.parse(json, filter);
  9890. } catch (e) {
  9891. // Fall through if the regexp test fails.
  9892. return { data: json}
  9893. }
  9894. }
  9895. if (this.keepData) {
  9896. this.data = object;
  9897. }
  9898. return object;
  9899. }
  9900. /**
  9901. * @function JSONFormat.prototype.write
  9902. * @description 序列化一个对象到一个符合 JSON 格式的字符串。
  9903. * @param {Object|string|Array|number|boolean} value - 需要被序列化的对象,数组,字符串,数字,布尔值。
  9904. * @param {boolean} [pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  9905. * @returns {string} 符合 JSON 格式的字符串。
  9906. *
  9907. */
  9908. write(value, pretty) {
  9909. this.pretty = !!pretty;
  9910. var json = null;
  9911. var type = typeof value;
  9912. if (this.serialize[type]) {
  9913. try {
  9914. json = (!this.pretty && this.nativeJSON) ?
  9915. JSON.stringify(value) :
  9916. this.serialize[type].apply(this, [value]);
  9917. } catch (err) {
  9918. //console.error("Trouble serializing: " + err);
  9919. }
  9920. }
  9921. return json;
  9922. }
  9923. /**
  9924. * @function JSONFormat.prototype.writeIndent
  9925. * @description 根据缩进级别输出一个缩进字符串。
  9926. * @private
  9927. * @returns {string} 一个适当的缩进字符串。
  9928. */
  9929. writeIndent() {
  9930. var pieces = [];
  9931. if (this.pretty) {
  9932. for (var i = 0; i < this.level; ++i) {
  9933. pieces.push(this.indent);
  9934. }
  9935. }
  9936. return pieces.join('');
  9937. }
  9938. /**
  9939. * @function JSONFormat.prototype.writeNewline
  9940. * @description 在格式化输出模式情况下输出代表新一行的字符串。
  9941. * @private
  9942. * @returns {string} 代表新的一行的字符串。
  9943. */
  9944. writeNewline() {
  9945. return (this.pretty) ? this.newline : '';
  9946. }
  9947. /**
  9948. * @function JSONFormat.prototype.writeSpace
  9949. * @private
  9950. * @description 在格式化输出模式情况下输出一个代表空格的字符串。
  9951. * @returns {string} 空格字符串。
  9952. */
  9953. writeSpace() {
  9954. return (this.pretty) ? this.space : '';
  9955. }
  9956. }
  9957. ;// CONCATENATED MODULE: ./src/common/iServer/CommonServiceBase.js
  9958. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  9959. * This program are made available under the terms of the Apache License, Version 2.0
  9960. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9961. /**
  9962. * @class CommonServiceBase
  9963. * @deprecatedclass SuperMap.CommonServiceBase
  9964. * @category iServer Core
  9965. * @classdesc 对接 iServer 各种服务的 Service 的基类。
  9966. * @param {string} url - 服务地址。
  9967. * @param {Object} options - 参数。
  9968. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  9969. * @param {string} [options.proxy] - 服务代理地址。
  9970. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  9971. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  9972. * @param {Object} [options.headers] - 请求头。
  9973. * @usage
  9974. */
  9975. class CommonServiceBase {
  9976. constructor(url, options) {
  9977. let me = this;
  9978. this.EVENT_TYPES = ['processCompleted', 'processFailed'];
  9979. this.events = null;
  9980. this.eventListeners = null;
  9981. this.url = null;
  9982. this.urls = null;
  9983. this.proxy = null;
  9984. this.index = null;
  9985. this.length = null;
  9986. this.totalTimes = null;
  9987. this.POLLING_TIMES = 3;
  9988. this.isInTheSameDomain = null;
  9989. this.withCredentials = false;
  9990. if (Util_Util.isArray(url)) {
  9991. me.urls = url;
  9992. me.length = url.length;
  9993. me.totalTimes = me.length;
  9994. if (me.length === 1) {
  9995. me.url = url[0];
  9996. } else {
  9997. me.index = parseInt(Math.random() * me.length);
  9998. me.url = url[me.index];
  9999. }
  10000. } else {
  10001. me.totalTimes = 1;
  10002. me.url = url;
  10003. }
  10004. if (Util_Util.isArray(url) && !me.isServiceSupportPolling()) {
  10005. me.url = url[0];
  10006. me.totalTimes = 1;
  10007. }
  10008. options = options || {};
  10009. this.crossOrigin = options.crossOrigin;
  10010. this.headers = options.headers;
  10011. Util_Util.extend(this, options);
  10012. me.isInTheSameDomain = Util_Util.isInTheSameDomain(me.url);
  10013. me.events = new Events(me, null, me.EVENT_TYPES, true);
  10014. if (me.eventListeners instanceof Object) {
  10015. me.events.on(me.eventListeners);
  10016. }
  10017. this.CLASS_NAME = 'SuperMap.CommonServiceBase';
  10018. }
  10019. /**
  10020. * @function CommonServiceBase.prototype.destroy
  10021. * @description 释放资源,将引用的资源属性置空。
  10022. */
  10023. destroy() {
  10024. let me = this;
  10025. if (Util_Util.isArray(me.urls)) {
  10026. me.urls = null;
  10027. me.index = null;
  10028. me.length = null;
  10029. me.totalTimes = null;
  10030. }
  10031. me.url = null;
  10032. me._processSuccess = null;
  10033. me._processFailed = null;
  10034. me.isInTheSameDomain = null;
  10035. me.EVENT_TYPES = null;
  10036. if (me.events) {
  10037. me.events.destroy();
  10038. me.events = null;
  10039. }
  10040. if (me.eventListeners) {
  10041. me.eventListeners = null;
  10042. }
  10043. }
  10044. /**
  10045. * @function CommonServiceBase.prototype.request
  10046. * @description: 该方法用于向服务发送请求。
  10047. * @param {Object} options - 参数。
  10048. * @param {string} [options.method='GET'] - 请求方式,包括 "GET","POST","PUT","DELETE"。
  10049. * @param {string} [options.url] - 发送请求的地址。
  10050. * @param {Object} [options.params] - 作为查询字符串添加到 URL 中的一组键值对,此参数只适用于 GET 方式发送的请求。
  10051. * @param {string} [options.data] - 发送到服务器的数据。
  10052. * @param {function} options.success - 请求成功后的回调函数。
  10053. * @param {function} options.failure - 请求失败后的回调函数。
  10054. * @param {Object} [options.scope] - 如果回调函数是对象的一个公共方法,设定该对象的范围。
  10055. * @param {boolean} [options.isInTheSameDomain] - 请求是否在当前域中。
  10056. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  10057. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  10058. * @param {Object} [options.headers] - 请求头。
  10059. */
  10060. request(options) {
  10061. const format = options.scope.format;
  10062. if (format && !this.supportDataFormat(format)) {
  10063. throw new Error(`${this.CLASS_NAME} is not surport ${format} format!`);
  10064. }
  10065. let me = this;
  10066. options.url = options.url || me.url;
  10067. if (this._returnContent(options) && !options.url.includes('returnContent=true')) {
  10068. options.url = Util_Util.urlAppend(options.url, 'returnContent=true');
  10069. }
  10070. options.proxy = options.proxy || me.proxy;
  10071. options.withCredentials = options.withCredentials != undefined ? options.withCredentials : me.withCredentials;
  10072. options.crossOrigin = options.crossOrigin != undefined ? options.crossOrigin : me.crossOrigin;
  10073. options.headers = options.headers || me.headers;
  10074. options.isInTheSameDomain = me.isInTheSameDomain;
  10075. options.withoutFormatSuffix = options.scope.withoutFormatSuffix || false;
  10076. //为url添加安全认证信息片段
  10077. options.url = SecurityManager.appendCredential(options.url);
  10078. me.calculatePollingTimes();
  10079. options.scope = me;
  10080. var success = options.scope? options.success.bind(options.scope) : options.success;
  10081. var failure = options.scope? options.failure.bind(options.scope) : options.failure;
  10082. options.success = me.getUrlCompleted(success, options);
  10083. options.failure = me.getUrlFailed(failure, options);
  10084. me._commit(options);
  10085. }
  10086. /**
  10087. * @function CommonServiceBase.prototype.getUrlCompleted
  10088. * @description 请求成功后执行此方法。
  10089. * @param {Object} cb - 成功回调函数。
  10090. * @param {Object} options - 请求参数对象。
  10091. * @private
  10092. */
  10093. getUrlCompleted(cb, options) {
  10094. // @param {Object} result - 服务器返回的结果对象。
  10095. return function(result) {
  10096. cb && cb(result, options);
  10097. }
  10098. }
  10099. /**
  10100. * @function CommonServiceBase.prototype.getUrlFailed
  10101. * @description 请求失败后执行此方法。
  10102. * @param {Object} cb - 失败回调函数。
  10103. * @param {Object} options - 请求参数对象。
  10104. * @private
  10105. */
  10106. getUrlFailed(cb, options) {
  10107. const me = this;
  10108. // @param {Object} result - 服务器返回的结果对象。
  10109. return function(result) {
  10110. if (me.totalTimes > 0) {
  10111. me.totalTimes--;
  10112. me.ajaxPolling(options);
  10113. } else {
  10114. cb && cb(result, options);
  10115. }
  10116. }
  10117. }
  10118. /**
  10119. *
  10120. * @function CommonServiceBase.prototype.ajaxPolling
  10121. * @description 请求失败后,如果剩余请求失败次数不为 0,重新获取 URL 发送请求。
  10122. * @param {Object} options - 请求参数对象。
  10123. * @private
  10124. */
  10125. ajaxPolling(options) {
  10126. let me = this,
  10127. url = options.url,
  10128. re = /^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;
  10129. me.index = parseInt(Math.random() * me.length);
  10130. me.url = me.urls[me.index];
  10131. url = url.replace(re, re.exec(me.url)[0]);
  10132. options.url = url;
  10133. options.isInTheSameDomain = Util_Util.isInTheSameDomain(url);
  10134. me._commit(options);
  10135. }
  10136. /**
  10137. * @function CommonServiceBase.prototype.calculatePollingTimes
  10138. * @description 计算剩余请求失败执行次数。
  10139. */
  10140. calculatePollingTimes() {
  10141. let me = this;
  10142. if (me.times) {
  10143. if (me.totalTimes > me.POLLING_TIMES) {
  10144. if (me.times > me.POLLING_TIMES) {
  10145. me.totalTimes = me.POLLING_TIMES;
  10146. } else {
  10147. me.totalTimes = me.times;
  10148. }
  10149. } else {
  10150. if (me.times < me.totalTimes) {
  10151. me.totalTimes = me.times;
  10152. }
  10153. }
  10154. } else {
  10155. if (me.totalTimes > me.POLLING_TIMES) {
  10156. me.totalTimes = me.POLLING_TIMES;
  10157. }
  10158. }
  10159. me.totalTimes--;
  10160. }
  10161. /**
  10162. * @function CommonServiceBase.prototype.isServiceSupportPolling
  10163. * @description 判断服务是否支持轮询。
  10164. */
  10165. isServiceSupportPolling() {
  10166. let me = this;
  10167. return !(
  10168. me.CLASS_NAME === 'SuperMap.REST.ThemeService' || me.CLASS_NAME === 'SuperMap.REST.EditFeaturesService'
  10169. );
  10170. }
  10171. /**
  10172. * @function CommonServiceBase.prototype.serviceProcessCompleted
  10173. * @description 状态完成,执行此方法。
  10174. * @param {Object} result - 服务器返回的结果对象。
  10175. * @param {Object} options - 请求参数对象。
  10176. * @private
  10177. */
  10178. serviceProcessCompleted(result, options) {
  10179. result = Util_Util.transformResult(result);
  10180. this.events.triggerEvent('processCompleted', {
  10181. result: result,
  10182. options: options
  10183. });
  10184. }
  10185. /**
  10186. * @function CommonServiceBase.prototype.serviceProcessFailed
  10187. * @description 状态失败,执行此方法。
  10188. * @param {Object} result - 服务器返回的结果对象。
  10189. * @param {Object} options - 请求参数对象。对象
  10190. * @private
  10191. */
  10192. serviceProcessFailed(result, options) {
  10193. result = Util_Util.transformResult(result);
  10194. let error = result.error || result;
  10195. this.events.triggerEvent('processFailed', {
  10196. error: error,
  10197. options: options
  10198. });
  10199. }
  10200. _returnContent(options) {
  10201. if (options.scope.format === DataFormat.FGB) {
  10202. return false;
  10203. }
  10204. if (options.scope.returnContent) {
  10205. return true;
  10206. }
  10207. return false;
  10208. }
  10209. supportDataFormat(foramt) {
  10210. return this.dataFormat().includes(foramt);
  10211. }
  10212. dataFormat() {
  10213. return [DataFormat.GEOJSON, DataFormat.ISERVER];
  10214. }
  10215. _commit(options) {
  10216. if (options.method === 'POST' || options.method === 'PUT' || options.method === 'PATCH') {
  10217. if (options.params) {
  10218. options.url = Util_Util.urlAppend(options.url, Util_Util.getParameterString(options.params || {}));
  10219. }
  10220. if (typeof options.data === 'object') {
  10221. try {
  10222. options.params = Util_Util.toJSON(options.data);
  10223. } catch (e) {
  10224. console.log('不是json对象');
  10225. }
  10226. } else {
  10227. options.params = options.data;
  10228. }
  10229. }
  10230. FetchRequest.commit(options.method, options.url, options.params, {
  10231. headers: options.headers,
  10232. withoutFormatSuffix: options.withoutFormatSuffix,
  10233. withCredentials: options.withCredentials,
  10234. crossOrigin: options.crossOrigin,
  10235. timeout: options.async ? 0 : null,
  10236. proxy: options.proxy
  10237. })
  10238. .then(function (response) {
  10239. if (response.text) {
  10240. return response.text();
  10241. }
  10242. if (response.json) {
  10243. return response.json();
  10244. }
  10245. return response;
  10246. })
  10247. .then(function (text) {
  10248. let requestResult = text;
  10249. if (typeof text === 'string') {
  10250. requestResult = new JSONFormat().read(text);
  10251. }
  10252. if (
  10253. !requestResult ||
  10254. requestResult.error ||
  10255. (requestResult.code >= 300 && requestResult.code !== 304)
  10256. ) {
  10257. if (requestResult && requestResult.error) {
  10258. requestResult = {
  10259. error: requestResult.error
  10260. };
  10261. } else {
  10262. requestResult = {
  10263. error: requestResult
  10264. };
  10265. }
  10266. }
  10267. if (requestResult && options.scope.format === DataFormat.FGB) {
  10268. requestResult.newResourceLocation = requestResult.newResourceLocation.replace('.json', '') + '.fgb';
  10269. }
  10270. return requestResult;
  10271. })
  10272. .catch(function (e) {
  10273. return { error: e };
  10274. })
  10275. .then((requestResult) => {
  10276. if (requestResult.error) {
  10277. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  10278. failure(requestResult);
  10279. } else {
  10280. requestResult.succeed = requestResult.succeed == undefined ? true : requestResult.succeed;
  10281. var success = options.scope ? FunctionExt.bind(options.success, options.scope) : options.success;
  10282. success(requestResult);
  10283. }
  10284. });
  10285. }
  10286. }
  10287. /**
  10288. * 服务器请求回调函数。
  10289. * @callback RequestCallback
  10290. * @category BaseTypes Util
  10291. * @example
  10292. * var requestCallback = function (serviceResult){
  10293. * console.log(serviceResult.result);
  10294. * }
  10295. * new QueryService(url).queryByBounds(param, requestCallback);
  10296. * @param {Object} serviceResult
  10297. * @param {Object} serviceResult.result 服务器返回结果。
  10298. * @param {Object} serviceResult.object 发布应用程序事件的对象。
  10299. * @param {Object} serviceResult.type 事件类型。
  10300. * @param {Object} serviceResult.element 接受浏览器事件的 DOM 节点。
  10301. * @param {Object} serviceResult.options 请求参数。
  10302. */
  10303. ;// CONCATENATED MODULE: ./src/common/iServer/AddressMatchService.js
  10304. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  10305. * This program are made available under the terms of the Apache License, Version 2.0
  10306. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10307. /**
  10308. * @class AddressMatchService
  10309. * @deprecatedclass SuperMap.AddressMatchService
  10310. * @category iServer AddressMatch
  10311. * @classdesc 地址匹配服务,包括正向匹配和反向匹配。
  10312. * @param {string} url - 服务地址。
  10313. * @param {Object} options - 可选参数。
  10314. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  10315. * @param {Object} [options.headers] - 请求头。
  10316. * @usage
  10317. */
  10318. class AddressMatchService_AddressMatchService extends CommonServiceBase {
  10319. constructor(url, options) {
  10320. super(url, options);
  10321. this.options = options || {};
  10322. this.eventCount = 0;
  10323. this.CLASS_NAME = 'SuperMap.AddressMatchService';
  10324. }
  10325. /**
  10326. * @function AddressMatchService.prototype.destroy
  10327. * @override
  10328. */
  10329. destroy() {
  10330. super.destroy();
  10331. }
  10332. /**
  10333. * @function AddressMatchService.prototype.code
  10334. * @param {string} url - 正向地址匹配服务地址。
  10335. * @param {GeoCodingParameter} params - 正向地址匹配服务参数。
  10336. */
  10337. code(url, params, callback) {
  10338. if (!(params instanceof GeoCodingParameter)) {
  10339. return;
  10340. }
  10341. this.processAsync(url, params, callback);
  10342. }
  10343. /**
  10344. * @function AddressMatchService.prototype.decode
  10345. * @param {string} url - 反向地址匹配服务地址。
  10346. * @param {GeoDecodingParameter} params - 反向地址匹配服务参数。
  10347. */
  10348. decode(url, params, callback) {
  10349. if (!(params instanceof GeoDecodingParameter)) {
  10350. return;
  10351. }
  10352. this.processAsync(url, params, callback);
  10353. }
  10354. /**
  10355. * @function AddressMatchService.prototype.processAsync
  10356. * @description 负责将客户端的动态分段服务参数传递到服务端。
  10357. * @param {string} url - 服务地址。
  10358. * @param {Object} params - 参数。
  10359. */
  10360. processAsync(url, params, callback) {
  10361. let eventId = ++this.eventCount;
  10362. let eventListeners = {
  10363. scope: this,
  10364. processCompleted: function(result) {
  10365. if (eventId === result.result.eventId && callback) {
  10366. delete result.result.eventId;
  10367. callback(result);
  10368. this.events && this.events.un(eventListeners);
  10369. return false;
  10370. }
  10371. },
  10372. processFailed: function(result) {
  10373. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  10374. callback(result);
  10375. this.events && this.events.un(eventListeners);
  10376. return false;
  10377. }
  10378. }
  10379. }
  10380. this.events.on(eventListeners);
  10381. this.request({
  10382. method: 'GET',
  10383. url,
  10384. params,
  10385. scope: this,
  10386. success(result, options) {
  10387. result.eventId = eventId;
  10388. this.serviceProcessCompleted(result, options);
  10389. },
  10390. failure(result, options) {
  10391. if (result.error) {
  10392. result.error.eventId = eventId;
  10393. }
  10394. result.eventId = eventId;
  10395. this.serviceProcessFailed(result, options);
  10396. }
  10397. });
  10398. }
  10399. /**
  10400. * @function AddressMatchService.prototype.serviceProcessCompleted
  10401. * @param {Object} result - 服务器返回的结果对象。
  10402. * @description 服务流程是否完成
  10403. */
  10404. serviceProcessCompleted(result, options) {
  10405. if (result.succeed) {
  10406. delete result.succeed;
  10407. }
  10408. super.serviceProcessCompleted(result, options);
  10409. }
  10410. /**
  10411. * @function AddressMatchService.prototype.serviceProcessCompleted
  10412. * @param {Object} result - 服务器返回的结果对象。
  10413. * @description 服务流程是否失败
  10414. */
  10415. serviceProcessFailed(result, options) {
  10416. super.serviceProcessFailed(result, options);
  10417. }
  10418. }
  10419. ;// CONCATENATED MODULE: ./src/classic/services/AddressMatchService.js
  10420. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  10421. * This program are made available under the terms of the Apache License, Version 2.0
  10422. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10423. /**
  10424. * @class SuperMap.REST.AddressMatchService
  10425. * @category iServer AddressMatch
  10426. * @classdesc 地址匹配服务类。包括正向匹配和反向匹配。
  10427. * @modulecategory Services
  10428. * @extends {CommonServiceBase}
  10429. * @param {string} url - 服务地址。
  10430. * @param {Object} options - 参数。
  10431. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  10432. * @param {Object} [options.headers] - 请求头。
  10433. */
  10434. class AddressMatchService extends CommonServiceBase {
  10435. constructor(url, options) {
  10436. super(url, options);
  10437. this.CLASS_NAME = "SuperMap.REST.AddressMatchService";
  10438. }
  10439. /**
  10440. * @function SuperMap.REST.AddressMatchService.prototype.code
  10441. * @description 正向匹配。
  10442. * @param {GeoCodingParameter} params - 正向匹配参数。
  10443. * @param {RequestCallback} callback - 回调函数。
  10444. */
  10445. code(params, callback) {
  10446. var me = this;
  10447. var addressMatchService = new AddressMatchService_AddressMatchService(me.url, {
  10448. headers: me.headers,
  10449. proxy: me.proxy,
  10450. withCredentials: me.withCredentials,
  10451. crossOrigin: me.crossOrigin,
  10452. eventListeners: {
  10453. scope: me,
  10454. processCompleted: callback,
  10455. processFailed: callback
  10456. }
  10457. });
  10458. addressMatchService.code(me.url + '/geocoding', params);
  10459. }
  10460. /**
  10461. * @function SuperMap.REST.AddressMatchService.prototype.decode
  10462. * @description 反向匹配。
  10463. * @param {GeoDecodingParameter} params - 反向匹配参数。
  10464. * @param {RequestCallback} callback - 回调函数。
  10465. */
  10466. decode(params, callback) {
  10467. var me = this;
  10468. var addressMatchService = new AddressMatchService_AddressMatchService(me.url, {
  10469. headers: me.headers,
  10470. proxy: me.proxy,
  10471. withCredentials: me.withCredentials,
  10472. crossOrigin: me.crossOrigin,
  10473. eventListeners: {
  10474. scope: me,
  10475. processCompleted: callback,
  10476. processFailed: callback
  10477. }
  10478. });
  10479. addressMatchService.decode(me.url + '/geodecoding', params);
  10480. }
  10481. }
  10482. SuperMap.REST.AddressMatchService = AddressMatchService;
  10483. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetService.js
  10484. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  10485. * This program are made available under the terms of the Apache License, Version 2.0
  10486. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10487. /**
  10488. * @class DatasetService
  10489. * @deprecatedclass SuperMap.DatasetService
  10490. * @category iServer Data Dataset
  10491. * @classdesc 数据集查询服务。
  10492. * @param {string} url - 服务的访问地址。如访问World Data服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  10493. * @param {Object} options - 参数。
  10494. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  10495. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  10496. * @param {string}options.datasource - 数据源名称。
  10497. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  10498. * @param {Object} [options.headers] - 请求头。
  10499. * @usage
  10500. */
  10501. class DatasetService_DatasetService extends CommonServiceBase {
  10502. constructor(url, options) {
  10503. super(url, options);
  10504. if(!options){
  10505. return;
  10506. }
  10507. /**
  10508. * @member {string} DatasetService.prototype.datasource
  10509. * @description 要查询的数据集所在的数据源名称。
  10510. */
  10511. this.datasource = null;
  10512. /**
  10513. * @member {string} DatasetService.prototype.dataset
  10514. * @description 要查询的数据集名称。
  10515. */
  10516. this.dataset = null;
  10517. this.eventCount = 0;
  10518. if (options) {
  10519. Util_Util.extend(this, options);
  10520. }
  10521. this.CLASS_NAME = "SuperMap.DatasetService";
  10522. }
  10523. /**
  10524. * @function DatasetService.prototype.destroy
  10525. * @override
  10526. */
  10527. destroy() {
  10528. super.destroy();
  10529. var me = this;
  10530. me.datasource = null;
  10531. me.dataset = null;
  10532. }
  10533. /**
  10534. * @function DatasetService.prototype.getDatasetsService
  10535. * @description 执行服务,查询数据集服务。
  10536. */
  10537. getDatasetsService(params, callback) {
  10538. const url = Util_Util.urlPathAppend(this.url,`datasources/name/${params}/datasets`);
  10539. this.processAsync(url, 'GET', callback);
  10540. }
  10541. /**
  10542. * @function DatasetService.prototype.getDatasetService
  10543. * @description 执行服务,查询数据集信息服务。
  10544. */
  10545. getDatasetService(datasourceName, datasetName, callback) {
  10546. const url = Util_Util.urlPathAppend(this.url,`datasources/name/${datasourceName}/datasets/name/${datasetName}`);
  10547. this.processAsync(url, 'GET', callback);
  10548. }
  10549. /**
  10550. * @function DatasetService.prototype.setDatasetService
  10551. * @description 执行服务,更改数据集信息服务。
  10552. */
  10553. setDatasetService(params, callback) {
  10554. if (!params) {
  10555. return;
  10556. }
  10557. const url = Util_Util.urlPathAppend(this.url, `datasources/name/${params.datasourceName}/datasets/name/${params.datasetName}`);
  10558. delete params.datasourceName;
  10559. this.processAsync(url, 'PUT', callback, params);
  10560. }
  10561. /**
  10562. * @function DatasetService.prototype.deleteDatasetService
  10563. * @description 执行服务,删除数据集信息服务。
  10564. */
  10565. deleteDatasetService(datasourceName, datasetName, callback) {
  10566. const url = Util_Util.urlPathAppend(this.url, `datasources/name/${datasourceName}/datasets/name/${datasetName}`);
  10567. this.processAsync(url, 'DELETE', callback);
  10568. }
  10569. processAsync(url, method, callback, params) {
  10570. let eventId = ++this.eventCount;
  10571. let eventListeners = {
  10572. scope: this,
  10573. processCompleted: function(result) {
  10574. if (eventId === result.result.eventId && callback) {
  10575. delete result.result.eventId;
  10576. callback(result);
  10577. this.events && this.events.un(eventListeners);
  10578. return false;
  10579. }
  10580. },
  10581. processFailed: function(result) {
  10582. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  10583. callback(result);
  10584. this.events && this.events.un(eventListeners);
  10585. return false;
  10586. }
  10587. }
  10588. }
  10589. this.events.on(eventListeners);
  10590. var me = this;
  10591. let requestConfig = {
  10592. url,
  10593. method,
  10594. scope: me,
  10595. success(result, options) {
  10596. result.eventId = eventId;
  10597. me.serviceProcessCompleted(result, options);
  10598. },
  10599. failure(result, options) {
  10600. if (result.error) {
  10601. result.error.eventId = eventId;
  10602. }
  10603. result.eventId = eventId;
  10604. me.serviceProcessFailed(result, options);
  10605. }
  10606. }
  10607. params && (requestConfig.data = Util_Util.toJSON(params));
  10608. me.request(requestConfig);
  10609. }
  10610. }
  10611. ;// CONCATENATED MODULE: ./src/common/iServer/CreateDatasetParameters.js
  10612. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  10613. * This program are made available under the terms of the Apache License, Version 2.0
  10614. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10615. /**
  10616. * @class CreateDatasetParameters
  10617. * @deprecatedclass SuperMap.CreateDatasetParameters
  10618. * @category iServer Data Dataset
  10619. * @classdesc 数据集创建参数类。
  10620. * @param {Object} options - 参数。
  10621. * @param {string} options.datasourceName - 数据源名称,此为必选参数。
  10622. * @param {string} options.datasetName - 数据集名称,此为必选参数。
  10623. * @param {string} options.datasetType - 数据集类型。目前支持创建的数据集类型有:点、线、面、文本、复合(CAD)和属性数据集。
  10624. * @usage
  10625. */
  10626. class CreateDatasetParameters {
  10627. constructor(options) {
  10628. if (!options) {
  10629. return;
  10630. }
  10631. /**
  10632. * @member {string} CreateDatasetParameters.prototype.datasourceName
  10633. * @description 数据源名称,此为必选参数。
  10634. */
  10635. this.datasourceName = null;
  10636. /**
  10637. * @member {string} CreateDatasetParameters.prototype.datasetName
  10638. * @description 数据集名称,此为必选参数。
  10639. */
  10640. this.datasetName = null;
  10641. /**
  10642. * @member {string} CreateDatasetParameters.prototype.datasetType
  10643. * @description 数据集类型。目前支持创建的数据集类型有:点、线、面、文本、复合(CAD)和属性数据集。
  10644. */
  10645. this.datasetType = null;
  10646. if (options) {
  10647. Util_Util.extend(this, options);
  10648. }
  10649. this.CLASS_NAME = "SuperMap.CreateDatasetParameters";
  10650. }
  10651. /**
  10652. * @function CreateDatasetParameters.prototype.destroy
  10653. * @description 释放资源,将引用资源的属性置空。
  10654. */
  10655. destroy() {
  10656. var me = this;
  10657. me.datasourceName = null;
  10658. me.datasetName = null;
  10659. me.datasetType = null;
  10660. }
  10661. }
  10662. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateDatasetParameters.js
  10663. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  10664. * This program are made available under the terms of the Apache License, Version 2.0
  10665. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10666. /**
  10667. * @class UpdateDatasetParameters
  10668. * @deprecatedclass SuperMap.UpdateDatasetParameters
  10669. * @category iServer Data Dataset
  10670. * @classdesc 数据集信息更改参数类。
  10671. * @param {Object} options - 参数。
  10672. * @param {string} options.datasourceName - 数据源名称。
  10673. * @param {string} options.datasetName - 数据集名称。
  10674. * @param {boolean} options.isFileCache - 是否使用文件形式的缓存。仅对数据库型数据源中的矢量数据集有效。
  10675. * @param {string} options.description - 数据集描述信息。
  10676. * @param {string} options.prjCoordSys - 投影坐标系。
  10677. * @param {Object} options.charset - 矢量数据集的字符集。当数据集类型为矢量数据集时,可以传递此参数。如果用户传递空值,则编码方式保持不变。
  10678. * @param {Array.<string>} options.palette - 影像数据的颜色调色板。当数据集类型为影像数据集时,可以传递此参数。
  10679. * @param {number} options.noValue - 栅格数据集中没有数据的像元的栅格值。当数据集类型为栅格数据集时,可以传递此参数。
  10680. * @usage
  10681. */
  10682. class UpdateDatasetParameters {
  10683. constructor(options) {
  10684. if (!options) {
  10685. return;
  10686. }
  10687. /**
  10688. * @member {string} UpdateDatasetParameters.prototype.datasourceName
  10689. * @description 数据源名称。
  10690. */
  10691. this.datasourceName = null;
  10692. /**
  10693. * @member {string} UpdateDatasetParameters.prototype.datasetName
  10694. * @description 数据集名称。
  10695. */
  10696. this.datasetName = null;
  10697. /**
  10698. * @member {boolean} UpdateDatasetParameters.prototype.isFileCache
  10699. * @description 是否使用文件形式的缓存。仅对数据库型数据源中的矢量数据集有效。
  10700. */
  10701. this.isFileCache = null;
  10702. /**
  10703. * @member {string} UpdateDatasetParameters.prototype.description
  10704. * @description 数据集描述信息。
  10705. */
  10706. this.description = null;
  10707. /**
  10708. * @member {string} UpdateDatasetParameters.prototype.prjCoordSys
  10709. * @description 投影坐标系。
  10710. */
  10711. this.prjCoordSys = null;
  10712. /**
  10713. * @member {Object} UpdateDatasetParameters.prototype.charset
  10714. * @description 矢量数据集的字符集。
  10715. */
  10716. this.charset = null;
  10717. /**
  10718. * @member {Array.<string>} UpdateDatasetParameters.prototype.palette
  10719. * @description 影像数据的颜色调色板。
  10720. */
  10721. this.palette = null;
  10722. /**
  10723. * @member {number} UpdateDatasetParameters.prototype.noValue
  10724. * @description 栅格数据集中没有数据的像元的栅格值。
  10725. */
  10726. this.noValue = null;
  10727. if (options) {
  10728. Util_Util.extend(this, options);
  10729. }
  10730. this.CLASS_NAME = "SuperMap.UpdateDatasetParameters";
  10731. }
  10732. /**
  10733. * @function UpdateDatasetParameters.prototype.destroy
  10734. * @description 释放资源,将引用资源的属性置空。
  10735. */
  10736. destroy() {
  10737. var me = this;
  10738. me.datasourceName = null;
  10739. me.datasetName = null;
  10740. me.isFileCache = null;
  10741. me.prjCoordSys = null;
  10742. me.charset = null;
  10743. me.palette = null;
  10744. me.noValue = null;
  10745. }
  10746. }
  10747. ;// CONCATENATED MODULE: ./src/classic/services/DatasetService.js
  10748. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  10749. * This program are made available under the terms of the Apache License, Version 2.0
  10750. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10751. /**
  10752. * @class SuperMap.REST.DatasetService
  10753. * @category iServer Data Dataset
  10754. * @classdesc 数据集信息服务。
  10755. * @extends {CommonServiceBase}
  10756. * @param {string} url - 服务地址。
  10757. * @param {Object} options - 参数。
  10758. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  10759. * @param {Object} [options.headers] - 请求头。
  10760. */
  10761. class DatasetService extends CommonServiceBase {
  10762. constructor(url, options) {
  10763. super(url, options);
  10764. const me = this;
  10765. this._datasetService = new DatasetService_DatasetService(me.url, {
  10766. proxy: me.proxy,
  10767. withCredentials: me.withCredentials,
  10768. crossOrigin: me.crossOrigin,
  10769. headers: me.headers
  10770. });
  10771. this.CLASS_NAME = "SuperMap.REST.DatasetService";
  10772. }
  10773. /**
  10774. * @function SuperMap.REST.DatasetService.prototype.getDatasets
  10775. * @description 数据集查询服务。
  10776. * @example
  10777. * new SuperMap.REST.DatasetService(url).getDatasets(datasourceName,function(result){
  10778. * //doSomething
  10779. * });
  10780. * @param {string} datasourceName - 数据源名称。
  10781. * @param {RequestCallback} callback - 回调函数。
  10782. */
  10783. getDatasets(datasourceName, callback) {
  10784. if (!datasourceName) {
  10785. return;
  10786. }
  10787. this._datasetService.getDatasetsService(datasourceName, callback);
  10788. }
  10789. /**
  10790. * @function SuperMap.REST.DatasetService.prototype.getDataset
  10791. * @description 数据集查询服务。
  10792. * @example
  10793. * new SuperMap.REST.DatasetService(url).getDataset(datasourceName, datasetName, function(result){
  10794. * //doSomething
  10795. * });
  10796. * @param {string} datasourceName - 数据源名称。
  10797. * @param {string} datasetName - 数据集名称。
  10798. * @param {RequestCallback} callback - 回调函数。
  10799. */
  10800. getDataset(datasourceName, datasetName, callback) {
  10801. if (!datasourceName || !datasetName) {
  10802. return;
  10803. }
  10804. this._datasetService.getDatasetService(datasourceName, datasetName, callback);
  10805. }
  10806. /**
  10807. * @function SuperMap.REST.DatasetService.prototype.setDataset
  10808. * @description 数据集信息设置服务。可实现修改已存在数据集,新增不存在数据集。
  10809. * @example
  10810. * new SuperMap.REST.DatasetService(url).setDataset(params, function(result){
  10811. * //doSomething
  10812. * });
  10813. * @param {CreateDatasetParameters | UpdateDatasetParameters } params - 数据集创建参数类或数据集信息更改参数类。
  10814. * @param {RequestCallback} callback - 回调函数。
  10815. */
  10816. setDataset(params, callback) {
  10817. if (!(params instanceof CreateDatasetParameters) && !(params instanceof UpdateDatasetParameters)) {
  10818. return;
  10819. }
  10820. let datasetParams;
  10821. if (params instanceof CreateDatasetParameters) {
  10822. datasetParams = {
  10823. "datasetType": params.datasetType,
  10824. "datasourceName": params.datasourceName,
  10825. "datasetName": params.datasetName
  10826. }
  10827. } else if (params instanceof UpdateDatasetParameters) {
  10828. datasetParams = {
  10829. "datasetName": params.datasetName,
  10830. "datasourceName": params.datasourceName,
  10831. "isFileCache": params.isFileCache,
  10832. "description": params.description,
  10833. "prjCoordSys": params.prjCoordSys,
  10834. "charset": params.charset
  10835. }
  10836. }
  10837. this._datasetService.setDatasetService(datasetParams, callback);
  10838. }
  10839. /**
  10840. * @function SuperMap.REST.DatasetService.prototype.deleteDataset
  10841. * @description 指定数据源下的数据集删除服务。
  10842. * @example
  10843. * new SuperMap.REST.DatasetService(url).deleteDataset(datasourceName, datasetName, function(result){
  10844. * //doSomething
  10845. * });
  10846. * @param {string} datasourceName - 数据源名称。
  10847. * @param {string} datasetName - 数据集名称。
  10848. * @param {RequestCallback} callback - 回调函数。
  10849. */
  10850. deleteDataset(datasourceName, datasetName, callback) {
  10851. this._datasetService.deleteDatasetService(datasourceName, datasetName, callback);
  10852. }
  10853. }
  10854. SuperMap.REST.DatasetService = DatasetService;
  10855. ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceService.js
  10856. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  10857. * This program are made available under the terms of the Apache License, Version 2.0
  10858. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10859. /**
  10860. * @class DatasourceService
  10861. * @deprecatedclass SuperMap.DatasourceService
  10862. * @category iServer Data Datasource
  10863. * @classdesc 数据源查询服务类。
  10864. * @param {string} url - 服务地址。如访问World Data服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  10865. * @param {Object} options - 参数。
  10866. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  10867. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  10868. * @param {string} options.datasource - 要查询的数据集所在的数据源名称。
  10869. * @param {string} options.dataset - 要查询的数据集名称。
  10870. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  10871. * @param {Object} [options.headers] - 请求头。
  10872. * @extends {CommonServiceBase}
  10873. * @usage
  10874. */
  10875. class DatasourceService_DatasourceService extends CommonServiceBase {
  10876. constructor(url, options) {
  10877. super(url, options);
  10878. if (options) {
  10879. Util_Util.extend(this, options);
  10880. }
  10881. this.eventCount = 0;
  10882. this.CLASS_NAME = "SuperMap.DatasourceService";
  10883. }
  10884. /**
  10885. * @function DatasourceService.prototype.destroy
  10886. * @override
  10887. */
  10888. destroy() {
  10889. this.eventCount = 0;
  10890. super.destroy();
  10891. }
  10892. /**
  10893. * @function DatasourceService.prototype.getDatasourceService
  10894. * @description 获取指定数据源信息。
  10895. */
  10896. getDatasourceService(datasourceName, callback) {
  10897. let url = Util_Util.urlPathAppend(this.url,`datasources/name/${datasourceName}`);
  10898. this.processAsync(url, "GET", callback);
  10899. }
  10900. /**
  10901. * @function DatasourceService.prototype.getDatasourcesService
  10902. * @description 获取所有数据源信息。
  10903. */
  10904. getDatasourcesService(callback) {
  10905. let url = Util_Util.urlPathAppend(this.url,`datasources`);
  10906. this.processAsync(url, "GET", callback);
  10907. }
  10908. /**
  10909. * @function DatasourceService.prototype.setDatasourceService
  10910. * @description 更新数据源信息。
  10911. */
  10912. setDatasourceService(params, callback) {
  10913. if (!params) {
  10914. return;
  10915. }
  10916. const url = Util_Util.urlPathAppend(this.url,`datasources/name/${params.datasourceName}`);
  10917. this.processAsync(url, "PUT", callback, params);
  10918. }
  10919. processAsync(url, method, callback, params) {
  10920. let eventId = ++this.eventCount;
  10921. let eventListeners = {
  10922. scope: this,
  10923. processCompleted: function(result) {
  10924. if (eventId === result.result.eventId && callback) {
  10925. delete result.result.eventId;
  10926. callback(result);
  10927. this.events && this.events.un(eventListeners);
  10928. return false;
  10929. }
  10930. },
  10931. processFailed: function(result) {
  10932. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  10933. callback(result);
  10934. this.events && this.events.un(eventListeners);
  10935. return false;
  10936. }
  10937. }
  10938. }
  10939. this.events.on(eventListeners);
  10940. var me = this;
  10941. let requestConfig = {
  10942. url,
  10943. method,
  10944. scope: me,
  10945. success(result, options) {
  10946. result.eventId = eventId;
  10947. this.serviceProcessCompleted(result, options);
  10948. },
  10949. failure(result, options) {
  10950. if (result.error) {
  10951. result.error.eventId = eventId;
  10952. }
  10953. result.eventId = eventId;
  10954. this.serviceProcessFailed(result, options);
  10955. }
  10956. }
  10957. params && (requestConfig.data = Util_Util.toJSON(params));
  10958. me.request(requestConfig);
  10959. }
  10960. }
  10961. ;// CONCATENATED MODULE: ./src/common/iServer/SetDatasourceParameters.js
  10962. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  10963. * This program are made available under the terms of the Apache License, Version 2.0
  10964. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10965. /**
  10966. * @class SetDatasourceParameters
  10967. * @deprecatedclass SuperMap.SetDatasourceParameters
  10968. * @category iServer Data Datasource
  10969. * @classdesc 设置数据源信息参数类。
  10970. * @param {Object} options - 参数。
  10971. * @param {string} options.datasourceName - 数据源名称。
  10972. * @param {string} options.description - 数据源描述信息。
  10973. * @param {string} options.coordUnit - 坐标单位。
  10974. * @param {string} options.distanceUnit - 距离单位。
  10975. * @usage
  10976. */
  10977. class SetDatasourceParameters {
  10978. constructor(options) {
  10979. if (!options) {
  10980. return;
  10981. }
  10982. /**
  10983. * @member {string} SetDatasourceParameters.prototype.datasourceName
  10984. * @description 数据源名称。
  10985. */
  10986. this.datasourceName = null;
  10987. /**
  10988. * @member {string} SetDatasourceParameters.prototype.description
  10989. * @description 数据源描述信息。
  10990. */
  10991. this.description = null;
  10992. /**
  10993. * @member {string} SetDatasourceParameters.prototype.coordUnit
  10994. * @description 坐标单位。
  10995. */
  10996. this.coordUnit = null;
  10997. /**
  10998. * @member {string} SetDatasourceParameters.prototype.distanceUnit
  10999. * @description 距离单位。
  11000. */
  11001. this.distanceUnit = null;
  11002. if (options) {
  11003. Util_Util.extend(this, options);
  11004. }
  11005. this.CLASS_NAME = "SuperMap.SetDatasourceParameters";
  11006. }
  11007. /**
  11008. * @function SetDatasourceParameters.prototype.destroy
  11009. * @description 释放资源,将引用资源的属性置空。
  11010. */
  11011. destroy() {
  11012. var me = this;
  11013. me.datasourceName = null;
  11014. me.description = null;
  11015. me.coordUnit = null;
  11016. me.distanceUnit = null;
  11017. }
  11018. }
  11019. ;// CONCATENATED MODULE: ./src/classic/services/DatasourceService.js
  11020. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11021. * This program are made available under the terms of the Apache License, Version 2.0
  11022. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11023. /**
  11024. * @class SuperMap.REST.DatasourceService
  11025. * @category iServer Data Datasource
  11026. * @classdesc 数据源服务类。
  11027. * @extends {CommonServiceBase}
  11028. * @param {string} url - 服务地址。
  11029. * @param {Object} options - 参数。
  11030. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11031. * @param {Object} [options.headers] - 请求头。
  11032. */
  11033. class DatasourceService extends CommonServiceBase {
  11034. constructor(url, options) {
  11035. super(url, options);
  11036. const me = this;
  11037. this._datasourceService = new DatasourceService_DatasourceService(me.url, {
  11038. proxy: me.proxy,
  11039. withCredentials: me.withCredentials,
  11040. crossOrigin: me.crossOrigin,
  11041. headers: me.headers
  11042. });
  11043. this.CLASS_NAME = "SuperMap.REST.DatasourceService";
  11044. }
  11045. /**
  11046. * @function SuperMap.REST.DatasourceService.prototype.getDatasources
  11047. * @description 数据源集查询服务。
  11048. * @example
  11049. * new SuperMap.REST.DatasourceService(url).getDatasources(function(result){
  11050. * //doSomething
  11051. * });
  11052. * @param {RequestCallback} callback - 回调函数。
  11053. */
  11054. getDatasources(callback) {
  11055. this._datasourceService.getDatasourcesService(callback);
  11056. }
  11057. /**
  11058. * @function SuperMap.REST.DatasourceService.prototype.getDatasource
  11059. * @description 数据源信息查询服务。
  11060. * @example
  11061. * new SuperMap.REST.DatasourceService(url).getDatasource(datasourceName,function(result){
  11062. * //doSomething
  11063. * });
  11064. * @param {string} datasourceName - 数据源名称。
  11065. * @param {RequestCallback} callback 回调函数。
  11066. */
  11067. getDatasource(datasourceName, callback) {
  11068. if (!datasourceName) {
  11069. return;
  11070. }
  11071. this._datasourceService.getDatasourceService(datasourceName, callback);
  11072. }
  11073. /**
  11074. * @function SuperMap.REST.DatasourceService.prototype.setDatasource
  11075. * @description 数据源信息设置服务。可实现更改当前数据源信息。
  11076. * @example
  11077. * new SuperMap.REST.DatasourceService(url).setDatasource(params, function(result){
  11078. * //doSomething
  11079. * });
  11080. * @param {SetDatasourceParameters} params - 数据源信息查询参数类。
  11081. * @param {RequestCallback} callback - 回调函数。
  11082. */
  11083. setDatasource(params, callback) {
  11084. if (!(params instanceof SetDatasourceParameters)) {
  11085. return;
  11086. }
  11087. const datasourceParams = {
  11088. description: params.description ,
  11089. coordUnit: params.coordUnit,
  11090. distanceUnit: params.distanceUnit,
  11091. datasourceName: params.datasourceName
  11092. };
  11093. this._datasourceService.setDatasourceService(datasourceParams, callback);
  11094. }
  11095. }
  11096. SuperMap.REST.DatasourceService = DatasourceService;
  11097. ;// CONCATENATED MODULE: ./src/common/iServer/ProcessingServiceBase.js
  11098. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11099. * This program are made available under the terms of the Apache License, Version 2.0
  11100. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11101. /**
  11102. * @class ProcessingServiceBase
  11103. * @deprecatedclass SuperMap.ProcessingServiceBase
  11104. * @category iServer Core
  11105. * @classdesc 分布式分析服务基类
  11106. * @extends {CommonServiceBase}
  11107. * @param {string} url - 服务地址。
  11108. * @param {Object} options - 参数。
  11109. * @param {Events} options.events - 处理所有事件的对象。
  11110. * @param {number} options.index - 服务访问地址在数组中的位置。
  11111. * @param {number} options.length - 服务访问地址数组长度。
  11112. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  11113. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11114. * @param {Object} [options.headers] - 请求头。
  11115. * @usage
  11116. */
  11117. class ProcessingServiceBase extends CommonServiceBase {
  11118. constructor(url, options) {
  11119. options = options || {};
  11120. /*
  11121. * Constant: EVENT_TYPES
  11122. * {Array.<string>}
  11123. * 此类支持的事件类型
  11124. * - *processCompleted* 创建成功后触发的事件。
  11125. * - *processFailed* 创建失败后触发的事件 。
  11126. * - *processRunning* 创建过程的整个阶段都会触发的事件,用于获取创建过程的状态 。
  11127. */
  11128. options.EVENT_TYPES = ["processCompleted", "processFailed", "processRunning"];
  11129. super(url, options);
  11130. this.CLASS_NAME = "SuperMap.ProcessingServiceBase";
  11131. }
  11132. /**
  11133. * @function ProcessingServiceBase.prototype.destroy
  11134. * @override
  11135. */
  11136. destroy() {
  11137. super.destroy();
  11138. }
  11139. /**
  11140. * @function ProcessingServiceBase.prototype.getJobs
  11141. * @description 获取分布式分析任务。
  11142. * @param {string} url - 资源地址。
  11143. */
  11144. getJobs(url) {
  11145. var me = this;
  11146. FetchRequest.get(SecurityManager.appendCredential(url), null, {
  11147. proxy: me.proxy
  11148. }).then(function (response) {
  11149. return response.json();
  11150. }).then(function (result) {
  11151. me.events.triggerEvent("processCompleted", {
  11152. result: result
  11153. });
  11154. }).catch(function (e) {
  11155. me.eventListeners.processFailed({
  11156. error: e
  11157. });
  11158. });
  11159. }
  11160. /**
  11161. * @function ProcessingServiceBase.prototype.addJob
  11162. * @description 添加分布式分析任务。
  11163. * @param {string} url - 资源根地址。
  11164. * @param {Object} params - 创建一个空间分析的请求参数。
  11165. * @param {string} paramType - 请求参数类型。
  11166. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  11167. */
  11168. addJob(url, params, paramType, seconds) {
  11169. var me = this,
  11170. parameterObject = null;
  11171. if (params && params instanceof paramType) {
  11172. parameterObject = new Object();
  11173. paramType.toObject(params, parameterObject);
  11174. }
  11175. let headers = Object.assign({
  11176. 'Content-Type': 'application/x-www-form-urlencoded'
  11177. }, me.headers || {})
  11178. var options = {
  11179. proxy: me.proxy,
  11180. headers,
  11181. withCredentials: me.withCredentials,
  11182. crossOrigin: me.crossOrigin,
  11183. isInTheSameDomain: me.isInTheSameDomain
  11184. };
  11185. FetchRequest.post(SecurityManager.appendCredential(url), JSON.stringify(parameterObject), options).then(function (response) {
  11186. return response.json();
  11187. }).then(function (result) {
  11188. if (result.succeed) {
  11189. me.serviceProcessCompleted(result, seconds);
  11190. } else {
  11191. me.serviceProcessFailed(result);
  11192. }
  11193. }).catch(function (e) {
  11194. me.serviceProcessFailed({
  11195. error: e
  11196. });
  11197. });
  11198. }
  11199. serviceProcessCompleted(result, seconds) {
  11200. result = Util_Util.transformResult(result);
  11201. seconds = seconds || 1000;
  11202. var me = this;
  11203. if (result) {
  11204. var id = setInterval(function () {
  11205. FetchRequest.get(SecurityManager.appendCredential(result.newResourceLocation), {
  11206. _t: new Date().getTime()
  11207. })
  11208. .then(function (response) {
  11209. return response.json();
  11210. }).then(function (job) {
  11211. me.events.triggerEvent("processRunning", {
  11212. id: job.id,
  11213. state: job.state
  11214. });
  11215. if (job.state.runState === 'LOST' || job.state.runState === 'KILLED' || job.state.runState === 'FAILED') {
  11216. clearInterval(id);
  11217. me.events.triggerEvent("processFailed", {
  11218. error: job.state.errorMsg,
  11219. state: job.state.runState
  11220. });
  11221. }
  11222. if (job.state.runState === 'FINISHED' && job.setting.serviceInfo) {
  11223. clearInterval(id);
  11224. me.events.triggerEvent("processCompleted", {
  11225. result: job
  11226. });
  11227. }
  11228. }).catch(function (e) {
  11229. clearInterval(id);
  11230. me.events.triggerEvent("processFailed", {
  11231. error: e
  11232. });
  11233. });
  11234. }, seconds);
  11235. }
  11236. }
  11237. serviceProcessFailed(result) {
  11238. super.serviceProcessFailed(result);
  11239. }
  11240. }
  11241. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobsService.js
  11242. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11243. * This program are made available under the terms of the Apache License, Version 2.0
  11244. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11245. /**
  11246. * @class KernelDensityJobsService
  11247. * @deprecatedclass SuperMap.KernelDensityJobsService
  11248. * @category iServer ProcessingService DensityAnalyst
  11249. * @classdesc 核密度分析服务类
  11250. * @extends {ProcessingServiceBase}
  11251. * @param {string} url - 服务地址。
  11252. * @param {Object} options - 可选参数。
  11253. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11254. * @param {Object} [options.headers] - 请求头。
  11255. * @usage
  11256. */
  11257. class KernelDensityJobsService extends ProcessingServiceBase {
  11258. constructor(url, options) {
  11259. super(url, options);
  11260. this.url = Util_Util.urlPathAppend(this.url, 'spatialanalyst/density');
  11261. this.CLASS_NAME = "SuperMap.KernelDensityJobsService";
  11262. }
  11263. /**
  11264. * @function KernelDensityJobsService.prototype.destroy
  11265. * @override
  11266. */
  11267. destroy() {
  11268. super.destroy();
  11269. }
  11270. /**
  11271. * @function KernelDensityJobsService.prototype.getKernelDensityJobs
  11272. * @description 获取核密度分析任务
  11273. */
  11274. getKernelDensityJobs() {
  11275. super.getJobs(this.url);
  11276. }
  11277. /**
  11278. * @function KernelDensityJobsService.prototype.getKernelDensityJobs
  11279. * @description 获取指定id的核密度分析服务
  11280. * @param {string} id - 指定要获取数据的id
  11281. */
  11282. getKernelDensityJob(id) {
  11283. super.getJobs(Util_Util.urlPathAppend(this.url, id));
  11284. }
  11285. /**
  11286. * @function KernelDensityJobsService.prototype.addKernelDensityJob
  11287. * @description 新建核密度分析服务
  11288. * @param {KernelDensityJobParameter} params - 核密度分析服务参数类。
  11289. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  11290. */
  11291. addKernelDensityJob(params, seconds) {
  11292. super.addJob(this.url, params, KernelDensityJobParameter, seconds);
  11293. }
  11294. }
  11295. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsService.js
  11296. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11297. * This program are made available under the terms of the Apache License, Version 2.0
  11298. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11299. /**
  11300. * @class SingleObjectQueryJobsService
  11301. * @deprecatedclass SuperMap.SingleObjectQueryJobsService
  11302. * @category iServer ProcessingService Query
  11303. * @classdesc 单对象查询分析服务类
  11304. * @extends {ProcessingServiceBase}
  11305. * @param {string} url - 服务地址。
  11306. * @param {Object} options - 可选参数。
  11307. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11308. * @param {Object} [options.headers] - 请求头。
  11309. * @usage
  11310. */
  11311. class SingleObjectQueryJobsService extends ProcessingServiceBase {
  11312. constructor(url, options) {
  11313. super(url, options);
  11314. this.url = Util_Util.urlPathAppend(this.url, 'spatialanalyst/query');
  11315. this.CLASS_NAME = 'SuperMap.SingleObjectQueryJobsService';
  11316. }
  11317. /**
  11318. *@override
  11319. */
  11320. destroy() {
  11321. super.destroy();
  11322. }
  11323. /**
  11324. * @function SingleObjectQueryJobsService.protitype.getQueryJobs
  11325. * @description 获取单对象空间查询分析所有任务
  11326. */
  11327. getQueryJobs() {
  11328. super.getJobs(this.url);
  11329. }
  11330. /**
  11331. * @function KernelDensityJobsService.protitype.getQueryJob
  11332. * @description 获取指定id的单对象空间查询分析服务
  11333. * @param {string} id - 指定要获取数据的id
  11334. */
  11335. getQueryJob(id) {
  11336. super.getJobs(Util_Util.urlPathAppend(this.url, id));
  11337. }
  11338. /**
  11339. * @function SingleObjectQueryJobsService.protitype.addQueryJob
  11340. * @description 新建单对象空间查询分析服务
  11341. * @param {SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
  11342. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  11343. */
  11344. addQueryJob(params, seconds) {
  11345. super.addJob(this.url, params, SingleObjectQueryJobsParameter, seconds);
  11346. }
  11347. }
  11348. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobsService.js
  11349. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11350. * This program are made available under the terms of the Apache License, Version 2.0
  11351. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11352. /**
  11353. * @class SummaryMeshJobsService
  11354. * @deprecatedclass SuperMap.SummaryMeshJobsService
  11355. * @category iServer ProcessingService AggregatePoints
  11356. * @classdesc 点聚合分析任务类。
  11357. * @param {string} url - 服务地址。
  11358. * @param {Object} options - 参数。
  11359. * @param {Events} options.events - 处理所有事件的对象。
  11360. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  11361. * @param {number} options.index - 服务地址在数组中的位置。
  11362. * @param {number} options.length - 服务地址数组长度。
  11363. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11364. * @param {Object} [options.headers] - 请求头。
  11365. * @usage
  11366. */
  11367. class SummaryMeshJobsService extends ProcessingServiceBase {
  11368. constructor(url, options) {
  11369. super(url, options);
  11370. this.url = Util_Util.urlPathAppend(this.url, 'spatialanalyst/aggregatepoints');
  11371. this.CLASS_NAME = 'SuperMap.SummaryMeshJobsService';
  11372. }
  11373. /**
  11374. * @override
  11375. */
  11376. destroy() {
  11377. super.destroy();
  11378. }
  11379. /**
  11380. * @function SummaryMeshJobsService.prototype.getSummaryMeshJobs
  11381. * @description 获取点聚合分析任务
  11382. */
  11383. getSummaryMeshJobs() {
  11384. super.getJobs(this.url);
  11385. }
  11386. /**
  11387. * @function SummaryMeshJobsService.prototype.getSummaryMeshJob
  11388. * @description 获取指定ip的点聚合分析任务
  11389. * @param {string} id - 指定要获取数据的id
  11390. */
  11391. getSummaryMeshJob(id) {
  11392. super.getJobs(Util_Util.urlPathAppend(this.url, id));
  11393. }
  11394. /**
  11395. * @function SummaryMeshJobsService.prototype.addSummaryMeshJob
  11396. * @description 新建点聚合分析服务
  11397. * @param {SummaryMeshJobParameter} params - 创建一个空间分析的请求参数。
  11398. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  11399. */
  11400. addSummaryMeshJob(params, seconds) {
  11401. super.addJob(this.url, params, SummaryMeshJobParameter, seconds);
  11402. }
  11403. }
  11404. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobsService.js
  11405. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11406. * This program are made available under the terms of the Apache License, Version 2.0
  11407. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11408. /**
  11409. * @class SummaryRegionJobsService
  11410. * @deprecatedclass SuperMap.SummaryRegionJobsService
  11411. * @category iServer ProcessingService SummaryRegion
  11412. * @classdesc 区域汇总分析服务类
  11413. * @extends {ProcessingServiceBase}
  11414. * @param {string} url - 服务地址。
  11415. * @param {Object} options - 可选参数。
  11416. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11417. * @param {Object} [options.headers] - 请求头。
  11418. * @usage
  11419. */
  11420. class SummaryRegionJobsService extends ProcessingServiceBase {
  11421. constructor(url, options) {
  11422. super(url, options);
  11423. this.url = Util_Util.urlPathAppend(this.url, 'spatialanalyst/summaryregion');
  11424. this.CLASS_NAME = 'SuperMap.SummaryRegionJobsService';
  11425. }
  11426. /**
  11427. *@override
  11428. */
  11429. destroy() {
  11430. super.destroy();
  11431. }
  11432. /**
  11433. * @function SummaryRegionJobsService.prototype.getSummaryRegionJobs
  11434. * @description 获取区域汇总分析任务集合。
  11435. */
  11436. getSummaryRegionJobs() {
  11437. super.getJobs(this.url);
  11438. }
  11439. /**
  11440. * @function SummaryRegionJobsService.prototype.getSummaryRegionJob
  11441. * @description 获取指定id的区域汇总分析任务。
  11442. * @param {string} id -要获取区域汇总分析任务的id
  11443. */
  11444. getSummaryRegionJob(id) {
  11445. super.getJobs(Util_Util.urlPathAppend(this.url, id));
  11446. }
  11447. /**
  11448. * @function SummaryRegionJobsService.prototype.addSummaryRegionJob
  11449. * @description 新建区域汇总任务。
  11450. * @param {SummaryRegionJobParameter} params - 区域汇总分析任务参数类。
  11451. * @param {number} seconds - 创建成功结果的时间间隔。
  11452. */
  11453. addSummaryRegionJob(params, seconds) {
  11454. super.addJob(this.url, params, SummaryRegionJobParameter, seconds);
  11455. }
  11456. }
  11457. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsParameter.js
  11458. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11459. * This program are made available under the terms of the Apache License, Version 2.0
  11460. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11461. /**
  11462. * @class VectorClipJobsParameter
  11463. * @deprecatedclass SuperMap.VectorClipJobsParameter
  11464. * @category iServer ProcessingService VectorClip
  11465. * @classdesc 矢量裁剪分析任务参数类。
  11466. * @param {Object} options - 参数。
  11467. * @param {string} options.datasetName - 数据集名。
  11468. * @param {string} options.datasetOverlay - 裁剪对象数据集。
  11469. * @param {ClipAnalystMode} [options.mode=ClipAnalystMode.CLIP] - 裁剪分析模式。
  11470. * @param {string} [options.geometryClip] - 裁剪几何对象。
  11471. * @param {OutputSetting} [options.output] - 输出参数设置。
  11472. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  11473. * @usage
  11474. */
  11475. class VectorClipJobsParameter {
  11476. constructor(options) {
  11477. options = options || {};
  11478. /**
  11479. * @member {string} VectorClipJobsParameter.prototype.datasetName
  11480. * @description 数据集名。
  11481. */
  11482. this.datasetName = "";
  11483. /**
  11484. * @member {string} VectorClipJobsParameter.prototype.datasetOverlay
  11485. * @description 裁剪对象数据集。
  11486. */
  11487. this.datasetVectorClip = "";
  11488. /**
  11489. * @member {string} VectorClipJobsParameter.prototype.geometryClip
  11490. * @description 裁剪几何对象。
  11491. */
  11492. this.geometryClip = "";
  11493. /**
  11494. * @member {ClipAnalystMode} [VectorClipJobsParameter.prototype.mode=ClipAnalystMode.CLIP]
  11495. * @description 裁剪分析模式 。
  11496. */
  11497. this.mode = ClipAnalystMode.CLIP;
  11498. /**
  11499. * @member {OutputSetting} VectorClipJobsParameter.prototype.output
  11500. * @description 输出参数设置类。
  11501. */
  11502. this.output = null;
  11503. /**
  11504. * @member {MappingParameters} [VectorClipJobsParameter.prototype.mappingParameters]
  11505. * @description 分析后结果可视化的参数类。
  11506. */
  11507. this.mappingParameters = null;
  11508. Util_Util.extend(this, options);
  11509. this.CLASS_NAME = "SuperMap.VectorClipJobsParameter";
  11510. }
  11511. /**
  11512. * @function VectorClipJobsParameter.prototype.destroy
  11513. * @description 释放资源,将引用资源的属性置空。
  11514. */
  11515. destroy() {
  11516. this.datasetName = null;
  11517. this.datasetVectorClip = null;
  11518. this.geometryClip = null;
  11519. this.mode = null;
  11520. if (this.output instanceof OutputSetting) {
  11521. this.output.destroy();
  11522. this.output = null;
  11523. }
  11524. if (this.mappingParameters instanceof MappingParameters) {
  11525. this.mappingParameters.destroy();
  11526. this.mappingParameters = null;
  11527. }
  11528. }
  11529. /**
  11530. * @function VectorClipJobsParameter.toObject
  11531. * @param {Object} vectorClipJobsParameter - 区域汇总分析服务参数。
  11532. * @param {Object} tempObj - 目标对象。
  11533. * @description 矢量裁剪分析任务对象。
  11534. */
  11535. static toObject(vectorClipJobsParameter, tempObj) {
  11536. for (var name in vectorClipJobsParameter) {
  11537. if (name === "datasetName") {
  11538. tempObj['input'] = tempObj['input'] || {};
  11539. tempObj['input'][name] = vectorClipJobsParameter[name];
  11540. continue;
  11541. }
  11542. if (name === "output"){
  11543. tempObj['output'] = tempObj['output'] || {};
  11544. tempObj['output'] = vectorClipJobsParameter[name];
  11545. continue;
  11546. }
  11547. tempObj['analyst'] = tempObj['analyst'] || {};
  11548. tempObj['analyst'][name] = vectorClipJobsParameter[name];
  11549. if(name === 'mappingParameters'){
  11550. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  11551. tempObj['analyst']['mappingParameters'] = vectorClipJobsParameter[name];
  11552. }
  11553. }
  11554. }
  11555. }
  11556. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsService.js
  11557. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11558. * This program are made available under the terms of the Apache License, Version 2.0
  11559. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11560. /**
  11561. * @class VectorClipJobsService
  11562. * @deprecatedclass SuperMap.VectorClipJobsService
  11563. * @category iServer ProcessingService VectorClip
  11564. * @classdesc 矢量裁剪分析服务类
  11565. * @extends {ProcessingServiceBase}
  11566. * @param {string} url -服务地址。
  11567. * @param {Object} options - 可选参数。
  11568. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11569. * @param {Object} [options.headers] - 请求头。
  11570. * @usage
  11571. */
  11572. class VectorClipJobsService extends ProcessingServiceBase {
  11573. constructor(url, options) {
  11574. super(url, options);
  11575. this.url = Util_Util.urlPathAppend(this.url, 'spatialanalyst/vectorclip');
  11576. this.CLASS_NAME = 'SuperMap.VectorClipJobsService';
  11577. }
  11578. /**
  11579. *@override
  11580. */
  11581. destroy() {
  11582. super.destroy();
  11583. }
  11584. /**
  11585. * @function VectorClipJobsService.protitype.getVectorClipJobs
  11586. * @description 获取矢量裁剪分析所有任务
  11587. */
  11588. getVectorClipJobs() {
  11589. super.getJobs(this.url);
  11590. }
  11591. /**
  11592. * @function KernelDensityJobsService.protitype.getVectorClipJob
  11593. * @description 获取指定id的矢量裁剪分析服务
  11594. * @param {string} id - 指定要获取数据的id
  11595. */
  11596. getVectorClipJob(id) {
  11597. super.getJobs(Util_Util.urlPathAppend(this.url, id));
  11598. }
  11599. /**
  11600. * @function VectorClipJobsService.protitype.addVectorClipJob
  11601. * @description 新建矢量裁剪分析服务
  11602. * @param {VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  11603. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  11604. */
  11605. addVectorClipJob(params, seconds) {
  11606. super.addJob(this.url, params, VectorClipJobsParameter, seconds);
  11607. }
  11608. }
  11609. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobsService.js
  11610. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11611. * This program are made available under the terms of the Apache License, Version 2.0
  11612. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11613. /**
  11614. * @class OverlayGeoJobsService
  11615. * @deprecatedclass SuperMap.OverlayGeoJobsService
  11616. * @category iServer ProcessingService OverlayAnalyst
  11617. * @classdesc 叠加分析任务类。
  11618. * @param {string} url - 服务地址。
  11619. * @param {Object} options - 参数。
  11620. * @param {Events} options.events - 处理所有事件的对象。
  11621. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  11622. * @param {number} options.index - 服务访问地址在数组中的位置。
  11623. * @param {number} options.length - 服务访问地址数组长度。
  11624. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11625. * @param {Object} [options.headers] - 请求头。
  11626. * @usage
  11627. */
  11628. class OverlayGeoJobsService extends ProcessingServiceBase {
  11629. constructor(url, options) {
  11630. super(url, options);
  11631. this.url = Util_Util.urlPathAppend(this.url, 'spatialanalyst/overlay');
  11632. this.CLASS_NAME = 'SuperMap.OverlayGeoJobsService';
  11633. }
  11634. /**
  11635. * @override
  11636. */
  11637. destroy() {
  11638. super.destroy();
  11639. }
  11640. /**
  11641. * @function OverlayGeoJobsService.prototype.getOverlayGeoJobs
  11642. * @description 获取叠加分析任务
  11643. */
  11644. getOverlayGeoJobs() {
  11645. super.getJobs(this.url);
  11646. }
  11647. /**
  11648. * @function OverlayGeoJobsService.prototype.getOverlayGeoJob
  11649. * @description 获取指定id的叠加分析任务
  11650. * @param {string} id - 指定要获取数据的id
  11651. */
  11652. getOverlayGeoJob(id) {
  11653. super.getJobs(Util_Util.urlPathAppend(this.url, id));
  11654. }
  11655. /**
  11656. * @function OverlayGeoJobsService.prototype.addOverlayGeoJob
  11657. * @description 新建点叠加析服务
  11658. * @param {OverlayGeoJobParameter} params - 创建一个叠加分析的请求参数。
  11659. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  11660. */
  11661. addOverlayGeoJob(params, seconds) {
  11662. super.addJob(this.url, params, OverlayGeoJobParameter, seconds);
  11663. }
  11664. }
  11665. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsService.js
  11666. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11667. * This program are made available under the terms of the Apache License, Version 2.0
  11668. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11669. /**
  11670. * @class BuffersAnalystJobsService
  11671. * @deprecatedclass SuperMap.BuffersAnalystJobsService
  11672. * @category iServer ProcessingService BufferAnalyst
  11673. * @classdesc 缓冲区分析服务类。
  11674. * @extends {ProcessingServiceBase}
  11675. * @param {string} url - 服务地址。
  11676. * @param {Object} options - 参数。
  11677. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11678. * @param {Object} [options.headers] - 请求头。
  11679. * @usage
  11680. */
  11681. class BuffersAnalystJobsService extends ProcessingServiceBase {
  11682. constructor(url, options) {
  11683. super(url, options);
  11684. this.url = Util_Util.urlPathAppend(this.url, 'spatialanalyst/buffers');
  11685. this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsService';
  11686. }
  11687. /**
  11688. *@override
  11689. */
  11690. destroy() {
  11691. super.destroy();
  11692. }
  11693. /**
  11694. * @function BuffersAnalystJobsService.prototype.getBufferJobs
  11695. * @description 获取缓冲区分析所有任务
  11696. */
  11697. getBuffersJobs() {
  11698. super.getJobs(this.url);
  11699. }
  11700. /**
  11701. * @function BuffersAnalystJobsService.prototype.getBufferJob
  11702. * @description 获取指定id的缓冲区分析服务
  11703. * @param {string} id - 指定要获取数据的id。
  11704. */
  11705. getBuffersJob(id) {
  11706. super.getJobs(Util_Util.urlPathAppend(this.url, id));
  11707. }
  11708. /**
  11709. * @function BuffersAnalystJobsService.prototype.addBufferJob
  11710. * @description 新建缓冲区分析服务
  11711. * @param {BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  11712. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  11713. */
  11714. addBuffersJob(params, seconds) {
  11715. super.addJob(this.url, params, BuffersAnalystJobsParameter, seconds);
  11716. }
  11717. }
  11718. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsService.js
  11719. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11720. * This program are made available under the terms of the Apache License, Version 2.0
  11721. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11722. /**
  11723. * @class TopologyValidatorJobsService
  11724. * @deprecatedclass SuperMap.TopologyValidatorJobsService
  11725. * @category iServer ProcessingService TopologyValidator
  11726. * @classdesc 拓扑检查分析服务类
  11727. * @extends {ProcessingServiceBase}
  11728. * @param {string} url - 服务地址。
  11729. * @param {Object} options - 可选参数。
  11730. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11731. * @param {Object} [options.headers] - 请求头。
  11732. * @usage
  11733. */
  11734. class TopologyValidatorJobsService extends ProcessingServiceBase {
  11735. constructor(url, options) {
  11736. super(url, options);
  11737. this.url = Util_Util.urlPathAppend(this.url, 'spatialanalyst/topologyvalidator');
  11738. this.CLASS_NAME = "SuperMap.TopologyValidatorJobsService";
  11739. }
  11740. /**
  11741. *@override
  11742. */
  11743. destroy() {
  11744. super.destroy();
  11745. }
  11746. /**
  11747. * @function TopologyValidatorJobsService.protitype.getTopologyValidatorJobs
  11748. * @description 获取拓扑检查分析所有任务
  11749. */
  11750. getTopologyValidatorJobs() {
  11751. super.getJobs(this.url);
  11752. }
  11753. /**
  11754. * @function TopologyValidatorJobsService.protitype.getTopologyValidatorJob
  11755. * @description 获取指定id的拓扑检查分析服务
  11756. * @param {string} id - 指定要获取数据的id
  11757. */
  11758. getTopologyValidatorJob(id) {
  11759. super.getJobs( Util_Util.urlPathAppend(this.url, id));
  11760. }
  11761. /**
  11762. * @function TopologyValidatorJobsService.protitype.addTopologyValidatorJob
  11763. * @description 新建拓扑检查分析服务
  11764. * @param {TopologyValidatorJobsParameter} params - 拓扑检查分析任务参数类。
  11765. * @param {number} seconds -创建成功结果的时间间隔。
  11766. */
  11767. addTopologyValidatorJob(params, seconds) {
  11768. super.addJob(this.url, params, TopologyValidatorJobsParameter, seconds);
  11769. }
  11770. }
  11771. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsService.js
  11772. /* Copyright© 2000 - 2023 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 SummaryAttributesJobsService
  11777. * @deprecatedclass SuperMap.SummaryAttributesJobsService
  11778. * @category iServer ProcessingService SummaryAttributes
  11779. * @classdesc 属性汇总分析服务类
  11780. * @extends {ProcessingServiceBase}
  11781. * @param {string} url - 服务地址。
  11782. * @param {Object} options - 可选参数。
  11783. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11784. * @param {Object} [options.headers] - 请求头。
  11785. * @usage
  11786. */
  11787. class SummaryAttributesJobsService extends ProcessingServiceBase {
  11788. constructor(url, options) {
  11789. super(url, options);
  11790. this.url = Util_Util.urlPathAppend(this.url, 'spatialanalyst/summaryattributes');
  11791. this.CLASS_NAME = "SuperMap.SummaryAttributesJobsService";
  11792. }
  11793. /**
  11794. *@override
  11795. */
  11796. destroy() {
  11797. super.destroy();
  11798. }
  11799. /**
  11800. * @function SummaryAttributesJobsService.protitype.getSummaryAttributesJobs
  11801. * @description 获取属性汇总分析所有任务
  11802. */
  11803. getSummaryAttributesJobs (){
  11804. super.getJobs(this.url);
  11805. }
  11806. /**
  11807. * @function SummaryAttributesJobsService.protitype.getSummaryAttributesJob
  11808. * @description 获取指定id的属性汇总分析服务
  11809. * @param {string} id - 指定要获取数据的id
  11810. */
  11811. getSummaryAttributesJob(id) {
  11812. super.getJobs(Util_Util.urlPathAppend(this.url, id));
  11813. }
  11814. /**
  11815. * @function SummaryAttributesJobsService.protitype.addSummaryAttributesJob
  11816. * @description 新建属性汇总分析服务
  11817. * @param {SummaryAttributesJobsParameter} params - 属性汇总分析任务参数类。
  11818. * @param {number} seconds - 创建成功结果的时间间隔。
  11819. */
  11820. addSummaryAttributesJob(params, seconds) {
  11821. super.addJob(this.url, params, SummaryAttributesJobsParameter, seconds);
  11822. }
  11823. }
  11824. ;// CONCATENATED MODULE: ./src/classic/services/ProcessingService.js
  11825. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  11826. * This program are made available under the terms of the Apache License, Version 2.0
  11827. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11828. /**
  11829. * @class SuperMap.REST.ProcessingService
  11830. * @category iServer ProcessingService
  11831. * @classdesc 分布式分析相关服务类。
  11832. * @modulecategory Services
  11833. * @augments CommonServiceBase
  11834. * @example
  11835. * new SuperMap.REST.ProcessingService(url,options)
  11836. * .getKernelDensityJobs(function(result){
  11837. * //doSomething
  11838. * })
  11839. * @param {string} url - 分布式分析服务地址。
  11840. * @param {Object} options - 可选参数。
  11841. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  11842. * @param {Object} [options.headers] - 请求头。
  11843. */
  11844. class ProcessingService extends CommonServiceBase {
  11845. constructor(url, options) {
  11846. super(url, options);
  11847. this.kernelDensityJobs = {};
  11848. this.summaryMeshJobs = {};
  11849. this.queryJobs = {};
  11850. this.summaryRegionJobs = {};
  11851. this.vectorClipJobs = {};
  11852. this.overlayGeoJobs = {};
  11853. this.buffersJobs = {};
  11854. this.topologyValidatorJobs = {};
  11855. this.summaryAttributesJobs = {};
  11856. }
  11857. /**
  11858. * @function SuperMap.REST.ProcessingService.prototype.getKernelDensityJobs
  11859. * @description 获取密度分析的列表。
  11860. * @param {function} callback - 回调函数。
  11861. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  11862. */
  11863. getKernelDensityJobs(callback, resultFormat) {
  11864. var me = this,
  11865. format = me._processFormat(resultFormat);
  11866. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  11867. headers: me.headers,
  11868. proxy: me.proxy,
  11869. withCredentials: me.withCredentials,
  11870. crossOrigin: me.crossOrigin,
  11871. eventListeners: {
  11872. scope: me,
  11873. processCompleted: callback,
  11874. processFailed: callback
  11875. },
  11876. format: format
  11877. });
  11878. kernelDensityJobsService.getKernelDensityJobs();
  11879. }
  11880. /**
  11881. * @function SuperMap.REST.ProcessingService.prototype.getKernelDensityJob
  11882. * @description 获取某一个密度分析。
  11883. * @param {string} id - 空间分析的 ID。
  11884. * @param {function} callback - 回调函数。
  11885. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  11886. */
  11887. getKernelDensityJob(id, callback, resultFormat) {
  11888. var me = this,
  11889. format = me._processFormat(resultFormat);
  11890. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  11891. headers: me.headers,
  11892. proxy: me.proxy,
  11893. withCredentials: me.withCredentials,
  11894. crossOrigin: me.crossOrigin,
  11895. eventListeners: {
  11896. scope: me,
  11897. processCompleted: callback,
  11898. processFailed: callback
  11899. },
  11900. format: format
  11901. });
  11902. kernelDensityJobsService.getKernelDensityJob(id);
  11903. }
  11904. /**
  11905. * @function SuperMap.REST.ProcessingService.prototype.addKernelDensityJob
  11906. * @description 密度分析。
  11907. * @param {KernelDensityJobParameter} params - 核密度分析服务参数类。
  11908. * @param {function} callback - 回调函数。
  11909. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  11910. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  11911. */
  11912. addKernelDensityJob(params, callback, seconds, resultFormat) {
  11913. var me = this,
  11914. format = me._processFormat(resultFormat);
  11915. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  11916. headers: me.headers,
  11917. proxy: me.proxy,
  11918. withCredentials: me.withCredentials,
  11919. crossOrigin: me.crossOrigin,
  11920. eventListeners: {
  11921. scope: me,
  11922. processCompleted: callback,
  11923. processFailed: callback,
  11924. processRunning(job) {
  11925. me.kernelDensityJobs[job.id] = job.state;
  11926. }
  11927. },
  11928. format: format
  11929. });
  11930. kernelDensityJobsService.addKernelDensityJob(params, seconds);
  11931. }
  11932. /**
  11933. * @function SuperMap.REST.ProcessingService.prototype.getKernelDensityJobState
  11934. * @description 获取密度分析的状态。
  11935. * @param {string} id - 密度分析的 ID。
  11936. * @returns {Object} 密度分析的状态。
  11937. */
  11938. getKernelDensityJobState(id) {
  11939. return this.kernelDensityJobs[id];
  11940. }
  11941. /**
  11942. * @function SuperMap.REST.ProcessingService.prototype.getSummaryMeshJobs
  11943. * @description 获取点聚合分析的列表。
  11944. * @param {function} callback - 回调函数。
  11945. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  11946. */
  11947. getSummaryMeshJobs(callback, resultFormat) {
  11948. var me = this,
  11949. format = me._processFormat(resultFormat);
  11950. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  11951. headers: me.headers,
  11952. proxy: me.proxy,
  11953. withCredentials: me.withCredentials,
  11954. crossOrigin: me.crossOrigin,
  11955. eventListeners: {
  11956. scope: me,
  11957. processCompleted: callback,
  11958. processFailed: callback
  11959. },
  11960. format: format
  11961. });
  11962. summaryMeshJobsService.getSummaryMeshJobs();
  11963. }
  11964. /**
  11965. * @function SuperMap.REST.ProcessingService.prototype.getSummaryMeshJob
  11966. * @description 获取点聚合分析。
  11967. * @param {string} id - 点聚合分析的 ID。
  11968. * @param {function} callback - 回调函数。
  11969. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  11970. */
  11971. getSummaryMeshJob(id, callback, resultFormat) {
  11972. var me = this,
  11973. format = me._processFormat(resultFormat);
  11974. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  11975. headers: me.headers,
  11976. proxy: me.proxy,
  11977. withCredentials: me.withCredentials,
  11978. crossOrigin: me.crossOrigin,
  11979. eventListeners: {
  11980. scope: me,
  11981. processCompleted: callback,
  11982. processFailed: callback
  11983. },
  11984. format: format
  11985. });
  11986. summaryMeshJobsService.getSummaryMeshJob(id);
  11987. }
  11988. /**
  11989. * @function SuperMap.REST.ProcessingService.prototype.addSummaryMeshJob
  11990. * @description 点聚合分析。
  11991. * @param {SummaryMeshJobParameter} params - 点聚合分析任务参数类。
  11992. * @param {function} callback - 回调函数。
  11993. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  11994. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  11995. */
  11996. addSummaryMeshJob(params, callback, seconds, resultFormat) {
  11997. var me = this,
  11998. format = me._processFormat(resultFormat);
  11999. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  12000. headers: me.headers,
  12001. proxy: me.proxy,
  12002. withCredentials: me.withCredentials,
  12003. crossOrigin: me.crossOrigin,
  12004. eventListeners: {
  12005. scope: me,
  12006. processCompleted: callback,
  12007. processFailed: callback,
  12008. processRunning(job) {
  12009. me.summaryMeshJobs[job.id] = job.state;
  12010. }
  12011. },
  12012. format: format
  12013. });
  12014. summaryMeshJobsService.addSummaryMeshJob(params, seconds);
  12015. }
  12016. /**
  12017. * @function SuperMap.REST.ProcessingService.prototype.getSummaryMeshJobState
  12018. * @description 获取点聚合分析的状态。
  12019. * @param {string} id - 点聚合分析的 ID。
  12020. * @returns {Object} 点聚合分析的状态。
  12021. */
  12022. getSummaryMeshJobState(id) {
  12023. return this.summaryMeshJobs[id];
  12024. }
  12025. /**
  12026. * @function SuperMap.REST.ProcessingService.prototype.getQueryJobs
  12027. * @description 获取单对象查询分析的列表。
  12028. * @param {function} callback - 回调函数。
  12029. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12030. */
  12031. getQueryJobs(callback, resultFormat) {
  12032. var me = this,
  12033. format = me._processFormat(resultFormat);
  12034. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  12035. headers: me.headers,
  12036. proxy: me.proxy,
  12037. withCredentials: me.withCredentials,
  12038. crossOrigin: me.crossOrigin,
  12039. eventListeners: {
  12040. scope: me,
  12041. processCompleted: callback,
  12042. processFailed: callback
  12043. },
  12044. format: format
  12045. });
  12046. singleObjectQueryJobsService.getQueryJobs();
  12047. }
  12048. /**
  12049. * @function SuperMap.REST.ProcessingService.prototype.getQueryJob
  12050. * @description 获取单对象查询分析。
  12051. * @param {string} id - 单对象查询分析的 ID。
  12052. * @param {function} callback - 回调函数。
  12053. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12054. */
  12055. getQueryJob(id, callback, resultFormat) {
  12056. var me = this,
  12057. format = me._processFormat(resultFormat);
  12058. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  12059. headers: me.headers,
  12060. proxy: me.proxy,
  12061. withCredentials: me.withCredentials,
  12062. crossOrigin: me.crossOrigin,
  12063. eventListeners: {
  12064. scope: me,
  12065. processCompleted: callback,
  12066. processFailed: callback
  12067. },
  12068. format: format
  12069. });
  12070. singleObjectQueryJobsService.getQueryJob(id);
  12071. }
  12072. /**
  12073. * @function SuperMap.REST.ProcessingService.prototype.addQueryJob
  12074. * @description 单对象查询分析。
  12075. * @param {SingleObjectQueryJobsParameter} params - 单对象空间查询分析任务参数类。
  12076. * @param {function} callback - 回调函数。
  12077. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  12078. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12079. */
  12080. addQueryJob(params, callback, seconds, resultFormat) {
  12081. var me = this,
  12082. param = me._processParams(params),
  12083. format = me._processFormat(resultFormat);
  12084. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  12085. headers: me.headers,
  12086. proxy: me.proxy,
  12087. withCredentials: me.withCredentials,
  12088. crossOrigin: me.crossOrigin,
  12089. eventListeners: {
  12090. scope: me,
  12091. processCompleted: callback,
  12092. processFailed: callback,
  12093. processRunning(job) {
  12094. me.queryJobs[job.id] = job.state;
  12095. }
  12096. },
  12097. format: format
  12098. });
  12099. singleObjectQueryJobsService.addQueryJob(param, seconds);
  12100. }
  12101. /**
  12102. * @function SuperMap.REST.ProcessingService.prototype.getQueryJobState
  12103. * @description 获取单对象查询分析的状态。
  12104. * @param {string} id - 单对象查询分析的 ID。
  12105. * @returns {Object} 单对象查询分析的状态。
  12106. */
  12107. getQueryJobState(id) {
  12108. return this.queryJobs[id];
  12109. }
  12110. /**
  12111. * @function SuperMap.REST.ProcessingService.prototype.getSummaryRegionJobs
  12112. * @description 获取区域汇总分析的列表。
  12113. * @param {function} callback - 回调函数。
  12114. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12115. */
  12116. getSummaryRegionJobs(callback, resultFormat) {
  12117. var me = this,
  12118. format = me._processFormat(resultFormat);
  12119. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  12120. proxy: me.proxy,
  12121. headers: me.headers,
  12122. withCredentials: me.withCredentials,
  12123. crossOrigin: me.crossOrigin,
  12124. eventListeners: {
  12125. scope: me,
  12126. processCompleted: callback,
  12127. processFailed: callback
  12128. },
  12129. format: format
  12130. });
  12131. summaryRegionJobsService.getSummaryRegionJobs();
  12132. }
  12133. /**
  12134. * @function SuperMap.REST.ProcessingService.prototype.getSummaryRegionJob
  12135. * @description 获取某一个区域汇总分析。
  12136. * @param {string} id - 区域汇总分析的 ID。
  12137. * @param {function} callback - 回调函数。
  12138. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12139. */
  12140. getSummaryRegionJob(id, callback, resultFormat) {
  12141. var me = this,
  12142. format = me._processFormat(resultFormat);
  12143. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  12144. proxy: me.proxy,
  12145. withCredentials: me.withCredentials,
  12146. crossOrigin: me.crossOrigin,
  12147. headers: me.headers,
  12148. eventListeners: {
  12149. scope: me,
  12150. processCompleted: callback,
  12151. processFailed: callback
  12152. },
  12153. format: format
  12154. });
  12155. summaryRegionJobsService.getSummaryRegionJob(id);
  12156. }
  12157. /**
  12158. * @function SuperMap.REST.ProcessingService.prototype.addSummaryRegionJob
  12159. * @description 新建一个区域汇总分析。
  12160. * @param {SummaryRegionJobParameter} params -创建一个区域汇总分析的请求参数。
  12161. * @param {function} callback - 回调函数。
  12162. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  12163. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12164. */
  12165. addSummaryRegionJob(params, callback, seconds, resultFormat) {
  12166. var me = this,
  12167. format = me._processFormat(resultFormat);
  12168. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  12169. proxy: me.proxy,
  12170. withCredentials: me.withCredentials,
  12171. crossOrigin: me.crossOrigin,
  12172. headers: me.headers,
  12173. eventListeners: {
  12174. scope: me,
  12175. processCompleted: callback,
  12176. processFailed: callback,
  12177. processRunning(job) {
  12178. me.summaryRegionJobs[job.id] = job.state;
  12179. }
  12180. },
  12181. format: format
  12182. });
  12183. summaryRegionJobsService.addSummaryRegionJob(params, seconds);
  12184. }
  12185. /**
  12186. * @function SuperMap.REST.ProcessingService.prototype.getSummaryRegionJobState
  12187. * @description 获取区域汇总分析的状态。
  12188. * @param {string} id - 区域汇总分析的 ID。
  12189. * @returns {Object} 区域汇总分析的状态。
  12190. */
  12191. getSummaryRegionJobState(id) {
  12192. return this.summaryRegionJobs[id];
  12193. }
  12194. /**
  12195. * @function SuperMap.REST.ProcessingService.prototype.getVectorClipJobs
  12196. * @description 获取矢量裁剪分析的列表。
  12197. * @param {function} callback - 回调函数。
  12198. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12199. */
  12200. getVectorClipJobs(callback, resultFormat) {
  12201. var me = this,
  12202. format = me._processFormat(resultFormat);
  12203. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  12204. proxy: me.proxy,
  12205. withCredentials: me.withCredentials,
  12206. crossOrigin: me.crossOrigin,
  12207. headers: me.headers,
  12208. eventListeners: {
  12209. scope: me,
  12210. processCompleted: callback,
  12211. processFailed: callback
  12212. },
  12213. format: format
  12214. });
  12215. vectorClipJobsService.getVectorClipJobs();
  12216. }
  12217. /**
  12218. * @function SuperMap.REST.ProcessingService.prototype.getVectorClipJob
  12219. * @description 获取矢量裁剪分析。
  12220. * @param {string} id - 矢量裁剪分析的 ID。
  12221. * @param {function} callback - 回调函数。
  12222. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12223. */
  12224. getVectorClipJob(id, callback, resultFormat) {
  12225. var me = this,
  12226. format = me._processFormat(resultFormat);
  12227. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  12228. proxy: me.proxy,
  12229. withCredentials: me.withCredentials,
  12230. crossOrigin: me.crossOrigin,
  12231. headers: me.headers,
  12232. eventListeners: {
  12233. scope: me,
  12234. processCompleted: callback,
  12235. processFailed: callback
  12236. },
  12237. format: format
  12238. });
  12239. vectorClipJobsService.getVectorClipJob(id);
  12240. }
  12241. /**
  12242. * @function SuperMap.REST.ProcessingService.prototype.addVectorClipJob
  12243. * @description 矢量裁剪分析。
  12244. * @param {VectorClipJobsParameter} params - 矢量裁剪分析任务参数类。
  12245. * @param {function} callback - 回调函数。
  12246. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  12247. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12248. */
  12249. addVectorClipJob(params, callback, seconds, resultFormat) {
  12250. var me = this,
  12251. param = me._processParams(params),
  12252. format = me._processFormat(resultFormat);
  12253. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  12254. proxy: me.proxy,
  12255. withCredentials: me.withCredentials,
  12256. crossOrigin: me.crossOrigin,
  12257. headers: me.headers,
  12258. eventListeners: {
  12259. scope: me,
  12260. processCompleted: callback,
  12261. processFailed: callback,
  12262. processRunning(job) {
  12263. me.vectorClipJobs[job.id] = job.state;
  12264. }
  12265. },
  12266. format: format
  12267. });
  12268. vectorClipJobsService.addVectorClipJob(param, seconds);
  12269. }
  12270. /**
  12271. * @function SuperMap.REST.ProcessingService.prototype.getVectorClipJobState
  12272. * @description 获取矢量裁剪分析的状态。
  12273. * @param {string} id - 矢量裁剪分析的 ID。
  12274. * @returns {Object} 矢量裁剪分析的状态。
  12275. */
  12276. getVectorClipJobState(id) {
  12277. return this.vectorClipJobs[id];
  12278. }
  12279. /**
  12280. * @function SuperMap.REST.ProcessingService.prototype.getOverlayGeoJobs
  12281. * @description 获取叠加分析的列表。
  12282. * @param {function} callback - 回调函数。
  12283. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12284. */
  12285. getOverlayGeoJobs(callback, resultFormat) {
  12286. var me = this,
  12287. format = me._processFormat(resultFormat);
  12288. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  12289. proxy: me.proxy,
  12290. withCredentials: me.withCredentials,
  12291. crossOrigin: me.crossOrigin,
  12292. headers: me.headers,
  12293. eventListeners: {
  12294. scope: me,
  12295. processCompleted: callback,
  12296. processFailed: callback
  12297. },
  12298. format: format
  12299. });
  12300. overlayGeoJobsService.getOverlayGeoJobs();
  12301. }
  12302. /**
  12303. * @function SuperMap.REST.ProcessingService.prototype.getOverlayGeoJob
  12304. * @description 获取叠加分析。
  12305. * @param {string} id - 叠加分析的 ID。
  12306. * @param {function} callback - 回调函数。
  12307. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12308. */
  12309. getOverlayGeoJob(id, callback, resultFormat) {
  12310. var me = this,
  12311. format = me._processFormat(resultFormat);
  12312. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  12313. proxy: me.proxy,
  12314. withCredentials: me.withCredentials,
  12315. crossOrigin: me.crossOrigin,
  12316. headers: me.headers,
  12317. eventListeners: {
  12318. scope: me,
  12319. processCompleted: callback,
  12320. processFailed: callback
  12321. },
  12322. format: format
  12323. });
  12324. overlayGeoJobsService.getOverlayGeoJob(id);
  12325. }
  12326. /**
  12327. * @function SuperMap.REST.ProcessingService.prototype.addOverlayGeoJob
  12328. * @description 叠加分析。
  12329. * @param {OverlayGeoJobParameter} params - 叠加分析任务参数类。
  12330. * @param {function} callback - 回调函数。
  12331. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  12332. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12333. */
  12334. addOverlayGeoJob(params, callback, seconds, resultFormat) {
  12335. var me = this,
  12336. format = me._processFormat(resultFormat);
  12337. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  12338. proxy: me.proxy,
  12339. withCredentials: me.withCredentials,
  12340. crossOrigin: me.crossOrigin,
  12341. headers: me.headers,
  12342. eventListeners: {
  12343. scope: me,
  12344. processCompleted: callback,
  12345. processFailed: callback,
  12346. processRunning: function(job) {
  12347. me.overlayGeoJobs[job.id] = job.state;
  12348. }
  12349. },
  12350. format: format
  12351. });
  12352. overlayGeoJobsService.addOverlayGeoJob(params, seconds);
  12353. }
  12354. /**
  12355. * @function SuperMap.REST.ProcessingService.prototype.getoverlayGeoJobState
  12356. * @description 获取叠加分析的状态。
  12357. * @param {string} id - 叠加分析的 ID。
  12358. * @returns {Object} 叠加分析的状态。
  12359. */
  12360. getoverlayGeoJobState(id) {
  12361. return this.overlayGeoJobs[id];
  12362. }
  12363. /**
  12364. * @function SuperMap.REST.ProcessingService.prototype.getBuffersJobs
  12365. * @description 获取缓冲区分析的列表。
  12366. * @param {function} callback - 回调函数。
  12367. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12368. */
  12369. getBuffersJobs(callback, resultFormat) {
  12370. var me = this,
  12371. format = me._processFormat(resultFormat);
  12372. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  12373. proxy: me.proxy,
  12374. withCredentials: me.withCredentials,
  12375. crossOrigin: me.crossOrigin,
  12376. headers: me.headers,
  12377. eventListeners: {
  12378. scope: me,
  12379. processCompleted: callback,
  12380. processFailed: callback
  12381. },
  12382. format: format
  12383. });
  12384. buffersAnalystJobsService.getBuffersJobs();
  12385. }
  12386. /**
  12387. * @function SuperMap.REST.ProcessingService.prototype.getBuffersJob
  12388. * @description 获取缓冲区分析。
  12389. * @param {string} id - 缓冲区分析的 ID。
  12390. * @param {function} callback - 回调函数。
  12391. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12392. */
  12393. getBuffersJob(id, callback, resultFormat) {
  12394. var me = this,
  12395. format = me._processFormat(resultFormat);
  12396. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  12397. proxy: me.proxy,
  12398. withCredentials: me.withCredentials,
  12399. crossOrigin: me.crossOrigin,
  12400. headers: me.headers,
  12401. eventListeners: {
  12402. scope: me,
  12403. processCompleted: callback,
  12404. processFailed: callback
  12405. },
  12406. format: format
  12407. });
  12408. buffersAnalystJobsService.getBuffersJob(id);
  12409. }
  12410. /**
  12411. * @function SuperMap.REST.ProcessingService.prototype.addBuffersJob
  12412. * @description 缓冲区分析。
  12413. * @param {BuffersAnalystJobsParameter} params - 创建一个缓冲区分析的请求参数。
  12414. * @param {function} callback - 回调函数。
  12415. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  12416. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12417. */
  12418. addBuffersJob(params, callback, seconds, resultFormat) {
  12419. var me = this,
  12420. format = me._processFormat(resultFormat);
  12421. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  12422. proxy: me.proxy,
  12423. withCredentials: me.withCredentials,
  12424. crossOrigin: me.crossOrigin,
  12425. headers: me.headers,
  12426. eventListeners: {
  12427. scope: me,
  12428. processCompleted: callback,
  12429. processFailed: callback,
  12430. processRunning: function(job) {
  12431. me.buffersJobs[job.id] = job.state;
  12432. }
  12433. },
  12434. format: format
  12435. });
  12436. buffersAnalystJobsService.addBuffersJob(params, seconds);
  12437. }
  12438. /**
  12439. * @function SuperMap.REST.ProcessingService.prototype.getBuffersJobState
  12440. * @description 获取缓冲区分析的状态。
  12441. * @param {string} id - 缓冲区分析的 ID。
  12442. * @returns {Object} 缓冲区分析的状态。
  12443. */
  12444. getBuffersJobState(id) {
  12445. return this.buffersJobs[id];
  12446. }
  12447. /**
  12448. * @function SuperMap.REST.ProcessingService.prototype.getTopologyValidatorJobs
  12449. * @description 获取拓扑检查分析的列表。
  12450. * @param {function} callback - 回调函数。
  12451. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12452. */
  12453. getTopologyValidatorJobs(callback, resultFormat) {
  12454. var me = this,
  12455. format = me._processFormat(resultFormat);
  12456. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  12457. proxy: me.proxy,
  12458. withCredentials: me.withCredentials,
  12459. crossOrigin: me.crossOrigin,
  12460. headers: me.headers,
  12461. eventListeners: {
  12462. scope: me,
  12463. processCompleted: callback,
  12464. processFailed: callback
  12465. },
  12466. format: format
  12467. });
  12468. topologyValidatorJobsService.getTopologyValidatorJobs();
  12469. }
  12470. /**
  12471. * @function SuperMap.REST.ProcessingService.prototype.getTopologyValidatorJob
  12472. * @description 获取拓扑检查分析。
  12473. * @param {string} id - 拓扑检查分析的 ID。
  12474. * @param {function} callback - 回调函数。
  12475. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12476. */
  12477. getTopologyValidatorJob(id, callback, resultFormat) {
  12478. var me = this,
  12479. format = me._processFormat(resultFormat);
  12480. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  12481. proxy: me.proxy,
  12482. withCredentials: me.withCredentials,
  12483. crossOrigin: me.crossOrigin,
  12484. headers: me.headers,
  12485. eventListeners: {
  12486. scope: me,
  12487. processCompleted: callback,
  12488. processFailed: callback
  12489. },
  12490. format: format
  12491. });
  12492. topologyValidatorJobsService.getTopologyValidatorJob(id);
  12493. }
  12494. /**
  12495. * @function SuperMap.REST.ProcessingService.prototype.addTopologyValidatorJob
  12496. * @description 拓扑检查分析。
  12497. * @param {TopologyValidatorJobsParameter} params - 拓扑检查分析任务参数类。
  12498. * @param {function} callback - 回调函数。
  12499. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  12500. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12501. */
  12502. addTopologyValidatorJob(params, callback, seconds, resultFormat) {
  12503. var me = this,
  12504. format = me._processFormat(resultFormat);
  12505. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  12506. proxy: me.proxy,
  12507. withCredentials: me.withCredentials,
  12508. crossOrigin: me.crossOrigin,
  12509. headers: me.headers,
  12510. eventListeners: {
  12511. scope: me,
  12512. processCompleted: callback,
  12513. processFailed: callback,
  12514. processRunning: function(job) {
  12515. me.topologyValidatorJobs[job.id] = job.state;
  12516. }
  12517. },
  12518. format: format
  12519. });
  12520. topologyValidatorJobsService.addTopologyValidatorJob(params, seconds);
  12521. }
  12522. /**
  12523. * @function SuperMap.REST.ProcessingService.prototype.getTopologyValidatorJobState
  12524. * @description 获取拓扑检查分析的状态。
  12525. * @param {string} id - 拓扑检查分析的 ID。
  12526. * @returns {Object} 拓扑检查分析的状态。
  12527. */
  12528. getTopologyValidatorJobState(id) {
  12529. return this.topologyValidatorJobs[id];
  12530. }
  12531. /**
  12532. * @function SuperMap.REST.ProcessingService.prototype.getSummaryAttributesJobs
  12533. * @description 获取属性汇总分析的列表。
  12534. * @param {function} callback - 回调函数。
  12535. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12536. */
  12537. getSummaryAttributesJobs(callback, resultFormat) {
  12538. var me = this,
  12539. format = me._processFormat(resultFormat);
  12540. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  12541. proxy: me.proxy,
  12542. withCredentials: me.withCredentials,
  12543. crossOrigin: me.crossOrigin,
  12544. headers: me.headers,
  12545. eventListeners: {
  12546. scope: me,
  12547. processCompleted: callback,
  12548. processFailed: callback
  12549. },
  12550. format: format
  12551. });
  12552. summaryAttributesJobsService.getSummaryAttributesJobs();
  12553. }
  12554. /**
  12555. * @function SuperMap.REST.ProcessingService.prototype.getSummaryAttributesJob
  12556. * @description 获取属性汇总分析。
  12557. * @param {string} id - 属性汇总分析的 ID。
  12558. * @param {function} callback - 回调函数。
  12559. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12560. */
  12561. getSummaryAttributesJob(id, callback, resultFormat) {
  12562. var me = this,
  12563. format = me._processFormat(resultFormat);
  12564. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  12565. proxy: me.proxy,
  12566. withCredentials: me.withCredentials,
  12567. crossOrigin: me.crossOrigin,
  12568. headers: me.headers,
  12569. eventListeners: {
  12570. scope: me,
  12571. processCompleted: callback,
  12572. processFailed: callback
  12573. },
  12574. format: format
  12575. });
  12576. summaryAttributesJobsService.getSummaryAttributesJob(id);
  12577. }
  12578. /**
  12579. * @function SuperMap.REST.ProcessingService.prototype.addSummaryAttributesJob
  12580. * @description 属性汇总分析。
  12581. * @param {SummaryAttributesJobsParameter} params - 属性汇总分析任务参数类。
  12582. * @param {function} callback - 回调函数。
  12583. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  12584. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  12585. */
  12586. addSummaryAttributesJob(params, callback, seconds, resultFormat) {
  12587. var me = this,
  12588. format = me._processFormat(resultFormat);
  12589. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  12590. proxy: me.proxy,
  12591. withCredentials: me.withCredentials,
  12592. crossOrigin: me.crossOrigin,
  12593. headers: me.headers,
  12594. eventListeners: {
  12595. scope: me,
  12596. processCompleted: callback,
  12597. processFailed: callback,
  12598. processRunning: function(job) {
  12599. me.summaryAttributesJobs[job.id] = job.state;
  12600. }
  12601. },
  12602. format: format
  12603. });
  12604. summaryAttributesJobsService.addSummaryAttributesJob(params, seconds);
  12605. }
  12606. /**
  12607. * @function SuperMap.REST.ProcessingService.prototype.getSummaryAttributesJobState
  12608. * @description 获取属性汇总分析的状态。
  12609. * @param {string} id - 属性汇总分析的 ID。
  12610. * @returns {Object} 属性汇总分析的状态。
  12611. */
  12612. getSummaryAttributesJobState(id) {
  12613. return this.summaryAttributesJobs[id];
  12614. }
  12615. _processFormat(resultFormat) {
  12616. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  12617. }
  12618. _processParams(params) {
  12619. if (!params) {
  12620. return {};
  12621. }
  12622. if (params.geometryQuery) {
  12623. params.geometryQuery = this._convertPatams(params.geometryQuery);
  12624. }
  12625. if (params.geometryClip) {
  12626. params.geometryClip = this._convertPatams(params.geometryClip);
  12627. }
  12628. return params;
  12629. }
  12630. _convertPatams(points) {
  12631. var geometryParam = {};
  12632. if (points.length < 1) {
  12633. geometryParam = '';
  12634. } else {
  12635. var results = [];
  12636. for (var i = 0; i < points.length; i++) {
  12637. var point = {};
  12638. point.x = points[i].x;
  12639. point.y = points[i].y;
  12640. results.push(point);
  12641. }
  12642. geometryParam.type = 'REGION';
  12643. geometryParam.points = results;
  12644. }
  12645. return geometryParam;
  12646. }
  12647. }
  12648. SuperMap.REST.ProcessingService = ProcessingService;
  12649. ;// CONCATENATED MODULE: ./src/classic/services/index.js
  12650. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  12651. * This program are made available under the terms of the Apache License, Version 2.0
  12652. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12653. ;// CONCATENATED MODULE: ./src/classic/index.js
  12654. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  12655. * This program are made available under the terms of the Apache License, Version 2.0
  12656. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12657. ;// CONCATENATED MODULE: ./src/classic/namespace.js
  12658. SuperMap.ElasticSearch = ElasticSearch;
  12659. SuperMap.SecurityManager = SecurityManager;
  12660. SuperMap.KernelDensityJobParameter = KernelDensityJobParameter;
  12661. SuperMap.SingleObjectQueryJobsParameter = SingleObjectQueryJobsParameter;
  12662. SuperMap.SummaryAttributesJobsParameter = SummaryAttributesJobsParameter;
  12663. SuperMap.SummaryMeshJobParameter = SummaryMeshJobParameter;
  12664. SuperMap.SummaryRegionJobParameter = SummaryRegionJobParameter;
  12665. SuperMap.OverlayGeoJobParameter = OverlayGeoJobParameter;
  12666. SuperMap.BuffersAnalystJobsParameter = BuffersAnalystJobsParameter;
  12667. SuperMap.TopologyValidatorJobsParameter = TopologyValidatorJobsParameter;
  12668. SuperMap.OutputSetting = OutputSetting;
  12669. SuperMap.MappingParameters = MappingParameters;
  12670. SuperMap.GeoCodingParameter = GeoCodingParameter;
  12671. SuperMap.GeoDecodingParameter = GeoDecodingParameter;
  12672. SuperMap.Util = {...SuperMap.Util, ...Util_Util};
  12673. })();
  12674. /******/ })()
  12675. ;