iclient-classic.js 486 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481
  1. /*!
  2. *
  3. * iclient-classic.(https://iclient.supermap.io)
  4. * Copyright© 2000 - 2021 SuperMap Software Co.Ltd
  5. * license: Apache-2.0
  6. * version: v10.1.1
  7. *
  8. */
  9. /******/ (function() { // webpackBootstrap
  10. /******/ var __webpack_modules__ = ({
  11. /***/ 122:
  12. /***/ (function(module) {
  13. (function (self) {
  14. 'use strict'; // if __disableNativeFetch is set to true, the it will always polyfill fetch
  15. // with Ajax.
  16. if (!self.__disableNativeFetch && self.fetch) {
  17. return;
  18. }
  19. function normalizeName(name) {
  20. if (typeof name !== 'string') {
  21. name = String(name);
  22. }
  23. if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
  24. throw new TypeError('Invalid character in header field name');
  25. }
  26. return name.toLowerCase();
  27. }
  28. function normalizeValue(value) {
  29. if (typeof value !== 'string') {
  30. value = String(value);
  31. }
  32. return value;
  33. }
  34. function Headers(headers) {
  35. this.map = {};
  36. if (headers instanceof Headers) {
  37. headers.forEach(function (value, name) {
  38. this.append(name, value);
  39. }, this);
  40. } else if (headers) {
  41. Object.getOwnPropertyNames(headers).forEach(function (name) {
  42. this.append(name, headers[name]);
  43. }, this);
  44. }
  45. }
  46. Headers.prototype.append = function (name, value) {
  47. name = normalizeName(name);
  48. value = normalizeValue(value);
  49. var list = this.map[name];
  50. if (!list) {
  51. list = [];
  52. this.map[name] = list;
  53. }
  54. list.push(value);
  55. };
  56. Headers.prototype['delete'] = function (name) {
  57. delete this.map[normalizeName(name)];
  58. };
  59. Headers.prototype.get = function (name) {
  60. var values = this.map[normalizeName(name)];
  61. return values ? values[0] : null;
  62. };
  63. Headers.prototype.getAll = function (name) {
  64. return this.map[normalizeName(name)] || [];
  65. };
  66. Headers.prototype.has = function (name) {
  67. return this.map.hasOwnProperty(normalizeName(name));
  68. };
  69. Headers.prototype.set = function (name, value) {
  70. this.map[normalizeName(name)] = [normalizeValue(value)];
  71. };
  72. Headers.prototype.forEach = function (callback, thisArg) {
  73. Object.getOwnPropertyNames(this.map).forEach(function (name) {
  74. this.map[name].forEach(function (value) {
  75. callback.call(thisArg, value, name, this);
  76. }, this);
  77. }, this);
  78. };
  79. function consumed(body) {
  80. if (body.bodyUsed) {
  81. return Promise.reject(new TypeError('Already read'));
  82. }
  83. body.bodyUsed = true;
  84. }
  85. function fileReaderReady(reader) {
  86. return new Promise(function (resolve, reject) {
  87. reader.onload = function () {
  88. resolve(reader.result);
  89. };
  90. reader.onerror = function () {
  91. reject(reader.error);
  92. };
  93. });
  94. }
  95. function readBlobAsArrayBuffer(blob) {
  96. var reader = new FileReader();
  97. reader.readAsArrayBuffer(blob);
  98. return fileReaderReady(reader);
  99. }
  100. function readBlobAsText(blob, options) {
  101. var reader = new FileReader();
  102. var contentType = options.headers.map['content-type'] ? options.headers.map['content-type'].toString() : '';
  103. var regex = /charset\=[0-9a-zA-Z\-\_]*;?/;
  104. var _charset = blob.type.match(regex) || contentType.match(regex);
  105. var args = [blob];
  106. if (_charset) {
  107. args.push(_charset[0].replace(/^charset\=/, '').replace(/;$/, ''));
  108. }
  109. reader.readAsText.apply(reader, args);
  110. return fileReaderReady(reader);
  111. }
  112. var support = {
  113. blob: 'FileReader' in self && 'Blob' in self && function () {
  114. try {
  115. new Blob();
  116. return true;
  117. } catch (e) {
  118. return false;
  119. }
  120. }(),
  121. formData: 'FormData' in self,
  122. arrayBuffer: 'ArrayBuffer' in self
  123. };
  124. function Body() {
  125. this.bodyUsed = false;
  126. this._initBody = function (body, options) {
  127. this._bodyInit = body;
  128. if (typeof body === 'string') {
  129. this._bodyText = body;
  130. } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
  131. this._bodyBlob = body;
  132. this._options = options;
  133. } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
  134. this._bodyFormData = body;
  135. } else if (!body) {
  136. this._bodyText = '';
  137. } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {// Only support ArrayBuffers for POST method.
  138. // Receiving ArrayBuffers happens via Blobs, instead.
  139. } else {
  140. throw new Error('unsupported BodyInit type');
  141. }
  142. };
  143. if (support.blob) {
  144. this.blob = function () {
  145. var rejected = consumed(this);
  146. if (rejected) {
  147. return rejected;
  148. }
  149. if (this._bodyBlob) {
  150. return Promise.resolve(this._bodyBlob);
  151. } else if (this._bodyFormData) {
  152. throw new Error('could not read FormData body as blob');
  153. } else {
  154. return Promise.resolve(new Blob([this._bodyText]));
  155. }
  156. };
  157. this.arrayBuffer = function () {
  158. return this.blob().then(readBlobAsArrayBuffer);
  159. };
  160. this.text = function () {
  161. var rejected = consumed(this);
  162. if (rejected) {
  163. return rejected;
  164. }
  165. if (this._bodyBlob) {
  166. return readBlobAsText(this._bodyBlob, this._options);
  167. } else if (this._bodyFormData) {
  168. throw new Error('could not read FormData body as text');
  169. } else {
  170. return Promise.resolve(this._bodyText);
  171. }
  172. };
  173. } else {
  174. this.text = function () {
  175. var rejected = consumed(this);
  176. return rejected ? rejected : Promise.resolve(this._bodyText);
  177. };
  178. }
  179. if (support.formData) {
  180. this.formData = function () {
  181. return this.text().then(decode);
  182. };
  183. }
  184. this.json = function () {
  185. return this.text().then(JSON.parse);
  186. };
  187. return this;
  188. } // HTTP methods whose capitalization should be normalized
  189. var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
  190. function normalizeMethod(method) {
  191. var upcased = method.toUpperCase();
  192. return methods.indexOf(upcased) > -1 ? upcased : method;
  193. }
  194. function Request(input, options) {
  195. options = options || {};
  196. var body = options.body;
  197. if (Request.prototype.isPrototypeOf(input)) {
  198. if (input.bodyUsed) {
  199. throw new TypeError('Already read');
  200. }
  201. this.url = input.url;
  202. this.credentials = input.credentials;
  203. if (!options.headers) {
  204. this.headers = new Headers(input.headers);
  205. }
  206. this.method = input.method;
  207. this.mode = input.mode;
  208. if (!body) {
  209. body = input._bodyInit;
  210. input.bodyUsed = true;
  211. }
  212. } else {
  213. this.url = input;
  214. }
  215. this.credentials = options.credentials || this.credentials || 'omit';
  216. if (options.headers || !this.headers) {
  217. this.headers = new Headers(options.headers);
  218. }
  219. this.method = normalizeMethod(options.method || this.method || 'GET');
  220. this.mode = options.mode || this.mode || null;
  221. this.referrer = null;
  222. if ((this.method === 'GET' || this.method === 'HEAD') && body) {
  223. throw new TypeError('Body not allowed for GET or HEAD requests');
  224. }
  225. this._initBody(body, options);
  226. }
  227. Request.prototype.clone = function () {
  228. return new Request(this);
  229. };
  230. function decode(body) {
  231. var form = new FormData();
  232. body.trim().split('&').forEach(function (bytes) {
  233. if (bytes) {
  234. var split = bytes.split('=');
  235. var name = split.shift().replace(/\+/g, ' ');
  236. var value = split.join('=').replace(/\+/g, ' ');
  237. form.append(decodeURIComponent(name), decodeURIComponent(value));
  238. }
  239. });
  240. return form;
  241. }
  242. function headers(xhr) {
  243. var head = new Headers();
  244. var pairs = xhr.getAllResponseHeaders().trim().split('\n');
  245. pairs.forEach(function (header) {
  246. var split = header.trim().split(':');
  247. var key = split.shift().trim();
  248. var value = split.join(':').trim();
  249. head.append(key, value);
  250. });
  251. return head;
  252. }
  253. Body.call(Request.prototype);
  254. function Response(bodyInit, options) {
  255. if (!options) {
  256. options = {};
  257. }
  258. this._initBody(bodyInit, options);
  259. this.type = 'default';
  260. this.status = options.status;
  261. this.ok = this.status >= 200 && this.status < 300;
  262. this.statusText = options.statusText;
  263. this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
  264. this.url = options.url || '';
  265. }
  266. Body.call(Response.prototype);
  267. Response.prototype.clone = function () {
  268. return new Response(this._bodyInit, {
  269. status: this.status,
  270. statusText: this.statusText,
  271. headers: new Headers(this.headers),
  272. url: this.url
  273. });
  274. };
  275. Response.error = function () {
  276. var response = new Response(null, {
  277. status: 0,
  278. statusText: ''
  279. });
  280. response.type = 'error';
  281. return response;
  282. };
  283. var redirectStatuses = [301, 302, 303, 307, 308];
  284. Response.redirect = function (url, status) {
  285. if (redirectStatuses.indexOf(status) === -1) {
  286. throw new RangeError('Invalid status code');
  287. }
  288. return new Response(null, {
  289. status: status,
  290. headers: {
  291. location: url
  292. }
  293. });
  294. };
  295. self.Headers = Headers;
  296. self.Request = Request;
  297. self.Response = Response;
  298. self.fetch = function (input, init) {
  299. return new Promise(function (resolve, reject) {
  300. var request;
  301. if (Request.prototype.isPrototypeOf(input) && !init) {
  302. request = input;
  303. } else {
  304. request = new Request(input, init);
  305. }
  306. var xhr = new XMLHttpRequest();
  307. function responseURL() {
  308. if ('responseURL' in xhr) {
  309. return xhr.responseURL;
  310. } // Avoid security warnings on getResponseHeader when not allowed by CORS
  311. if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
  312. return xhr.getResponseHeader('X-Request-URL');
  313. }
  314. return;
  315. }
  316. var __onLoadHandled = false;
  317. function onload() {
  318. if (xhr.readyState !== 4) {
  319. return;
  320. }
  321. var status = xhr.status === 1223 ? 204 : xhr.status;
  322. if (status < 100 || status > 599) {
  323. if (__onLoadHandled) {
  324. return;
  325. } else {
  326. __onLoadHandled = true;
  327. }
  328. reject(new TypeError('Network request failed'));
  329. return;
  330. }
  331. var options = {
  332. status: status,
  333. statusText: xhr.statusText,
  334. headers: headers(xhr),
  335. url: responseURL()
  336. };
  337. var body = 'response' in xhr ? xhr.response : xhr.responseText;
  338. if (__onLoadHandled) {
  339. return;
  340. } else {
  341. __onLoadHandled = true;
  342. }
  343. resolve(new Response(body, options));
  344. }
  345. xhr.onreadystatechange = onload;
  346. xhr.onload = onload;
  347. xhr.onerror = function () {
  348. if (__onLoadHandled) {
  349. return;
  350. } else {
  351. __onLoadHandled = true;
  352. }
  353. reject(new TypeError('Network request failed'));
  354. };
  355. xhr.open(request.method, request.url, true); // `withCredentials` should be setted after calling `.open` in IE10
  356. // http://stackoverflow.com/a/19667959/1219343
  357. try {
  358. if (request.credentials === 'include') {
  359. if ('withCredentials' in xhr) {
  360. xhr.withCredentials = true;
  361. } else {
  362. console && console.warn && console.warn('withCredentials is not supported, you can ignore this warning');
  363. }
  364. }
  365. } catch (e) {
  366. console && console.warn && console.warn('set withCredentials error:' + e);
  367. }
  368. if ('responseType' in xhr && support.blob) {
  369. xhr.responseType = 'blob';
  370. }
  371. request.headers.forEach(function (value, name) {
  372. xhr.setRequestHeader(name, value);
  373. });
  374. xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
  375. });
  376. };
  377. self.fetch.polyfill = true; // Support CommonJS
  378. if ( true && module.exports) {
  379. module.exports = self.fetch;
  380. }
  381. })(typeof self !== 'undefined' ? self : this);
  382. /***/ }),
  383. /***/ 683:
  384. /***/ (function(module, exports) {
  385. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  386. if (true) {
  387. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  388. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  389. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  390. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  391. } else { var mod; }
  392. })(this, function (exports, module) {
  393. 'use strict';
  394. var defaultOptions = {
  395. timeout: 5000,
  396. jsonpCallback: 'callback',
  397. jsonpCallbackFunction: null
  398. };
  399. function generateCallbackFunction() {
  400. return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
  401. }
  402. function clearFunction(functionName) {
  403. // IE8 throws an exception when you try to delete a property on window
  404. // http://stackoverflow.com/a/1824228/751089
  405. try {
  406. delete window[functionName];
  407. } catch (e) {
  408. window[functionName] = undefined;
  409. }
  410. }
  411. function removeScript(scriptId) {
  412. var script = document.getElementById(scriptId);
  413. if (script) {
  414. document.getElementsByTagName('head')[0].removeChild(script);
  415. }
  416. }
  417. function fetchJsonp(_url) {
  418. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // to avoid param reassign
  419. var url = _url;
  420. var timeout = options.timeout || defaultOptions.timeout;
  421. var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
  422. var timeoutId = undefined;
  423. return new Promise(function (resolve, reject) {
  424. var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
  425. var scriptId = jsonpCallback + '_' + callbackFunction;
  426. window[callbackFunction] = function (response) {
  427. resolve({
  428. ok: true,
  429. // keep consistent with fetch API
  430. json: function json() {
  431. return Promise.resolve(response);
  432. }
  433. });
  434. if (timeoutId) clearTimeout(timeoutId);
  435. removeScript(scriptId);
  436. clearFunction(callbackFunction);
  437. }; // Check if the user set their own params, and if not add a ? to start a list of params
  438. url += url.indexOf('?') === -1 ? '?' : '&';
  439. var jsonpScript = document.createElement('script');
  440. jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);
  441. if (options.charset) {
  442. jsonpScript.setAttribute('charset', options.charset);
  443. }
  444. jsonpScript.id = scriptId;
  445. document.getElementsByTagName('head')[0].appendChild(jsonpScript);
  446. timeoutId = setTimeout(function () {
  447. reject(new Error('JSONP request to ' + _url + ' timed out'));
  448. clearFunction(callbackFunction);
  449. removeScript(scriptId);
  450. window[callbackFunction] = function () {
  451. clearFunction(callbackFunction);
  452. };
  453. }, timeout); // Caught if got 404/500
  454. jsonpScript.onerror = function () {
  455. reject(new Error('JSONP request to ' + _url + ' failed'));
  456. clearFunction(callbackFunction);
  457. removeScript(scriptId);
  458. if (timeoutId) clearTimeout(timeoutId);
  459. };
  460. });
  461. } // export as global function
  462. /*
  463. let local;
  464. if (typeof global !== 'undefined') {
  465. local = global;
  466. } else if (typeof self !== 'undefined') {
  467. local = self;
  468. } else {
  469. try {
  470. local = Function('return this')();
  471. } catch (e) {
  472. throw new Error('polyfill failed because global object is unavailable in this environment');
  473. }
  474. }
  475. local.fetchJsonp = fetchJsonp;
  476. */
  477. module.exports = fetchJsonp;
  478. });
  479. /***/ }),
  480. /***/ 347:
  481. /***/ (function(module, exports, __webpack_require__) {
  482. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  483. (function (global, factory) {
  484. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  485. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  486. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  487. __WEBPACK_AMD_DEFINE_FACTORY__),
  488. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
  489. })(this, function () {
  490. 'use strict';
  491. /**
  492. * @this {Promise}
  493. */
  494. function finallyConstructor(callback) {
  495. var constructor = this.constructor;
  496. return this.then(function (value) {
  497. // @ts-ignore
  498. return constructor.resolve(callback()).then(function () {
  499. return value;
  500. });
  501. }, function (reason) {
  502. // @ts-ignore
  503. return constructor.resolve(callback()).then(function () {
  504. // @ts-ignore
  505. return constructor.reject(reason);
  506. });
  507. });
  508. } // Store setTimeout reference so promise-polyfill will be unaffected by
  509. // other code modifying setTimeout (like sinon.useFakeTimers())
  510. var setTimeoutFunc = setTimeout;
  511. function isArray(x) {
  512. return Boolean(x && typeof x.length !== 'undefined');
  513. }
  514. function noop() {} // Polyfill for Function.prototype.bind
  515. function bind(fn, thisArg) {
  516. return function () {
  517. fn.apply(thisArg, arguments);
  518. };
  519. }
  520. /**
  521. * @constructor
  522. * @param {Function} fn
  523. */
  524. function Promise(fn) {
  525. if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
  526. if (typeof fn !== 'function') throw new TypeError('not a function');
  527. /** @type {!number} */
  528. this._state = 0;
  529. /** @type {!boolean} */
  530. this._handled = false;
  531. /** @type {Promise|undefined} */
  532. this._value = undefined;
  533. /** @type {!Array<!Function>} */
  534. this._deferreds = [];
  535. doResolve(fn, this);
  536. }
  537. function handle(self, deferred) {
  538. while (self._state === 3) {
  539. self = self._value;
  540. }
  541. if (self._state === 0) {
  542. self._deferreds.push(deferred);
  543. return;
  544. }
  545. self._handled = true;
  546. Promise._immediateFn(function () {
  547. var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
  548. if (cb === null) {
  549. (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
  550. return;
  551. }
  552. var ret;
  553. try {
  554. ret = cb(self._value);
  555. } catch (e) {
  556. reject(deferred.promise, e);
  557. return;
  558. }
  559. resolve(deferred.promise, ret);
  560. });
  561. }
  562. function resolve(self, newValue) {
  563. try {
  564. // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
  565. if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
  566. if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) {
  567. var then = newValue.then;
  568. if (newValue instanceof Promise) {
  569. self._state = 3;
  570. self._value = newValue;
  571. finale(self);
  572. return;
  573. } else if (typeof then === 'function') {
  574. doResolve(bind(then, newValue), self);
  575. return;
  576. }
  577. }
  578. self._state = 1;
  579. self._value = newValue;
  580. finale(self);
  581. } catch (e) {
  582. reject(self, e);
  583. }
  584. }
  585. function reject(self, newValue) {
  586. self._state = 2;
  587. self._value = newValue;
  588. finale(self);
  589. }
  590. function finale(self) {
  591. if (self._state === 2 && self._deferreds.length === 0) {
  592. Promise._immediateFn(function () {
  593. if (!self._handled) {
  594. Promise._unhandledRejectionFn(self._value);
  595. }
  596. });
  597. }
  598. for (var i = 0, len = self._deferreds.length; i < len; i++) {
  599. handle(self, self._deferreds[i]);
  600. }
  601. self._deferreds = null;
  602. }
  603. /**
  604. * @constructor
  605. */
  606. function Handler(onFulfilled, onRejected, promise) {
  607. this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
  608. this.onRejected = typeof onRejected === 'function' ? onRejected : null;
  609. this.promise = promise;
  610. }
  611. /**
  612. * Take a potentially misbehaving resolver function and make sure
  613. * onFulfilled and onRejected are only called once.
  614. *
  615. * Makes no guarantees about asynchrony.
  616. */
  617. function doResolve(fn, self) {
  618. var done = false;
  619. try {
  620. fn(function (value) {
  621. if (done) return;
  622. done = true;
  623. resolve(self, value);
  624. }, function (reason) {
  625. if (done) return;
  626. done = true;
  627. reject(self, reason);
  628. });
  629. } catch (ex) {
  630. if (done) return;
  631. done = true;
  632. reject(self, ex);
  633. }
  634. }
  635. Promise.prototype['catch'] = function (onRejected) {
  636. return this.then(null, onRejected);
  637. };
  638. Promise.prototype.then = function (onFulfilled, onRejected) {
  639. // @ts-ignore
  640. var prom = new this.constructor(noop);
  641. handle(this, new Handler(onFulfilled, onRejected, prom));
  642. return prom;
  643. };
  644. Promise.prototype['finally'] = finallyConstructor;
  645. Promise.all = function (arr) {
  646. return new Promise(function (resolve, reject) {
  647. if (!isArray(arr)) {
  648. return reject(new TypeError('Promise.all accepts an array'));
  649. }
  650. var args = Array.prototype.slice.call(arr);
  651. if (args.length === 0) return resolve([]);
  652. var remaining = args.length;
  653. function res(i, val) {
  654. try {
  655. if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
  656. var then = val.then;
  657. if (typeof then === 'function') {
  658. then.call(val, function (val) {
  659. res(i, val);
  660. }, reject);
  661. return;
  662. }
  663. }
  664. args[i] = val;
  665. if (--remaining === 0) {
  666. resolve(args);
  667. }
  668. } catch (ex) {
  669. reject(ex);
  670. }
  671. }
  672. for (var i = 0; i < args.length; i++) {
  673. res(i, args[i]);
  674. }
  675. });
  676. };
  677. Promise.resolve = function (value) {
  678. if (value && _typeof(value) === 'object' && value.constructor === Promise) {
  679. return value;
  680. }
  681. return new Promise(function (resolve) {
  682. resolve(value);
  683. });
  684. };
  685. Promise.reject = function (value) {
  686. return new Promise(function (resolve, reject) {
  687. reject(value);
  688. });
  689. };
  690. Promise.race = function (arr) {
  691. return new Promise(function (resolve, reject) {
  692. if (!isArray(arr)) {
  693. return reject(new TypeError('Promise.race accepts an array'));
  694. }
  695. for (var i = 0, len = arr.length; i < len; i++) {
  696. Promise.resolve(arr[i]).then(resolve, reject);
  697. }
  698. });
  699. }; // Use polyfill for setImmediate for performance gains
  700. Promise._immediateFn = // @ts-ignore
  701. typeof setImmediate === 'function' && function (fn) {
  702. // @ts-ignore
  703. setImmediate(fn);
  704. } || function (fn) {
  705. setTimeoutFunc(fn, 0);
  706. };
  707. Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
  708. if (typeof console !== 'undefined' && console) {
  709. console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
  710. }
  711. };
  712. /** @suppress {undefinedVars} */
  713. var globalNS = function () {
  714. // the only reliable means to get the global object is
  715. // `Function('return this')()`
  716. // However, this causes CSP violations in Chrome apps.
  717. if (typeof self !== 'undefined') {
  718. return self;
  719. }
  720. if (typeof window !== 'undefined') {
  721. return window;
  722. }
  723. if (typeof __webpack_require__.g !== 'undefined') {
  724. return __webpack_require__.g;
  725. }
  726. throw new Error('unable to locate global object');
  727. }();
  728. if (!('Promise' in globalNS)) {
  729. globalNS['Promise'] = Promise;
  730. } else if (!globalNS.Promise.prototype['finally']) {
  731. globalNS.Promise.prototype['finally'] = finallyConstructor;
  732. }
  733. });
  734. /***/ })
  735. /******/ });
  736. /************************************************************************/
  737. /******/ // The module cache
  738. /******/ var __webpack_module_cache__ = {};
  739. /******/
  740. /******/ // The require function
  741. /******/ function __webpack_require__(moduleId) {
  742. /******/ // Check if module is in cache
  743. /******/ if(__webpack_module_cache__[moduleId]) {
  744. /******/ return __webpack_module_cache__[moduleId].exports;
  745. /******/ }
  746. /******/ // Create a new module (and put it into the cache)
  747. /******/ var module = __webpack_module_cache__[moduleId] = {
  748. /******/ // no module.id needed
  749. /******/ // no module.loaded needed
  750. /******/ exports: {}
  751. /******/ };
  752. /******/
  753. /******/ // Execute the module function
  754. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  755. /******/
  756. /******/ // Return the exports of the module
  757. /******/ return module.exports;
  758. /******/ }
  759. /******/
  760. /************************************************************************/
  761. /******/ /* webpack/runtime/compat get default export */
  762. /******/ !function() {
  763. /******/ // getDefaultExport function for compatibility with non-harmony modules
  764. /******/ __webpack_require__.n = function(module) {
  765. /******/ var getter = module && module.__esModule ?
  766. /******/ function() { return module['default']; } :
  767. /******/ function() { return module; };
  768. /******/ __webpack_require__.d(getter, { a: getter });
  769. /******/ return getter;
  770. /******/ };
  771. /******/ }();
  772. /******/
  773. /******/ /* webpack/runtime/define property getters */
  774. /******/ !function() {
  775. /******/ // define getter functions for harmony exports
  776. /******/ __webpack_require__.d = function(exports, definition) {
  777. /******/ for(var key in definition) {
  778. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  779. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  780. /******/ }
  781. /******/ }
  782. /******/ };
  783. /******/ }();
  784. /******/
  785. /******/ /* webpack/runtime/global */
  786. /******/ !function() {
  787. /******/ __webpack_require__.g = (function() {
  788. /******/ if (typeof globalThis === 'object') return globalThis;
  789. /******/ try {
  790. /******/ return this || new Function('return this')();
  791. /******/ } catch (e) {
  792. /******/ if (typeof window === 'object') return window;
  793. /******/ }
  794. /******/ })();
  795. /******/ }();
  796. /******/
  797. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  798. /******/ !function() {
  799. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  800. /******/ }();
  801. /******/
  802. /************************************************************************/
  803. !function() {
  804. "use strict";
  805. // UNUSED EXPORTS: AddressMatchService, BuffersAnalystJobsParameter, ElasticSearch, GeoCodingParameter, GeoDecodingParameter, KernelDensityJobParameter, MapVLayer, MapVRenderer, MappingParameters, OutputSetting, OverlayGeoJobParameter, ProcessingService, SecurityManager, SingleObjectQueryJobsParameter, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SuperMap, TopologyValidatorJobsParameter
  806. ;// CONCATENATED MODULE: ./src/common/SuperMap.js
  807. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  808. * This program are made available under the terms of the Apache License, Version 2.0
  809. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  810. var SuperMap = window.SuperMap = window.SuperMap || {};
  811. SuperMap.Components = window.SuperMap.Components || {};
  812. ;// CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
  813. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  814. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  815. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  816. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  817. * This program are made available under the terms of the Apache License, Version 2.0
  818. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  819. /**
  820. * @class SuperMap.Pixel
  821. * @category BaseTypes Geometry
  822. * @classdesc 此类用 x,y 坐标描绘屏幕坐标(像素点)。
  823. * @param {number} [x=0.0] - x 坐标。
  824. * @param {number} [y=0.0] - y 坐标。
  825. * @param {SuperMap.Pixel.Mode} [mode=SuperMap.Pixel.Mode.LeftTop] - 坐标模式。
  826. *
  827. * @example
  828. * //单独创建一个对象
  829. * var pixcel = new SuperMap.Pixel(100,50);
  830. *
  831. * //依据 size 创建
  832. * var size = new SuperMap.Size(21,25);
  833. * var offset = new SuperMap.Pixel(-(size.w/2), -size.h);
  834. */
  835. var Pixel = /*#__PURE__*/function () {
  836. function Pixel(x, y, mode) {
  837. _classCallCheck(this, Pixel);
  838. /**
  839. * @member {number} [SuperMap.Pixel.prototype.x=0.0]
  840. * @description x 坐标。
  841. */
  842. this.x = x ? parseFloat(x) : 0.0;
  843. /**
  844. * @member {number} [SuperMap.Pixel.prototype.y=0.0]
  845. * @description y 坐标。
  846. */
  847. this.y = y ? parseFloat(y) : 0.0;
  848. /**
  849. * @member {SuperMap.Pixel.Mode} [SuperMap.Pixel.prototype.mode=SuperMap.Pixel.Mode.LeftTop]
  850. * @description 坐标模式,有左上、右上、右下、左下这几种模式,分别表示相对于左上角、右上角、右下角、左下角的坐标。
  851. */
  852. this.mode = mode;
  853. this.CLASS_NAME = "SuperMap.Pixel";
  854. /**
  855. * @enum SuperMap.Pixel.Mode
  856. * @readonly
  857. * @description 模式。
  858. * @type {string}
  859. */
  860. SuperMap.Pixel.Mode = {
  861. /** 左上模式。*/
  862. LeftTop: "lefttop",
  863. /** 右上模式。 */
  864. RightTop: "righttop",
  865. /** 右下模式。 */
  866. RightBottom: "rightbottom",
  867. /** 左下模式。 */
  868. LeftBottom: "leftbottom"
  869. };
  870. }
  871. /**
  872. * @function SuperMap.Pixel.prototype.toString
  873. * @description 返回此对象的字符串形式。
  874. * @example
  875. *
  876. * var pixcel = new SuperMap.Pixel(100,50);
  877. * var str = pixcel.toString();
  878. *
  879. * @returns {string} 例如: "x=200.4,y=242.2"
  880. */
  881. _createClass(Pixel, [{
  882. key: "toString",
  883. value: function toString() {
  884. return "x=" + this.x + ",y=" + this.y;
  885. }
  886. /**
  887. * @function SuperMap.Pixel.prototype.clone
  888. * @description 克隆当前的 pixel 对象。
  889. * @example
  890. * var pixcel = new SuperMap.Pixel(100,50);
  891. * var pixcel2 = pixcel.clone();
  892. * @returns {SuperMap.Pixel} 返回一个新的与当前 pixel 对象有相同 x、y 坐标的 pixel 对象。
  893. */
  894. }, {
  895. key: "clone",
  896. value: function clone() {
  897. return new Pixel(this.x, this.y, this.mode);
  898. }
  899. /**
  900. * @function SuperMap.Pixel.prototype.equals
  901. * @description 比较两 pixel 是否相等。
  902. * @example
  903. * var pixcel = new SuperMap.Pixel(100,50);
  904. * var pixcel2 = new SuperMap.Pixel(100,50);
  905. * var isEquals = pixcel.equals(pixcel2);
  906. *
  907. * @param {SuperMap.Pixel} px - 用于比较相等的 pixel 对象。
  908. * @returns {boolean} 如果传入的像素点和当前像素点相同返回 true,如果不同或传入参数为 NULL 则返回 false。
  909. */
  910. }, {
  911. key: "equals",
  912. value: function equals(px) {
  913. var equals = false;
  914. if (px != null) {
  915. equals = this.x == px.x && this.y == px.y || isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y);
  916. }
  917. return equals;
  918. }
  919. /**
  920. * @function SuperMap.Pixel.prototype.distanceTo
  921. * @description 返回两个 pixel 的距离。
  922. * @example
  923. * var pixcel = new SuperMap.Pixel(100,50);
  924. * var pixcel2 = new SuperMap.Pixel(110,30);
  925. * var distance = pixcel.distanceTo(pixcel2);
  926. *
  927. * @param {SuperMap.Pixel} px - 用于计算的一个 pixel。
  928. * @returns {float} 作为参数传入的像素与当前像素点的距离。
  929. */
  930. }, {
  931. key: "distanceTo",
  932. value: function distanceTo(px) {
  933. return Math.sqrt(Math.pow(this.x - px.x, 2) + Math.pow(this.y - px.y, 2));
  934. }
  935. /**
  936. * @function SuperMap.Pixel.prototype.add
  937. * @description 在原来像素坐标基础上,x 值加上传入的 x 参数,y 值加上传入的 y 参数。
  938. * @example
  939. * var pixcel = new SuperMap.Pixel(100,50);
  940. * //pixcel2是新的对象
  941. * var pixcel2 = pixcel.add(20,30);
  942. *
  943. * @param {number} x - 传入的 x 值。
  944. * @param {number} y - 传入的 y 值。
  945. * @returns {SuperMap.Pixel} 返回一个新的 pixel 对象,该 pixel 是由当前的 pixel 与传入的 x,y 相加得到。
  946. */
  947. }, {
  948. key: "add",
  949. value: function add(x, y) {
  950. if (x == null || y == null) {
  951. throw new TypeError('Pixel.add cannot receive null values');
  952. }
  953. return new Pixel(this.x + x, this.y + y);
  954. }
  955. /**
  956. * @function SuperMap.Pixel.prototype.offset
  957. * @description 通过传入的 {@link SuperMap.Pixel} 参数对原屏幕坐标进行偏移。
  958. * @example
  959. * var pixcel = new SuperMap.Pixel(100,50);
  960. * var pixcel2 = new SuperMap.Pixel(130,20);
  961. * //pixcel3 是新的对象
  962. * var pixcel3 = pixcel.offset(pixcel2);
  963. *
  964. * @param {SuperMap.Pixel} px - 传入的 <SuperMap.Pixel> 对象。
  965. * @returns {SuperMap.Pixel} 返回一个新的 pixel,该 pixel 是由当前的 pixel 对象的 x,y 值与传入的 Pixel 对象的 x,y 值相加得到。
  966. */
  967. }, {
  968. key: "offset",
  969. value: function offset(px) {
  970. var newPx = this.clone();
  971. if (px) {
  972. newPx = this.add(px.x, px.y);
  973. }
  974. return newPx;
  975. }
  976. /**
  977. *
  978. * @function SuperMap.Pixel.prototype.destroy
  979. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  980. * @example
  981. * var pixcel = new SuperMap.Pixel(100,50);
  982. * pixcel.destroy();
  983. */
  984. }, {
  985. key: "destroy",
  986. value: function destroy() {
  987. this.x = null;
  988. this.y = null;
  989. this.mode = null;
  990. }
  991. }]);
  992. return Pixel;
  993. }();
  994. SuperMap.Pixel = Pixel;
  995. ;// CONCATENATED MODULE: ./src/common/commontypes/BaseTypes.js
  996. function BaseTypes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  997. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  998. * This program are made available under the terms of the Apache License, Version 2.0
  999. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  1000. /**
  1001. *@namespace SuperMap
  1002. *@category BaseTypes Namespace
  1003. */
  1004. /**
  1005. * @function SuperMap.inherit
  1006. * @description 除了 C 和 P 两个必要参数外,可以传递任意数量的对象,这些对象都将继承C。
  1007. * @memberOf SuperMap
  1008. * @param {Object} C - 继承的类。
  1009. * @param {Object} P - 被继承的父类。
  1010. */
  1011. SuperMap.inherit = function (C, P) {
  1012. var F = function F() {};
  1013. F.prototype = P.prototype;
  1014. C.prototype = new F();
  1015. var i, l, o;
  1016. for (i = 2, l = arguments.length; i < l; i++) {
  1017. o = arguments[i];
  1018. if (typeof o === "function") {
  1019. o = o.prototype;
  1020. }
  1021. SuperMap.Util.extend(C.prototype, o);
  1022. }
  1023. };
  1024. /**
  1025. * @function SuperMap.mixin
  1026. * @description 实现多重继承。
  1027. * @memberOf SuperMap
  1028. * @param {Class|Object} ...mixins - 继承的类。
  1029. */
  1030. SuperMap.mixin = function () {
  1031. for (var _len = arguments.length, mixins = new Array(_len), _key = 0; _key < _len; _key++) {
  1032. mixins[_key] = arguments[_key];
  1033. }
  1034. var Mix = function Mix(options) {
  1035. BaseTypes_classCallCheck(this, Mix);
  1036. for (var index = 0; index < mixins.length; index++) {
  1037. copyProperties(this, new mixins[index](options));
  1038. }
  1039. };
  1040. for (var index = 0; index < mixins.length; index++) {
  1041. var mixin = mixins[index];
  1042. copyProperties(Mix, mixin);
  1043. copyProperties(Mix.prototype, mixin.prototype);
  1044. copyProperties(Mix.prototype, new mixin());
  1045. }
  1046. return Mix;
  1047. function copyProperties(target, source) {
  1048. var ownKeys = Object.getOwnPropertyNames(source);
  1049. if (Object.getOwnPropertySymbols) {
  1050. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source));
  1051. }
  1052. for (var index = 0; index < ownKeys.length; index++) {
  1053. var key = ownKeys[index];
  1054. if (key !== "constructor" && key !== "prototype" && key !== "name" && key !== "length") {
  1055. var desc = Object.getOwnPropertyDescriptor(source, key);
  1056. if (window["ActiveXObject"]) {
  1057. Object.defineProperty(target, key, desc || {});
  1058. } else {
  1059. Object.defineProperty(target, key, desc);
  1060. }
  1061. }
  1062. }
  1063. }
  1064. };
  1065. /**
  1066. * @name String
  1067. * @namespace
  1068. * @memberOf SuperMap
  1069. * @category BaseTypes Util
  1070. * @description 字符串操作的一系列常用扩展函数。
  1071. */
  1072. var StringExt = SuperMap.String = {
  1073. /**
  1074. * @function SuperMap.String.startsWith
  1075. * @description 判断目标字符串是否以指定的子字符串开头。
  1076. * @param {string} str - 目标字符串。
  1077. * @param {string} sub - 查找的子字符串。
  1078. * @returns {boolean} 目标字符串以指定的子字符串开头,则返回 true;否则返回 false。
  1079. */
  1080. startsWith: function startsWith(str, sub) {
  1081. return str.indexOf(sub) == 0;
  1082. },
  1083. /**
  1084. * @function SuperMap.String.contains
  1085. * @description 判断目标字符串是否包含指定的子字符串。
  1086. * @param {string} str - 目标字符串。
  1087. * @param {string} sub - 查找的子字符串。
  1088. * @returns {boolean} 目标字符串中包含指定的子字符串,则返回 true;否则返回 false。
  1089. */
  1090. contains: function contains(str, sub) {
  1091. return str.indexOf(sub) != -1;
  1092. },
  1093. /**
  1094. * @function SuperMap.String.trim
  1095. * @description 删除一个字符串的开头和结尾处的所有空白字符。
  1096. * @param {string} str - (可能)存在空白字符填塞的字符串。
  1097. * @returns {string} 删除开头和结尾处空白字符后的字符串。
  1098. */
  1099. trim: function trim(str) {
  1100. return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  1101. },
  1102. /**
  1103. * @function SuperMap.String.camelize
  1104. * @description 骆驼式("-")连字符的字符串处理。
  1105. * 例如:"chicken-head" becomes "chickenHead",
  1106. * "-chicken-head" becomes "ChickenHead"。
  1107. * @param {string} str - 要处理的字符串,原始内容不应被修改。
  1108. * @returns {string}
  1109. */
  1110. camelize: function camelize(str) {
  1111. var oStringList = str.split('-');
  1112. var camelizedString = oStringList[0];
  1113. for (var i = 1, len = oStringList.length; i < len; i++) {
  1114. var s = oStringList[i];
  1115. camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
  1116. }
  1117. return camelizedString;
  1118. },
  1119. /**
  1120. * @function SuperMap.String.format
  1121. * @description 提供带 ${token} 标记的字符串, 返回 context 对象属性中指定标记的属性值。
  1122. * @example
  1123. * 示例:
  1124. * (code)
  1125. * 1、template = "${value,getValue}";
  1126. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  1127. * args = [2,23,12,36,21];
  1128. * 返回值:36
  1129. * (end)
  1130. * 示例:
  1131. * (code)
  1132. * 2、template = "$${{value,getValue}}";
  1133. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  1134. * args = [2,23,12,36,21];
  1135. * 返回值:"${36}"
  1136. * (end)
  1137. * 示例:
  1138. * (code)
  1139. * 3、template = "${a,b}";
  1140. * context = {a: {b:"format"}};
  1141. * args = null;
  1142. * 返回值:"format"
  1143. * (end)
  1144. * 示例:
  1145. * (code)
  1146. * 3、template = "${a,b}";
  1147. * context = null;
  1148. * args = null;
  1149. * 返回值:"${a.b}"
  1150. * (end)
  1151. * @param {string} template - 带标记的字符串将要被替换。参数 template 格式为"${token}",此处的 token 标记会替换为 context["token"] 属性的值。
  1152. * @param {Object} [context=window] - 带有属性的可选对象的属性用于匹配格式化字符串中的标记。如果该参数为空,将使用 window 对象。
  1153. * @param {Array} [args] - 可选参数传递给在 context 对象上找到的函数。
  1154. * @returns {string} 从 context 对象属性中替换字符串标记位的字符串。
  1155. */
  1156. format: function format(template, context, args) {
  1157. if (!context) {
  1158. context = window;
  1159. } // Example matching:
  1160. // str = ${foo.bar}
  1161. // match = foo.bar
  1162. var replacer = function replacer(str, match) {
  1163. var replacement; // Loop through all subs. Example: ${a.b.c}
  1164. // 0 -> replacement = context[a];
  1165. // 1 -> replacement = context[a][b];
  1166. // 2 -> replacement = context[a][b][c];
  1167. var subs = match.split(/\.+/);
  1168. for (var i = 0; i < subs.length; i++) {
  1169. if (i == 0) {
  1170. replacement = context;
  1171. }
  1172. replacement = replacement[subs[i]];
  1173. }
  1174. if (typeof replacement === "function") {
  1175. replacement = args ? replacement.apply(null, args) : replacement();
  1176. } // If replacement is undefined, return the string 'undefined'.
  1177. // This is a workaround for a bugs in browsers not properly
  1178. // dealing with non-participating groups in regular expressions:
  1179. // http://blog.stevenlevithan.com/archives/npcg-javascript
  1180. if (typeof replacement == 'undefined') {
  1181. return 'undefined';
  1182. } else {
  1183. return replacement;
  1184. }
  1185. };
  1186. return template.replace(SuperMap.String.tokenRegEx, replacer);
  1187. },
  1188. /**
  1189. * @member {RegExp} [SuperMap.String.tokenRegEx]
  1190. * @description 寻找带 token 的字符串,默认为 tokenRegEx=/\$\{([\w.]+?)\}/g。
  1191. * @example
  1192. * Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
  1193. */
  1194. tokenRegEx: /\$\{([\w.]+?)\}/g,
  1195. /**
  1196. * @member {RegExp} [SuperMap.String.numberRegEx]
  1197. * @description 判断一个字符串是否只包含一个数值,默认为 numberRegEx=/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/。
  1198. */
  1199. numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
  1200. /**
  1201. * @function SuperMap.String.isNumeric
  1202. * @description 判断一个字符串是否只包含一个数值。
  1203. * @example
  1204. * (code)
  1205. * SuperMap.String.isNumeric("6.02e23") // true
  1206. * SuperMap.String.isNumeric("12 dozen") // false
  1207. * SuperMap.String.isNumeric("4") // true
  1208. * SuperMap.String.isNumeric(" 4 ") // false
  1209. * (end)
  1210. * @returns {boolean} 字符串包含唯一的数值,返回 true;否则返回 false。
  1211. */
  1212. isNumeric: function isNumeric(value) {
  1213. return SuperMap.String.numberRegEx.test(value);
  1214. },
  1215. /**
  1216. * @function SuperMap.String.numericIf
  1217. * @description 把一个看似数值型的字符串转化为一个数值。
  1218. * @returns {(number|string)} 如果能转换为数值则返回数值,否则返回字符串本身。
  1219. */
  1220. numericIf: function numericIf(value) {
  1221. return SuperMap.String.isNumeric(value) ? parseFloat(value) : value;
  1222. }
  1223. };
  1224. /**
  1225. * @name Number
  1226. * @memberOf SuperMap
  1227. * @namespace
  1228. * @category BaseTypes Util
  1229. * @description 数值操作的一系列常用扩展函数。
  1230. */
  1231. var NumberExt = SuperMap.Number = {
  1232. /**
  1233. * @member {string} [SuperMap.Number.decimalSeparator='.']
  1234. * @description 格式化数字时默认的小数点分隔符。
  1235. * @constant
  1236. */
  1237. decimalSeparator: ".",
  1238. /**
  1239. * @member {string} [SuperMap.Number.thousandsSeparator=',']
  1240. * @description 格式化数字时默认的千位分隔符。
  1241. * @constant
  1242. */
  1243. thousandsSeparator: ",",
  1244. /**
  1245. * @function SuperMap.Number.limitSigDigs
  1246. * @description 限制浮点数的有效数字位数。
  1247. * @param {number} num - 浮点数。
  1248. * @param {integer} sig - 有效位数。
  1249. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  1250. */
  1251. limitSigDigs: function limitSigDigs(num, sig) {
  1252. var fig = 0;
  1253. if (sig > 0) {
  1254. fig = parseFloat(num.toPrecision(sig));
  1255. }
  1256. return fig;
  1257. },
  1258. /**
  1259. * @function SuperMap.Number.format
  1260. * @description 数字格式化输出。
  1261. * @param {number} num - 数字。
  1262. * @param {integer} [dec=0] - 数字的小数部分四舍五入到指定的位数。设置为 null 值时小数部分不变。
  1263. * @param {string} [tsep=','] - 千位分隔符。
  1264. * @param {string} [dsep='.'] - 小数点分隔符。
  1265. * @returns {string} 数字格式化后的字符串。
  1266. */
  1267. format: function format(num, dec, tsep, dsep) {
  1268. dec = typeof dec != "undefined" ? dec : 0;
  1269. tsep = typeof tsep != "undefined" ? tsep : SuperMap.Number.thousandsSeparator;
  1270. dsep = typeof dsep != "undefined" ? dsep : SuperMap.Number.decimalSeparator;
  1271. if (dec != null) {
  1272. num = parseFloat(num.toFixed(dec));
  1273. }
  1274. var parts = num.toString().split(".");
  1275. if (parts.length === 1 && dec == null) {
  1276. // integer where we do not want to touch the decimals
  1277. dec = 0;
  1278. }
  1279. var integer = parts[0];
  1280. if (tsep) {
  1281. var thousands = /(-?[0-9]+)([0-9]{3})/;
  1282. while (thousands.test(integer)) {
  1283. integer = integer.replace(thousands, "$1" + tsep + "$2");
  1284. }
  1285. }
  1286. var str;
  1287. if (dec == 0) {
  1288. str = integer;
  1289. } else {
  1290. var rem = parts.length > 1 ? parts[1] : "0";
  1291. if (dec != null) {
  1292. rem = rem + new Array(dec - rem.length + 1).join("0");
  1293. }
  1294. str = integer + dsep + rem;
  1295. }
  1296. return str;
  1297. }
  1298. };
  1299. if (!Number.prototype.limitSigDigs) {
  1300. /**
  1301. * APIMethod: Number.limitSigDigs
  1302. * 限制浮点数的有效数字位数.
  1303. * @param {integer} sig -有效位数。
  1304. * @returns {integer} 将数字四舍五入到指定数量的有效位数。
  1305. * 如果传入值 为 null、0、或者是负数, 返回值 0。
  1306. */
  1307. Number.prototype.limitSigDigs = function (sig) {
  1308. return NumberExt.limitSigDigs(this, sig);
  1309. };
  1310. }
  1311. /**
  1312. * @name Function
  1313. * @memberOf SuperMap
  1314. * @namespace
  1315. * @category BaseTypes Util
  1316. * @description 函数操作的一系列常用扩展函数。
  1317. */
  1318. var FunctionExt = SuperMap.Function = {
  1319. /**
  1320. * @function SuperMap.Function.bind
  1321. * @description 绑定函数到对象。方便创建 this 的作用域。
  1322. * @param {function} func - 输入函数。
  1323. * @param {Object} object - 对象绑定到输入函数(作为输入函数的 this 对象)。
  1324. * @returns {function} object 参数作为 func 函数的 this 对象。
  1325. */
  1326. bind: function bind(func, object) {
  1327. // create a reference to all arguments past the second one
  1328. var args = Array.prototype.slice.apply(arguments, [2]);
  1329. return function () {
  1330. // Push on any additional arguments from the actual function call.
  1331. // These will come after those sent to the bind call.
  1332. var newArgs = args.concat(Array.prototype.slice.apply(arguments, [0]));
  1333. return func.apply(object, newArgs);
  1334. };
  1335. },
  1336. /**
  1337. * @function SuperMap.Function.bindAsEventListener
  1338. * @description 绑定函数到对象,在调用该函数时配置并使用事件对象作为第一个参数。
  1339. * @param {function} func - 用于监听事件的函数。
  1340. * @param {Object} object - this 对象的引用。
  1341. * @returns {function}
  1342. */
  1343. bindAsEventListener: function bindAsEventListener(func, object) {
  1344. return function (event) {
  1345. return func.call(object, event || window.event);
  1346. };
  1347. },
  1348. /**
  1349. * @function SuperMap.Function.False
  1350. * @description 该函数仅仅返回 false。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  1351. * @example
  1352. * document.onclick = SuperMap.Function.False;
  1353. * @returns {boolean}
  1354. */
  1355. False: function False() {
  1356. return false;
  1357. },
  1358. /**
  1359. * @function SuperMap.Function.True
  1360. * @description 该函数仅仅返回 true。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  1361. * @example
  1362. * document.onclick = SuperMap.Function.True;
  1363. * @returns {boolean}
  1364. */
  1365. True: function True() {
  1366. return true;
  1367. },
  1368. /**
  1369. * @function SuperMap.Function.Void
  1370. * @description 可重用函数,仅仅返回 "undefined"。
  1371. * @returns {undefined}
  1372. */
  1373. Void: function Void() {}
  1374. };
  1375. /**
  1376. * @name Array
  1377. * @memberOf SuperMap
  1378. * @namespace
  1379. * @category BaseTypes Util
  1380. * @description 数组操作的一系列常用扩展函数。
  1381. */
  1382. var ArrayExt = SuperMap.Array = {
  1383. /**
  1384. * @function SuperMap.Array.filter
  1385. * @description 过滤数组,提供了 ECMA-262 标准中 Array.prototype.filter 函数的扩展。详见:{@link http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter}
  1386. * @param {Array} array - 要过滤的数组。
  1387. * @param {function} callback - 数组中的每一个元素调用该函数。</br>
  1388. * 如果函数的返回值为 true,该元素将包含在返回的数组中。该函数有三个参数: 数组中的元素,元素的索引,数组自身。</br>
  1389. * 如果设置了可选参数 caller,在调用 callback 时,使用可选参数 caller 设置为 callback 的参数。</br>
  1390. * @param {Object} [caller] - 在调用 callback 时,使用参数 caller 设置为 callback 的参数。
  1391. * @returns {Array} callback 函数返回 true 时的元素将作为返回数组中的元素。
  1392. */
  1393. filter: function filter(array, callback, caller) {
  1394. var selected = [];
  1395. if (Array.prototype.filter) {
  1396. selected = array.filter(callback, caller);
  1397. } else {
  1398. var len = array.length;
  1399. if (typeof callback != "function") {
  1400. throw new TypeError();
  1401. }
  1402. for (var i = 0; i < len; i++) {
  1403. if (i in array) {
  1404. var val = array[i];
  1405. if (callback.call(caller, val, i, array)) {
  1406. selected.push(val);
  1407. }
  1408. }
  1409. }
  1410. }
  1411. return selected;
  1412. }
  1413. };
  1414. ;// CONCATENATED MODULE: ./src/common/commontypes/Util.js
  1415. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1416. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  1417. * This program are made available under the terms of the Apache License, Version 2.0
  1418. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  1419. var Util = SuperMap.Util = SuperMap.Util || {};
  1420. /**
  1421. * @name Util
  1422. * @memberOf SuperMap
  1423. * @namespace
  1424. * @category BaseTypes Util
  1425. * @description common 工具类。
  1426. */
  1427. /**
  1428. * @description 复制源对象的所有属性到目标对象上,源对象上的没有定义的属性在目标对象上也不会被设置。
  1429. * @example
  1430. * 要复制 SuperMap.Size 对象的所有属性到自定义对象上,使用方法如下:
  1431. * var size = new SuperMap.Size(100, 100);
  1432. * var obj = {};
  1433. * SuperMap.Util.extend(obj, size);
  1434. * @param {Object} [destination] - 目标对象。
  1435. * @param {Object} source - 源对象,其属性将被设置到目标对象上。
  1436. * @returns {Object} 目标对象。
  1437. */
  1438. SuperMap.Util.extend = function (destination, source) {
  1439. destination = destination || {};
  1440. if (source) {
  1441. for (var property in source) {
  1442. var value = source[property];
  1443. if (value !== undefined) {
  1444. destination[property] = value;
  1445. }
  1446. }
  1447. /**
  1448. * IE doesn't include the toString property when iterating over an object's
  1449. * properties with the for(property in object) syntax. Explicitly check if
  1450. * the source has its own toString property.
  1451. */
  1452. /*
  1453. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  1454. * prototype object" when calling hawOwnProperty if the source object
  1455. * is an instance of window.Event.
  1456. */
  1457. var sourceIsEvt = typeof window.Event === "function" && source instanceof window.Event;
  1458. if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty("toString")) {
  1459. destination.toString = source.toString;
  1460. }
  1461. }
  1462. return destination;
  1463. };
  1464. /**
  1465. * @description 对象拷贝。
  1466. * @param {Object} [des] - 目标对象。
  1467. * @param {Object} soc - 源对象。
  1468. */
  1469. SuperMap.Util.copy = function (des, soc) {
  1470. des = des || {};
  1471. var v;
  1472. if (soc) {
  1473. for (var p in des) {
  1474. v = soc[p];
  1475. if (typeof v !== 'undefined') {
  1476. des[p] = v;
  1477. }
  1478. }
  1479. }
  1480. };
  1481. /**
  1482. * @description 销毁对象,将其属性置空。
  1483. * @param {Object} [obj] - 目标对象。
  1484. */
  1485. SuperMap.Util.reset = function (obj) {
  1486. obj = obj || {};
  1487. for (var p in obj) {
  1488. if (obj.hasOwnProperty(p)) {
  1489. if (_typeof(obj[p]) === "object" && obj[p] instanceof Array) {
  1490. for (var i in obj[p]) {
  1491. if (obj[p][i].destroy) {
  1492. obj[p][i].destroy();
  1493. }
  1494. }
  1495. obj[p].length = 0;
  1496. } else if (_typeof(obj[p]) === "object" && obj[p] instanceof Object) {
  1497. if (obj[p].destroy) {
  1498. obj[p].destroy();
  1499. }
  1500. }
  1501. obj[p] = null;
  1502. }
  1503. }
  1504. };
  1505. /**
  1506. * @description 获取 HTML 元素数组。
  1507. * @returns {Array.<HTMLElement>} HTML 元素数组。
  1508. */
  1509. SuperMap.Util.getElement = function () {
  1510. var elements = [];
  1511. for (var i = 0, len = arguments.length; i < len; i++) {
  1512. var element = arguments[i];
  1513. if (typeof element === 'string') {
  1514. element = document.getElementById(element);
  1515. }
  1516. if (arguments.length === 1) {
  1517. return element;
  1518. }
  1519. elements.push(element);
  1520. }
  1521. return elements;
  1522. };
  1523. /**
  1524. * @description instance of 的跨浏览器实现。
  1525. * @param {Object} o - 对象。
  1526. * @returns {boolean} 是否是页面元素。
  1527. */
  1528. SuperMap.Util.isElement = function (o) {
  1529. return !!(o && o.nodeType === 1);
  1530. };
  1531. /**
  1532. * @description 判断一个对象是否是数组。
  1533. * @param {Object} a - 对象。
  1534. * @returns {boolean} 是否是数组。
  1535. */
  1536. SuperMap.Util.isArray = function (a) {
  1537. return Object.prototype.toString.call(a) === '[object Array]';
  1538. };
  1539. /**
  1540. * @description 从数组中删除某一项。
  1541. * @param {Array} array - 数组。
  1542. * @param {Object} item - 数组中要删除的一项。
  1543. * @returns {Array} 执行删除操作后的数组。
  1544. */
  1545. SuperMap.Util.removeItem = function (array, item) {
  1546. for (var i = array.length - 1; i >= 0; i--) {
  1547. if (array[i] === item) {
  1548. array.splice(i, 1); //break;more than once??
  1549. }
  1550. }
  1551. return array;
  1552. };
  1553. /**
  1554. * @description 获取某对象再数组中的索引值。
  1555. * @param {Array} array - 数组。
  1556. * @param {Object} obj - 对象。
  1557. * @returns {number} 某对象再数组中的索引值。
  1558. */
  1559. SuperMap.Util.indexOf = function (array, obj) {
  1560. if (array == null) {
  1561. return -1;
  1562. } else {
  1563. // use the build-in function if available.
  1564. if (typeof array.indexOf === "function") {
  1565. return array.indexOf(obj);
  1566. } else {
  1567. for (var i = 0, len = array.length; i < len; i++) {
  1568. if (array[i] === obj) {
  1569. return i;
  1570. }
  1571. }
  1572. return -1;
  1573. }
  1574. }
  1575. };
  1576. /**
  1577. * @description 修改某 DOM 元素的许多属性。
  1578. * @param {HTMLElement} element - 待修改的 DOM 元素。
  1579. * @param {string} [id] - DOM 元素的 ID。
  1580. * @param {SuperMap.Pixel} [px] - 包含 DOM 元素的 style 属性的 left 和 top 属性。
  1581. * @param {SuperMap.Size} [sz] - 包含 DOM 元素的 width 和 height 属性。
  1582. * @param {string} [position] - DOM 元素的 position 属性。
  1583. * @param {string} [border] - DOM 元素的 style 属性的 border 属性。
  1584. * @param {string} [overflow] - DOM 元素的 style 属性的 overflow 属性。
  1585. * @param {number} [opacity] - 不透明度值。取值范围为(0.0 - 1.0)。
  1586. */
  1587. SuperMap.Util.modifyDOMElement = function (element, id, px, sz, position, border, overflow, opacity) {
  1588. if (id) {
  1589. element.id = id;
  1590. }
  1591. if (px) {
  1592. element.style.left = px.x + "px";
  1593. element.style.top = px.y + "px";
  1594. }
  1595. if (sz) {
  1596. element.style.width = sz.w + "px";
  1597. element.style.height = sz.h + "px";
  1598. }
  1599. if (position) {
  1600. element.style.position = position;
  1601. }
  1602. if (border) {
  1603. element.style.border = border;
  1604. }
  1605. if (overflow) {
  1606. element.style.overflow = overflow;
  1607. }
  1608. if (parseFloat(opacity) >= 0.0 && parseFloat(opacity) < 1.0) {
  1609. element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
  1610. element.style.opacity = opacity;
  1611. } else if (parseFloat(opacity) === 1.0) {
  1612. element.style.filter = '';
  1613. element.style.opacity = '';
  1614. }
  1615. };
  1616. /**
  1617. * @description Takes an object and copies any properties that don't exist from
  1618. * another properties, by analogy with SuperMap.Util.extend() from
  1619. * Prototype.js.
  1620. *
  1621. * @param {Object} [to] - 目标对象。
  1622. * @param {Object} from - 源对象。Any properties of this object that
  1623. * are undefined in the to object will be set on the to object.
  1624. *
  1625. * @returns {Object} A reference to the to object. Note that the to argument is modified
  1626. * in place and returned by this function.
  1627. */
  1628. SuperMap.Util.applyDefaults = function (to, from) {
  1629. to = to || {};
  1630. /*
  1631. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  1632. * prototype object" when calling hawOwnProperty if the source object is an
  1633. * instance of window.Event.
  1634. */
  1635. var fromIsEvt = typeof window.Event === "function" && from instanceof window.Event;
  1636. for (var key in from) {
  1637. if (to[key] === undefined || !fromIsEvt && from.hasOwnProperty && from.hasOwnProperty(key) && !to.hasOwnProperty(key)) {
  1638. to[key] = from[key];
  1639. }
  1640. }
  1641. /**
  1642. * IE doesn't include the toString property when iterating over an object's
  1643. * properties with the for(property in object) syntax. Explicitly check if
  1644. * the source has its own toString property.
  1645. */
  1646. if (!fromIsEvt && from && from.hasOwnProperty && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) {
  1647. to.toString = from.toString;
  1648. }
  1649. return to;
  1650. };
  1651. /**
  1652. * @description 将参数对象转换为 HTTP 的 GET 请求中的参数字符串。例如:"key1=value1&key2=value2&key3=value3"。
  1653. * @param {Object} params - 参数对象。
  1654. * @returns {string} HTTP 的 GET 请求中的参数字符串。
  1655. */
  1656. SuperMap.Util.getParameterString = function (params) {
  1657. var paramsArray = [];
  1658. for (var key in params) {
  1659. var value = params[key];
  1660. if (value != null && typeof value !== 'function') {
  1661. var encodedValue;
  1662. if (Array.isArray(value) || value.toString() === '[object Object]') {
  1663. encodedValue = encodeURIComponent(JSON.stringify(value));
  1664. } else {
  1665. /* value is a string; simply encode */
  1666. encodedValue = encodeURIComponent(value);
  1667. }
  1668. paramsArray.push(encodeURIComponent(key) + "=" + encodedValue);
  1669. }
  1670. }
  1671. return paramsArray.join("&");
  1672. };
  1673. /**
  1674. * @description 给 URL 追加查询参数。
  1675. * @param {string} url - 待追加参数的 URL 字符串。
  1676. * @param {string} paramStr - 待追加的查询参数。
  1677. * @returns {string} 新的 URL。
  1678. */
  1679. SuperMap.Util.urlAppend = function (url, paramStr) {
  1680. var newUrl = url;
  1681. if (paramStr) {
  1682. if (paramStr.indexOf('?') === 0) {
  1683. paramStr = paramStr.substring(1);
  1684. }
  1685. var parts = (url + " ").split(/[?&]/);
  1686. newUrl += parts.pop() === " " ? paramStr : parts.length ? "&" + paramStr : "?" + paramStr;
  1687. }
  1688. return newUrl;
  1689. };
  1690. /**
  1691. * @description 给 URL 追加 path 参数。
  1692. * @param {string} url - 待追加参数的 URL 字符串。
  1693. * @param {string} paramStr - 待追加的path参数。
  1694. * @returns {string} 新的 URL。
  1695. */
  1696. SuperMap.Util.urlPathAppend = function (url, pathStr) {
  1697. var newUrl = url;
  1698. if (!pathStr) {
  1699. return newUrl;
  1700. }
  1701. if (pathStr.indexOf('/') === 0) {
  1702. pathStr = pathStr.substring(1);
  1703. }
  1704. var parts = url.split('?');
  1705. if (parts[0].indexOf('/', parts[0].length - 1) < 0) {
  1706. parts[0] += '/';
  1707. }
  1708. newUrl = "".concat(parts[0]).concat(pathStr).concat(parts.length > 1 ? "?".concat(parts[1]) : '');
  1709. return newUrl;
  1710. };
  1711. /**
  1712. * @description 为了避免浮点精度错误而保留的有效位数。
  1713. * @type {number}
  1714. * @default 14
  1715. */
  1716. SuperMap.Util.DEFAULT_PRECISION = 14;
  1717. /**
  1718. * @description 将字符串以接近的精度转换为数字。
  1719. * @param {string} number - 字符串。
  1720. * @param {number} [precision=14] - 精度。
  1721. * @returns {number} 数字。
  1722. */
  1723. SuperMap.Util.toFloat = function (number, precision) {
  1724. if (precision == null) {
  1725. precision = SuperMap.Util.DEFAULT_PRECISION;
  1726. }
  1727. if (typeof number !== "number") {
  1728. number = parseFloat(number);
  1729. }
  1730. return precision === 0 ? number : parseFloat(number.toPrecision(precision));
  1731. };
  1732. /**
  1733. * @description 角度转弧度。
  1734. * @param {number} x - 角度。
  1735. * @returns {number} 弧度。
  1736. */
  1737. SuperMap.Util.rad = function (x) {
  1738. return x * Math.PI / 180;
  1739. };
  1740. /**
  1741. * @description 从 URL 字符串中解析出参数对象。
  1742. * @param {string} url - URL。
  1743. * @returns {Object} 解析出的参数对象。
  1744. */
  1745. SuperMap.Util.getParameters = function (url) {
  1746. // if no url specified, take it from the location bar
  1747. url = url === null || url === undefined ? window.location.href : url; //parse out parameters portion of url string
  1748. var paramsString = "";
  1749. if (SuperMap.String.contains(url, '?')) {
  1750. var start = url.indexOf('?') + 1;
  1751. var end = SuperMap.String.contains(url, "#") ? url.indexOf('#') : url.length;
  1752. paramsString = url.substring(start, end);
  1753. }
  1754. var parameters = {};
  1755. var pairs = paramsString.split(/[&;]/);
  1756. for (var i = 0, len = pairs.length; i < len; ++i) {
  1757. var keyValue = pairs[i].split('=');
  1758. if (keyValue[0]) {
  1759. var key = keyValue[0];
  1760. try {
  1761. key = decodeURIComponent(key);
  1762. } catch (err) {
  1763. key = unescape(key);
  1764. } // being liberal by replacing "+" with " "
  1765. var value = (keyValue[1] || '').replace(/\+/g, " ");
  1766. try {
  1767. value = decodeURIComponent(value);
  1768. } catch (err) {
  1769. value = unescape(value);
  1770. } // follow OGC convention of comma delimited values
  1771. value = value.split(","); //if there's only one value, do not return as array
  1772. if (value.length == 1) {
  1773. value = value[0];
  1774. }
  1775. parameters[key] = value;
  1776. }
  1777. }
  1778. return parameters;
  1779. };
  1780. /**
  1781. * @description 不断递增计数变量,用于生成唯一 ID。
  1782. * @type {number}
  1783. * @default 0
  1784. */
  1785. SuperMap.Util.lastSeqID = 0;
  1786. /**
  1787. * @description 创建唯一 ID 值。
  1788. * @param {string} [prefix] - 前缀。
  1789. * @returns {string} 唯一的 ID 值。
  1790. */
  1791. SuperMap.Util.createUniqueID = function (prefix) {
  1792. if (prefix == null) {
  1793. prefix = "id_";
  1794. }
  1795. SuperMap.Util.lastSeqID += 1;
  1796. return prefix + SuperMap.Util.lastSeqID;
  1797. };
  1798. /**
  1799. * @memberOf SuperMap
  1800. * @description 每单位的英尺数。
  1801. * @type {Object}
  1802. * @constant
  1803. */
  1804. SuperMap.INCHES_PER_UNIT = {
  1805. 'inches': 1.0,
  1806. 'ft': 12.0,
  1807. 'mi': 63360.0,
  1808. 'm': 39.3701,
  1809. 'km': 39370.1,
  1810. 'dd': 4374754,
  1811. 'yd': 36
  1812. };
  1813. SuperMap.INCHES_PER_UNIT.in = SuperMap.INCHES_PER_UNIT.inches;
  1814. SuperMap.INCHES_PER_UNIT.degrees = SuperMap.INCHES_PER_UNIT.dd;
  1815. SuperMap.INCHES_PER_UNIT.nmi = 1852 * SuperMap.INCHES_PER_UNIT.m; // Units from CS-Map
  1816. SuperMap.METERS_PER_INCH = 0.02540005080010160020;
  1817. SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
  1818. "Inch": SuperMap.INCHES_PER_UNIT.inches,
  1819. "Meter": 1.0 / SuperMap.METERS_PER_INCH,
  1820. //EPSG:9001
  1821. "Foot": 0.30480060960121920243 / SuperMap.METERS_PER_INCH,
  1822. //EPSG:9003
  1823. "IFoot": 0.30480000000000000000 / SuperMap.METERS_PER_INCH,
  1824. //EPSG:9002
  1825. "ClarkeFoot": 0.3047972651151 / SuperMap.METERS_PER_INCH,
  1826. //EPSG:9005
  1827. "SearsFoot": 0.30479947153867624624 / SuperMap.METERS_PER_INCH,
  1828. //EPSG:9041
  1829. "GoldCoastFoot": 0.30479971018150881758 / SuperMap.METERS_PER_INCH,
  1830. //EPSG:9094
  1831. "IInch": 0.02540000000000000000 / SuperMap.METERS_PER_INCH,
  1832. "MicroInch": 0.00002540000000000000 / SuperMap.METERS_PER_INCH,
  1833. "Mil": 0.00000002540000000000 / SuperMap.METERS_PER_INCH,
  1834. "Centimeter": 0.01000000000000000000 / SuperMap.METERS_PER_INCH,
  1835. "Kilometer": 1000.00000000000000000000 / SuperMap.METERS_PER_INCH,
  1836. //EPSG:9036
  1837. "Yard": 0.91440182880365760731 / SuperMap.METERS_PER_INCH,
  1838. "SearsYard": 0.914398414616029 / SuperMap.METERS_PER_INCH,
  1839. //EPSG:9040
  1840. "IndianYard": 0.91439853074444079983 / SuperMap.METERS_PER_INCH,
  1841. //EPSG:9084
  1842. "IndianYd37": 0.91439523 / SuperMap.METERS_PER_INCH,
  1843. //EPSG:9085
  1844. "IndianYd62": 0.9143988 / SuperMap.METERS_PER_INCH,
  1845. //EPSG:9086
  1846. "IndianYd75": 0.9143985 / SuperMap.METERS_PER_INCH,
  1847. //EPSG:9087
  1848. "IndianFoot": 0.30479951 / SuperMap.METERS_PER_INCH,
  1849. //EPSG:9080
  1850. "IndianFt37": 0.30479841 / SuperMap.METERS_PER_INCH,
  1851. //EPSG:9081
  1852. "IndianFt62": 0.3047996 / SuperMap.METERS_PER_INCH,
  1853. //EPSG:9082
  1854. "IndianFt75": 0.3047995 / SuperMap.METERS_PER_INCH,
  1855. //EPSG:9083
  1856. "Mile": 1609.34721869443738887477 / SuperMap.METERS_PER_INCH,
  1857. "IYard": 0.91440000000000000000 / SuperMap.METERS_PER_INCH,
  1858. //EPSG:9096
  1859. "IMile": 1609.34400000000000000000 / SuperMap.METERS_PER_INCH,
  1860. //EPSG:9093
  1861. "NautM": 1852.00000000000000000000 / SuperMap.METERS_PER_INCH,
  1862. //EPSG:9030
  1863. "Lat-66": 110943.316488932731 / SuperMap.METERS_PER_INCH,
  1864. "Lat-83": 110946.25736872234125 / SuperMap.METERS_PER_INCH,
  1865. "Decimeter": 0.10000000000000000000 / SuperMap.METERS_PER_INCH,
  1866. "Millimeter": 0.00100000000000000000 / SuperMap.METERS_PER_INCH,
  1867. "Dekameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
  1868. "Decameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
  1869. "Hectometer": 100.00000000000000000000 / SuperMap.METERS_PER_INCH,
  1870. "GermanMeter": 1.0000135965 / SuperMap.METERS_PER_INCH,
  1871. //EPSG:9031
  1872. "CaGrid": 0.999738 / SuperMap.METERS_PER_INCH,
  1873. "ClarkeChain": 20.1166194976 / SuperMap.METERS_PER_INCH,
  1874. //EPSG:9038
  1875. "GunterChain": 20.11684023368047 / SuperMap.METERS_PER_INCH,
  1876. //EPSG:9033
  1877. "BenoitChain": 20.116782494375872 / SuperMap.METERS_PER_INCH,
  1878. //EPSG:9062
  1879. "SearsChain": 20.11676512155 / SuperMap.METERS_PER_INCH,
  1880. //EPSG:9042
  1881. "ClarkeLink": 0.201166194976 / SuperMap.METERS_PER_INCH,
  1882. //EPSG:9039
  1883. "GunterLink": 0.2011684023368047 / SuperMap.METERS_PER_INCH,
  1884. //EPSG:9034
  1885. "BenoitLink": 0.20116782494375872 / SuperMap.METERS_PER_INCH,
  1886. //EPSG:9063
  1887. "SearsLink": 0.2011676512155 / SuperMap.METERS_PER_INCH,
  1888. //EPSG:9043
  1889. "Rod": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  1890. "IntnlChain": 20.1168 / SuperMap.METERS_PER_INCH,
  1891. //EPSG:9097
  1892. "IntnlLink": 0.201168 / SuperMap.METERS_PER_INCH,
  1893. //EPSG:9098
  1894. "Perch": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  1895. "Pole": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  1896. "Furlong": 201.1684023368046 / SuperMap.METERS_PER_INCH,
  1897. "Rood": 3.778266898 / SuperMap.METERS_PER_INCH,
  1898. "CapeFoot": 0.3047972615 / SuperMap.METERS_PER_INCH,
  1899. "Brealey": 375.00000000000000000000 / SuperMap.METERS_PER_INCH,
  1900. "ModAmFt": 0.304812252984505969011938 / SuperMap.METERS_PER_INCH,
  1901. "Fathom": 1.8288 / SuperMap.METERS_PER_INCH,
  1902. "NautM-UK": 1853.184 / SuperMap.METERS_PER_INCH,
  1903. "50kilometers": 50000.0 / SuperMap.METERS_PER_INCH,
  1904. "150kilometers": 150000.0 / SuperMap.METERS_PER_INCH
  1905. }); //unit abbreviations supported by PROJ.4
  1906. SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
  1907. "mm": SuperMap.INCHES_PER_UNIT.Meter / 1000.0,
  1908. "cm": SuperMap.INCHES_PER_UNIT.Meter / 100.0,
  1909. "dm": SuperMap.INCHES_PER_UNIT.Meter * 100.0,
  1910. "km": SuperMap.INCHES_PER_UNIT.Meter * 1000.0,
  1911. "kmi": SuperMap.INCHES_PER_UNIT.nmi,
  1912. //International Nautical Mile
  1913. "fath": SuperMap.INCHES_PER_UNIT.Fathom,
  1914. //International Fathom
  1915. "ch": SuperMap.INCHES_PER_UNIT.IntnlChain,
  1916. //International Chain
  1917. "link": SuperMap.INCHES_PER_UNIT.IntnlLink,
  1918. //International Link
  1919. "us-in": SuperMap.INCHES_PER_UNIT.inches,
  1920. //U.S. Surveyor's Inch
  1921. "us-ft": SuperMap.INCHES_PER_UNIT.Foot,
  1922. //U.S. Surveyor's Foot
  1923. "us-yd": SuperMap.INCHES_PER_UNIT.Yard,
  1924. //U.S. Surveyor's Yard
  1925. "us-ch": SuperMap.INCHES_PER_UNIT.GunterChain,
  1926. //U.S. Surveyor's Chain
  1927. "us-mi": SuperMap.INCHES_PER_UNIT.Mile,
  1928. //U.S. Surveyor's Statute Mile
  1929. "ind-yd": SuperMap.INCHES_PER_UNIT.IndianYd37,
  1930. //Indian Yard
  1931. "ind-ft": SuperMap.INCHES_PER_UNIT.IndianFt37,
  1932. //Indian Foot
  1933. "ind-ch": 20.11669506 / SuperMap.METERS_PER_INCH //Indian Chain
  1934. });
  1935. /**
  1936. * @memberOf SuperMap
  1937. * @member [SuperMap.DOTS_PER_INCH=96]
  1938. * @description 分辨率与比例尺之间转换的常量。
  1939. * @type {Object}
  1940. */
  1941. SuperMap.DOTS_PER_INCH = 96;
  1942. /**
  1943. * @param {number} scale - 比例尺。
  1944. * @returns {number} 返回正常的 scale 值。
  1945. */
  1946. SuperMap.Util.normalizeScale = function (scale) {
  1947. var normScale = scale > 1.0 ? 1.0 / scale : scale;
  1948. return normScale;
  1949. };
  1950. /**
  1951. * @description 比例尺转分辨率。
  1952. * @param {number} scale - 比例尺。
  1953. * @param {string} [units='degrees'] - 比例尺单位。
  1954. * @returns {number} 分辨率。
  1955. */
  1956. SuperMap.Util.getResolutionFromScale = function (scale, units) {
  1957. var resolution;
  1958. if (scale) {
  1959. if (units == null) {
  1960. units = "degrees";
  1961. }
  1962. var normScale = SuperMap.Util.normalizeScale(scale);
  1963. resolution = 1 / (normScale * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH);
  1964. }
  1965. return resolution;
  1966. };
  1967. /**
  1968. * @description 分辨率转比例尺。
  1969. * @param {number} resolution - 分辨率。
  1970. * @param {string} [units='degrees'] - 分辨率单位。
  1971. * @returns {number} 比例尺。
  1972. */
  1973. SuperMap.Util.getScaleFromResolution = function (resolution, units) {
  1974. if (units == null) {
  1975. units = "degrees";
  1976. }
  1977. var scale = resolution * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH;
  1978. return scale;
  1979. };
  1980. /**
  1981. * @memberOf SuperMap
  1982. * @description 如果 userAgent 捕获到浏览器使用的是 Gecko 引擎则返回 true。
  1983. * @constant
  1984. */
  1985. SuperMap.IS_GECKO = function () {
  1986. var ua = navigator.userAgent.toLowerCase();
  1987. return ua.indexOf("webkit") === -1 && ua.indexOf("gecko") !== -1;
  1988. }();
  1989. /**
  1990. * @memberOf SuperMap
  1991. * @description 浏览器名称,依赖于 userAgent 属性,BROWSER_NAME 可以是空,或者以下浏览器:
  1992. * * "opera" -- Opera
  1993. * * "msie" -- Internet Explorer
  1994. * * "safari" -- Safari
  1995. * * "firefox" -- Firefox
  1996. * * "mozilla" -- Mozilla
  1997. * @constant
  1998. */
  1999. SuperMap.Browser = function () {
  2000. var name = '',
  2001. version = '',
  2002. device = 'pc',
  2003. uaMatch; //以下进行测试
  2004. var ua = navigator.userAgent.toLowerCase();
  2005. if (ua.indexOf("msie") > -1 || ua.indexOf("trident") > -1 && ua.indexOf("rv") > -1) {
  2006. name = 'msie';
  2007. uaMatch = ua.match(/msie ([\d.]+)/) || ua.match(/rv:([\d.]+)/);
  2008. } else if (ua.indexOf("chrome") > -1) {
  2009. name = 'chrome';
  2010. uaMatch = ua.match(/chrome\/([\d.]+)/);
  2011. } else if (ua.indexOf("firefox") > -1) {
  2012. name = 'firefox';
  2013. uaMatch = ua.match(/firefox\/([\d.]+)/);
  2014. } else if (ua.indexOf("opera") > -1) {
  2015. name = 'opera';
  2016. uaMatch = ua.match(/version\/([\d.]+)/);
  2017. } else if (ua.indexOf("safari") > -1) {
  2018. name = 'safari';
  2019. uaMatch = ua.match(/version\/([\d.]+)/);
  2020. }
  2021. version = uaMatch ? uaMatch[1] : '';
  2022. if (ua.indexOf("ipad") > -1 || ua.indexOf("ipod") > -1 || ua.indexOf("iphone") > -1) {
  2023. device = 'apple';
  2024. } else if (ua.indexOf("android") > -1) {
  2025. uaMatch = ua.match(/version\/([\d.]+)/);
  2026. version = uaMatch ? uaMatch[1] : '';
  2027. device = 'android';
  2028. }
  2029. return {
  2030. name: name,
  2031. version: version,
  2032. device: device
  2033. };
  2034. }();
  2035. /**
  2036. * @description 获取浏览器相关信息。支持的浏览器包括:Opera,Internet Explorer,Safari,Firefox。
  2037. * @returns {Object} 获取浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
  2038. */
  2039. SuperMap.Util.getBrowser = function () {
  2040. return SuperMap.Browser;
  2041. };
  2042. /**
  2043. * @description 浏览器是否支持 Canvas。
  2044. * @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas。
  2045. */
  2046. SuperMap.Util.isSupportCanvas = function () {
  2047. var checkRes = true,
  2048. broz = SuperMap.Util.getBrowser();
  2049. if (document.createElement("canvas").getContext) {
  2050. if (broz.name === 'firefox' && parseFloat(broz.version) < 5) {
  2051. checkRes = false;
  2052. }
  2053. if (broz.name === 'safari' && parseFloat(broz.version) < 4) {
  2054. checkRes = false;
  2055. }
  2056. if (broz.name === 'opera' && parseFloat(broz.version) < 10) {
  2057. checkRes = false;
  2058. }
  2059. if (broz.name === 'msie' && parseFloat(broz.version) < 9) {
  2060. checkRes = false;
  2061. }
  2062. } else {
  2063. checkRes = false;
  2064. }
  2065. return checkRes;
  2066. }();
  2067. /**
  2068. * @description 判断;浏览器是否支持 Canvas。
  2069. * @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas 。
  2070. */
  2071. SuperMap.Util.supportCanvas = function () {
  2072. return SuperMap.Util.isSupportCanvas;
  2073. }; //将服务端的地图单位转成SuperMap的地图单位
  2074. SuperMap.INCHES_PER_UNIT.degree = SuperMap.INCHES_PER_UNIT.dd;
  2075. SuperMap.INCHES_PER_UNIT.meter = SuperMap.INCHES_PER_UNIT.m;
  2076. SuperMap.INCHES_PER_UNIT.foot = SuperMap.INCHES_PER_UNIT.ft;
  2077. SuperMap.INCHES_PER_UNIT.inch = SuperMap.INCHES_PER_UNIT.inches;
  2078. SuperMap.INCHES_PER_UNIT.mile = SuperMap.INCHES_PER_UNIT.mi;
  2079. SuperMap.INCHES_PER_UNIT.kilometer = SuperMap.INCHES_PER_UNIT.km;
  2080. SuperMap.INCHES_PER_UNIT.yard = SuperMap.INCHES_PER_UNIT.yd;
  2081. /**
  2082. * @description 判断一个 URL 请求是否在当前域中。
  2083. * @param {string} url - URL 请求字符串。
  2084. * @returns {boolean} URL 请求是否在当前域中。
  2085. */
  2086. SuperMap.Util.isInTheSameDomain = function (url) {
  2087. if (!url) {
  2088. return true;
  2089. }
  2090. var index = url.indexOf("//");
  2091. var documentUrl = document.location.toString();
  2092. var documentIndex = documentUrl.indexOf("//");
  2093. if (index === -1) {
  2094. return true;
  2095. } else {
  2096. var protocol;
  2097. var substring = protocol = url.substring(0, index);
  2098. var documentSubString = documentUrl.substring(documentIndex + 2);
  2099. documentIndex = documentSubString.indexOf("/");
  2100. var documentPortIndex = documentSubString.indexOf(":");
  2101. var documentDomainWithPort = documentSubString.substring(0, documentIndex); //var documentPort;
  2102. var documentprotocol = document.location.protocol;
  2103. if (documentPortIndex !== -1) {// documentPort = +documentSubString.substring(documentPortIndex, documentIndex);
  2104. } else {
  2105. documentDomainWithPort += ':' + (documentprotocol.toLowerCase() === 'http:' ? 80 : 443);
  2106. }
  2107. if (documentprotocol.toLowerCase() !== substring.toLowerCase()) {
  2108. return false;
  2109. }
  2110. substring = url.substring(index + 2);
  2111. var portIndex = substring.indexOf(":");
  2112. index = substring.indexOf("/");
  2113. var domainWithPort = substring.substring(0, index);
  2114. var domain;
  2115. if (portIndex !== -1) {
  2116. domain = substring.substring(0, portIndex);
  2117. } else {
  2118. domain = substring.substring(0, index);
  2119. domainWithPort += ':' + (protocol.toLowerCase() === 'http:' ? 80 : 443);
  2120. }
  2121. var documentDomain = document.domain;
  2122. if (domain === documentDomain && domainWithPort === documentDomainWithPort) {
  2123. return true;
  2124. }
  2125. }
  2126. return false;
  2127. };
  2128. /**
  2129. * @description 计算 iServer 服务的 REST 图层的显示分辨率,需要从 iServer 的 REST 图层表述中获取 viewBounds、viewer、scale、coordUnit、datumAxis 五个参数,来进行计算。
  2130. * @param {SuperMap.Bounds} viewBounds - 地图的参照可视范围,即地图初始化时默认的地图显示范围。
  2131. * @param {SuperMap.Size} viewer - 地图初始化时默认的地图图片的尺寸。
  2132. * @param {number} scale - 地图初始化时默认的显示比例尺。
  2133. * @param {string} [coordUnit='degrees'] - 投影坐标系统的地图单位。
  2134. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则系统默认为 WGS84 参考系的椭球体长半轴 6378137。
  2135. * @returns {number} 返回图层显示分辨率。
  2136. */
  2137. SuperMap.Util.calculateDpi = function (viewBounds, viewer, scale, coordUnit, datumAxis) {
  2138. //10000 是 0.1毫米与米的转换。DPI的计算公式:Viewer / DPI * 0.0254 * 10000 = ViewBounds * scale ,公式中的10000是为了提高计算结果的精度,以下出现的ratio皆为如此。
  2139. if (!viewBounds || !viewer || !scale) {
  2140. return;
  2141. }
  2142. var ratio = 10000,
  2143. rvbWidth = viewBounds.getWidth(),
  2144. rvbHeight = viewBounds.getHeight(),
  2145. rvWidth = viewer.w,
  2146. rvHeight = viewer.h; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  2147. datumAxis = datumAxis || 6378137;
  2148. coordUnit = coordUnit || "degrees";
  2149. var dpi;
  2150. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  2151. var num1 = rvbWidth / rvWidth,
  2152. num2 = rvbHeight / rvHeight,
  2153. resolution = num1 > num2 ? num1 : num2;
  2154. dpi = 0.0254 * ratio / resolution / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  2155. } else {
  2156. var _resolution = rvbWidth / rvWidth;
  2157. dpi = 0.0254 * ratio / _resolution / scale / ratio;
  2158. }
  2159. return dpi;
  2160. };
  2161. /**
  2162. * @description 将对象转换成 JSON 字符串。
  2163. * @param {Object} obj - 要转换成 JSON 的 Object 对象。
  2164. * @returns {string} 返回转换后的 JSON 对象。
  2165. */
  2166. SuperMap.Util.toJSON = function (obj) {
  2167. var objInn = obj;
  2168. if (objInn == null) {
  2169. return null;
  2170. }
  2171. switch (objInn.constructor) {
  2172. case String:
  2173. //s = "'" + str.replace(/(["\\])/g, "\\$1") + "'"; string含有单引号出错
  2174. objInn = '"' + objInn.replace(/(["\\])/g, '\\$1') + '"';
  2175. objInn = objInn.replace(/\n/g, "\\n");
  2176. objInn = objInn.replace(/\r/g, "\\r");
  2177. objInn = objInn.replace("<", "&lt;");
  2178. objInn = objInn.replace(">", "&gt;");
  2179. objInn = objInn.replace(/%/g, "%25");
  2180. objInn = objInn.replace(/&/g, "%26");
  2181. return objInn;
  2182. case Array:
  2183. var arr = [];
  2184. for (var i = 0, len = objInn.length; i < len; i++) {
  2185. arr.push(SuperMap.Util.toJSON(objInn[i]));
  2186. }
  2187. return "[" + arr.join(",") + "]";
  2188. case Number:
  2189. return isFinite(objInn) ? String(objInn) : null;
  2190. case Boolean:
  2191. return String(objInn);
  2192. case Date:
  2193. var dateStr = "{" + "'__type':\"System.DateTime\"," + "'Year':" + objInn.getFullYear() + "," + "'Month':" + (objInn.getMonth() + 1) + "," + "'Day':" + objInn.getDate() + "," + "'Hour':" + objInn.getHours() + "," + "'Minute':" + objInn.getMinutes() + "," + "'Second':" + objInn.getSeconds() + "," + "'Millisecond':" + objInn.getMilliseconds() + "," + "'TimezoneOffset':" + objInn.getTimezoneOffset() + "}";
  2194. return dateStr;
  2195. default:
  2196. if (objInn["toJSON"] != null && typeof objInn["toJSON"] === "function") {
  2197. return objInn.toJSON();
  2198. }
  2199. if (_typeof(objInn) === "object") {
  2200. if (objInn.length) {
  2201. var _arr2 = [];
  2202. for (var _i = 0, _len = objInn.length; _i < _len; _i++) {
  2203. _arr2.push(SuperMap.Util.toJSON(objInn[_i]));
  2204. }
  2205. return "[" + _arr2.join(",") + "]";
  2206. }
  2207. var _arr = [];
  2208. for (var attr in objInn) {
  2209. //为解决SuperMap.Geometry类型头json时堆栈溢出的问题,attr == "parent"时不进行json转换
  2210. if (typeof objInn[attr] !== "function" && attr !== "CLASS_NAME" && attr !== "parent") {
  2211. _arr.push("'" + attr + "':" + SuperMap.Util.toJSON(objInn[attr]));
  2212. }
  2213. }
  2214. if (_arr.length > 0) {
  2215. return "{" + _arr.join(",") + "}";
  2216. } else {
  2217. return "{}";
  2218. }
  2219. }
  2220. return objInn.toString();
  2221. }
  2222. };
  2223. /**
  2224. * @description 根据比例尺和 dpi 计算屏幕分辨率。
  2225. * @param {number} scale - 比例尺。
  2226. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  2227. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  2228. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  2229. * @returns {number} 返回当前比例尺下的屏幕分辨率。
  2230. */
  2231. SuperMap.Util.getResolutionFromScaleDpi = function (scale, dpi, coordUnit, datumAxis) {
  2232. var resolution = null,
  2233. ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  2234. datumAxis = datumAxis || 6378137;
  2235. coordUnit = coordUnit || "";
  2236. if (scale > 0 && dpi > 0) {
  2237. scale = SuperMap.Util.normalizeScale(scale);
  2238. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  2239. //scale = SuperMap.Util.normalizeScale(scale);
  2240. resolution = 0.0254 * ratio / dpi / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  2241. return resolution;
  2242. } else {
  2243. resolution = 0.0254 * ratio / dpi / scale / ratio;
  2244. return resolution;
  2245. }
  2246. }
  2247. return -1;
  2248. };
  2249. /**
  2250. * @description 根据 resolution、dpi、coordUnit 和 datumAxis 计算比例尺。
  2251. * @param {number} resolution - 用于计算比例尺的地图分辨率。
  2252. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  2253. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  2254. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  2255. * @returns {number} 返回当前屏幕分辨率下的比例尺。
  2256. */
  2257. SuperMap.Util.getScaleFromResolutionDpi = function (resolution, dpi, coordUnit, datumAxis) {
  2258. var scale = null,
  2259. ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  2260. datumAxis = datumAxis || 6378137;
  2261. coordUnit = coordUnit || "";
  2262. if (resolution > 0 && dpi > 0) {
  2263. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  2264. scale = 0.0254 * ratio / dpi / resolution / (Math.PI * 2 * datumAxis / 360) / ratio;
  2265. return scale;
  2266. } else {
  2267. scale = 0.0254 * ratio / dpi / resolution / ratio;
  2268. return scale;
  2269. }
  2270. }
  2271. return -1;
  2272. };
  2273. /**
  2274. * @description 转换查询结果。
  2275. * @param {Object} result - 查询结果。
  2276. * @returns {Object} 转换后的查询结果。
  2277. */
  2278. SuperMap.Util.transformResult = function (result) {
  2279. if (result.responseText && typeof result.responseText === "string") {
  2280. result = JSON.parse(result.responseText);
  2281. }
  2282. return result;
  2283. };
  2284. /**
  2285. * @description 属性拷贝,不拷贝方法类名(CLASS_NAME)等。
  2286. * @param {Object} [destination] - 拷贝目标。
  2287. * @param {Object} source - 源对象。
  2288. *
  2289. */
  2290. SuperMap.Util.copyAttributes = function (destination, source) {
  2291. destination = destination || {};
  2292. if (source) {
  2293. for (var property in source) {
  2294. var value = source[property];
  2295. if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
  2296. destination[property] = value;
  2297. }
  2298. }
  2299. }
  2300. return destination;
  2301. };
  2302. /**
  2303. * @description 将源对象上的属性拷贝到目标对象上。(不拷贝 CLASS_NAME 和方法)
  2304. * @param {Object} [destination] - 目标对象。
  2305. * @param {Object} source - 源对象。
  2306. * @param {Array.<string>} clip - 源对象中禁止拷贝到目标对象的属性,目的是防止目标对象上不可修改的属性被篡改。
  2307. *
  2308. */
  2309. SuperMap.Util.copyAttributesWithClip = function (destination, source, clip) {
  2310. destination = destination || {};
  2311. if (source) {
  2312. for (var property in source) {
  2313. //去掉禁止拷贝的属性
  2314. var isInClip = false;
  2315. if (clip && clip.length) {
  2316. for (var i = 0, len = clip.length; i < len; i++) {
  2317. if (property === clip[i]) {
  2318. isInClip = true;
  2319. break;
  2320. }
  2321. }
  2322. }
  2323. if (isInClip === true) {
  2324. continue;
  2325. }
  2326. var value = source[property];
  2327. if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
  2328. destination[property] = value;
  2329. }
  2330. }
  2331. }
  2332. return destination;
  2333. };
  2334. /**
  2335. * @description 克隆一个 Object 对象
  2336. * @param {Object} obj - 需要克隆的对象。
  2337. * @returns {Object} 返回对象的拷贝对象,注意是新的对象,不是指向。
  2338. */
  2339. SuperMap.Util.cloneObject = function (obj) {
  2340. // Handle the 3 simple types, and null or undefined
  2341. if (null === obj || "object" !== _typeof(obj)) {
  2342. return obj;
  2343. } // Handle Date
  2344. if (obj instanceof Date) {
  2345. var copy = new Date();
  2346. copy.setTime(obj.getTime());
  2347. return copy;
  2348. } // Handle Array
  2349. if (obj instanceof Array) {
  2350. var _copy = obj.slice(0);
  2351. return _copy;
  2352. } // Handle Object
  2353. if (obj instanceof Object) {
  2354. var _copy2 = {};
  2355. for (var attr in obj) {
  2356. if (obj.hasOwnProperty(attr)) {
  2357. _copy2[attr] = SuperMap.Util.cloneObject(obj[attr]);
  2358. }
  2359. }
  2360. return _copy2;
  2361. }
  2362. throw new Error("Unable to copy obj! Its type isn't supported.");
  2363. };
  2364. /**
  2365. * @description 判断两条线段是不是有交点。
  2366. * @param {SuperMap.Geometry.Point} a1 - 第一条线段的起始节点。
  2367. * @param {SuperMap.Geometry.Point} a2 - 第一条线段的结束节点。
  2368. * @param {SuperMap.Geometry.Point} b1 - 第二条线段的起始节点。
  2369. * @param {SuperMap.Geometry.Point} b2 - 第二条线段的结束节点。
  2370. * @returns {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
  2371. */
  2372. SuperMap.Util.lineIntersection = function (a1, a2, b1, b2) {
  2373. var intersectValue = null;
  2374. var k1;
  2375. var k2;
  2376. var b = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x);
  2377. var a = (a2.x - a1.x) * (a1.y - b1.y) - (a2.y - a1.y) * (a1.x - b1.x);
  2378. var ab = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y); //ab==0代表两条线断的斜率一样
  2379. if (ab != 0) {
  2380. k1 = b / ab;
  2381. k2 = a / ab;
  2382. if (k1 >= 0 && k2 <= 1 && k1 <= 1 && k2 >= 0) {
  2383. intersectValue = new SuperMap.Geometry.Point(a1.x + k1 * (a2.x - a1.x), a1.y + k1 * (a2.y - a1.y));
  2384. } else {
  2385. intersectValue = "No Intersection";
  2386. }
  2387. } else {
  2388. if (b == 0 && a == 0) {
  2389. var maxy = Math.max(a1.y, a2.y);
  2390. var miny = Math.min(a1.y, a2.y);
  2391. var maxx = Math.max(a1.x, a2.x);
  2392. var minx = Math.min(a1.x, a2.x);
  2393. if ((b1.y >= miny && b1.y <= maxy || b2.y >= miny && b2.y <= maxy) && b1.x >= minx && b1.x <= maxx || b2.x >= minx && b2.x <= maxx) {
  2394. intersectValue = "Coincident"; //重合
  2395. } else {
  2396. intersectValue = "Parallel"; //平行
  2397. }
  2398. } else {
  2399. intersectValue = "Parallel"; //平行
  2400. }
  2401. }
  2402. return intersectValue;
  2403. };
  2404. /**
  2405. * @description 获取文本外接矩形宽度与高度。
  2406. * @param {SuperMap.ThemeStyle} style - 文本样式。
  2407. * @param {string} text - 文本内容。
  2408. * @param {Object} element - DOM 元素。
  2409. * @returns {Object} 返回裁剪后的宽度,高度信息。
  2410. */
  2411. SuperMap.Util.getTextBounds = function (style, text, element) {
  2412. document.body.appendChild(element);
  2413. element.style.width = 'auto';
  2414. element.style.height = 'auto';
  2415. if (style.fontSize) {
  2416. element.style.fontSize = style.fontSize;
  2417. }
  2418. if (style.fontFamily) {
  2419. element.style.fontFamily = style.fontFamily;
  2420. }
  2421. if (style.fontWeight) {
  2422. element.style.fontWeight = style.fontWeight;
  2423. }
  2424. element.style.position = 'relative';
  2425. element.style.visibility = 'hidden'; //fix 在某些情况下,element内的文本变成竖起排列,导致宽度计算不正确的bug
  2426. element.style.display = 'inline-block';
  2427. element.innerHTML = text;
  2428. var textWidth = element.clientWidth;
  2429. var textHeight = element.clientHeight;
  2430. document.body.removeChild(element);
  2431. return {
  2432. textWidth: textWidth,
  2433. textHeight: textHeight
  2434. };
  2435. };
  2436. ;// CONCATENATED MODULE: ./src/common/commontypes/Event.js
  2437. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  2438. * This program are made available under the terms of the Apache License, Version 2.0
  2439. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  2440. /**
  2441. * @name Event
  2442. * @memberOf SuperMap
  2443. * @namespace
  2444. * @description 事件处理函数.
  2445. */
  2446. var Event = SuperMap.Event = {
  2447. /**
  2448. * @description A hash table cache of the event observers. Keyed by element._eventCacheID
  2449. * @type {boolean}
  2450. * @default false
  2451. */
  2452. observers: false,
  2453. /**
  2454. * @description KEY_SPACE
  2455. * @type {number}
  2456. * @default 32
  2457. */
  2458. KEY_SPACE: 32,
  2459. /**
  2460. * @description KEY_BACKSPACE
  2461. * @type {number}
  2462. * @default 8
  2463. */
  2464. KEY_BACKSPACE: 8,
  2465. /**
  2466. * @description KEY_TAB
  2467. * @type {number}
  2468. * @default 9
  2469. */
  2470. KEY_TAB: 9,
  2471. /**
  2472. * @description KEY_RETURN
  2473. * @type {number}
  2474. * @default 13
  2475. */
  2476. KEY_RETURN: 13,
  2477. /**
  2478. * @description KEY_ESC
  2479. * @type {number}
  2480. * @default 27
  2481. */
  2482. KEY_ESC: 27,
  2483. /**
  2484. * @description KEY_LEFT
  2485. * @type {number}
  2486. * @default 37
  2487. */
  2488. KEY_LEFT: 37,
  2489. /**
  2490. * @description KEY_UP
  2491. * @type {number}
  2492. * @default 38
  2493. */
  2494. KEY_UP: 38,
  2495. /**
  2496. * @description KEY_RIGHT
  2497. * @type {number}
  2498. * @default 39
  2499. */
  2500. KEY_RIGHT: 39,
  2501. /**
  2502. * @description KEY_DOWN
  2503. * @type {number}
  2504. * @default 40
  2505. */
  2506. KEY_DOWN: 40,
  2507. /**
  2508. * @description KEY_DELETE
  2509. * @type {number}
  2510. * @default 46
  2511. */
  2512. KEY_DELETE: 46,
  2513. /**
  2514. * @description Cross browser event element detection.
  2515. * @param {Event} event - The event
  2516. * @returns {HTMLElement} The element that caused the event
  2517. */
  2518. element: function element(event) {
  2519. return event.target || event.srcElement;
  2520. },
  2521. /**
  2522. * @description Determine whether event was caused by a single touch
  2523. * @param {Event} event - The event
  2524. * @returns {boolean}
  2525. */
  2526. isSingleTouch: function isSingleTouch(event) {
  2527. return event.touches && event.touches.length === 1;
  2528. },
  2529. /**
  2530. * @description Determine whether event was caused by a multi touch
  2531. * @param {Event} event - The event
  2532. * @returns {boolean}
  2533. */
  2534. isMultiTouch: function isMultiTouch(event) {
  2535. return event.touches && event.touches.length > 1;
  2536. },
  2537. /**
  2538. * @description Determine whether event was caused by a left click.
  2539. * @param {Event} event - The event
  2540. * @returns {boolean}
  2541. */
  2542. isLeftClick: function isLeftClick(event) {
  2543. return event.which && event.which === 1 || event.button && event.button === 1;
  2544. },
  2545. /**
  2546. * @description Determine whether event was caused by a right mouse click.
  2547. * @param {Event} event - The event
  2548. * @returns {boolean}
  2549. */
  2550. isRightClick: function isRightClick(event) {
  2551. return event.which && event.which === 3 || event.button && event.button === 2;
  2552. },
  2553. /**
  2554. * @description Stops an event from propagating.
  2555. * @param {Event} event - The event
  2556. * @param {boolean} allowDefault - If true, we stop the event chain but still allow the default browser behaviour (text selection, radio-button clicking, etc) Default false
  2557. */
  2558. stop: function stop(event, allowDefault) {
  2559. if (!allowDefault) {
  2560. if (event.preventDefault) {
  2561. event.preventDefault();
  2562. } else {
  2563. event.returnValue = false;
  2564. }
  2565. }
  2566. if (event.stopPropagation) {
  2567. event.stopPropagation();
  2568. } else {
  2569. event.cancelBubble = true;
  2570. }
  2571. },
  2572. /**
  2573. * @param {Event} event - The event。
  2574. * @param {string} tagName - html 标签名。
  2575. * @returns {HTMLElement} The first node with the given tagName, starting from the node the event was triggered on and traversing the DOM upwards
  2576. */
  2577. findElement: function findElement(event, tagName) {
  2578. var element = SuperMap.Event.element(event);
  2579. while (element.parentNode && (!element.tagName || element.tagName.toUpperCase() != tagName.toUpperCase())) {
  2580. element = element.parentNode;
  2581. }
  2582. return element;
  2583. },
  2584. /**
  2585. * @description 监听事件,注册事件处理方法。
  2586. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  2587. * @param {string} name - 监听事件的类别名称。
  2588. * @param {function} observer - 注册的事件处理方法。
  2589. * @param {boolean} [useCapture=false] - 是否捕获。
  2590. */
  2591. observe: function observe(elementParam, name, observer, useCapture) {
  2592. var element = Util.getElement(elementParam);
  2593. useCapture = useCapture || false;
  2594. if (name === 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) {
  2595. name = 'keydown';
  2596. } //if observers cache has not yet been created, create it
  2597. if (!this.observers) {
  2598. this.observers = {};
  2599. } //if not already assigned, make a new unique cache ID
  2600. if (!element._eventCacheID) {
  2601. var idPrefix = "eventCacheID_";
  2602. if (element.id) {
  2603. idPrefix = element.id + "_" + idPrefix;
  2604. }
  2605. element._eventCacheID = Util.createUniqueID(idPrefix);
  2606. }
  2607. var cacheID = element._eventCacheID; //if there is not yet a hash entry for this element, add one
  2608. if (!this.observers[cacheID]) {
  2609. this.observers[cacheID] = [];
  2610. } //add a new observer to this element's list
  2611. this.observers[cacheID].push({
  2612. 'element': element,
  2613. 'name': name,
  2614. 'observer': observer,
  2615. 'useCapture': useCapture
  2616. }); //add the actual browser event listener
  2617. if (element.addEventListener) {
  2618. if (name === 'mousewheel') {
  2619. // https://www.chromestatus.com/features/6662647093133312
  2620. element.addEventListener(name, observer, {
  2621. useCapture: useCapture,
  2622. passive: false
  2623. });
  2624. } else {
  2625. element.addEventListener(name, observer, useCapture);
  2626. }
  2627. } else if (element.attachEvent) {
  2628. element.attachEvent('on' + name, observer);
  2629. }
  2630. },
  2631. /**
  2632. * @description Given the id of an element to stop observing, cycle through the
  2633. * element's cached observers, calling stopObserving on each one,
  2634. * skipping those entries which can no longer be removed.
  2635. *
  2636. * @param {(HTMLElement|string)} elementParam -
  2637. */
  2638. stopObservingElement: function stopObservingElement(elementParam) {
  2639. var element = Util.getElement(elementParam);
  2640. var cacheID = element._eventCacheID;
  2641. this._removeElementObservers(SuperMap.Event.observers[cacheID]);
  2642. },
  2643. /**
  2644. * @param {Array.<Object>} elementObservers - Array of (element, name,
  2645. * observer, usecapture) objects,
  2646. * taken directly from hashtable
  2647. */
  2648. _removeElementObservers: function _removeElementObservers(elementObservers) {
  2649. if (elementObservers) {
  2650. for (var i = elementObservers.length - 1; i >= 0; i--) {
  2651. var entry = elementObservers[i];
  2652. var args = new Array(entry.element, entry.name, entry.observer, entry.useCapture);
  2653. SuperMap.Event.stopObserving.apply(this, args);
  2654. }
  2655. }
  2656. },
  2657. /**
  2658. * @description 移除事件监听和注册的事件处理方法。注意:事件的移除和监听相对应,移除时的各属性信息必须监听时
  2659. * 保持一致才能确保事件移除成功。
  2660. * @param {(HTMLElement|string)} elementParam - 被监听的 DOM 元素或者其 ID。
  2661. * @param {string} name - 需要移除的被监听事件名称。
  2662. * @param {function} observer - 需要移除的事件处理方法。
  2663. * @param {boolean} [useCapture=false] - 是否捕获。
  2664. * @returns {boolean} Whether or not the event observer was removed
  2665. */
  2666. stopObserving: function stopObserving(elementParam, name, observer, useCapture) {
  2667. useCapture = useCapture || false;
  2668. var element = Util.getElement(elementParam);
  2669. var cacheID = element._eventCacheID;
  2670. if (name === 'keypress') {
  2671. if (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent) {
  2672. name = 'keydown';
  2673. }
  2674. } // find element's entry in this.observers cache and remove it
  2675. var foundEntry = false;
  2676. var elementObservers = SuperMap.Event.observers[cacheID];
  2677. if (elementObservers) {
  2678. // find the specific event type in the element's list
  2679. var i = 0;
  2680. while (!foundEntry && i < elementObservers.length) {
  2681. var cacheEntry = elementObservers[i];
  2682. if (cacheEntry.name === name && cacheEntry.observer === observer && cacheEntry.useCapture === useCapture) {
  2683. elementObservers.splice(i, 1);
  2684. if (elementObservers.length == 0) {
  2685. delete SuperMap.Event.observers[cacheID];
  2686. }
  2687. foundEntry = true;
  2688. break;
  2689. }
  2690. i++;
  2691. }
  2692. } //actually remove the event listener from browser
  2693. if (foundEntry) {
  2694. if (element.removeEventListener) {
  2695. element.removeEventListener(name, observer, useCapture);
  2696. } else if (element && element.detachEvent) {
  2697. element.detachEvent('on' + name, observer);
  2698. }
  2699. }
  2700. return foundEntry;
  2701. },
  2702. /**
  2703. * @description Cycle through all the element entries in the events cache and call
  2704. * stopObservingElement on each.
  2705. */
  2706. unloadCache: function unloadCache() {
  2707. // check for SuperMap.Event before checking for observers, because
  2708. // SuperMap.Event may be undefined in IE if no map instance was
  2709. // created
  2710. if (SuperMap.Event && SuperMap.Event.observers) {
  2711. for (var cacheID in SuperMap.Event.observers) {
  2712. var elementObservers = SuperMap.Event.observers[cacheID];
  2713. SuperMap.Event._removeElementObservers.apply(this, [elementObservers]);
  2714. }
  2715. SuperMap.Event.observers = false;
  2716. }
  2717. },
  2718. CLASS_NAME: "SuperMap.Event"
  2719. };
  2720. SuperMap.Event = Event;
  2721. /* prevent memory leaks in IE */
  2722. SuperMap.Event.observe(window, 'unload', SuperMap.Event.unloadCache, false);
  2723. ;// CONCATENATED MODULE: ./src/common/commontypes/Events.js
  2724. function Events_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Events_typeof = function _typeof(obj) { return typeof obj; }; } else { Events_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Events_typeof(obj); }
  2725. function Events_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2726. function Events_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2727. function Events_createClass(Constructor, protoProps, staticProps) { if (protoProps) Events_defineProperties(Constructor.prototype, protoProps); if (staticProps) Events_defineProperties(Constructor, staticProps); return Constructor; }
  2728. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  2729. * This program are made available under the terms of the Apache License, Version 2.0
  2730. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  2731. /**
  2732. * @class SuperMap.Events
  2733. * @classdesc 事件类。
  2734. * @param {Object} object - 当前事件对象被添加到的 JS 对象。
  2735. * @param {HTMLElement} element - 响应浏览器事件的 DOM 元素。
  2736. * @param {Array.<string>} eventTypes - 自定义应用事件的数组。
  2737. * @param {boolean} [fallThrough=false] - 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  2738. * @param {Object} options - 事件对象选项。
  2739. */
  2740. var Events = /*#__PURE__*/function () {
  2741. function Events(object, element, eventTypes, fallThrough, options) {
  2742. Events_classCallCheck(this, Events);
  2743. /**
  2744. * @member {Array.<string>} SuperMap.Events.prototype.BROWSER_EVENTS
  2745. * @description 支持的事件。
  2746. * @constant
  2747. * @default [
  2748. "mouseover", "mouseout","mousedown", "mouseup", "mousemove",
  2749. "click", "dblclick", "rightclick", "dblrightclick","resize",
  2750. "focus", "blur","touchstart", "touchmove", "touchend","keydown",
  2751. "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup",
  2752. "MSGestureStart", "MSGestureChange", "MSGestureEnd","contextmenu"
  2753. ]
  2754. */
  2755. this.BROWSER_EVENTS = ["mouseover", "mouseout", "mousedown", "mouseup", "mousemove", "click", "dblclick", "rightclick", "dblrightclick", "resize", "focus", "blur", "touchstart", "touchmove", "touchend", "keydown", "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup", "MSGestureStart", "MSGestureChange", "MSGestureEnd", "contextmenu"];
  2756. /**
  2757. * @member {Object} SuperMap.Events.prototype.listeners
  2758. * @description Hashtable of Array(function): events listener functions
  2759. */
  2760. this.listeners = {};
  2761. /**
  2762. * @member {Object} SuperMap.Events.prototype.object
  2763. * @description 发布应用程序事件的对象。
  2764. */
  2765. this.object = object;
  2766. /**
  2767. * @member {HTMLElement} SuperMap.Events.prototype.element
  2768. * @description 接受浏览器事件的 DOM 节点。
  2769. */
  2770. this.element = null;
  2771. /**
  2772. * @member {Array.<string>} SuperMap.Events.prototype.eventTypes
  2773. * @description 支持的事件类型列表。
  2774. */
  2775. this.eventTypes = [];
  2776. /**
  2777. * @member {function} SuperMap.Events.prototype.eventHandler
  2778. * @description 绑定在元素上的事件处理器对象。
  2779. */
  2780. this.eventHandler = null;
  2781. /**
  2782. * @member {boolean} [SuperMap.Events.prototype.fallThrough=false]
  2783. * @description 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  2784. */
  2785. this.fallThrough = fallThrough;
  2786. /**
  2787. * @member {boolean} [SuperMap.Events.prototype.includeXY=false]
  2788. * @description 判断是否让 xy 属性自动创建到浏览器上的鼠标事件,一般设置为 false,如果设置为 true,鼠标事件将会在事件传递过程中自动产生 xy 属性。
  2789. * 可根据事件对象的 'evt.object' 属性在相关的事件句柄上调用 getMousePosition 函数。这个选项习惯默认为 false 的原因在于,当创建一个
  2790. * 事件对象,其主要目的是管理。在一个 div 的相对定位的鼠标事件,将其设为 true 也是有意义的。这个选项也可以用来控制是否抵消缓存。如果
  2791. * 设为 false 不抵消,如果设为 true,用 this.clearMouseCache() 清除缓存偏移(边界元素偏移,元素在页面的位置偏移)。
  2792. * @example
  2793. * function named(evt) {
  2794. * this.xy = this.object.events.getMousePosition(evt);
  2795. * }
  2796. */
  2797. this.includeXY = false;
  2798. /**
  2799. * @member {Object} SuperMap.Events.prototype.extensions
  2800. * @description 事件扩展。Keys 代表事件类型,values 代表事件对象。
  2801. * @example
  2802. * 以扩展 "foostart" 和 "fooend" 事件为例。展示替换 css 属性为 foo 的元素的 click 事件。
  2803. *
  2804. * SuperMap.Events.foostart = SuperMap.Class({
  2805. * initialize: function(target) {
  2806. * this.target = target;
  2807. * this.target.register("click", this, this.doStuff, {extension: true});
  2808. * // only required if extension provides more than one event type
  2809. * this.target.extensions["foostart"] = true;
  2810. * this.target.extensions["fooend"] = true;
  2811. * },
  2812. * destroy: function() {
  2813. * var target = this.target;
  2814. * target.unregister("click", this, this.doStuff);
  2815. * delete this.target;
  2816. * // only required if extension provides more than one event type
  2817. * delete target.extensions["foostart"];
  2818. * delete target.extensions["fooend"];
  2819. * },
  2820. * doStuff: function(evt) {
  2821. * var propagate = true;
  2822. * if (SuperMap.Event.element(evt).className === "foo") {
  2823. * propagate = false;
  2824. * var target = this.target;
  2825. * target.triggerEvent("foostart");
  2826. * window.setTimeout(function() {
  2827. * target.triggerEvent("fooend");
  2828. * }, 1000);
  2829. * }
  2830. * return propagate;
  2831. * }
  2832. * });
  2833. * // only required if extension provides more than one event type
  2834. * SuperMap.Events.fooend = SuperMap.Events.foostart;
  2835. */
  2836. this.extensions = {};
  2837. /**
  2838. * @member {Object} SuperMap.Events.prototype.extensionCount
  2839. */
  2840. this.extensionCount = {};
  2841. /**
  2842. * @member {Object} SuperMap.Events.prototype.clearMouseListener
  2843. */
  2844. this.clearMouseListener = null;
  2845. Util.extend(this, options);
  2846. if (eventTypes != null) {
  2847. for (var i = 0, len = eventTypes.length; i < len; i++) {
  2848. this.addEventType(eventTypes[i]);
  2849. }
  2850. }
  2851. if (element != null) {
  2852. this.attachToElement(element);
  2853. }
  2854. this.CLASS_NAME = "SuperMap.Events";
  2855. }
  2856. /**
  2857. * @function SuperMap.Events.prototype.destroy
  2858. * @description 移除当前要素 element 上的所有事件监听和处理。
  2859. */
  2860. Events_createClass(Events, [{
  2861. key: "destroy",
  2862. value: function destroy() {
  2863. for (var e in this.extensions) {
  2864. if (typeof this.extensions[e] !== "boolean") {
  2865. this.extensions[e].destroy();
  2866. }
  2867. }
  2868. this.extensions = null;
  2869. if (this.element) {
  2870. Event.stopObservingElement(this.element);
  2871. if (this.element.hasScrollEvent) {
  2872. Event.stopObserving(window, "scroll", this.clearMouseListener);
  2873. }
  2874. }
  2875. this.element = null;
  2876. this.listeners = null;
  2877. this.object = null;
  2878. this.eventTypes = null;
  2879. this.fallThrough = null;
  2880. this.eventHandler = null;
  2881. }
  2882. /**
  2883. * @function SuperMap.Events.prototype.addEventType
  2884. * @description 在此事件对象中添加新的事件类型,如果这个事件类型已经添加过了,则不做任何事情。
  2885. * @param {string} eventName - 事件名。
  2886. */
  2887. }, {
  2888. key: "addEventType",
  2889. value: function addEventType(eventName) {
  2890. if (!this.listeners[eventName]) {
  2891. this.eventTypes.push(eventName);
  2892. this.listeners[eventName] = [];
  2893. }
  2894. }
  2895. /**
  2896. * @function SuperMap.Events.prototype.attachToElement
  2897. * @description 给 DOM 元素绑定浏览器事件。
  2898. * @param {HTMLDOMElement} element - 绑定浏览器事件的 DOM 元素。
  2899. */
  2900. }, {
  2901. key: "attachToElement",
  2902. value: function attachToElement(element) {
  2903. if (this.element) {
  2904. Event.stopObservingElement(this.element);
  2905. } else {
  2906. // keep a bound copy of handleBrowserEvent() so that we can
  2907. // pass the same function to both Event.observe() and .stopObserving()
  2908. this.eventHandler = FunctionExt.bindAsEventListener(this.handleBrowserEvent, this); // to be used with observe and stopObserving
  2909. this.clearMouseListener = FunctionExt.bind(this.clearMouseCache, this);
  2910. }
  2911. this.element = element;
  2912. for (var i = 0, len = this.BROWSER_EVENTS.length; i < len; i++) {
  2913. var eventType = this.BROWSER_EVENTS[i]; // every browser event has a corresponding application event
  2914. // (whether it's listened for or not).
  2915. this.addEventType(eventType); // use Prototype to register the event cross-browser
  2916. Event.observe(element, eventType, this.eventHandler);
  2917. } // disable dragstart in IE so that mousedown/move/up works normally
  2918. Event.observe(element, "dragstart", Event.stop);
  2919. }
  2920. /**
  2921. * @function SuperMap.Events.prototype.on
  2922. * @description 在一个相同的范围内注册监听器的方法,此方法调用 register 函数。
  2923. * @example
  2924. * // 注册一个 "loadstart" 监听事件
  2925. * events.on({"loadstart": loadStartListener});
  2926. *
  2927. * // 同样注册一个 "loadstart" 监听事件
  2928. * events.register("loadstart", undefined, loadStartListener);
  2929. *
  2930. * // 同时为对象注册多个监听事件
  2931. * events.on({
  2932. * "loadstart": loadStartListener,
  2933. * "loadend": loadEndListener,
  2934. * scope: object
  2935. * });
  2936. *
  2937. * // 同时为对象注册多个监听事件,多次调用 register 方法
  2938. * events.register("loadstart", object, loadStartListener);
  2939. * events.register("loadend", object, loadEndListener);
  2940. *
  2941. *
  2942. * @param {Object} object - 添加监听的对象。
  2943. */
  2944. }, {
  2945. key: "on",
  2946. value: function on(object) {
  2947. for (var type in object) {
  2948. if (type !== "scope" && object.hasOwnProperty(type)) {
  2949. this.register(type, object.scope, object[type]);
  2950. }
  2951. }
  2952. }
  2953. /**
  2954. * @function SuperMap.Events.prototype.register
  2955. * @description 在事件对象上注册一个事件。当事件被触发时,'func' 函数被调用,假设我们触发一个事件,
  2956. * 指定 SuperMap.Bounds 作为 "obj",当事件被触发时,回调函数的上下文作为 Bounds 对象。
  2957. * @param {string} type - 事件注册者的名字。
  2958. * @param {Object} [obj=this.object] - 对象绑定的回调。
  2959. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  2960. * @param {(boolean|Object)} [priority] - 当为 true 时将新的监听加在事件队列的前面。
  2961. */
  2962. }, {
  2963. key: "register",
  2964. value: function register(type, obj, func, priority) {
  2965. if (type in Events && !this.extensions[type]) {
  2966. this.extensions[type] = new Events[type](this);
  2967. }
  2968. if (func != null && Util.indexOf(this.eventTypes, type) !== -1) {
  2969. if (obj == null) {
  2970. obj = this.object;
  2971. }
  2972. var listeners = this.listeners[type];
  2973. if (!listeners) {
  2974. listeners = [];
  2975. this.listeners[type] = listeners;
  2976. this.extensionCount[type] = 0;
  2977. }
  2978. var listener = {
  2979. obj: obj,
  2980. func: func
  2981. };
  2982. if (priority) {
  2983. listeners.splice(this.extensionCount[type], 0, listener);
  2984. if (Events_typeof(priority) === "object" && priority.extension) {
  2985. this.extensionCount[type]++;
  2986. }
  2987. } else {
  2988. listeners.push(listener);
  2989. }
  2990. }
  2991. }
  2992. /**
  2993. * @function SuperMap.Events.prototype.registerPriority
  2994. * @description 相同的注册方法,但是在前面增加新的监听者事件查询而代替到方法的结束。
  2995. * @param {string} type - 事件注册者的名字。
  2996. * @param {Object} [obj=this.object] - 对象绑定方面的回调。
  2997. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  2998. */
  2999. }, {
  3000. key: "registerPriority",
  3001. value: function registerPriority(type, obj, func) {
  3002. this.register(type, obj, func, true);
  3003. }
  3004. /**
  3005. * @function SuperMap.Events.prototype.un
  3006. * @description 在一个相同的范围内取消注册监听器的方法,此方法调用 unregister 函数。
  3007. * @example
  3008. * // 移除 "loadstart" 事件监听
  3009. * events.un({"loadstart": loadStartListener});
  3010. *
  3011. * // 使用 "unregister" 方法移除 "loadstart" 事件监听
  3012. * events.unregister("loadstart", undefined, loadStartListener);
  3013. *
  3014. * // 取消对象多个事件监听
  3015. * events.un({
  3016. * "loadstart": loadStartListener,
  3017. * "loadend": loadEndListener,
  3018. * scope: object
  3019. * });
  3020. *
  3021. * // 取消对象多个事件监听,多次调用unregister方法。
  3022. * events.unregister("loadstart", object, loadStartListener);
  3023. * events.unregister("loadend", object, loadEndListener);
  3024. *
  3025. * @param {Object} object - 移除监听的对象。
  3026. */
  3027. }, {
  3028. key: "un",
  3029. value: function un(object) {
  3030. for (var type in object) {
  3031. if (type !== "scope" && object.hasOwnProperty(type)) {
  3032. this.unregister(type, object.scope, object[type]);
  3033. }
  3034. }
  3035. }
  3036. /**
  3037. * @function SuperMap.Events.prototype.unregister
  3038. * @description 取消注册。
  3039. * @param {string} type - 事件类型。
  3040. * @param {Object} [obj=this.object] - 对象绑定方面的回调。
  3041. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  3042. */
  3043. }, {
  3044. key: "unregister",
  3045. value: function unregister(type, obj, func) {
  3046. if (obj == null) {
  3047. obj = this.object;
  3048. }
  3049. var listeners = this.listeners[type];
  3050. if (listeners != null) {
  3051. for (var i = 0, len = listeners.length; i < len; i++) {
  3052. if (listeners[i].obj === obj && listeners[i].func === func) {
  3053. listeners.splice(i, 1);
  3054. break;
  3055. }
  3056. }
  3057. }
  3058. }
  3059. /**
  3060. * @function SuperMap.Events.prototype.remove
  3061. * @description 删除某个事件类型的所有监听,如果该事件类型没有注册,则不做任何操作。
  3062. * @param {string} type - 事件类型。
  3063. */
  3064. }, {
  3065. key: "remove",
  3066. value: function remove(type) {
  3067. if (this.listeners[type] != null) {
  3068. this.listeners[type] = [];
  3069. }
  3070. }
  3071. /**
  3072. * @function SuperMap.Events.prototype.triggerEvent
  3073. * @description 触发一个特定的注册事件。
  3074. * @param {string} type - 触发事件类型。
  3075. * @param {Event} evt - 事件对象。
  3076. * @returns {boolean} 返回监听对象,如果返回是 false,则停止监听。
  3077. */
  3078. }, {
  3079. key: "triggerEvent",
  3080. value: function triggerEvent(type, evt) {
  3081. var listeners = this.listeners[type]; // fast path
  3082. if (!listeners || listeners.length == 0) {
  3083. return undefined;
  3084. } // prep evt object with object & div references
  3085. if (evt == null) {
  3086. evt = {};
  3087. }
  3088. evt.object = this.object;
  3089. evt.element = this.element;
  3090. if (!evt.type) {
  3091. evt.type = type;
  3092. } // execute all callbacks registered for specified type
  3093. // get a clone of the listeners array to
  3094. // allow for splicing during callbacks
  3095. listeners = listeners.slice();
  3096. var continueChain;
  3097. for (var i = 0, len = listeners.length; i < len; i++) {
  3098. var callback = listeners[i]; // bind the context to callback.obj
  3099. continueChain = callback.func.apply(callback.obj, [evt]);
  3100. if (continueChain != undefined && continueChain === false) {
  3101. // if callback returns false, execute no more callbacks.
  3102. break;
  3103. }
  3104. } // don't fall through to other DOM elements
  3105. if (!this.fallThrough) {
  3106. Event.stop(evt, true);
  3107. }
  3108. return continueChain;
  3109. }
  3110. /**
  3111. * @function SuperMap.Events.prototype.handleBrowserEvent
  3112. * @description 对 triggerEvent 函数的包装,给事件对象设置了 xy 属性(即当前鼠标点的 xy 坐标)。
  3113. * @param {Event} evt - 事件对象。
  3114. */
  3115. }, {
  3116. key: "handleBrowserEvent",
  3117. value: function handleBrowserEvent(evt) {
  3118. var type = evt.type,
  3119. listeners = this.listeners[type];
  3120. if (!listeners || listeners.length == 0) {
  3121. // noone's listening, bail out
  3122. return;
  3123. } // add clientX & clientY to all events - corresponds to average x, y
  3124. var touches = evt.touches;
  3125. if (touches && touches[0]) {
  3126. var x = 0;
  3127. var y = 0;
  3128. var num = touches.length;
  3129. var touch;
  3130. for (var i = 0; i < num; ++i) {
  3131. touch = touches[i];
  3132. x += touch.clientX;
  3133. y += touch.clientY;
  3134. }
  3135. evt.clientX = x / num;
  3136. evt.clientY = y / num;
  3137. }
  3138. if (this.includeXY) {
  3139. evt.xy = this.getMousePosition(evt);
  3140. }
  3141. this.triggerEvent(type, evt);
  3142. }
  3143. /**
  3144. * @function SuperMap.Events.prototype.clearMouseCache
  3145. * @description 清除鼠标缓存。
  3146. */
  3147. }, {
  3148. key: "clearMouseCache",
  3149. value: function clearMouseCache() {
  3150. this.element.scrolls = null;
  3151. this.element.lefttop = null;
  3152. var body = document.body;
  3153. if (body && !((body.scrollTop != 0 || body.scrollLeft != 0) && navigator.userAgent.match(/iPhone/i))) {
  3154. this.element.offsets = null;
  3155. }
  3156. }
  3157. /**
  3158. * @function SuperMap.Events.prototype.getMousePosition
  3159. * @param {Event} evt - 事件对象。
  3160. * @returns {SuperMap.Pixel} 当前的鼠标的 xy 坐标点。
  3161. */
  3162. }, {
  3163. key: "getMousePosition",
  3164. value: function getMousePosition(evt) {
  3165. if (!this.includeXY) {
  3166. this.clearMouseCache();
  3167. } else if (!this.element.hasScrollEvent) {
  3168. Event.observe(window, "scroll", this.clearMouseListener);
  3169. this.element.hasScrollEvent = true;
  3170. }
  3171. if (!this.element.scrolls) {
  3172. var viewportElement = Util.getViewportElement();
  3173. this.element.scrolls = [viewportElement.scrollLeft, viewportElement.scrollTop];
  3174. }
  3175. if (!this.element.lefttop) {
  3176. this.element.lefttop = [document.documentElement.clientLeft || 0, document.documentElement.clientTop || 0];
  3177. }
  3178. if (!this.element.offsets) {
  3179. this.element.offsets = Util.pagePosition(this.element);
  3180. }
  3181. return new Pixel(evt.clientX + this.element.scrolls[0] - this.element.offsets[0] - this.element.lefttop[0], evt.clientY + this.element.scrolls[1] - this.element.offsets[1] - this.element.lefttop[1]);
  3182. }
  3183. }]);
  3184. return Events;
  3185. }();
  3186. SuperMap.Events = Events;
  3187. SuperMap.Events.prototype.BROWSER_EVENTS = ["mouseover", "mouseout", "mousedown", "mouseup", "mousemove", "click", "dblclick", "rightclick", "dblrightclick", "resize", "focus", "blur", "touchstart", "touchmove", "touchend", "keydown", "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup", "MSGestureStart", "MSGestureChange", "MSGestureEnd", "contextmenu"];
  3188. ;// CONCATENATED MODULE: external "function(){try{return elasticsearch}catch(e){return {}}}()"
  3189. var external_function_try_return_elasticsearch_catch_e_return_namespaceObject = function(){try{return elasticsearch}catch(e){return {}}}();
  3190. var external_function_try_return_elasticsearch_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_elasticsearch_catch_e_return_namespaceObject);
  3191. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/ElasticSearch.js
  3192. function ElasticSearch_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3193. function ElasticSearch_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3194. function ElasticSearch_createClass(Constructor, protoProps, staticProps) { if (protoProps) ElasticSearch_defineProperties(Constructor.prototype, protoProps); if (staticProps) ElasticSearch_defineProperties(Constructor, staticProps); return Constructor; }
  3195. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  3196. * This program are made available under the terms of the Apache License, Version 2.0
  3197. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  3198. /**
  3199. * @class SuperMap.ElasticSearch
  3200. * @classdesc ElasticSearch服务类。
  3201. * @category ElasticSearch
  3202. * @param {string} url - ElasticSearch服务地址。
  3203. * @param {Object} options - 参数。
  3204. * @param {function} [options.change] - 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  3205. * @param {boolean} [options.openGeoFence=false] - 是否开启地理围栏验证,默认为不开启。
  3206. * @param {function} [options.outOfGeoFence] - 数据超出地理围栏后执行的函数。
  3207. * @param {Object} [options.geoFence] - 地理围栏。
  3208. */
  3209. var ElasticSearch = /*#__PURE__*/function () {
  3210. function ElasticSearch(url, options) {
  3211. ElasticSearch_classCallCheck(this, ElasticSearch);
  3212. options = options || {};
  3213. /**
  3214. * @member {string} SuperMap.ElasticSearch.prototype.url
  3215. * @description ElasticSearch服务地址
  3216. */
  3217. this.url = url;
  3218. /**
  3219. * @member {Object} SuperMap.ElasticSearch.prototype.client
  3220. * @description client ES客户端
  3221. */
  3222. this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
  3223. host: this.url
  3224. });
  3225. /**
  3226. * @deprecated
  3227. * @member {function} [SuperMap.ElasticSearch.prototype.change]
  3228. * @description 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  3229. */
  3230. this.change = null;
  3231. /**
  3232. * @member {boolean} [SuperMap.ElasticSearch.prototype.openGeoFence=false]
  3233. * @description 是否开启地理围栏验证,默认为不开启。
  3234. */
  3235. this.openGeoFence = false;
  3236. /**
  3237. * @member {function} [SuperMap.ElasticSearch.prototype.outOfGeoFence]
  3238. * @description 数据超出地理围栏后执行的函数
  3239. */
  3240. this.outOfGeoFence = null;
  3241. /**
  3242. * @member {Object} [SuperMap.ElasticSearch.prototype.geoFence]
  3243. * @description 地理围栏
  3244. * @example {
  3245. * radius: 1000,//单位是m
  3246. * center: [104.40, 30.43],
  3247. * unit: 'meter|degree'
  3248. * }
  3249. */
  3250. this.geoFence = null;
  3251. /*
  3252. * Constant: EVENT_TYPES
  3253. * {Array.<String>}
  3254. * 此类支持的事件类型。
  3255. *
  3256. */
  3257. this.EVENT_TYPES = ['change', 'error', 'outOfGeoFence'];
  3258. /**
  3259. * @member {SuperMap.Events} SuperMap.ElasticSearch.prototype.events
  3260. * @description 事件
  3261. */
  3262. this.events = new Events(this, null, this.EVENT_TYPES);
  3263. /**
  3264. * @member {Object} SuperMap.ElasticSearch.prototype.eventListeners
  3265. * @description 听器对象,在构造函数中设置此参数(可选),对 MapService 支持的两个事件 processCompleted 、processFailed 进行监听,
  3266. * 相当于调用 SuperMap.Events.on(eventListeners)。
  3267. */
  3268. this.eventListeners = null;
  3269. Util.extend(this, options);
  3270. if (this.eventListeners instanceof Object) {
  3271. this.events.on(this.eventListeners);
  3272. }
  3273. }
  3274. /**
  3275. * @function SuperMap.ElasticSearch.prototype.setGeoFence
  3276. * @description 设置地理围栏,openGeoFence参数为true的时候,设置的地理围栏才生效。
  3277. * @param {SuperMap.Geometry} geoFence - 地理围栏。
  3278. */
  3279. ElasticSearch_createClass(ElasticSearch, [{
  3280. key: "setGeoFence",
  3281. value: function setGeoFence(geoFence) {
  3282. this.geoFence = geoFence;
  3283. }
  3284. /**
  3285. * @function SuperMap.ElasticSearch.prototype.bulk
  3286. * @description 批量操作API,允许执行多个索引/删除操作。
  3287. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk}</br>
  3288. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html}</br>
  3289. * @param {Object} params - 参数。
  3290. * @param {function} callback - 回调函数。
  3291. */
  3292. }, {
  3293. key: "bulk",
  3294. value: function bulk(params, callback) {
  3295. return this.client.bulk(params, callback);
  3296. }
  3297. /**
  3298. * @function SuperMap.ElasticSearch.prototype.clearScroll
  3299. * @description 通过指定scroll参数进行查询来清除已经创建的scroll请求。
  3300. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-clearscroll}</br>
  3301. *更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  3302. * @param {Object} params - 参数。
  3303. * @param {function} callback - 回调函数。
  3304. */
  3305. }, {
  3306. key: "clearScroll",
  3307. value: function clearScroll(params, callback) {
  3308. return this.client.clearScroll(params, callback);
  3309. }
  3310. /**
  3311. * @function SuperMap.ElasticSearch.prototype.count
  3312. * @description 获取集群、索引、类型或查询的文档个数。
  3313. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-count}</br>
  3314. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html}</br>
  3315. * @param {Object} params - 参数。
  3316. * @param {function} callback - 回调函数。
  3317. */
  3318. }, {
  3319. key: "count",
  3320. value: function count(params, callback) {
  3321. return this.client.count(params, callback);
  3322. }
  3323. /**
  3324. * @function SuperMap.ElasticSearch.prototype.count
  3325. * @description 在特定索引中添加一个类型化的JSON文档,使其可搜索。如果具有相同index,type且id已经存在的文档将发生错误。</br>
  3326. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-create}
  3327. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}
  3328. * @param {Object} params - 参数。
  3329. * @param {function} callback - 回调函数。
  3330. */
  3331. }, {
  3332. key: "create",
  3333. value: function create(params, callback) {
  3334. return this.client.create(params, callback);
  3335. }
  3336. /**
  3337. * @function SuperMap.ElasticSearch.prototype.delete
  3338. * @description 根据其ID从特定索引中删除键入的JSON文档。
  3339. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-delete}</br>
  3340. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html}</br>
  3341. * @param {Object} params - 参数。
  3342. * @param {function} callback - 回调函数。
  3343. */
  3344. }, {
  3345. key: "delete",
  3346. value: function _delete(params, callback) {
  3347. return this.client["delete"](params, callback);
  3348. }
  3349. /**
  3350. * @function SuperMap.ElasticSearch.prototype.delete
  3351. * @description 根据其ID从特定索引中删除键入的JSON文档。
  3352. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletebyquery}</br>
  3353. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html}</br>
  3354. * @param {Object} params - 参数。
  3355. * @param {function} callback - 回调函数。
  3356. */
  3357. }, {
  3358. key: "deleteByQuery",
  3359. value: function deleteByQuery(params, callback) {
  3360. return this.client.deleteByQuery(params, callback);
  3361. }
  3362. /**
  3363. * @function SuperMap.ElasticSearch.prototype.delete
  3364. * @description 根据其ID删除脚本。</br>
  3365. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletescript}</br>
  3366. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  3367. * @param {Object} params - 参数。
  3368. * @param {function} callback - 回调函数。
  3369. */
  3370. }, {
  3371. key: "deleteScript",
  3372. value: function deleteScript(params, callback) {
  3373. return this.client.deleteScript(params, callback);
  3374. }
  3375. /**
  3376. * @function SuperMap.ElasticSearch.prototype.deleteTemplate
  3377. * @description 根据其ID删除模板。</br>
  3378. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletetemplate}</br>
  3379. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  3380. * @param {Object} params - 参数。
  3381. * @param {function} callback - 回调函数。
  3382. */
  3383. }, {
  3384. key: "deleteTemplate",
  3385. value: function deleteTemplate(params, callback) {
  3386. return this.client.deleteTemplate(params, callback);
  3387. }
  3388. /**
  3389. * @function SuperMap.ElasticSearch.prototype.exists
  3390. * @description 检查给定文档是否存在。</br>
  3391. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-exists}</br>
  3392. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  3393. * @param {Object} params - 参数。
  3394. * @param {function} callback - 回调函数。
  3395. */
  3396. }, {
  3397. key: "exists",
  3398. value: function exists(params, callback) {
  3399. return this.client.exists(params, callback);
  3400. }
  3401. /**
  3402. * @function SuperMap.ElasticSearch.prototype.existsSource
  3403. * @description 检查资源是否存在。</br>
  3404. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-existssource}</br>
  3405. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  3406. * @param {Object} params - 参数。
  3407. * @param {function} callback - 回调函数。
  3408. */
  3409. }, {
  3410. key: "existsSource",
  3411. value: function existsSource(params, callback) {
  3412. return this.client.existsSource(params, callback);
  3413. }
  3414. /**
  3415. * @function SuperMap.ElasticSearch.prototype.explain
  3416. * @description 提供与特定查询相关的特定文档分数的详细信息。它还会告诉您文档是否与指定的查询匹配。</br>
  3417. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-explain}</br>
  3418. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html}</br>
  3419. * @param {Object} params - 参数。
  3420. * @param {function} callback - 回调函数。
  3421. */
  3422. }, {
  3423. key: "explain",
  3424. value: function explain(params, callback) {
  3425. return this.client.explain(params, callback);
  3426. }
  3427. /**
  3428. * @function SuperMap.ElasticSearch.prototype.fieldCaps
  3429. * @description 允许检索多个索引之间的字段的功能。(实验性API,可能会在未来版本中删除)</br>
  3430. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-fieldcaps}</br>
  3431. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html}</br>
  3432. * @param {Object} params - 参数。
  3433. * @param {function} callback - 回调函数。
  3434. */
  3435. }, {
  3436. key: "fieldCaps",
  3437. value: function fieldCaps(params, callback) {
  3438. return this.client.fieldCaps(params, callback);
  3439. }
  3440. /**
  3441. * @function SuperMap.ElasticSearch.prototype.get
  3442. * @description 从索引获取一个基于其id的类型的JSON文档。</br>
  3443. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-get}</br>
  3444. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  3445. * @param {Object} params - 参数。
  3446. * @param {function} callback - 回调函数。
  3447. */
  3448. }, {
  3449. key: "get",
  3450. value: function get(params, callback) {
  3451. return this.client.get(params, callback);
  3452. }
  3453. /**
  3454. * @function SuperMap.ElasticSearch.prototype.getScript
  3455. * @description 获取脚本。</br>
  3456. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getscript}</br>
  3457. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  3458. * @param {Object} params - 参数。
  3459. * @param {function} callback - 回调函数。
  3460. */
  3461. }, {
  3462. key: "getScript",
  3463. value: function getScript(params, callback) {
  3464. return this.client.getScript(params, callback);
  3465. }
  3466. /**
  3467. * @function SuperMap.ElasticSearch.prototype.getSource
  3468. * @description 通过索引,类型和ID获取文档的源。</br>
  3469. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getsource}</br>
  3470. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  3471. * @param {Object} params - 参数。
  3472. * @param {function} callback - 回调函数。
  3473. */
  3474. }, {
  3475. key: "getSource",
  3476. value: function getSource(params, callback) {
  3477. return this.client.getSource(params, callback);
  3478. }
  3479. /**
  3480. * @function SuperMap.ElasticSearch.prototype.getTemplate
  3481. * @description 获取模板。</br>
  3482. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-gettemplate}</br>
  3483. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  3484. * @param {Object} params - 参数。
  3485. * @param {function} callback - 回调函数。
  3486. */
  3487. }, {
  3488. key: "getTemplate",
  3489. value: function getTemplate(params, callback) {
  3490. return this.client.getTemplate(params, callback);
  3491. }
  3492. /**
  3493. * @function SuperMap.ElasticSearch.prototype.index
  3494. * @description 在索引中存储一个键入的JSON文档,使其可搜索。</br>
  3495. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-index}</br>
  3496. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}</br>
  3497. * @param {Object} params - 参数。
  3498. * @param {function} callback - 回调函数。
  3499. */
  3500. }, {
  3501. key: "index",
  3502. value: function index(params, callback) {
  3503. return this.client.index(params, callback);
  3504. }
  3505. /**
  3506. * @function SuperMap.ElasticSearch.prototype.info
  3507. * @description 从当前集群获取基本信息。</br>
  3508. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-info}</br>
  3509. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  3510. * @param {Object} params - 参数。
  3511. * @param {function} callback - 回调函数。
  3512. */
  3513. }, {
  3514. key: "info",
  3515. value: function info(params, callback) {
  3516. return this.client.info(params, callback);
  3517. }
  3518. /**
  3519. * @function SuperMap.ElasticSearch.prototype.mget
  3520. * @description 根据索引,类型(可选)和ids来获取多个文档。mget所需的主体可以采用两种形式:文档位置数组或文档ID数组。</br>
  3521. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mget}</br>
  3522. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html}</br>
  3523. * @param {Object} params - 参数。
  3524. * @param {function} callback - 回调函数。
  3525. */
  3526. }, {
  3527. key: "mget",
  3528. value: function mget(params, callback) {
  3529. return this.client.mget(params, callback);
  3530. }
  3531. /**
  3532. * @function SuperMap.ElasticSearch.prototype.msearch
  3533. * @description 在同一请求中执行多个搜索请求。</br>
  3534. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch}</br>
  3535. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html}</br>
  3536. * @param {Object} params - 参数。
  3537. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  3538. * 回调参数:error,response。结果存储在response.responses中
  3539. */
  3540. }, {
  3541. key: "msearch",
  3542. value: function msearch(params, callback) {
  3543. var me = this;
  3544. return me.client.msearch(params).then(function (resp) {
  3545. me._update(resp.responses, callback);
  3546. return resp;
  3547. }, function (err) {
  3548. callback(err);
  3549. me.events.triggerEvent('error', {
  3550. error: err
  3551. });
  3552. return err;
  3553. });
  3554. }
  3555. /**
  3556. * @function SuperMap.ElasticSearch.prototype.msearchTemplate
  3557. * @description 在同一请求中执行多个搜索模板请求。</br>
  3558. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearchtemplate}</br>
  3559. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  3560. * @param {Object} params - 参数。
  3561. * @param {function} callback - 回调函数。
  3562. */
  3563. }, {
  3564. key: "msearchTemplate",
  3565. value: function msearchTemplate(params, callback) {
  3566. return this.client.msearchTemplate(params, callback);
  3567. }
  3568. /**
  3569. * @function SuperMap.ElasticSearch.prototype.mtermvectors
  3570. * @description 多termvectors API允许一次获得多个termvectors。</br>
  3571. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mtermvectors}</br>
  3572. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html}</br>
  3573. * @param {Object} params - 参数。
  3574. * @param {function} callback - 回调函数。
  3575. */
  3576. }, {
  3577. key: "mtermvectors",
  3578. value: function mtermvectors(params, callback) {
  3579. return this.client.mtermvectors(params, callback);
  3580. }
  3581. /**
  3582. * @function SuperMap.ElasticSearch.prototype.ping
  3583. * @description 测试连接。</br>
  3584. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-ping}</br>
  3585. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  3586. * @param {Object} params - 参数。
  3587. * @param {function} callback - 回调函数。
  3588. */
  3589. }, {
  3590. key: "ping",
  3591. value: function ping(params, callback) {
  3592. return this.client.ping(params, callback);
  3593. }
  3594. /**
  3595. * @function SuperMap.ElasticSearch.prototype.putScript
  3596. * @description 添加脚本。</br>
  3597. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-putscript}</br>
  3598. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  3599. * @param {Object} params - 参数。
  3600. * @param {function} callback - 回调函数。
  3601. */
  3602. }, {
  3603. key: "putScript",
  3604. value: function putScript(params, callback) {
  3605. return this.client.putScript(params, callback);
  3606. }
  3607. /**
  3608. * @function SuperMap.ElasticSearch.prototype.putTemplate
  3609. * @description 添加模板。</br>
  3610. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-puttemplate}</br>
  3611. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  3612. * @param {Object} params - 参数。
  3613. * @param {function} callback - 回调函数。
  3614. */
  3615. }, {
  3616. key: "putTemplate",
  3617. value: function putTemplate(params, callback) {
  3618. return this.client.putTemplate(params, callback);
  3619. }
  3620. /**
  3621. * @function SuperMap.ElasticSearch.prototype.reindex
  3622. * @description 重新索引。</br>
  3623. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindex}</br>
  3624. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  3625. * @param {Object} params - 参数。
  3626. * @param {function} callback - 回调函数。
  3627. */
  3628. }, {
  3629. key: "reindex",
  3630. value: function reindex(params, callback) {
  3631. return this.client.reindex(params, callback);
  3632. }
  3633. /**
  3634. * @function SuperMap.ElasticSearch.prototype.reindexRessrottle
  3635. * @description 重新索引。</br>
  3636. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindexrethrottle}</br>
  3637. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  3638. * @param {Object} params - 参数。
  3639. * @param {function} callback - 回调函数。
  3640. */
  3641. }, {
  3642. key: "reindexRessrottle",
  3643. value: function reindexRessrottle(params, callback) {
  3644. return this.client.reindexRessrottle(params, callback);
  3645. }
  3646. /**
  3647. * @function SuperMap.ElasticSearch.prototype.renderSearchTemplate
  3648. * @description 搜索模板。</br>
  3649. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-rendersearchtemplate}</br>
  3650. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  3651. * @param {Object} params - 参数。
  3652. * @param {function} callback - 回调函数。
  3653. */
  3654. }, {
  3655. key: "renderSearchTemplate",
  3656. value: function renderSearchTemplate(params, callback) {
  3657. return this.client.renderSearchTemplate(params, callback);
  3658. }
  3659. /**
  3660. * @function SuperMap.ElasticSearch.prototype.scroll
  3661. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。</br>
  3662. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-scroll}</br>
  3663. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  3664. * @param {Object} params - 参数。
  3665. * @param {function} callback - 回调函数。
  3666. */
  3667. }, {
  3668. key: "scroll",
  3669. value: function scroll(params, callback) {
  3670. return this.client.scroll(params, callback);
  3671. }
  3672. /**
  3673. * @function SuperMap.ElasticSearch.prototype.search
  3674. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。
  3675. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search}</br>
  3676. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html}</br>
  3677. * @param {Object} params - 参数。
  3678. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  3679. * 回调参数:error,response,结果存储在response.responses中
  3680. */
  3681. }, {
  3682. key: "search",
  3683. value: function search(params, callback) {
  3684. var me = this;
  3685. return me.client.search(params).then(function (resp) {
  3686. me._update(resp.responses, callback);
  3687. return resp;
  3688. }, function (err) {
  3689. callback(err);
  3690. me.events.triggerEvent('error', {
  3691. error: err
  3692. });
  3693. return err;
  3694. });
  3695. }
  3696. /**
  3697. * @function SuperMap.ElasticSearch.prototype.searchShards
  3698. * @description 返回要执行搜索请求的索引和分片。
  3699. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchshards}</br>
  3700. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shards.html}</br>
  3701. * @param {Object} params - 参数。
  3702. * @param {function} callback - 回调函数。
  3703. */
  3704. }, {
  3705. key: "searchShards",
  3706. value: function searchShards(params, callback) {
  3707. return this.client.searchShards(params, callback);
  3708. }
  3709. /**
  3710. * @function SuperMap.ElasticSearch.prototype.searchTemplate
  3711. * @description 搜索模板。
  3712. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchtemplate}</br>
  3713. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  3714. * @param {Object} params - 参数。
  3715. * @param {function} callback - 回调函数。
  3716. */
  3717. }, {
  3718. key: "searchTemplate",
  3719. value: function searchTemplate(params, callback) {
  3720. return this.client.searchTemplate(params, callback);
  3721. }
  3722. /**
  3723. * @function SuperMap.ElasticSearch.prototype.suggest
  3724. * @description 该建议功能通过使用特定的建议者,基于所提供的文本来建议类似的术语。
  3725. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-suggest}</br>
  3726. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  3727. * @param {Object} params - 参数。
  3728. * @param {function} callback - 回调函数。
  3729. */
  3730. }, {
  3731. key: "suggest",
  3732. value: function suggest(params, callback) {
  3733. return this.client.suggest(params, callback);
  3734. }
  3735. /**
  3736. * @function SuperMap.ElasticSearch.prototype.termvectors
  3737. * @description 返回有关特定文档字段中的术语的信息和统计信息。
  3738. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-termvectors}</br>
  3739. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html}</br>
  3740. * @param {Object} params - 参数。
  3741. * @param {function} callback - 回调函数。
  3742. */
  3743. }, {
  3744. key: "termvectors",
  3745. value: function termvectors(params, callback) {
  3746. return this.client.termvectors(params, callback);
  3747. }
  3748. /**
  3749. * @function SuperMap.ElasticSearch.prototype.update
  3750. * @description 更新文档的部分。
  3751. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-update}</br>
  3752. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html}</br>
  3753. * @param {Object} params - 参数。
  3754. * @param {function} callback - 回调函数。
  3755. */
  3756. }, {
  3757. key: "update",
  3758. value: function update(params, callback) {
  3759. return this.client.update(params, callback);
  3760. }
  3761. /**
  3762. * @function SuperMap.ElasticSearch.prototype.update
  3763. * @description 通过查询API来更新文档。
  3764. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-updatebyquery}</br>
  3765. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html}</br>
  3766. * @param {Object} params - 参数。
  3767. * @param {function} callback - 回调函数。
  3768. */
  3769. }, {
  3770. key: "updateByQuery",
  3771. value: function updateByQuery(params, callback) {
  3772. return this.client.updateByQuery(params, callback);
  3773. }
  3774. }, {
  3775. key: "_update",
  3776. value: function _update(data, callback) {
  3777. var me = this;
  3778. if (!data) {
  3779. return;
  3780. }
  3781. me.data = data;
  3782. if (me.openGeoFence && me.geoFence) {
  3783. me._validateDatas(data);
  3784. }
  3785. me.events.triggerEvent('change', {
  3786. data: me.data
  3787. }); //change方法已废弃,不建议使用。建议使用search方法的第二个参数传入请求成功的回调
  3788. if (me.change) {
  3789. me.change && me.change(data);
  3790. } else {
  3791. //加responses是为了保持跟原来es自身的数据结构一致
  3792. callback && callback(undefined, {
  3793. responses: data
  3794. });
  3795. }
  3796. }
  3797. }, {
  3798. key: "_validateDatas",
  3799. value: function _validateDatas(datas) {
  3800. if (!datas) {
  3801. return;
  3802. }
  3803. if (!(datas instanceof Array)) {
  3804. datas = [datas];
  3805. }
  3806. var i,
  3807. len = datas.length;
  3808. for (i = 0; i < len; i++) {
  3809. this._validateData(datas[i]);
  3810. }
  3811. }
  3812. }, {
  3813. key: "_validateData",
  3814. value: function _validateData(data) {
  3815. var me = this;
  3816. data.hits.hits.map(function (source) {
  3817. var content = source._source;
  3818. var meterUnit = me._getMeterPerMapUnit(me.geoFence.unit);
  3819. var geoFenceCX = me.geoFence.center[0] * meterUnit;
  3820. var geoFenceCY = me.geoFence.center[1] * meterUnit;
  3821. var contentX = content.x * meterUnit;
  3822. var contentY = content.y * meterUnit;
  3823. var distance = me._distance(contentX, contentY, geoFenceCX, geoFenceCY);
  3824. var radius = me.geoFence.radius;
  3825. if (distance > radius) {
  3826. me.outOfGeoFence && me.outOfGeoFence(data);
  3827. me.events.triggerEvent('outOfGeoFence', {
  3828. data: data
  3829. });
  3830. }
  3831. return source;
  3832. });
  3833. }
  3834. }, {
  3835. key: "_distance",
  3836. value: function _distance(x1, y1, x2, y2) {
  3837. return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
  3838. }
  3839. }, {
  3840. key: "_getMeterPerMapUnit",
  3841. value: function _getMeterPerMapUnit(mapUnit) {
  3842. var earchRadiusInMeters = 6378137;
  3843. var meterPerMapUnit;
  3844. if (mapUnit === 'meter') {
  3845. meterPerMapUnit = 1;
  3846. } else if (mapUnit === 'degree') {
  3847. // 每度表示多少米。
  3848. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  3849. }
  3850. return meterPerMapUnit;
  3851. }
  3852. }]);
  3853. return ElasticSearch;
  3854. }();
  3855. SuperMap.ElasticSearch = ElasticSearch;
  3856. // EXTERNAL MODULE: ./node_modules/promise-polyfill/dist/polyfill.js
  3857. var polyfill = __webpack_require__(347);
  3858. // EXTERNAL MODULE: ./node_modules/fetch-ie8/fetch.js
  3859. var fetch = __webpack_require__(122);
  3860. // EXTERNAL MODULE: ./node_modules/fetch-jsonp/build/fetch-jsonp.js
  3861. var fetch_jsonp = __webpack_require__(683);
  3862. var fetch_jsonp_default = /*#__PURE__*/__webpack_require__.n(fetch_jsonp);
  3863. ;// CONCATENATED MODULE: ./src/common/util/FetchRequest.js
  3864. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  3865. * This program are made available under the terms of the Apache License, Version 2.0
  3866. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  3867. var FetchRequest_fetch = window.fetch;
  3868. var setFetch = function setFetch(newFetch) {
  3869. FetchRequest_fetch = newFetch;
  3870. };
  3871. /**
  3872. * @function SuperMap.setCORS
  3873. * @description 设置是否允许跨域请求,全局配置,优先级低于 service 下的 crossOring 参数。
  3874. * @param {boolean} cors - 是否允许跨域请求。
  3875. */
  3876. var setCORS = SuperMap.setCORS = function (cors) {
  3877. SuperMap.CORS = cors;
  3878. };
  3879. /**
  3880. * @function SuperMap.isCORS
  3881. * @description 是是否允许跨域请求。
  3882. * @returns {boolean} 是否允许跨域请求。
  3883. */
  3884. var isCORS = SuperMap.isCORS = function () {
  3885. if (SuperMap.CORS != undefined) {
  3886. return SuperMap.CORS;
  3887. }
  3888. return window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest();
  3889. };
  3890. /**
  3891. * @function SuperMap.setRequestTimeout
  3892. * @description 设置请求超时时间。
  3893. * @param {number} [timeout=45] - 请求超时时间,单位秒。
  3894. */
  3895. var setRequestTimeout = SuperMap.setRequestTimeout = function (timeout) {
  3896. return SuperMap.RequestTimeout = timeout;
  3897. };
  3898. /**
  3899. * @function SuperMap.getRequestTimeout
  3900. * @description 获取请求超时时间。
  3901. * @returns {number} 请求超时时间。
  3902. */
  3903. var getRequestTimeout = SuperMap.getRequestTimeout = function () {
  3904. return SuperMap.RequestTimeout || 45000;
  3905. };
  3906. var FetchRequest = SuperMap.FetchRequest = {
  3907. commit: function commit(method, url, params, options) {
  3908. method = method ? method.toUpperCase() : method;
  3909. switch (method) {
  3910. case 'GET':
  3911. return this.get(url, params, options);
  3912. case 'POST':
  3913. return this.post(url, params, options);
  3914. case 'PUT':
  3915. return this.put(url, params, options);
  3916. case 'DELETE':
  3917. return this["delete"](url, params, options);
  3918. default:
  3919. return this.get(url, params, options);
  3920. }
  3921. },
  3922. supportDirectRequest: function supportDirectRequest(url, options) {
  3923. if (Util.isInTheSameDomain(url)) {
  3924. return true;
  3925. }
  3926. if (options.crossOrigin != undefined) {
  3927. return options.crossOrigin;
  3928. } else {
  3929. return isCORS() || options.proxy;
  3930. }
  3931. },
  3932. get: function get(url, params, options) {
  3933. options = options || {};
  3934. var type = 'GET';
  3935. url = Util.urlAppend(url, this._getParameterString(params || {}));
  3936. url = this._processUrl(url, options);
  3937. if (!this.supportDirectRequest(url, options)) {
  3938. url = url.replace('.json', '.jsonp');
  3939. var config = {
  3940. url: url,
  3941. data: params
  3942. };
  3943. return SuperMap.Util.RequestJSONPPromise.GET(config);
  3944. }
  3945. if (!this.urlIsLong(url)) {
  3946. return this._fetch(url, params, options, type);
  3947. } else {
  3948. return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
  3949. }
  3950. },
  3951. "delete": function _delete(url, params, options) {
  3952. options = options || {};
  3953. var type = 'DELETE';
  3954. url = Util.urlAppend(url, this._getParameterString(params || {}));
  3955. url = this._processUrl(url, options);
  3956. if (!this.supportDirectRequest(url, options)) {
  3957. url = url.replace('.json', '.jsonp');
  3958. var config = {
  3959. url: url += "&_method=DELETE",
  3960. data: params
  3961. };
  3962. return SuperMap.Util.RequestJSONPPromise.DELETE(config);
  3963. }
  3964. if (this.urlIsLong(url)) {
  3965. return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
  3966. }
  3967. return this._fetch(url, params, options, type);
  3968. },
  3969. post: function post(url, params, options) {
  3970. options = options || {};
  3971. if (!this.supportDirectRequest(url, options)) {
  3972. url = url.replace('.json', '.jsonp');
  3973. var config = {
  3974. url: url += "&_method=POST",
  3975. data: params
  3976. };
  3977. return SuperMap.Util.RequestJSONPPromise.POST(config);
  3978. }
  3979. return this._fetch(this._processUrl(url, options), params, options, 'POST');
  3980. },
  3981. put: function put(url, params, options) {
  3982. options = options || {};
  3983. url = this._processUrl(url, options);
  3984. if (!this.supportDirectRequest(url, options)) {
  3985. url = url.replace('.json', '.jsonp');
  3986. var config = {
  3987. url: url += "&_method=PUT",
  3988. data: params
  3989. };
  3990. return SuperMap.Util.RequestJSONPPromise.PUT(config);
  3991. }
  3992. return this._fetch(url, params, options, 'PUT');
  3993. },
  3994. urlIsLong: function urlIsLong(url) {
  3995. //当前url的字节长度。
  3996. var totalLength = 0,
  3997. charCode = null;
  3998. for (var i = 0, len = url.length; i < len; i++) {
  3999. //转化为Unicode编码
  4000. charCode = url.charCodeAt(i);
  4001. if (charCode < 0x007f) {
  4002. totalLength++;
  4003. } else if (0x0080 <= charCode && charCode <= 0x07ff) {
  4004. totalLength += 2;
  4005. } else if (0x0800 <= charCode && charCode <= 0xffff) {
  4006. totalLength += 3;
  4007. }
  4008. }
  4009. return totalLength < 2000 ? false : true;
  4010. },
  4011. _postSimulatie: function _postSimulatie(type, url, params, options) {
  4012. var separator = url.indexOf('?') > -1 ? '&' : '?';
  4013. url += separator + '_method=' + type;
  4014. if (typeof params !== 'string') {
  4015. params = JSON.stringify(params);
  4016. }
  4017. return this.post(url, params, options);
  4018. },
  4019. _processUrl: function _processUrl(url, options) {
  4020. if (this._isMVTRequest(url)) {
  4021. return url;
  4022. }
  4023. if (url.indexOf('.json') === -1 && !options.withoutFormatSuffix) {
  4024. if (url.indexOf('?') < 0) {
  4025. url += '.json';
  4026. } else {
  4027. var urlArrays = url.split('?');
  4028. if (urlArrays.length === 2) {
  4029. url = urlArrays[0] + '.json?' + urlArrays[1];
  4030. }
  4031. }
  4032. }
  4033. if (options && options.proxy) {
  4034. if (typeof options.proxy === 'function') {
  4035. url = options.proxy(url);
  4036. } else {
  4037. url = decodeURIComponent(url);
  4038. url = options.proxy + encodeURIComponent(url);
  4039. }
  4040. }
  4041. return url;
  4042. },
  4043. _fetch: function _fetch(url, params, options, type) {
  4044. options = options || {};
  4045. options.headers = options.headers || {};
  4046. if (!options.headers['Content-Type']) {
  4047. options.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
  4048. }
  4049. if (options.timeout) {
  4050. return this._timeout(options.timeout, FetchRequest_fetch(url, {
  4051. method: type,
  4052. headers: options.headers,
  4053. body: type === 'PUT' || type === 'POST' ? params : undefined,
  4054. credentials: this._getWithCredentials(options),
  4055. mode: 'cors',
  4056. timeout: getRequestTimeout()
  4057. }).then(function (response) {
  4058. return response;
  4059. }));
  4060. }
  4061. return FetchRequest_fetch(url, {
  4062. method: type,
  4063. body: type === 'PUT' || type === 'POST' ? params : undefined,
  4064. headers: options.headers,
  4065. credentials: this._getWithCredentials(options),
  4066. mode: 'cors',
  4067. timeout: getRequestTimeout()
  4068. }).then(function (response) {
  4069. return response;
  4070. });
  4071. },
  4072. _getWithCredentials: function _getWithCredentials(options) {
  4073. if (options.withCredentials === true) {
  4074. return 'include';
  4075. }
  4076. if (options.withCredentials === false) {
  4077. return 'omit';
  4078. }
  4079. return 'same-origin';
  4080. },
  4081. _fetchJsonp: function _fetchJsonp(url, options) {
  4082. options = options || {};
  4083. return fetch_jsonp_default()(url, {
  4084. method: 'GET',
  4085. timeout: options.timeout
  4086. }).then(function (response) {
  4087. return response;
  4088. });
  4089. },
  4090. _timeout: function _timeout(seconds, promise) {
  4091. return new Promise(function (resolve, reject) {
  4092. setTimeout(function () {
  4093. reject(new Error('timeout'));
  4094. }, seconds);
  4095. promise.then(resolve, reject);
  4096. });
  4097. },
  4098. _getParameterString: function _getParameterString(params) {
  4099. var paramsArray = [];
  4100. for (var key in params) {
  4101. var value = params[key];
  4102. if (value != null && typeof value !== 'function') {
  4103. var encodedValue;
  4104. if (Array.isArray(value) || value.toString() === '[object Object]') {
  4105. encodedValue = encodeURIComponent(JSON.stringify(value));
  4106. } else {
  4107. encodedValue = encodeURIComponent(value);
  4108. }
  4109. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  4110. }
  4111. }
  4112. return paramsArray.join('&');
  4113. },
  4114. _isMVTRequest: function _isMVTRequest(url) {
  4115. return url.indexOf('.mvt') > -1 || url.indexOf('.pbf') > -1;
  4116. }
  4117. };
  4118. SuperMap.Util.RequestJSONPPromise = {
  4119. limitLength: 1500,
  4120. queryKeys: [],
  4121. queryValues: [],
  4122. supermap_callbacks: {},
  4123. addQueryStrings: function addQueryStrings(values) {
  4124. var me = this;
  4125. for (var key in values) {
  4126. me.queryKeys.push(key);
  4127. if (typeof values[key] !== 'string') {
  4128. values[key] = SuperMap.Util.toJSON(values[key]);
  4129. }
  4130. var tempValue = encodeURIComponent(values[key]);
  4131. me.queryValues.push(tempValue);
  4132. }
  4133. },
  4134. issue: function issue(config) {
  4135. var me = this,
  4136. uid = me.getUid(),
  4137. url = config.url,
  4138. splitQuestUrl = [];
  4139. var p = new Promise(function (resolve) {
  4140. me.supermap_callbacks[uid] = function (response) {
  4141. delete me.supermap_callbacks[uid];
  4142. resolve(response);
  4143. };
  4144. }); // me.addQueryStrings({
  4145. // callback: "SuperMap.Util.RequestJSONPPromise.supermap_callbacks[" + uid + "]"
  4146. // });
  4147. var sectionURL = url,
  4148. keysCount = 0; //此次sectionURL中有多少个key
  4149. var length = me.queryKeys ? me.queryKeys.length : 0;
  4150. for (var i = 0; i < length; i++) {
  4151. if (sectionURL.length + me.queryKeys[i].length + 2 >= me.limitLength) {
  4152. //+2 for ("&"or"?")and"="
  4153. if (keysCount == 0) {
  4154. return false;
  4155. }
  4156. splitQuestUrl.push(sectionURL);
  4157. sectionURL = url;
  4158. keysCount = 0;
  4159. i--;
  4160. } else {
  4161. if (sectionURL.length + me.queryKeys[i].length + 2 + me.queryValues[i].length > me.limitLength) {
  4162. var leftValue = me.queryValues[i];
  4163. while (leftValue.length > 0) {
  4164. var leftLength = me.limitLength - sectionURL.length - me.queryKeys[i].length - 2; //+2 for ("&"or"?")and"="
  4165. if (sectionURL.indexOf('?') > -1) {
  4166. sectionURL += '&';
  4167. } else {
  4168. sectionURL += '?';
  4169. }
  4170. var tempLeftValue = leftValue.substring(0, leftLength); //避免 截断sectionURL时,将类似于%22这样的符号截成两半,从而导致服务端组装sectionURL时发生错误
  4171. if (tempLeftValue.substring(leftLength - 1, leftLength) === '%') {
  4172. leftLength -= 1;
  4173. tempLeftValue = leftValue.substring(0, leftLength);
  4174. } else if (tempLeftValue.substring(leftLength - 2, leftLength - 1) === '%') {
  4175. leftLength -= 2;
  4176. tempLeftValue = leftValue.substring(0, leftLength);
  4177. }
  4178. sectionURL += me.queryKeys[i] + '=' + tempLeftValue;
  4179. leftValue = leftValue.substring(leftLength);
  4180. if (tempLeftValue.length > 0) {
  4181. splitQuestUrl.push(sectionURL);
  4182. sectionURL = url;
  4183. keysCount = 0;
  4184. }
  4185. }
  4186. } else {
  4187. keysCount++;
  4188. if (sectionURL.indexOf('?') > -1) {
  4189. sectionURL += '&';
  4190. } else {
  4191. sectionURL += '?';
  4192. }
  4193. sectionURL += me.queryKeys[i] + '=' + me.queryValues[i];
  4194. }
  4195. }
  4196. }
  4197. splitQuestUrl.push(sectionURL);
  4198. me.send(splitQuestUrl, 'SuperMap.Util.RequestJSONPPromise.supermap_callbacks[' + uid + ']', config && config.proxy);
  4199. return p;
  4200. },
  4201. getUid: function getUid() {
  4202. var uid = new Date().getTime(),
  4203. random = Math.floor(Math.random() * 1e17);
  4204. return uid * 1000 + random;
  4205. },
  4206. send: function send(splitQuestUrl, callback, proxy) {
  4207. var len = splitQuestUrl.length;
  4208. if (len > 0) {
  4209. var jsonpUserID = new Date().getTime();
  4210. for (var i = 0; i < len; i++) {
  4211. var url = splitQuestUrl[i];
  4212. if (url.indexOf('?') > -1) {
  4213. url += '&';
  4214. } else {
  4215. url += '?';
  4216. }
  4217. url += 'sectionCount=' + len;
  4218. url += '&sectionIndex=' + i;
  4219. url += '&jsonpUserID=' + jsonpUserID;
  4220. if (proxy) {
  4221. url = decodeURIComponent(url);
  4222. url = proxy + encodeURIComponent(url);
  4223. }
  4224. fetch_jsonp_default()(url, {
  4225. jsonpCallbackFunction: callback,
  4226. timeout: 30000
  4227. });
  4228. }
  4229. }
  4230. },
  4231. GET: function GET(config) {
  4232. var me = this;
  4233. me.queryKeys.length = 0;
  4234. me.queryValues.length = 0;
  4235. me.addQueryStrings(config.params);
  4236. return me.issue(config);
  4237. },
  4238. POST: function POST(config) {
  4239. var me = this;
  4240. me.queryKeys.length = 0;
  4241. me.queryValues.length = 0;
  4242. me.addQueryStrings({
  4243. requestEntity: config.data
  4244. });
  4245. return me.issue(config);
  4246. },
  4247. PUT: function PUT(config) {
  4248. var me = this;
  4249. me.queryKeys.length = 0;
  4250. me.queryValues.length = 0;
  4251. me.addQueryStrings({
  4252. requestEntity: config.data
  4253. });
  4254. return me.issue(config);
  4255. },
  4256. DELETE: function DELETE(config) {
  4257. var me = this;
  4258. me.queryKeys.length = 0;
  4259. me.queryValues.length = 0;
  4260. me.addQueryStrings({
  4261. requestEntity: config.data
  4262. });
  4263. return me.issue(config);
  4264. }
  4265. };
  4266. ;// CONCATENATED MODULE: ./src/common/security/SecurityManager.js
  4267. function SecurityManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4268. function SecurityManager_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  4269. function SecurityManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) SecurityManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) SecurityManager_defineProperties(Constructor, staticProps); return Constructor; }
  4270. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  4271. * This program are made available under the terms of the Apache License, Version 2.0
  4272. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  4273. /**
  4274. * @name SecurityManager
  4275. * @memberOf SuperMap
  4276. * @namespace
  4277. * @category Security
  4278. * @description 安全管理中心,提供 iServer,iPortal,Online 统一权限认证管理。
  4279. * > 使用说明:
  4280. * > 创建任何一个服务之前调用 {@link SuperMap.SecurityManager.registerToken}或
  4281. * > {@link SuperMap.SecurityManager.registerKey}注册凭据。
  4282. * > 发送请求时根据 url 或者服务 id 获取相应的 key 或者 token 并自动添加到服务地址中。
  4283. */
  4284. var SecurityManager = /*#__PURE__*/function () {
  4285. function SecurityManager() {
  4286. SecurityManager_classCallCheck(this, SecurityManager);
  4287. }
  4288. SecurityManager_createClass(SecurityManager, null, [{
  4289. key: "generateToken",
  4290. /**
  4291. * @description 从服务器获取一个token,在此之前要注册服务器信息。
  4292. * @function SuperMap.SecurityManager.generateToken
  4293. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  4294. * @param {SuperMap.TokenServiceParameter} tokenParam - token 申请参数。
  4295. * @returns {Promise} 返回包含 token 信息的 Promise 对象。
  4296. */
  4297. value: function generateToken(url, tokenParam) {
  4298. var serverInfo = this.servers[url];
  4299. if (!serverInfo) {
  4300. return;
  4301. }
  4302. return FetchRequest.post(serverInfo.tokenServiceUrl, JSON.stringify(tokenParam.toJSON())).then(function (response) {
  4303. return response.text();
  4304. });
  4305. }
  4306. /**
  4307. * @description 注册安全服务器相关信息。
  4308. * @function SuperMap.SecurityManager.registerServers
  4309. * @param {SuperMap.ServerInfo} serverInfos - 服务器信息。
  4310. */
  4311. }, {
  4312. key: "registerServers",
  4313. value: function registerServers(serverInfos) {
  4314. this.servers = this.servers || {};
  4315. if (!Util.isArray(serverInfos)) {
  4316. serverInfos = [serverInfos];
  4317. }
  4318. for (var i = 0; i < serverInfos.length; i++) {
  4319. var serverInfo = serverInfos[i];
  4320. this.servers[serverInfo.server] = serverInfo;
  4321. }
  4322. }
  4323. /**
  4324. * @description 服务请求都会自动带上这个 token。
  4325. * @function SuperMap.SecurityManager.registerToken
  4326. * @param {string} url -服务器域名+端口:如http://localhost:8090。
  4327. * @param {string} token - token
  4328. */
  4329. }, {
  4330. key: "registerToken",
  4331. value: function registerToken(url, token) {
  4332. this.tokens = this.tokens || {};
  4333. if (!url || !token) {
  4334. return;
  4335. }
  4336. var domain = this._getTokenStorageKey(url);
  4337. this.tokens[domain] = token;
  4338. }
  4339. /**
  4340. * @description 注册 key,ids 为数组(存在一个 key 对应多个服务)。
  4341. * @function SuperMap.SecurityManager.registerKey
  4342. * @param {Array} ids - 可以是服务 id 数组或者 url 地址数组或者 webAPI 类型数组。
  4343. * @param {string} key - key
  4344. */
  4345. }, {
  4346. key: "registerKey",
  4347. value: function registerKey(ids, key) {
  4348. this.keys = this.keys || {};
  4349. if (!ids || ids.length < 1 || !key) {
  4350. return;
  4351. }
  4352. ids = Util.isArray(ids) ? ids : [ids];
  4353. for (var i = 0; i < ids.length; i++) {
  4354. var id = this._getUrlRestString(ids[0]) || ids[0];
  4355. this.keys[id] = key;
  4356. }
  4357. }
  4358. /**
  4359. * @description 获取服务器信息。
  4360. * @function SuperMap.SecurityManager.getServerInfo
  4361. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  4362. * @returns {SuperMap.ServerInfo} 服务器信息。
  4363. */
  4364. }, {
  4365. key: "getServerInfo",
  4366. value: function getServerInfo(url) {
  4367. this.servers = this.servers || {};
  4368. return this.servers[url];
  4369. }
  4370. /**
  4371. * @description 根据 Url 获取token。
  4372. * @function SuperMap.SecurityManager.getToken
  4373. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  4374. * @returns {string} token
  4375. */
  4376. }, {
  4377. key: "getToken",
  4378. value: function getToken(url) {
  4379. if (!url) {
  4380. return;
  4381. }
  4382. this.tokens = this.tokens || {};
  4383. var domain = this._getTokenStorageKey(url);
  4384. return this.tokens[domain];
  4385. }
  4386. /**
  4387. * @description 根据 Url 获取 key。
  4388. * @function SuperMap.SecurityManager.getKey
  4389. * @param {string} id - id
  4390. * @returns {string} key
  4391. */
  4392. }, {
  4393. key: "getKey",
  4394. value: function getKey(id) {
  4395. this.keys = this.keys || {};
  4396. var key = this._getUrlRestString(id) || id;
  4397. return this.keys[key];
  4398. }
  4399. /**
  4400. * @description iServer 登录验证。
  4401. * @function SuperMap.SecurityManager.loginiServer
  4402. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  4403. * @param {string} username - 用户名。
  4404. * @param {string} password - 密码。
  4405. * @param {boolean} [rememberme=false] - 是否记住。
  4406. * @returns {Promise} 返回包含 iServer 登录请求结果的 Promise 对象。
  4407. */
  4408. }, {
  4409. key: "loginiServer",
  4410. value: function loginiServer(url, username, password, rememberme) {
  4411. url = Util.urlPathAppend(url, 'services/security/login');
  4412. var loginInfo = {
  4413. username: username && username.toString(),
  4414. password: password && password.toString(),
  4415. rememberme: rememberme
  4416. };
  4417. loginInfo = JSON.stringify(loginInfo);
  4418. var requestOptions = {
  4419. headers: {
  4420. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  4421. }
  4422. };
  4423. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  4424. return response.json();
  4425. });
  4426. }
  4427. /**
  4428. * @description iServer登出。
  4429. * @function SuperMap.SecurityManager.logoutiServer
  4430. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  4431. * @returns {Promise} 是否登出成功。
  4432. */
  4433. }, {
  4434. key: "logoutiServer",
  4435. value: function logoutiServer(url) {
  4436. url = Util.urlPathAppend(url, 'services/security/logout');
  4437. var requestOptions = {
  4438. headers: {
  4439. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  4440. },
  4441. withoutFormatSuffix: true
  4442. };
  4443. return FetchRequest.get(url, "", requestOptions).then(function () {
  4444. return true;
  4445. })["catch"](function () {
  4446. return false;
  4447. });
  4448. }
  4449. /**
  4450. * @description Online 登录验证。
  4451. * @function SuperMap.SecurityManager.loginOnline
  4452. * @param {string} callbackLocation - 跳转位置。
  4453. * @param {boolean} [newTab=true] - 是否新窗口打开。
  4454. */
  4455. }, {
  4456. key: "loginOnline",
  4457. value: function loginOnline(callbackLocation, newTab) {
  4458. var loginUrl = SecurityManager.SSO + "/login?service=" + callbackLocation;
  4459. this._open(loginUrl, newTab);
  4460. }
  4461. /**
  4462. * @description iPortal登录验证。
  4463. * @function SuperMap.SecurityManager.loginiPortal
  4464. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  4465. * @param {string} username - 用户名。
  4466. * @param {string} password - 密码。
  4467. * @returns {Promise} 返回包含 iPortal 登录请求结果的 Promise 对象。
  4468. */
  4469. }, {
  4470. key: "loginiPortal",
  4471. value: function loginiPortal(url, username, password) {
  4472. url = Util.urlPathAppend(url, 'web/login');
  4473. var loginInfo = {
  4474. username: username && username.toString(),
  4475. password: password && password.toString()
  4476. };
  4477. loginInfo = JSON.stringify(loginInfo);
  4478. var requestOptions = {
  4479. headers: {
  4480. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  4481. },
  4482. withCredentials: true
  4483. };
  4484. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  4485. return response.json();
  4486. });
  4487. }
  4488. /**
  4489. * @description iPortal 登出。
  4490. * @function SuperMap.SecurityManager.logoutiPortal
  4491. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  4492. * @returns {Promise} 如果登出成功,返回 true;否则返回 false。
  4493. */
  4494. }, {
  4495. key: "logoutiPortal",
  4496. value: function logoutiPortal(url) {
  4497. url = Util.urlPathAppend(url, 'services/security/logout');
  4498. var requestOptions = {
  4499. headers: {
  4500. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  4501. },
  4502. withCredentials: true,
  4503. withoutFormatSuffix: true
  4504. };
  4505. return FetchRequest.get(url, "", requestOptions).then(function () {
  4506. return true;
  4507. })["catch"](function () {
  4508. return false;
  4509. });
  4510. }
  4511. /**
  4512. * @description iManager 登录验证。
  4513. * @function SuperMap.SecurityManager.loginManager
  4514. * @param {string} url - iManager 地址。地址参数为 iManager 首页地址,如: http://localhost:8390/imanager。
  4515. * @param {Object} [loginInfoParams] - iManager 登录参数。
  4516. * @param {string} loginInfoParams.userName - 用户名。
  4517. * @param {string} loginInfoParams.password - 密码。
  4518. * @param {Object} options
  4519. * @param {boolean} [options.isNewTab=true] - 不同域时是否在新窗口打开登录页面。
  4520. * @returns {Promise} 返回包含 iManager 登录请求结果的 Promise 对象。
  4521. */
  4522. }, {
  4523. key: "loginManager",
  4524. value: function loginManager(url, loginInfoParams, options) {
  4525. if (!Util.isInTheSameDomain(url)) {
  4526. var isNewTab = options ? options.isNewTab : true;
  4527. this._open(url, isNewTab);
  4528. return;
  4529. }
  4530. var requestUrl = Util.urlPathAppend(url, 'icloud/security/tokens');
  4531. var params = loginInfoParams || {};
  4532. var loginInfo = {
  4533. username: params.userName && params.userName.toString(),
  4534. password: params.password && params.password.toString()
  4535. };
  4536. loginInfo = JSON.stringify(loginInfo);
  4537. var requestOptions = {
  4538. headers: {
  4539. 'Accept': '*/*',
  4540. 'Content-Type': 'application/json'
  4541. }
  4542. };
  4543. var me = this;
  4544. return FetchRequest.post(requestUrl, loginInfo, requestOptions).then(function (response) {
  4545. response.text().then(function (result) {
  4546. me.imanagerToken = result;
  4547. return result;
  4548. });
  4549. });
  4550. }
  4551. /**
  4552. * @description 清空全部验证信息。
  4553. * @function SuperMap.SecurityManager.destroyAllCredentials
  4554. */
  4555. }, {
  4556. key: "destroyAllCredentials",
  4557. value: function destroyAllCredentials() {
  4558. this.keys = null;
  4559. this.tokens = null;
  4560. this.servers = null;
  4561. }
  4562. /**
  4563. * @description 清空令牌信息。
  4564. * @function SuperMap.SecurityManager.destroyToken
  4565. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  4566. */
  4567. }, {
  4568. key: "destroyToken",
  4569. value: function destroyToken(url) {
  4570. if (!url) {
  4571. return;
  4572. }
  4573. var domain = this._getTokenStorageKey(url);
  4574. this.tokens = this.tokens || {};
  4575. if (this.tokens[domain]) {
  4576. delete this.tokens[domain];
  4577. }
  4578. }
  4579. /**
  4580. * @description 清空服务授权码。
  4581. * @function SuperMap.SecurityManager.destroyKey
  4582. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  4583. */
  4584. }, {
  4585. key: "destroyKey",
  4586. value: function destroyKey(url) {
  4587. if (!url) {
  4588. return;
  4589. }
  4590. this.keys = this.keys || {};
  4591. var key = this._getUrlRestString(url) || url;
  4592. if (this.keys[key]) {
  4593. delete this.keys[key];
  4594. }
  4595. }
  4596. }, {
  4597. key: "_open",
  4598. value: function _open(url, newTab) {
  4599. newTab = newTab != null ? newTab : true;
  4600. var offsetX = window.screen.availWidth / 2 - this.INNER_WINDOW_WIDTH / 2;
  4601. var offsetY = window.screen.availHeight / 2 - this.INNER_WINDOW_HEIGHT / 2;
  4602. var options = "height=" + this.INNER_WINDOW_HEIGHT + ", width=" + this.INNER_WINDOW_WIDTH + ",top=" + offsetY + ", left=" + offsetX + ",toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no";
  4603. if (newTab) {
  4604. window.open(url, 'login');
  4605. } else {
  4606. window.open(url, 'login', options);
  4607. }
  4608. }
  4609. }, {
  4610. key: "_getTokenStorageKey",
  4611. value: function _getTokenStorageKey(url) {
  4612. var patten = /(.*?):\/\/([^\/]+)/i;
  4613. var result = url.match(patten);
  4614. if (!result) {
  4615. return url;
  4616. }
  4617. return result[0];
  4618. }
  4619. }, {
  4620. key: "_getUrlRestString",
  4621. value: function _getUrlRestString(url) {
  4622. if (!url) {
  4623. return url;
  4624. } // var patten = /http:\/\/(.*\/rest)/i;
  4625. var patten = /(http|https):\/\/(.*\/rest)/i;
  4626. var result = url.match(patten);
  4627. if (!result) {
  4628. return url;
  4629. }
  4630. return result[0];
  4631. }
  4632. }]);
  4633. return SecurityManager;
  4634. }();
  4635. SecurityManager.INNER_WINDOW_WIDTH = 600;
  4636. SecurityManager.INNER_WINDOW_HEIGHT = 600;
  4637. SecurityManager.SSO = "https://sso.supermap.com";
  4638. SecurityManager.ONLINE = "https://www.supermapol.com";
  4639. SuperMap.SecurityManager = SecurityManager;
  4640. ;// CONCATENATED MODULE: ./src/common/REST.js
  4641. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  4642. * This program are made available under the terms of the Apache License, Version 2.0
  4643. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  4644. /**
  4645. * @enum DataFormat
  4646. * @memberOf SuperMap
  4647. * @description 服务请求返回结果数据类型
  4648. * @type {string}
  4649. */
  4650. var DataFormat = SuperMap.DataFormat = {
  4651. /** GEOJSON */
  4652. GEOJSON: "GEOJSON",
  4653. /** ISERVER */
  4654. ISERVER: "ISERVER"
  4655. };
  4656. /**
  4657. * @enum ServerType
  4658. * @memberOf SuperMap
  4659. * @description 服务器类型
  4660. * @type {string}
  4661. */
  4662. var ServerType = SuperMap.ServerType = {
  4663. /** ISERVER */
  4664. ISERVER: "ISERVER",
  4665. /** IPORTAL */
  4666. IPORTAL: "IPORTAL",
  4667. /** ONLINE */
  4668. ONLINE: "ONLINE"
  4669. };
  4670. /**
  4671. * @enum GeometryType
  4672. * @memberOf SuperMap
  4673. * @description 几何对象枚举,定义了一系列几何对象类型。
  4674. * @type {string}
  4675. */
  4676. var GeometryType = SuperMap.GeometryType = {
  4677. /** LINE */
  4678. LINE: "LINE",
  4679. /** LINEM */
  4680. LINEM: "LINEM",
  4681. /** POINT */
  4682. POINT: "POINT",
  4683. /** REGION */
  4684. REGION: "REGION",
  4685. /** POINTEPS */
  4686. POINTEPS: "POINTEPS",
  4687. /** LINEEPS */
  4688. LINEEPS: "LINEEPS",
  4689. /** REGIONEPS */
  4690. REGIONEPS: "REGIONEPS",
  4691. /** ELLIPSE */
  4692. ELLIPSE: "ELLIPSE",
  4693. /** CIRCLE */
  4694. CIRCLE: "CIRCLE",
  4695. /** TEXT */
  4696. TEXT: "TEXT",
  4697. /** RECTANGLE */
  4698. RECTANGLE: "RECTANGLE",
  4699. /** UNKNOWN */
  4700. UNKNOWN: "UNKNOWN",
  4701. /** GEOCOMPOUND */
  4702. GEOCOMPOUND: "GEOCOMPOUND"
  4703. };
  4704. /**
  4705. * @enum QueryOption
  4706. * @memberOf SuperMap
  4707. * @description 查询结果类型枚举,描述查询结果返回类型,包括只返回属性、只返回几何实体以及返回属性和几何实体。
  4708. * @type {string}
  4709. */
  4710. var QueryOption = SuperMap.QueryOption = {
  4711. /** 属性 */
  4712. ATTRIBUTE: "ATTRIBUTE",
  4713. /** 属性和几何对象 */
  4714. ATTRIBUTEANDGEOMETRY: "ATTRIBUTEANDGEOMETRY",
  4715. /** 几何对象 */
  4716. GEOMETRY: "GEOMETRY"
  4717. };
  4718. /**
  4719. * @enum JoinType
  4720. * @memberOf SuperMap
  4721. * @description 关联查询时的关联类型常量。
  4722. * 该类定义了两个表之间的连接类型常量,决定了对两个表之间进行连接查询时,查询结果中得到的记录的情况。
  4723. * @type {string}
  4724. */
  4725. var JoinType = SuperMap.JoinType = {
  4726. /** INNERJOIN */
  4727. INNERJOIN: "INNERJOIN",
  4728. /** LEFTJOIN */
  4729. LEFTJOIN: "LEFTJOIN"
  4730. };
  4731. /**
  4732. * @enum SpatialQueryMode
  4733. * @memberOf SuperMap
  4734. * @description 空间查询模式枚举。该类定义了空间查询操作模式常量。
  4735. * @type {string}
  4736. */
  4737. var SpatialQueryMode = SuperMap.SpatialQueryMode = {
  4738. /** 包含空间查询模式 */
  4739. CONTAIN: "CONTAIN",
  4740. /** 交叉空间查询模式 */
  4741. CROSS: "CROSS",
  4742. /** 分离空间查询模式 */
  4743. DISJOINT: "DISJOINT",
  4744. /** 重合空间查询模式 */
  4745. IDENTITY: "IDENTITY",
  4746. /** 相交空间查询模式 */
  4747. INTERSECT: "INTERSECT",
  4748. /** 无空间查询 */
  4749. NONE: "NONE",
  4750. /** 叠加空间查询模式 */
  4751. OVERLAP: "OVERLAP",
  4752. /** 邻接空间查询模式 */
  4753. TOUCH: "TOUCH",
  4754. /** 被包含空间查询模式 */
  4755. WITHIN: "WITHIN"
  4756. };
  4757. /**
  4758. * @enum SpatialRelationType
  4759. * @memberOf SuperMap
  4760. * @description 数据集对象间的空间关系枚举。
  4761. * 该类定义了数据集对象间的空间关系类型常量。
  4762. * @type {string}
  4763. */
  4764. var SpatialRelationType = SuperMap.SpatialRelationType = {
  4765. /** 包含关系 */
  4766. CONTAIN: "CONTAIN",
  4767. /** 相交关系 */
  4768. INTERSECT: "INTERSECT",
  4769. /** 被包含关系 */
  4770. WITHIN: "WITHIN"
  4771. };
  4772. /**
  4773. * @enum MeasureMode
  4774. * @memberOf SuperMap
  4775. * @type {string}
  4776. * @description 量算模式枚举。
  4777. * 该类定义了两种测量模式:距离测量和面积测量。
  4778. */
  4779. var MeasureMode = SuperMap.MeasureMode = {
  4780. /** 距离测量 */
  4781. DISTANCE: "DISTANCE",
  4782. /** 面积测量 */
  4783. AREA: "AREA"
  4784. };
  4785. /**
  4786. * @enum Unit
  4787. * @memberOf SuperMap
  4788. * @description 距离单位枚举。
  4789. * 该类定义了一系列距离单位类型。
  4790. * @type {string}
  4791. */
  4792. var Unit = SuperMap.Unit = {
  4793. /** 米 */
  4794. METER: "METER",
  4795. /** 千米 */
  4796. KILOMETER: "KILOMETER",
  4797. /** 英里 */
  4798. MILE: "MILE",
  4799. /** 码 */
  4800. YARD: "YARD",
  4801. /** 度 */
  4802. DEGREE: "DEGREE",
  4803. /** 毫米 */
  4804. MILLIMETER: "MILLIMETER",
  4805. /** 厘米 */
  4806. CENTIMETER: "CENTIMETER",
  4807. /** 英寸 */
  4808. INCH: "INCH",
  4809. /** 分米 */
  4810. DECIMETER: "DECIMETER",
  4811. /** 英尺 */
  4812. FOOT: "FOOT",
  4813. /** 秒 */
  4814. SECOND: "SECOND",
  4815. /** 分 */
  4816. MINUTE: "MINUTE",
  4817. /** 弧度 */
  4818. RADIAN: "RADIAN"
  4819. };
  4820. /**
  4821. * @enum BufferRadiusUnit
  4822. * @memberOf SuperMap
  4823. * @description 缓冲区距离单位枚举。
  4824. * 该类定义了一系列缓冲距离单位类型。
  4825. * @type {string}
  4826. */
  4827. var BufferRadiusUnit = SuperMap.BufferRadiusUnit = {
  4828. /** 厘米 */
  4829. CENTIMETER: "CENTIMETER",
  4830. /** 分米 */
  4831. DECIMETER: "DECIMETER",
  4832. /** 英尺 */
  4833. FOOT: "FOOT",
  4834. /** 英寸 */
  4835. INCH: "INCH",
  4836. /** 千米 */
  4837. KILOMETER: "KILOMETER",
  4838. /** 米 */
  4839. METER: "METER",
  4840. /** 英里 */
  4841. MILE: "MILE",
  4842. /** 毫米 */
  4843. MILLIMETER: "MILLIMETER",
  4844. /** 码 */
  4845. YARD: "YARD"
  4846. };
  4847. /**
  4848. * @enum EngineType
  4849. * @memberOf SuperMap
  4850. * @description 数据源引擎类型枚举。
  4851. * @type {string}
  4852. */
  4853. var EngineType = SuperMap.EngineType = {
  4854. /** 影像只读引擎类型,文件引擎,针对通用影像格式如 BMP,JPG,TIFF 以及超图自定义影像格式 SIT 等。 */
  4855. IMAGEPLUGINS: "IMAGEPLUGINS",
  4856. /** OGC 引擎类型,针对于 Web 数据源,Web 引擎,目前支持的类型有 WMS,WFS,WCS。 */
  4857. OGC: "OGC",
  4858. /** Oracle 引擎类型,针对 Oracle 数据源,数据库引擎。 */
  4859. ORACLEPLUS: "ORACLEPLUS",
  4860. /** SDB 引擎类型,文件引擎,即 SDB 数据源。 */
  4861. SDBPLUS: "SDBPLUS",
  4862. /** SQL Server 引擎类型,针对 SQL Server 数据源,数据库引擎 */
  4863. SQLPLUS: "SQLPLUS",
  4864. /** UDB 引擎类型,文件引擎。 */
  4865. UDB: "UDB"
  4866. };
  4867. /**
  4868. * @enum ThemeGraphTextFormat
  4869. * @memberOf SuperMap
  4870. * @description 统计专题图文本显示格式枚举。
  4871. * @type {string}
  4872. */
  4873. var ThemeGraphTextFormat = SuperMap.ThemeGraphTextFormat = {
  4874. /** 标题。以各子项的标题来进行标注。 */
  4875. CAPTION: "CAPTION",
  4876. /** 标题 + 百分数。以各子项的标题和所占的百分比来进行标注。 */
  4877. CAPTION_PERCENT: "CAPTION_PERCENT",
  4878. /** 标题 + 实际数值。以各子项的标题和真实数值来进行标注。 */
  4879. CAPTION_VALUE: "CAPTION_VALUE",
  4880. /** 百分数。以各子项所占的百分比来进行标注。 */
  4881. PERCENT: "PERCENT",
  4882. /** 实际数值。以各子项的真实数值来进行标注。 */
  4883. VALUE: "VALUE"
  4884. };
  4885. /**
  4886. * @enum ThemeGraphType
  4887. * @memberOf SuperMap
  4888. * @description 统计专题图类型枚举。
  4889. * @type {string}
  4890. */
  4891. var ThemeGraphType = SuperMap.ThemeGraphType = {
  4892. /** 面积图。 */
  4893. AREA: "AREA",
  4894. /** 柱状图。 */
  4895. BAR: "BAR",
  4896. /** 三维柱状图。 */
  4897. BAR3D: "BAR3D",
  4898. /** 折线图。 */
  4899. LINE: "LINE",
  4900. /** 饼图。 */
  4901. PIE: "PIE",
  4902. /** 三维饼图。 */
  4903. PIE3D: "PIE3D",
  4904. /** 点状图。 */
  4905. POINT: "POINT",
  4906. /** 环状图。 */
  4907. RING: "RING",
  4908. /** 玫瑰图。 */
  4909. ROSE: "ROSE",
  4910. /** 三维玫瑰图。 */
  4911. ROSE3D: "ROSE3D",
  4912. /** 堆叠柱状图。 */
  4913. STACK_BAR: "STACK_BAR",
  4914. /** 三维堆叠柱状图。 */
  4915. STACK_BAR3D: "STACK_BAR3D",
  4916. /** 阶梯图。 */
  4917. STEP: "STEP"
  4918. };
  4919. /**
  4920. * @enum GraphAxesTextDisplayMode
  4921. * @memberOf SuperMap
  4922. * @description 统计专题图坐标轴文本显示模式。
  4923. * @type {string}
  4924. */
  4925. var GraphAxesTextDisplayMode = SuperMap.GraphAxesTextDisplayMode = {
  4926. /** 显示全部文本。 */
  4927. ALL: "ALL",
  4928. /** 不显示。 */
  4929. NONE: "NONE",
  4930. /** 显示Y轴的文本。 */
  4931. YAXES: "YAXES"
  4932. };
  4933. /**
  4934. * @enum GraduatedMode
  4935. * @memberOf SuperMap
  4936. * @description 专题图分级模式枚举。
  4937. *
  4938. * @type {string}
  4939. */
  4940. var GraduatedMode = SuperMap.GraduatedMode = {
  4941. /** 常量分级模式。 */
  4942. CONSTANT: "CONSTANT",
  4943. /** 对数分级模式。 */
  4944. LOGARITHM: "LOGARITHM",
  4945. /** 平方根分级模式。 */
  4946. SQUAREROOT: "SQUAREROOT"
  4947. };
  4948. /**
  4949. * @enum RangeMode
  4950. * @memberOf SuperMap
  4951. * @description 范围分段专题图分段方式枚举。
  4952. * @type {string}
  4953. */
  4954. var RangeMode = SuperMap.RangeMode = {
  4955. /** 自定义分段法。 */
  4956. CUSTOMINTERVAL: "CUSTOMINTERVAL",
  4957. /** 等距离分段法。 */
  4958. EQUALINTERVAL: "EQUALINTERVAL",
  4959. /** 对数分段法。 */
  4960. LOGARITHM: "LOGARITHM",
  4961. /** 等计数分段法。 */
  4962. QUANTILE: "QUANTILE",
  4963. /** 平方根分段法。 */
  4964. SQUAREROOT: "SQUAREROOT",
  4965. /** 标准差分段法。 */
  4966. STDDEVIATION: "STDDEVIATION"
  4967. };
  4968. /**
  4969. * @enum ThemeType
  4970. * @memberOf SuperMap
  4971. * @description 专题图类型枚举。
  4972. * @type {string}
  4973. */
  4974. var ThemeType = SuperMap.ThemeType = {
  4975. /** 点密度专题图。 */
  4976. DOTDENSITY: "DOTDENSITY",
  4977. /** 等级符号专题图。 */
  4978. GRADUATEDSYMBOL: "GRADUATEDSYMBOL",
  4979. /** 统计专题图。 */
  4980. GRAPH: "GRAPH",
  4981. /** 标签专题图。 */
  4982. LABEL: "LABEL",
  4983. /** 分段专题图。 */
  4984. RANGE: "RANGE",
  4985. /** 単值专题图。 */
  4986. UNIQUE: "UNIQUE"
  4987. };
  4988. /**
  4989. * @enum ColorGradientType
  4990. * @memberOf SuperMap
  4991. * @description 渐变颜色枚举。
  4992. * @type {string}
  4993. */
  4994. var ColorGradientType = SuperMap.ColorGradientType = {
  4995. /** 黑白渐变色。 */
  4996. BLACK_WHITE: "BLACKWHITE",
  4997. /** 蓝黑渐变色。 */
  4998. BLUE_BLACK: "BLUEBLACK",
  4999. /** 蓝红渐变色。 */
  5000. BLUE_RED: "BLUERED",
  5001. /** 蓝白渐变色。 */
  5002. BLUE_WHITE: "BLUEWHITE",
  5003. /** 青黑渐变色。 */
  5004. CYAN_BLACK: "CYANBLACK",
  5005. /** 青蓝渐变色。 */
  5006. CYAN_BLUE: "CYANBLUE",
  5007. /** 青绿渐变色。 */
  5008. CYAN_GREEN: "CYANGREEN",
  5009. /** 青白渐变色。 */
  5010. CYAN_WHITE: "CYANWHITE",
  5011. /** 绿黑渐变色。 */
  5012. GREEN_BLACK: "GREENBLACK",
  5013. /** 绿蓝渐变色。 */
  5014. GREEN_BLUE: "GREENBLUE",
  5015. /** 绿橙紫渐变色。 */
  5016. GREEN_ORANGE_VIOLET: "GREENORANGEVIOLET",
  5017. /** 绿红渐变色。 */
  5018. GREEN_RED: "GREENRED",
  5019. /** 蓝红渐变色。 */
  5020. GREEN_WHITE: "GREENWHITE",
  5021. /** 粉黑渐变色。 */
  5022. PINK_BLACK: "PINKBLACK",
  5023. /** 粉蓝渐变色。 */
  5024. PINK_BLUE: "PINKBLUE",
  5025. /** 粉红渐变色。 */
  5026. PINK_RED: "PINKRED",
  5027. /** 粉白渐变色。 */
  5028. PINK_WHITE: "PINKWHITE",
  5029. /** 彩虹色。 */
  5030. RAIN_BOW: "RAINBOW",
  5031. /** 红黑渐变色。 */
  5032. RED_BLACK: "REDBLACK",
  5033. /** 红白渐变色。 */
  5034. RED_WHITE: "REDWHITE",
  5035. /** 光谱渐变。 */
  5036. SPECTRUM: "SPECTRUM",
  5037. /** 地形渐变,用于三维显示效果较好。 */
  5038. TERRAIN: "TERRAIN",
  5039. /** 黄黑渐变色。 */
  5040. YELLOW_BLACK: "YELLOWBLACK",
  5041. /** 黄蓝渐变色。 */
  5042. YELLOW_BLUE: "YELLOWBLUE",
  5043. /** 黄绿渐变色。 */
  5044. YELLOW_GREEN: "YELLOWGREEN",
  5045. /** 黄红渐变色。 */
  5046. YELLOW_RED: "YELLOWRED",
  5047. /** 黄白渐变色。 */
  5048. YELLOW_WHITE: "YELLOWWHITE"
  5049. };
  5050. /**
  5051. * @enum TextAlignment
  5052. * @memberOf SuperMap
  5053. * @description 文本对齐枚举。
  5054. * @type {string}
  5055. */
  5056. var TextAlignment = SuperMap.TextAlignment = {
  5057. /** 左上角对齐。 */
  5058. TOPLEFT: "TOPLEFT",
  5059. /** 顶部居中对齐。 */
  5060. TOPCENTER: "TOPCENTER",
  5061. /** 右上角对齐。 */
  5062. TOPRIGHT: "TOPRIGHT",
  5063. /** 基准线左对齐。 */
  5064. BASELINELEFT: "BASELINELEFT",
  5065. /** 基准线居中对齐。 */
  5066. BASELINECENTER: "BASELINECENTER",
  5067. /** 基准线右对齐。 */
  5068. BASELINERIGHT: "BASELINERIGHT",
  5069. /** 左下角对齐。 */
  5070. BOTTOMLEFT: "BOTTOMLEFT",
  5071. /** 底部居中对齐。 */
  5072. BOTTOMCENTER: "BOTTOMCENTER",
  5073. /** 右下角对齐。 */
  5074. BOTTOMRIGHT: "BOTTOMRIGHT",
  5075. /** 左中对齐。 */
  5076. MIDDLELEFT: "MIDDLELEFT",
  5077. /** 中心对齐。 */
  5078. MIDDLECENTER: "MIDDLECENTER",
  5079. /** 右中对齐。 */
  5080. MIDDLERIGHT: "MIDDLERIGHT"
  5081. };
  5082. /**
  5083. * @enum FillGradientMode
  5084. * @memberOf SuperMap
  5085. * @description 渐变填充风格的渐变类型枚举。
  5086. * @type {string}
  5087. */
  5088. var FillGradientMode = SuperMap.FillGradientMode = {
  5089. /** 无渐变。 */
  5090. NONE: "NONE",
  5091. /** 线性渐变填充。 */
  5092. LINEAR: "LINEAR",
  5093. /** 辐射渐变填充。 */
  5094. RADIAL: "RADIAL",
  5095. /** 圆锥渐变填充。 */
  5096. CONICAL: "CONICAL",
  5097. /** 四角渐变填充。 */
  5098. SQUARE: "SQUARE"
  5099. };
  5100. /**
  5101. * @enum AlongLineDirection
  5102. * @memberOf SuperMap
  5103. * @description 标签沿线标注方向枚举。
  5104. * @type {string}
  5105. */
  5106. var AlongLineDirection = SuperMap.AlongLineDirection = {
  5107. /** 沿线的法线方向放置标签。 */
  5108. NORMAL: "ALONG_LINE_NORMAL",
  5109. /** 从下到上,从左到右放置。 */
  5110. LB_TO_RT: "LEFT_BOTTOM_TO_RIGHT_TOP",
  5111. /** 从上到下,从左到右放置。 */
  5112. LT_TO_RB: "LEFT_TOP_TO_RIGHT_BOTTOM",
  5113. /** 从下到上,从右到左放置。 */
  5114. RB_TO_LT: "RIGHT_BOTTOM_TO_LEFT_TOP",
  5115. /** 从上到下,从右到左放置。 */
  5116. RT_TO_LB: "RIGHT_TOP_TO_LEFT_BOTTOM"
  5117. };
  5118. /**
  5119. * @enum LabelBackShape
  5120. * @memberOf SuperMap
  5121. * @description 标签专题图中标签背景的形状枚举。
  5122. * @type {string}
  5123. */
  5124. var LabelBackShape = SuperMap.LabelBackShape = {
  5125. /** 菱形背景,即标签背景的形状为菱形。 */
  5126. DIAMOND: "DIAMOND",
  5127. /** 椭圆形背景,即标签背景的行状为椭圆形。 */
  5128. ELLIPSE: "ELLIPSE",
  5129. /** 符号背景,即标签背景的形状为设定的符号。 */
  5130. MARKER: "MARKER",
  5131. /** 空背景,即不使用任何形状作为标签的背景。 */
  5132. NONE: "NONE",
  5133. /** 矩形背景,即标签背景的形状为矩形。 */
  5134. RECT: "RECT",
  5135. /** 圆角矩形背景,即标签背景的形状为圆角矩形。 */
  5136. ROUNDRECT: "ROUNDRECT",
  5137. /** 三角形背景,即标签背景的形状为三角形。 */
  5138. TRIANGLE: "TRIANGLE"
  5139. };
  5140. /**
  5141. * @enum LabelOverLengthMode
  5142. * @memberOf SuperMap
  5143. * @description 标签专题图中超长标签的处理模式枚举。
  5144. * @type {string}
  5145. */
  5146. var LabelOverLengthMode = SuperMap.LabelOverLengthMode = {
  5147. /** 换行显示。 */
  5148. NEWLINE: "NEWLINE",
  5149. /** 对超长标签不进行处理。 */
  5150. NONE: "NONE",
  5151. /** 省略超出部分。 */
  5152. OMIT: "OMIT"
  5153. };
  5154. /**
  5155. * @enum DirectionType
  5156. * @memberOf SuperMap
  5157. * @description 网络分析中方向枚举。
  5158. * 在行驶引导子项中使用。
  5159. * @type {string}
  5160. */
  5161. var DirectionType = SuperMap.DirectionType = {
  5162. /** 东。 */
  5163. EAST: "EAST",
  5164. /** 无方向。 */
  5165. NONE: "NONE",
  5166. /** 北。 */
  5167. NORTH: "NORTH",
  5168. /** 南。 */
  5169. SOURTH: "SOURTH",
  5170. /** 西。 */
  5171. WEST: "WEST"
  5172. };
  5173. /**
  5174. * @enum SideType
  5175. * @memberOf SuperMap
  5176. * @description 行驶位置枚举。
  5177. * 表示在行驶在路的左边、右边或者路上的枚举,该类用在行驶导引子项类中。
  5178. * @type {string}
  5179. */
  5180. var SideType = SuperMap.SideType = {
  5181. /** 路的左侧。 */
  5182. LEFT: "LEFT",
  5183. /** 在路上(即路的中间)。 */
  5184. MIDDLE: "MIDDLE",
  5185. /** 无效值。 */
  5186. NONE: "NONE",
  5187. /** 路的右侧。 */
  5188. RIGHT: "RIGHT"
  5189. };
  5190. /**
  5191. * @enum SupplyCenterType
  5192. * @memberOf SuperMap
  5193. * @description 资源供给中心类型枚举。
  5194. * 该枚举定义了网络分析中资源中心点的类型,主要用于资源分配和选址分区。
  5195. * 资源供给中心点的类型包括非中心,固定中心和可选中心。固定中心用于资源分配分析; 固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  5196. * @type {string}
  5197. */
  5198. var SupplyCenterType = SuperMap.SupplyCenterType = {
  5199. /** 固定中心点。 */
  5200. FIXEDCENTER: "FIXEDCENTER",
  5201. /** 非中心点。 */
  5202. NULL: "NULL",
  5203. /** 可选中心点。 */
  5204. OPTIONALCENTER: "OPTIONALCENTER"
  5205. };
  5206. /**
  5207. * @enum TurnType
  5208. * @memberOf SuperMap
  5209. * @description 转弯方向枚举。
  5210. * 用在行驶引导子项类中,表示转弯的方向。
  5211. * @type {string}
  5212. */
  5213. var TurnType = SuperMap.TurnType = {
  5214. /** 向前直行。 */
  5215. AHEAD: "AHEAD",
  5216. /** 掉头。 */
  5217. BACK: "BACK",
  5218. /** 终点,不拐弯。 */
  5219. END: "END",
  5220. /** 左转弯。 */
  5221. LEFT: "LEFT",
  5222. /** 无效值。 */
  5223. NONE: "NONE",
  5224. /** 右转弯。 */
  5225. RIGHT: "RIGHT"
  5226. };
  5227. /**
  5228. * @enum BufferEndType
  5229. * @memberOf SuperMap
  5230. * @description 缓冲区分析BufferEnd类型。
  5231. * @type {string}
  5232. */
  5233. var BufferEndType = SuperMap.BufferEndType = {
  5234. /** FLAT */
  5235. FLAT: "FLAT",
  5236. /** ROUND */
  5237. ROUND: "ROUND"
  5238. };
  5239. /**
  5240. * @enum OverlayOperationType
  5241. * @memberOf SuperMap
  5242. * @description 叠加分析类型枚举。
  5243. * @type {string}
  5244. */
  5245. var OverlayOperationType = SuperMap.OverlayOperationType = {
  5246. /** 操作数据集(几何对象)裁剪被操作数据集(几何对象)。 */
  5247. CLIP: "CLIP",
  5248. /** 在被操作数据集(几何对象)上擦除掉与操作数据集(几何对象)相重合的部分。 */
  5249. ERASE: "ERASE",
  5250. /**对被操作数据集(几何对象)进行同一操作,即操作执行后,被操作数据集(几何对象)包含来自操作数据集(几何对象)的几何形状。 */
  5251. IDENTITY: "IDENTITY",
  5252. /** 对两个数据集(几何对象)求交,返回两个数据集(几何对象)的交集。 */
  5253. INTERSECT: "INTERSECT",
  5254. /** 对两个面数据集(几何对象)进行合并操作。 */
  5255. UNION: "UNION",
  5256. /** 对两个面数据集(几何对象)进行更新操作。 */
  5257. UPDATE: "UPDATE",
  5258. /** 对两个面数据集(几何对象)进行对称差操作。 */
  5259. XOR: "XOR"
  5260. };
  5261. /**
  5262. * @enum OutputType
  5263. * @memberOf SuperMap
  5264. * @description 分布式分析输出类型枚举。
  5265. * @type {string}
  5266. */
  5267. var OutputType = SuperMap.OutputType = {
  5268. /** INDEXEDHDFS */
  5269. INDEXEDHDFS: "INDEXEDHDFS",
  5270. /** UDB */
  5271. UDB: "UDB",
  5272. /** MONGODB */
  5273. MONGODB: "MONGODB",
  5274. /** PG */
  5275. PG: "PG"
  5276. };
  5277. /**
  5278. * @enum SmoothMethod
  5279. * @memberOf SuperMap
  5280. * @description 光滑方法枚举。
  5281. * 用于从Grid 或DEM数据生成等值线或等值面时对等值线或者等值面的边界线进行平滑处理的方法。
  5282. * @type {string}
  5283. */
  5284. var SmoothMethod = SuperMap.SmoothMethod = {
  5285. /** B 样条法。 */
  5286. BSPLINE: "BSPLINE",
  5287. /** 磨角法。 */
  5288. POLISH: "POLISH"
  5289. };
  5290. /**
  5291. * @enum SurfaceAnalystMethod
  5292. * @memberOf SuperMap
  5293. * @description 表面分析方法枚举。
  5294. * 通过对数据进行表面分析,能够挖掘原始数据所包含的信息,使某些细节明显化,易于分析。
  5295. * @type {string}
  5296. */
  5297. var SurfaceAnalystMethod = SuperMap.SurfaceAnalystMethod = {
  5298. /** 等值线提取。 */
  5299. ISOLINE: "ISOLINE",
  5300. /** 等值面提取。 */
  5301. ISOREGION: "ISOREGION"
  5302. };
  5303. /**
  5304. * @enum DataReturnMode
  5305. * @memberOf SuperMap
  5306. * @description 数据返回模式枚举。
  5307. * 该枚举用于指定空间分析返回结果模式,包含返回数据集标识和记录集、只返回数据集标识(数据集名称@数据源名称)及只返回记录集三种模式。
  5308. * @type {string}
  5309. */
  5310. var DataReturnMode = SuperMap.DataReturnMode = {
  5311. /** 返回结果数据集标识(数据集名称@数据源名称)和记录集(RecordSet)。 */
  5312. DATASET_AND_RECORDSET: "DATASET_AND_RECORDSET",
  5313. /** 只返回数据集标识(数据集名称@数据源名称)。 */
  5314. DATASET_ONLY: "DATASET_ONLY",
  5315. /** 只返回记录集(RecordSet)。 */
  5316. RECORDSET_ONLY: "RECORDSET_ONLY"
  5317. };
  5318. /**
  5319. * @enum EditType
  5320. * @memberOf SuperMap
  5321. * @description 要素集更新模式枚举。
  5322. * 该枚举用于指定数据服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  5323. * @type {string}
  5324. */
  5325. var EditType = SuperMap.EditType = {
  5326. /** 增加操作。 */
  5327. ADD: "add",
  5328. /** 修改操作。 */
  5329. UPDATE: "update",
  5330. /** 删除操作。 */
  5331. DELETE: "delete"
  5332. };
  5333. /**
  5334. * @enum TransferTactic
  5335. * @memberOf SuperMap
  5336. * @description 公交换乘策略枚举。
  5337. * 该枚举用于指定公交服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  5338. * @type {string}
  5339. */
  5340. var TransferTactic = SuperMap.TransferTactic = {
  5341. /** 时间短。 */
  5342. LESS_TIME: "LESS_TIME",
  5343. /** 少换乘。 */
  5344. LESS_TRANSFER: "LESS_TRANSFER",
  5345. /** 少步行。 */
  5346. LESS_WALK: "LESS_WALK",
  5347. /** 距离最短。 */
  5348. MIN_DISTANCE: "MIN_DISTANCE"
  5349. };
  5350. /**
  5351. * @enum TransferPreference
  5352. * @memberOf SuperMap
  5353. * @description 公交换乘策略枚举。
  5354. * 该枚举用于指定交通换乘服务中设置地铁优先、公交优先、不乘地铁、无偏好等偏好设置。
  5355. * @type {string}
  5356. */
  5357. var TransferPreference = SuperMap.TransferPreference = {
  5358. /** 公交汽车优先。 */
  5359. BUS: "BUS",
  5360. /** 地铁优先。 */
  5361. SUBWAY: "SUBWAY",
  5362. /** 不乘坐地铁。 */
  5363. NO_SUBWAY: "NO_SUBWAY",
  5364. /** 无乘车偏好。 */
  5365. NONE: "NONE"
  5366. };
  5367. /**
  5368. * @enum GridType
  5369. * @memberOf SuperMap
  5370. * @description 地图背景格网类型枚举。
  5371. * @type {string}
  5372. */
  5373. var GridType = SuperMap.GridType = {
  5374. /** 十字叉丝。 */
  5375. CROSS: "CROSS",
  5376. /** 网格线。 */
  5377. GRID: "GRID",
  5378. /** 点。 */
  5379. POINT: "POINT"
  5380. };
  5381. /**
  5382. * @enum ColorSpaceType
  5383. * @memberOf SuperMap
  5384. * @description 色彩空间枚举。
  5385. * 由于成色原理的不同,决定了显示器、投影仪这类靠色光直接合成颜色的颜色设备和打印机、
  5386. * 印刷机这类靠使用颜料的印刷设备在生成颜色方式上的区别。
  5387. * 针对上述不同成色方式,SuperMap 提供两种色彩空间,
  5388. * 分别为 RGB 和 CMYK。RGB 主要用于显示系统中,CMYK 主要用于印刷系统中。
  5389. * @type {string}
  5390. */
  5391. var ColorSpaceType = SuperMap.ColorSpaceType = {
  5392. /** 该类型主要在印刷系统使用。 */
  5393. CMYK: "CMYK",
  5394. /** 该类型主要在显示系统中使用。 */
  5395. RGB: "RGB"
  5396. };
  5397. /**
  5398. * @enum LayerType
  5399. * @memberOf SuperMap
  5400. * @description 图层类型。
  5401. * @type {string}
  5402. */
  5403. var LayerType = SuperMap.LayerType = {
  5404. /** SuperMap UGC 类型图层。如矢量图层、栅格(Grid)图层、影像图层。 */
  5405. UGC: "UGC",
  5406. /** WMS 图层。 */
  5407. WMS: "WMS",
  5408. /** WFS 图层。 */
  5409. WFS: "WFS",
  5410. /** 自定义图层。 */
  5411. CUSTOM: "CUSTOM"
  5412. };
  5413. /**
  5414. * @enum UGCLayerType
  5415. * @memberOf SuperMap
  5416. * @description UGC图层类型。
  5417. * @type {string}
  5418. */
  5419. var UGCLayerType = SuperMap.UGCLayerType = {
  5420. /** 专题图层。 */
  5421. THEME: "THEME",
  5422. /** 矢量图层。 */
  5423. VECTOR: "VECTOR",
  5424. /** 栅格图层。。 */
  5425. GRID: "GRID",
  5426. /** 影像图层。 */
  5427. IMAGE: "IMAGE"
  5428. };
  5429. /**
  5430. * @enum StatisticMode
  5431. * @memberOf SuperMap
  5432. * @description 字段统计方法类型。
  5433. * @type {string}
  5434. */
  5435. var StatisticMode = SuperMap.StatisticMode = {
  5436. /** 统计所选字段的平均值。 */
  5437. AVERAGE: "AVERAGE",
  5438. /** 统计所选字段的最大值。 */
  5439. MAX: "MAX",
  5440. /** 统计所选字段的最小值。 */
  5441. MIN: "MIN",
  5442. /** 统计所选字段的标准差 */
  5443. STDDEVIATION: "STDDEVIATION",
  5444. /** 统计所选字段的总和。 */
  5445. SUM: "SUM",
  5446. /** 统计所选字段的方差。 */
  5447. VARIANCE: "VARIANCE"
  5448. };
  5449. /**
  5450. * @enum PixelFormat
  5451. * @memberOf SuperMap
  5452. * @description 栅格与影像数据存储的像素格式枚举。
  5453. * @type {string}
  5454. */
  5455. var PixelFormat = SuperMap.PixelFormat = {
  5456. /** 每个像元用16个比特(即2个字节)表示。 */
  5457. BIT16: "BIT16",
  5458. /** 每个像元用32个比特(即4个字节)表示。 */
  5459. BIT32: "BIT32",
  5460. /** 每个像元用64个比特(即8个字节)表示,只提供给栅格数据集使用。 */
  5461. BIT64: "BIT64",
  5462. /** 每个像元用4个字节来表示,只提供给栅格数据集使用。 */
  5463. SINGLE: "SINGLE",
  5464. /** 每个像元用8个字节来表示,只提供给栅格数据集使用。 */
  5465. DOUBLE: "DOUBLE",
  5466. /** 每个像元用1个比特表示。 */
  5467. UBIT1: "UBIT1",
  5468. /** 每个像元用4个比特来表示。 */
  5469. UBIT4: "UBIT4",
  5470. /** 每个像元用8个比特(即1个字节)来表示。 */
  5471. UBIT8: "UBIT8",
  5472. /** 每个像元用24个比特(即3个字节)来表示。 */
  5473. UBIT24: "UBIT24",
  5474. /** 每个像元用32个比特(即4个字节)来表示。 */
  5475. UBIT32: "UBIT32"
  5476. };
  5477. /**
  5478. * @enum SearchMode
  5479. * @memberOf SuperMap
  5480. * @description 内插时使用的样本点的查找方式枚举
  5481. * @type {string}
  5482. */
  5483. var SearchMode = SuperMap.SearchMode = {
  5484. /** 使用 KDTREE 的固定点数方式查找参与内插分析的点。 */
  5485. KDTREE_FIXED_COUNT: "KDTREE_FIXED_COUNT",
  5486. /** 使用 KDTREE 的定长方式查找参与内插分析的点。 */
  5487. KDTREE_FIXED_RADIUS: "KDTREE_FIXED_RADIUS",
  5488. /** 不进行查找,使用所有的输入点进行内插分析。 */
  5489. NONE: "NONE",
  5490. /** 使用 QUADTREE 方式查找参与内插分析的点,仅对样条(RBF)插值和普通克吕金(Kriging)有用。 */
  5491. QUADTREE: "QUADTREE"
  5492. };
  5493. /**
  5494. * @enum InterpolationAlgorithmType
  5495. * @memberOf SuperMap
  5496. * @description 插值分析的算法的类型
  5497. * @type {string}
  5498. */
  5499. var InterpolationAlgorithmType = SuperMap.InterpolationAlgorithmType = {
  5500. /** 普通克吕金插值法。 */
  5501. KRIGING: "KRIGING",
  5502. /** 简单克吕金插值法。 */
  5503. SimpleKriging: "SimpleKriging",
  5504. /** 泛克吕金插值法。 */
  5505. UniversalKriging: "UniversalKriging"
  5506. };
  5507. /**
  5508. * @enum VariogramMode
  5509. * @memberOf SuperMap
  5510. * @description 克吕金(Kriging)插值时的半变函数类型枚举
  5511. * @type {string}
  5512. */
  5513. var VariogramMode = SuperMap.VariogramMode = {
  5514. /** 指数函数。 */
  5515. EXPONENTIAL: "EXPONENTIAL",
  5516. /** 高斯函数。 */
  5517. GAUSSIAN: "GAUSSIAN",
  5518. /** 球型函数。 */
  5519. SPHERICAL: "SPHERICAL"
  5520. };
  5521. /**
  5522. * @enum Exponent
  5523. * @memberOf SuperMap
  5524. * @description 定义了泛克吕金(UniversalKriging)插值时样点数据中趋势面方程的阶数
  5525. * @type {string}
  5526. */
  5527. var Exponent = SuperMap.Exponent = {
  5528. /** 阶数为1。 */
  5529. EXP1: "EXP1",
  5530. /** 阶数为2。 */
  5531. EXP2: "EXP2"
  5532. };
  5533. /**
  5534. * @enum ClientType
  5535. * @memberOf SuperMap
  5536. * @description token申请的客户端标识类型
  5537. * @type {string}
  5538. */
  5539. var ClientType = SuperMap.ClientType = {
  5540. /** 指定的 IP 地址。 */
  5541. IP: "IP",
  5542. /** 指定的 URL。 */
  5543. REFERER: "Referer",
  5544. /** 发送申请令牌请求的客户端 IP。 */
  5545. REQUESTIP: "RequestIP",
  5546. /** 不做任何验证。 */
  5547. NONE: "NONE",
  5548. /** SERVER。 */
  5549. SERVER: "SERVER",
  5550. /** WEB。 */
  5551. WEB: "WEB"
  5552. };
  5553. /**
  5554. * @enum ChartType
  5555. * @memberOf SuperMap
  5556. * @description 客户端专题图图表类型
  5557. * @type {string}
  5558. */
  5559. var ChartType = SuperMap.ChartType = {
  5560. /** 柱状图。 */
  5561. BAR: "Bar",
  5562. /** 三维柱状图。 */
  5563. BAR3D: "Bar3D",
  5564. /** 圆形图。 */
  5565. CIRCLE: "Circle",
  5566. /** 饼图。 */
  5567. PIE: "Pie",
  5568. /** 散点图。 */
  5569. POINT: "Point",
  5570. /** 折线图。 */
  5571. LINE: "Line",
  5572. /** 环状图。 */
  5573. RING: "Ring"
  5574. };
  5575. /**
  5576. * @enum ClipAnalystMode
  5577. * @memberOf SuperMap
  5578. * @description 裁剪分析模式
  5579. * @type {string}
  5580. */
  5581. var ClipAnalystMode = SuperMap.ClipAnalystMode = {
  5582. /** CLIP。 */
  5583. CLIP: "clip",
  5584. /** INTERSECT。 */
  5585. INTERSECT: "intersect"
  5586. };
  5587. /**
  5588. * @enum AnalystAreaUnit
  5589. * @memberOf SuperMap
  5590. * @description 分布式分析面积单位
  5591. * @type {string}
  5592. */
  5593. var AnalystAreaUnit = SuperMap.AnalystAreaUnit = {
  5594. /** 平方米。 */
  5595. "SQUAREMETER": "SquareMeter",
  5596. /** 平方千米。 */
  5597. "SQUAREKILOMETER": "SquareKiloMeter",
  5598. /** 公顷。 */
  5599. "HECTARE": "Hectare",
  5600. /** 公亩。 */
  5601. "ARE": "Are",
  5602. /** 英亩。 */
  5603. "ACRE": "Acre",
  5604. /** 平方英尺。 */
  5605. "SQUAREFOOT": "SquareFoot",
  5606. /** 平方码。 */
  5607. "SQUAREYARD": "SquareYard",
  5608. /** 平方英里。 */
  5609. "SQUAREMILE": "SquareMile"
  5610. };
  5611. /**
  5612. * @enum AnalystSizeUnit
  5613. * @memberOf SuperMap
  5614. * @description 分布式分析单位
  5615. * @type {string}
  5616. */
  5617. var AnalystSizeUnit = SuperMap.AnalystSizeUnit = {
  5618. /** 米。 */
  5619. "METER": "Meter",
  5620. /** 千米。 */
  5621. "KILOMETER": "Kilometer",
  5622. /** 码。 */
  5623. "YARD": "Yard",
  5624. /** 英尺。 */
  5625. "FOOT": "Foot",
  5626. /** 英里。 */
  5627. "MILE": "Mile"
  5628. };
  5629. /**
  5630. * @enum StatisticAnalystMode
  5631. * @memberOf SuperMap
  5632. * @description 分布式分析统计模式
  5633. * @type {string}
  5634. */
  5635. var StatisticAnalystMode = SuperMap.StatisticAnalystMode = {
  5636. /** 统计所选字段的最大值。 */
  5637. "MAX": "max",
  5638. /** 统计所选字段的最小值。 */
  5639. "MIN": "min",
  5640. /** 统计所选字段的平均值。 */
  5641. "AVERAGE": "average",
  5642. /** 统计所选字段的总和。 */
  5643. "SUM": "sum",
  5644. /** 统计所选字段的方差。 */
  5645. "VARIANCE": "variance",
  5646. /** 统计所选字段的标准差 */
  5647. "STDDEVIATION": "stdDeviation"
  5648. };
  5649. /**
  5650. * @enum SummaryType
  5651. * @memberOf SuperMap
  5652. * @description 分布式分析聚合类型
  5653. * @type {string}
  5654. */
  5655. var SummaryType = SuperMap.SummaryType = {
  5656. /** 格网聚合。 */
  5657. "SUMMARYMESH": "SUMMARYMESH",
  5658. /** 多边形聚合。 */
  5659. "SUMMARYREGION": "SUMMARYREGION"
  5660. };
  5661. /**
  5662. * @enum TopologyValidatorRule
  5663. * @memberOf SuperMap
  5664. * @description 拓扑检查模式枚举。该类定义了拓扑检查操作模式常量。
  5665. * @type {string}
  5666. */
  5667. var TopologyValidatorRule = SuperMap.TopologyValidatorRule = {
  5668. /** 面内无重叠,用于对面数据进行拓扑检查。 */
  5669. REGIONNOOVERLAP: "REGIONNOOVERLAP",
  5670. /** 面与面无重叠,用于对面数据进行拓扑检查。 */
  5671. REGIONNOOVERLAPWITH: "REGIONNOOVERLAPWITH",
  5672. /** 面被面包含,用于对面数据进行拓扑检查。 */
  5673. REGIONCONTAINEDBYREGION: "REGIONCONTAINEDBYREGION",
  5674. /** 面被面覆盖,用于对面数据进行拓扑检查。 */
  5675. REGIONCOVEREDBYREGION: "REGIONCOVEREDBYREGION",
  5676. /** 线与线无重叠,用于对线数据进行拓扑检查。 */
  5677. LINENOOVERLAP: "LINENOOVERLAP",
  5678. /** 线内无重叠,用于对线数据进行拓扑检查。 */
  5679. LINENOOVERLAPWITH: "LINENOOVERLAPWITH",
  5680. /** 点不相同,用于对点数据进行拓扑检查。 */
  5681. POINTNOIDENTICAL: "POINTNOIDENTICAL"
  5682. };
  5683. /**
  5684. * @enum AggregationType
  5685. * @memberOf SuperMap
  5686. * @description 聚合查询枚举类,该类定义了Es数据服务中聚合查询模式常量
  5687. * @type {string}
  5688. */
  5689. var AggregationType = SuperMap.AggregationType = {
  5690. /** 格网聚合类型。 */
  5691. GEOHASH_GRID: "geohash_grid",
  5692. /** 过滤聚合类型。 */
  5693. FILTER: "filter"
  5694. };
  5695. /**
  5696. * @enum AggregationType
  5697. * @memberOf SuperMap
  5698. * @description 聚合查询中filter查询枚举类
  5699. * @type {string}
  5700. */
  5701. var AggregationQueryBuilderType = SuperMap.AggregationQueryBuilderType = {
  5702. /** 范围查询。 */
  5703. GEO_BOUNDING_BOX: "geo_bounding_box"
  5704. };
  5705. /**
  5706. * @enum GetFeatureMode
  5707. * @memberOf SuperMap
  5708. * @description feature 查询方式。
  5709. * @type {string}
  5710. */
  5711. var GetFeatureMode = SuperMap.GetFeatureMode = {
  5712. /** 通过范围查询来获取要素。 */
  5713. BOUNDS: "BOUNDS",
  5714. /** 通过几何对象的缓冲区来获取要素。 */
  5715. BUFFER: "BUFFER",
  5716. /** 通过 ID 来获取要素。 */
  5717. ID: "ID",
  5718. /** 通过空间查询模式来获取要素。 */
  5719. SPATIAL: "SPATIAL",
  5720. /** 通过 SQL 查询来获取要素。 */
  5721. SQL: 'SQL'
  5722. };
  5723. /**
  5724. * @enum RasterFunctionType
  5725. * @memberOf SuperMap
  5726. * @description 栅格分析方法。
  5727. * @type {string}
  5728. */
  5729. var RasterFunctionType = SuperMap.RasterFunctionType = {
  5730. /** 归一化植被指数。 */
  5731. NDVI: "NDVI",
  5732. /** 阴影面分析。 */
  5733. HILLSHADE: "HILLSHADE"
  5734. };
  5735. /**
  5736. * @enum ResourceType
  5737. * @memberOf SuperMap
  5738. * @description iportal资源类型。
  5739. * @version 10.0.1
  5740. * @type {string}
  5741. */
  5742. var ResourceType = SuperMap.ResourceType = {
  5743. /** 地图。 */
  5744. MAP: "MAP",
  5745. /** 服务。 */
  5746. SERVICE: "SERVICE",
  5747. /** 场景。 */
  5748. SCENE: "SCENE",
  5749. /** 数据。 */
  5750. DATA: "DATA",
  5751. /** 洞察。 */
  5752. INSIGHTS_WORKSPACE: "INSIGHTS_WORKSPACE",
  5753. /** 大屏。 */
  5754. MAP_DASHBOARD: "MAP_DASHBOARD"
  5755. };
  5756. /**
  5757. * @enum OrderBy
  5758. * @memberOf SuperMap
  5759. * @description iportal资源排序字段。
  5760. * @version 10.0.1
  5761. * @type {string}
  5762. */
  5763. var OrderBy = SuperMap.OrderBy = {
  5764. /** 按更新时间排序 */
  5765. UPDATETIME: "UPDATETIME",
  5766. /** 按热度(可能是访问量、下载量)排序 */
  5767. HEATLEVEL: "HEATLEVEL",
  5768. /** 按相关性排序 */
  5769. RELEVANCE: "RELEVANCE"
  5770. };
  5771. /**
  5772. * @enum OrderType
  5773. * @memberOf SuperMap
  5774. * @description iportal资源升序还是降序过滤
  5775. * @version 10.0.1
  5776. * @type {string}
  5777. */
  5778. var OrderType = SuperMap.OrderType = {
  5779. /** 升序 */
  5780. ASC: "ASC",
  5781. /** 降序 */
  5782. DESC: "DESC"
  5783. };
  5784. /**
  5785. * @enum SearchType
  5786. * @memberOf SuperMap
  5787. * @description iportal资源查询的范围进行过滤
  5788. * @version 10.0.1
  5789. * @type {string}
  5790. */
  5791. var SearchType = SuperMap.SearchType = {
  5792. /** 公开资源。 */
  5793. PUBLIC: "PUBLIC",
  5794. /** 我的资源。 */
  5795. MY_RES: "MY_RES",
  5796. /** 我的群组资源。 */
  5797. MYGROUP_RES: "MYGROUP_RES",
  5798. /** 我的部门资源。 */
  5799. MYDEPARTMENT_RES: "MYDEPARTMENT_RES",
  5800. /** 分享给我的资源。 */
  5801. SHARETOME_RES: "SHARETOME_RES"
  5802. };
  5803. /**
  5804. * @enum AggregationTypes
  5805. * @memberOf SuperMap
  5806. * @description iportal资源聚合查询的类型
  5807. * @version 10.0.1
  5808. * @type {string}
  5809. */
  5810. var AggregationTypes = SuperMap.AggregationTypes = {
  5811. /** 标签 */
  5812. TAG: "TAG",
  5813. /** 资源类型 */
  5814. TYPE: "TYPE"
  5815. };
  5816. /**
  5817. * @enum PermissionType
  5818. * @memberOf SuperMap
  5819. * @description iportal资源权限类型。
  5820. * @version 10.0.1
  5821. * @type {string}
  5822. */
  5823. var PermissionType = SuperMap.PermissionType = {
  5824. /** 可检索 */
  5825. SEARCH: "SEARCH",
  5826. /** 可查看 */
  5827. READ: "READ",
  5828. /** 可编辑 */
  5829. READWRITE: "READWRITE",
  5830. /** 可删除 */
  5831. DELETE: "DELETE",
  5832. /** 可下载,包括可读、可检索 */
  5833. DOWNLOAD: "DOWNLOAD"
  5834. };
  5835. /**
  5836. * @enum EntityType
  5837. * @memberOf SuperMap
  5838. * @description iportal资源实体类型。
  5839. * @version 10.0.1
  5840. * @type {string}
  5841. */
  5842. var EntityType = SuperMap.EntityType = {
  5843. /** 部门 */
  5844. DEPARTMENT: "DEPARTMENT",
  5845. /** 用户组 */
  5846. GROUP: "GROUP",
  5847. /** 群组 */
  5848. IPORTALGROUP: "IPORTALGROUP",
  5849. /** 角色 */
  5850. ROLE: "ROLE",
  5851. /** 用户 */
  5852. USER: "USER"
  5853. };
  5854. /**
  5855. * @enum DataItemType
  5856. * @memberOf SuperMap
  5857. * @description iportal数据类型。
  5858. * @version 10.0.1
  5859. * @type {string}
  5860. */
  5861. var DataItemType = SuperMap.DataItemType = {
  5862. /** 工作空间 sxwu, smwu, sxw, smw */
  5863. WORKSPACE: "WORKSPACE",
  5864. /** udb 数据源 */
  5865. UDB: "UDB",
  5866. /** shp空间数据 */
  5867. SHP: "SHP",
  5868. /** excel数据 */
  5869. EXCEL: "EXCEL",
  5870. /** csv数据 */
  5871. CSV: "CSV",
  5872. /** geojson数据。 */
  5873. GEOJSON: "GEOJSON",
  5874. /** smtiles */
  5875. SMTILES: "SMTILES",
  5876. /** svtiles */
  5877. SVTILES: "SVTILES",
  5878. /** mbtiles */
  5879. MBTILES: "MBTILES",
  5880. /** tpk */
  5881. TPK: "TPK",
  5882. /** ugc v5 */
  5883. UGCV5: "UGCV5",
  5884. /** UGCV5_MVT */
  5885. UGCV5_MVT: "UGCV5_MVT",
  5886. /** json数据 */
  5887. JSON: "JSON"
  5888. };
  5889. /**
  5890. * @enum WebExportFormatType
  5891. * @memberOf SuperMap
  5892. * @description Web 打印输出的格式。
  5893. * @version 10.0.1
  5894. * @type {string}
  5895. */
  5896. var WebExportFormatType = SuperMap.WebExportFormatType = {
  5897. /** png */
  5898. PNG: "PNG",
  5899. /** pdf */
  5900. PDF: "PDF"
  5901. };
  5902. /**
  5903. * @enum WebScaleOrientationType
  5904. * @memberOf SuperMap
  5905. * @description Web 比例尺的方位样式。
  5906. * @version 10.0.1
  5907. * @type {string}
  5908. */
  5909. var WebScaleOrientationType = SuperMap.WebScaleOrientationType = {
  5910. /** horizontal labels below */
  5911. HORIZONTALLABELSBELOW: "HORIZONTALLABELSBELOW",
  5912. /** horizontal labels above */
  5913. HORIZONTALLABELSABOVE: "HORIZONTALLABELSABOVE",
  5914. /** vertical labels left */
  5915. VERTICALLABELSLEFT: "VERTICALLABELSLEFT",
  5916. /** vertical labels right */
  5917. VERTICALLABELSRIGHT: "VERTICALLABELSRIGHT"
  5918. };
  5919. /**
  5920. * @enum WebScaleType
  5921. * @memberOf SuperMap
  5922. * @description Web 比例尺的样式。
  5923. * @version 10.0.1
  5924. * @type {string}
  5925. */
  5926. var WebScaleType = SuperMap.WebScaleType = {
  5927. /** line */
  5928. LINE: "LINE",
  5929. /** bar */
  5930. BAR: "BAR",
  5931. /** bar sub */
  5932. BAR_SUB: "BAR_SUB"
  5933. };
  5934. /**
  5935. * @enum WebScaleUnit
  5936. * @memberOf SuperMap
  5937. * @description Web 比例尺的单位制。
  5938. * @version 10.0.1
  5939. * @type {string}
  5940. */
  5941. var WebScaleUnit = SuperMap.WebScaleUnit = {
  5942. /** meter */
  5943. METER: "METER",
  5944. /** foot */
  5945. FOOT: "FOOT",
  5946. /** degrees */
  5947. DEGREES: "DEGREES"
  5948. };
  5949. ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceConnectionInfo.js
  5950. function DatasourceConnectionInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5951. function DatasourceConnectionInfo_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5952. function DatasourceConnectionInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasourceConnectionInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasourceConnectionInfo_defineProperties(Constructor, staticProps); return Constructor; }
  5953. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  5954. * This program are made available under the terms of the Apache License, Version 2.0
  5955. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5956. // eslint-disable-line no-unused-vars
  5957. /**
  5958. * @class SuperMap.DatasourceConnectionInfo
  5959. * @category iServer Data
  5960. * @classdesc 数据源连接信息类。该类包括了进行数据源连接的所有信息,如所要连接的服务器名称、数据库名称、用户名以及密码等。
  5961. * 当保存为工作空间时, 工作空间中的数据源的连接信息都将存储到工作空间文件中。对于不同类型的数据源,其连接信息有所区别。
  5962. * 所以在使 用该类所包含的成员时,请注意该成员所适用的数据源类型。对于从数据源对象中返回的数据连接信息对象,只有 connect 方法可以被修改,
  5963. * 其他内容是不可以被修改的。对于用户创建的数据源连接信息对象,其内容都可以修改。
  5964. * @category iServer Data
  5965. * @param {Object} options - 参数。
  5966. * @param {string} options.alias - 数据源别名。
  5967. * @param {string} options.dataBase - 数据源连接的数据库名。
  5968. * @param {boolean} [options.connect] - 数据源是否自动连接数据。
  5969. * @param {string} [options.driver] - 使用 ODBC(Open Database Connectivity,开放数据库互连)的数据库的驱动程序名。
  5970. * @param {SuperMap.EngineType} [options.engineType] - 数据源连接的引擎类型。
  5971. * @param {boolean} [options.exclusive] - 是否以独占方式打开数据源。
  5972. * @param {boolean} [options.OpenLinkTable] - 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  5973. * @param {string} [options.password] - 登录数据源连接的数据库或文件的密码。
  5974. * @param {boolean} [options.readOnly] - 是否以只读方式打开数据源。
  5975. * @param {string} [options.server] - 数据库服务器名或 SDB 文件名。
  5976. * @param {string} [options.user] - 登录数据库的用户名。
  5977. */
  5978. var DatasourceConnectionInfo = /*#__PURE__*/function () {
  5979. function DatasourceConnectionInfo(options) {
  5980. DatasourceConnectionInfo_classCallCheck(this, DatasourceConnectionInfo);
  5981. /**
  5982. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.alias
  5983. * @description 数据源别名。
  5984. */
  5985. this.alias = null;
  5986. /**
  5987. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.connect]
  5988. * @description 数据源是否自动连接数据。
  5989. */
  5990. this.connect = null;
  5991. /**
  5992. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.dataBase
  5993. * @description 数据源连接的数据库名。
  5994. */
  5995. this.dataBase = null;
  5996. /**
  5997. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.driver]
  5998. * @description 使用 ODBC(Open Database Connectivity,开放数据库互连) 的数据库的驱动程序名。
  5999. * 其中,对于 SQL Server 数据库与 iServer 发布的 WMTS 服务,此为必设参数。
  6000. * 对于 SQL Server 数据库,它使用 ODBC 连接,所设置的驱动程序名为 "SQL Server" 或 "SQL Native Client";
  6001. * 对于 iServer 发布的 WMTS 服务,设置的驱动名称为 "WMTS"。
  6002. */
  6003. this.driver = null;
  6004. /**
  6005. * @member {SuperMap.EngineType} [SuperMap.DatasourceConnectionInfo.prototype.engineType]
  6006. * @description 数据源连接的引擎类型。
  6007. */
  6008. this.engineType = null;
  6009. /**
  6010. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.exclusive]
  6011. * @description 是否以独占方式打开数据源。
  6012. */
  6013. this.exclusive = null;
  6014. /**
  6015. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.OpenLinkTable]
  6016. * @description 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  6017. */
  6018. this.OpenLinkTable = null;
  6019. /**
  6020. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.password]
  6021. * @description 登录数据源连接的数据库或文件的密码。
  6022. */
  6023. this.password = null;
  6024. /**
  6025. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.readOnly]
  6026. * @description 是否以只读方式打开数据源。
  6027. */
  6028. this.readOnly = null;
  6029. /**
  6030. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.server]
  6031. * @description 数据库服务器名、文件名或服务地址。
  6032. * 1.对于 SDB 和 UDB 文件,为其文件的绝对路径。注意:当绝对路径的长度超过 UTF-8 编码格式的 260 字节长度,该数据源无法打开。
  6033. * 2.对于 Oracle 数据库,其服务器名为其 TNS 服务名称。
  6034. * 3.对于 SQL Server 数据库,其服务器名为其系统的 DSN(Database Source Name) 名称。
  6035. * 4.对于 PostgreSQL 数据库,其服务器名为 “IP:端口号”,默认的端口号是 5432。
  6036. * 5.对于 DB2 数据库,已经进行了编目,所以不需要进行服务器的设置。
  6037. * 6.对于 Kingbase 数据库,其服务器名为其 IP 地址。
  6038. * 7.对于 GoogleMaps 数据源,其服务器地址,默认设置为 “{@link http://maps.google.com}”,且不可更改。
  6039. * 8.对于 SuperMapCould 数据源,为其服务地址。
  6040. * 9.对于 MAPWORLD 数据源,为其服务地址,默认设置为 “{@link http://www.tianditu.cn}”,且不可更改。
  6041. * 10.对于 OGC 和 REST 数据源,为其服务地址。
  6042. */
  6043. this.server = null;
  6044. /**
  6045. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.user
  6046. * @description 登录数据库的用户名。
  6047. */
  6048. this.user = null;
  6049. if (options) {
  6050. Util.extend(this, options);
  6051. }
  6052. this.CLASS_NAME = "SuperMap.DatasourceConnectionInfo";
  6053. }
  6054. /**
  6055. * @function SuperMap.DatasourceConnectionInfo.prototype.destroy
  6056. * @description 释放资源,将引用资源的属性置空。
  6057. */
  6058. DatasourceConnectionInfo_createClass(DatasourceConnectionInfo, [{
  6059. key: "destroy",
  6060. value: function destroy() {
  6061. var me = this;
  6062. me.alias = null;
  6063. me.connect = null;
  6064. me.dataBase = null;
  6065. me.driver = null;
  6066. me.engineType = null;
  6067. me.exclusive = null;
  6068. me.OpenLinkTable = null;
  6069. me.password = null;
  6070. me.readOnly = null;
  6071. me.server = null;
  6072. me.user = null;
  6073. }
  6074. }]);
  6075. return DatasourceConnectionInfo;
  6076. }();
  6077. SuperMap.DatasourceConnectionInfo = DatasourceConnectionInfo;
  6078. ;// CONCATENATED MODULE: ./src/common/iServer/OutputSetting.js
  6079. function OutputSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6080. function OutputSetting_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6081. function OutputSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) OutputSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) OutputSetting_defineProperties(Constructor, staticProps); return Constructor; }
  6082. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6083. * This program are made available under the terms of the Apache License, Version 2.0
  6084. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6085. /**
  6086. * @class SuperMap.OutputSetting
  6087. * @category iServer ProcessingService
  6088. * @classdesc 分布式分析输出类型设置类。
  6089. * @param {Object} options - 参数。
  6090. * @param {SuperMap.DatasourceConnectionInfo} options.datasourceInfo - 数据源连接信息。
  6091. * @param {string} [options.datasetName='analystResult'] - 结果数据集名称。
  6092. * @param {SuperMap.OutputType} [options.type=SuperMap.OutputType.UDB] - 输出类型。
  6093. * @param {string} [options.outputPath] - 分析结果输出路径。
  6094. */
  6095. var OutputSetting = /*#__PURE__*/function () {
  6096. function OutputSetting(options) {
  6097. OutputSetting_classCallCheck(this, OutputSetting);
  6098. /**
  6099. * @member {SuperMap.OutputType} SuperMap.OutputSetting.prototype.type
  6100. * @description 分布式分析的输出类型。
  6101. */
  6102. this.type = OutputType.UDB;
  6103. /**
  6104. * @member {string} [SuperMap.OutputSetting.prototype.datasetName='analystResult']
  6105. * @description 分布式分析的输出结果数据集名称。
  6106. */
  6107. this.datasetName = "analystResult";
  6108. /**
  6109. * @member {SuperMap.DatasourceConnectionInfo} SuperMap.OutputSetting.prototype.datasourceInfo
  6110. * @description 分布式分析的输出结果数据源连接信息。
  6111. */
  6112. this.datasourceInfo = null;
  6113. /**
  6114. * @member {string} [SuperMap.OutputSetting.prototype.outputPath]
  6115. * @description 分布式分析的分析结果输出路径。
  6116. */
  6117. this.outputPath = "";
  6118. Util.extend(this, options);
  6119. this.CLASS_NAME = "SuperMap.OutputSetting";
  6120. }
  6121. /**
  6122. * @function SuperMap.OutputSetting.prototype.destroy
  6123. * @description 释放资源,将引用资源的属性置空。
  6124. */
  6125. OutputSetting_createClass(OutputSetting, [{
  6126. key: "destroy",
  6127. value: function destroy() {
  6128. var me = this;
  6129. me.type = null;
  6130. me.datasetName = null;
  6131. me.outputPath = null;
  6132. if (me.datasourceInfo instanceof DatasourceConnectionInfo) {
  6133. me.datasourceInfo.destroy();
  6134. me.datasourceInfo = null;
  6135. }
  6136. }
  6137. }]);
  6138. return OutputSetting;
  6139. }();
  6140. SuperMap.OutputSetting = OutputSetting;
  6141. ;// CONCATENATED MODULE: ./src/common/iServer/MappingParameters.js
  6142. function MappingParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6143. function MappingParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6144. function MappingParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MappingParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MappingParameters_defineProperties(Constructor, staticProps); return Constructor; }
  6145. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6146. * This program are made available under the terms of the Apache License, Version 2.0
  6147. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6148. /**
  6149. * @class SuperMap.MappingParameters
  6150. * @category iServer ProcessingService
  6151. * @classdesc 分析后结果可视化的参数类。
  6152. * @param {Object} options - 参数。
  6153. * @param {Array.<SuperMap.ThemeGridRangeItem>} [options.items] - 栅格分段专题图子项数组。
  6154. * @param {number} [options.numericPrecision=1] - 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  6155. * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 专题图分段模式。
  6156. * @param {number} [options.rangeCount] - 专题图分段个数。
  6157. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 专题图颜色渐变模式。
  6158. */
  6159. var MappingParameters = /*#__PURE__*/function () {
  6160. function MappingParameters(options) {
  6161. MappingParameters_classCallCheck(this, MappingParameters);
  6162. /**
  6163. * @member {Array.<SuperMap.ThemeGridRangeItem>} [SuperMap.MappingParameters.prototype.items]
  6164. * @description 栅格分段专题图子项数组。
  6165. */
  6166. this.items = null;
  6167. /**
  6168. * @member {number} [SuperMap.MappingParameters.prototype.numericPrecision=1]
  6169. * @description 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  6170. */
  6171. this.numericPrecision = 1;
  6172. /**
  6173. * @member {SuperMap.RangeMode} [SuperMap.MappingParameters.prototype.RangeMode=SuperMap.RangeMode.EQUALINTERVAL]
  6174. * @description 专题图分段模式。
  6175. */
  6176. this.rangeMode = RangeMode.EQUALINTERVAL;
  6177. /**
  6178. * @member {number} [SuperMap.MappingParameters.prototype.rangeCount]
  6179. * @description 专题图分段个数。
  6180. */
  6181. this.rangeCount = "";
  6182. /**
  6183. * @member {SuperMap.ColorGradientType} [SuperMap.MappingParameters.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  6184. * @description 专题图颜色渐变模式。
  6185. */
  6186. this.colorGradientType = ColorGradientType.YELLOW_RED;
  6187. Util.extend(this, options);
  6188. this.CLASS_NAME = "SuperMap.MappingParameters";
  6189. }
  6190. /**
  6191. * @function SuperMap.MappingParameters.prototype.destroy
  6192. * @description 释放资源,将引用资源的属性置空。
  6193. */
  6194. MappingParameters_createClass(MappingParameters, [{
  6195. key: "destroy",
  6196. value: function destroy() {
  6197. var me = this;
  6198. if (me.items) {
  6199. if (me.items.length > 0) {
  6200. for (var item in me.items) {
  6201. me.items[item].destroy();
  6202. me.items[item] = null;
  6203. }
  6204. }
  6205. me.items = null;
  6206. }
  6207. me.numericPrecision = null;
  6208. me.rangeMode = null;
  6209. me.rangeCount = null;
  6210. me.colorGradientType = null;
  6211. }
  6212. }]);
  6213. return MappingParameters;
  6214. }();
  6215. SuperMap.MappingParameters = MappingParameters;
  6216. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobParameter.js
  6217. function KernelDensityJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6218. function KernelDensityJobParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6219. function KernelDensityJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  6220. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6221. * This program are made available under the terms of the Apache License, Version 2.0
  6222. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6223. /**
  6224. * @class SuperMap.KernelDensityJobParameter
  6225. * @category iServer ProcessingService DensityAnalyst
  6226. * @classdesc 密度分析任务参数类。
  6227. * @param {Object} options - 参数。
  6228. * @param {string} options.datasetName - 数据集名。
  6229. * @param {string} options.fields - 权重索引。
  6230. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  6231. * @param {number} [options.resolution=80] - 分辨率。
  6232. * @param {number} [options.method=0] - 分析方法。
  6233. * @param {number} [options.meshType=0] - 分析类型。
  6234. * @param {number} [options.radius=300] - 分析的影响半径。
  6235. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  6236. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  6237. */
  6238. var KernelDensityJobParameter = /*#__PURE__*/function () {
  6239. function KernelDensityJobParameter(options) {
  6240. KernelDensityJobParameter_classCallCheck(this, KernelDensityJobParameter);
  6241. if (!options) {
  6242. return;
  6243. }
  6244. /**
  6245. * @member {string} SuperMap.KernelDensityJobParameter.prototype.datasetName
  6246. * @description 数据集名。
  6247. */
  6248. this.datasetName = "";
  6249. /**
  6250. * @member {SuperMap.Bounds|L.Bounds|ol.extent} [SuperMap.KernelDensityJobParameter.prototype.query]
  6251. * @description 分析范围。
  6252. */
  6253. this.query = "";
  6254. /**
  6255. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.resolution=80]
  6256. * @description 网格大小。
  6257. */
  6258. this.resolution = 80;
  6259. /**
  6260. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.method=0]
  6261. * @description 分析方法。
  6262. */
  6263. this.method = 0;
  6264. /**
  6265. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.meshType=0]
  6266. * @description 分析类型。
  6267. */
  6268. this.meshType = 0;
  6269. /**
  6270. * @member {string} SuperMap.KernelDensityJobParameter.prototype.fields
  6271. * @description 权重索引。
  6272. */
  6273. this.fields = "";
  6274. /**
  6275. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.radius=300]
  6276. * @description 分析的影响半径。
  6277. */
  6278. this.radius = 300;
  6279. /**
  6280. * @member {SuperMap.AnalystSizeUnit} [SuperMap.KernelDensityJobParameter.prototype.meshSizeUnit=SuperMap.AnalystSizeUnit.METER]
  6281. * @description 网格大小单位。
  6282. */
  6283. this.meshSizeUnit = AnalystSizeUnit.METER;
  6284. /**
  6285. * @member {SuperMap.AnalystSizeUnit} [SuperMap.KernelDensityJobParameter.prototype.radiusUnit=SuperMap.AnalystSizeUnit.METER]
  6286. * @description 搜索半径单位。
  6287. */
  6288. this.radiusUnit = AnalystSizeUnit.METER;
  6289. /**
  6290. * @member {SuperMap.AnalystAreaUnit} [SuperMap.KernelDensityJobParameter.prototype.areaUnit=SuperMap.AnalystAreaUnit.SQUAREMILE]
  6291. * @description 面积单位。
  6292. */
  6293. this.areaUnit = AnalystAreaUnit.SQUAREMILE;
  6294. /**
  6295. * @member {SuperMap.OutputSetting} SuperMap.KernelDensityJobParameter.prototype.output
  6296. * @description 输出参数设置类
  6297. */
  6298. this.output = null;
  6299. /**
  6300. * @member {SuperMap.MappingParameters} [SuperMap.KernelDensityJobParameter.prototype.mappingParameters]
  6301. * @description 分析后结果可视化的参数类。
  6302. */
  6303. this.mappingParameters = null;
  6304. Util.extend(this, options);
  6305. this.CLASS_NAME = "SuperMap.KernelDensityJobParameter";
  6306. }
  6307. /**
  6308. * @function SuperMap.KernelDensityJobParameter.prototype.destroy
  6309. * @description 释放资源,将引用资源的属性置空。
  6310. */
  6311. KernelDensityJobParameter_createClass(KernelDensityJobParameter, [{
  6312. key: "destroy",
  6313. value: function destroy() {
  6314. this.datasetName = null;
  6315. this.query = null;
  6316. this.resolution = null;
  6317. this.method = null;
  6318. this.radius = null;
  6319. this.meshType = null;
  6320. this.fields = null;
  6321. this.meshSizeUnit = null;
  6322. this.radiusUnit = null;
  6323. this.areaUnit = null;
  6324. if (this.output instanceof OutputSetting) {
  6325. this.output.destroy();
  6326. this.output = null;
  6327. }
  6328. if (this.mappingParameters instanceof MappingParameters) {
  6329. this.mappingParameters.destroy();
  6330. this.mappingParameters = null;
  6331. }
  6332. }
  6333. /**
  6334. * @function SuperMap.KernelDensityJobParameter.toObject
  6335. * @param {SuperMap.KernelDensityJobParameter} kernelDensityJobParameter - 密度分析任务参数类。
  6336. * @param {SuperMap.KernelDensityJobParameter} tempObj - 密度分析任务参数对象。
  6337. * @description 将密度分析任务参数对象转换为 JSON 对象。
  6338. * @returns JSON 对象。
  6339. */
  6340. }], [{
  6341. key: "toObject",
  6342. value: function toObject(kernelDensityJobParameter, tempObj) {
  6343. for (var name in kernelDensityJobParameter) {
  6344. if (name === "datasetName") {
  6345. tempObj['input'] = tempObj['input'] || {};
  6346. tempObj['input'][name] = kernelDensityJobParameter[name];
  6347. continue;
  6348. }
  6349. if (name === "output") {
  6350. tempObj['output'] = tempObj['output'] || {};
  6351. tempObj['output'] = kernelDensityJobParameter[name];
  6352. continue;
  6353. }
  6354. tempObj['analyst'] = tempObj['analyst'] || {};
  6355. if (name === 'query' && kernelDensityJobParameter[name]) {
  6356. tempObj['analyst'][name] = kernelDensityJobParameter[name].toBBOX();
  6357. } else {
  6358. tempObj['analyst'][name] = kernelDensityJobParameter[name];
  6359. }
  6360. if (name === 'mappingParameters') {
  6361. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  6362. tempObj['analyst']['mappingParameters'] = kernelDensityJobParameter[name];
  6363. }
  6364. }
  6365. }
  6366. }]);
  6367. return KernelDensityJobParameter;
  6368. }();
  6369. SuperMap.KernelDensityJobParameter = KernelDensityJobParameter;
  6370. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsParameter.js
  6371. function SingleObjectQueryJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6372. function SingleObjectQueryJobsParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6373. function SingleObjectQueryJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  6374. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6375. * This program are made available under the terms of the Apache License, Version 2.0
  6376. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6377. /**
  6378. * @class SuperMap.SingleObjectQueryJobsParameter
  6379. * @category iServer ProcessingService Query
  6380. * @classdesc 单对象空间查询分析任务参数类。
  6381. * @param {Object} options - 参数。
  6382. * @param {string} options.datasetName - 数据集名。
  6383. * @param {string} options.datasetQuery - 查询对象所在的数据集名称。
  6384. * @param {SuperMap.SpatialQueryMode} [options.mode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式。
  6385. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  6386. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  6387. */
  6388. var SingleObjectQueryJobsParameter = /*#__PURE__*/function () {
  6389. function SingleObjectQueryJobsParameter(options) {
  6390. SingleObjectQueryJobsParameter_classCallCheck(this, SingleObjectQueryJobsParameter);
  6391. if (!options) {
  6392. return;
  6393. }
  6394. /**
  6395. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.datasetName
  6396. * @description 数据集名。
  6397. */
  6398. this.datasetName = "";
  6399. /**
  6400. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.datasetQuery
  6401. * @description 查询对象所在的数据集名称。
  6402. */
  6403. this.datasetQuery = "";
  6404. /**
  6405. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.geometryQuery
  6406. * @description 查询对象所在的几何对象。
  6407. */
  6408. this.geometryQuery = "";
  6409. /**
  6410. * @member {SuperMap.SpatialQueryMode} [SuperMap.SingleObjectQueryJobsParameter.prototype.mode=SuperMap.SpatialQueryMode.CONTAIN]
  6411. * @description 空间查询模式 。
  6412. */
  6413. this.mode = SpatialQueryMode.CONTAIN;
  6414. /**
  6415. * @member {SuperMap.OutputSetting} [SuperMap.SingleObjectQueryJobsParameter.prototype.output]
  6416. * @description 输出参数设置类。
  6417. */
  6418. this.output = null;
  6419. /**
  6420. * @member {SuperMap.MappingParameters} [SuperMap.SingleObjectQueryJobsParameter.prototype.mappingParameters]
  6421. * @description 分析后结果可视化的参数类。
  6422. */
  6423. this.mappingParameters = null;
  6424. Util.extend(this, options);
  6425. this.CLASS_NAME = "SuperMap.SingleObjectQueryJobsParameter";
  6426. }
  6427. /**
  6428. * @function SuperMap.SingleObjectQueryJobsParameter.prototype.destroy
  6429. * @description 释放资源,将引用资源的属性置空。
  6430. */
  6431. SingleObjectQueryJobsParameter_createClass(SingleObjectQueryJobsParameter, [{
  6432. key: "destroy",
  6433. value: function destroy() {
  6434. this.datasetName = null;
  6435. this.datasetQuery = null;
  6436. this.geometryQuery = null;
  6437. this.mode = null;
  6438. if (this.output instanceof OutputSetting) {
  6439. this.output.destroy();
  6440. this.output = null;
  6441. }
  6442. if (this.mappingParameters instanceof MappingParameters) {
  6443. this.mappingParameters.destroy();
  6444. this.mappingParameters = null;
  6445. }
  6446. }
  6447. /**
  6448. * @function SuperMap.SingleObjectQueryJobsParameter.toObject
  6449. * @param {Object} singleObjectQueryJobsParameter - 单对象空间查询分析任务参数。
  6450. * @param {Object} tempObj - 目标对象。
  6451. * @description 生成单对象空间查询分析任务对象。
  6452. */
  6453. }], [{
  6454. key: "toObject",
  6455. value: function toObject(singleObjectQueryJobsParameter, tempObj) {
  6456. for (var name in singleObjectQueryJobsParameter) {
  6457. if (name === "datasetName") {
  6458. tempObj['input'] = tempObj['input'] || {};
  6459. tempObj['input'][name] = singleObjectQueryJobsParameter[name];
  6460. continue;
  6461. }
  6462. if (name === "output") {
  6463. tempObj['output'] = tempObj['output'] || {};
  6464. tempObj['output'] = singleObjectQueryJobsParameter[name];
  6465. continue;
  6466. }
  6467. tempObj['analyst'] = tempObj['analyst'] || {};
  6468. tempObj['analyst'][name] = singleObjectQueryJobsParameter[name];
  6469. if (name === 'mappingParameters') {
  6470. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  6471. tempObj['analyst']['mappingParameters'] = singleObjectQueryJobsParameter[name];
  6472. }
  6473. }
  6474. }
  6475. }]);
  6476. return SingleObjectQueryJobsParameter;
  6477. }();
  6478. SuperMap.SingleObjectQueryJobsParameter = SingleObjectQueryJobsParameter;
  6479. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsParameter.js
  6480. function SummaryAttributesJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6481. function SummaryAttributesJobsParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6482. function SummaryAttributesJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  6483. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6484. * This program are made available under the terms of the Apache License, Version 2.0
  6485. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6486. /**
  6487. * @class SuperMap.SummaryAttributesJobsParameter
  6488. * @category iServer ProcessingService SummaryAttributes
  6489. * @classdesc 属性汇总分析任务参数类
  6490. * @param {Object} options - 参数。
  6491. * @param {string} options.datasetName - 数据集名。
  6492. * @param {string} options.groupField - 分组字段。
  6493. * @param {string} options.attributeField - 属性字段。
  6494. * @param {string} options.statisticModes - 统计模式。
  6495. * @param {SuperMap.OutputSetting} [options.output] -输出参数设置。
  6496. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  6497. */
  6498. var SummaryAttributesJobsParameter = /*#__PURE__*/function () {
  6499. function SummaryAttributesJobsParameter(options) {
  6500. SummaryAttributesJobsParameter_classCallCheck(this, SummaryAttributesJobsParameter);
  6501. if (!options) {
  6502. return;
  6503. }
  6504. /**
  6505. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.datasetName
  6506. * @description 汇总数据集名称。
  6507. */
  6508. this.datasetName = "";
  6509. /**
  6510. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.groupField
  6511. * @description 分组字段。
  6512. */
  6513. this.groupField = "";
  6514. /**
  6515. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.attributeField
  6516. * @description 属性字段。
  6517. */
  6518. this.attributeField = "";
  6519. /**
  6520. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.statisticModes
  6521. * @description 属性汇总统计模式。
  6522. */
  6523. this.statisticModes = "";
  6524. /**
  6525. * @member {SuperMap.OutputSetting} SuperMap.SummaryAttributesJobsParameter.prototype.output
  6526. * @description 输出参数设置类。
  6527. */
  6528. this.output = null;
  6529. /**
  6530. * @member {SuperMap.MappingParameters} [SuperMap.SummaryAttributesJobsParameter.prototype.mappingParameters]
  6531. * @description 分析后结果可视化的参数类。
  6532. */
  6533. this.mappingParameters = null;
  6534. Util.extend(this, options);
  6535. this.CLASS_NAME = "SuperMap.SummaryAttributesJobsParameter";
  6536. }
  6537. /**
  6538. * @function SuperMap.SummaryAttributesJobsParameter.destroy
  6539. * @override
  6540. */
  6541. SummaryAttributesJobsParameter_createClass(SummaryAttributesJobsParameter, [{
  6542. key: "destroy",
  6543. value: function destroy() {
  6544. this.datasetName = null;
  6545. this.groupField = null;
  6546. this.attributeField = null;
  6547. this.statisticModes = null;
  6548. if (this.output instanceof OutputSetting) {
  6549. this.output.destroy();
  6550. this.output = null;
  6551. }
  6552. if (this.mappingParameters instanceof MappingParameters) {
  6553. this.mappingParameters.destroy();
  6554. this.mappingParameters = null;
  6555. }
  6556. }
  6557. /**
  6558. * @function SuperMap.SummaryAttributesJobsParameter.toObject
  6559. * @param {Object} SummaryAttributesJobsParameter - 属性汇总任务参数。
  6560. * @param {Object} tempObj - 目标对象。
  6561. * @description 生成属性汇总分析任务对象。
  6562. */
  6563. }], [{
  6564. key: "toObject",
  6565. value: function toObject(SummaryAttributesJobsParameter, tempObj) {
  6566. for (var name in SummaryAttributesJobsParameter) {
  6567. if (name === "datasetName") {
  6568. tempObj['input'] = tempObj['input'] || {};
  6569. tempObj['input'][name] = SummaryAttributesJobsParameter[name];
  6570. continue;
  6571. }
  6572. if (name === "output") {
  6573. tempObj['output'] = tempObj['output'] || {};
  6574. tempObj['output'] = SummaryAttributesJobsParameter[name];
  6575. continue;
  6576. }
  6577. tempObj['analyst'] = tempObj['analyst'] || {};
  6578. tempObj['analyst'][name] = SummaryAttributesJobsParameter[name];
  6579. if (name === 'mappingParameters') {
  6580. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  6581. tempObj['analyst']['mappingParameters'] = SummaryAttributesJobsParameter[name];
  6582. }
  6583. }
  6584. }
  6585. }]);
  6586. return SummaryAttributesJobsParameter;
  6587. }();
  6588. SuperMap.SummaryAttributesJobsParameter = SummaryAttributesJobsParameter;
  6589. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobParameter.js
  6590. function SummaryMeshJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6591. function SummaryMeshJobParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6592. function SummaryMeshJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  6593. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6594. * This program are made available under the terms of the Apache License, Version 2.0
  6595. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6596. /**
  6597. * @class SuperMap.SummaryMeshJobParameter
  6598. * @category iServer ProcessingService AggregatePoints
  6599. * @classdesc 点聚合分析任务参数类。
  6600. * @param {Object} options - 参数。
  6601. * @param {string} options.datasetName - 数据集名。
  6602. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  6603. * @param {number} options.fields - 权重索引。
  6604. * @param {number} [options.resolution=100] - 分辨率。
  6605. * @param {SuperMap.StatisticAnalystMode} [options.statisticModes=SuperMap.StatisticAnalystMode.AVERAGE] - 分析模式。
  6606. * @param {number} [options.meshType=0] - 分析类型。
  6607. * @param {SuperMap.SummaryType} [options.type=SuperMap.SummaryType.SUMMARYMESH] - 聚合类型。
  6608. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  6609. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  6610. */
  6611. var SummaryMeshJobParameter = /*#__PURE__*/function () {
  6612. function SummaryMeshJobParameter(options) {
  6613. SummaryMeshJobParameter_classCallCheck(this, SummaryMeshJobParameter);
  6614. if (!options) {
  6615. return;
  6616. }
  6617. /**
  6618. * @member {string} SuperMap.SummaryMeshJobParameter.prototype.datasetName
  6619. * @description 数据集名。
  6620. */
  6621. this.datasetName = "";
  6622. /**
  6623. * @member {string} SuperMap.SummaryMeshJobParameter.prototype.regionDataset
  6624. * @description 聚合面数据集(聚合类型为多边形聚合时使用的参数)。
  6625. */
  6626. this.regionDataset = "";
  6627. /**
  6628. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.SummaryMeshJobParameter.prototype.query
  6629. * @description 分析范围(聚合类型为网格面聚合时使用的参数)。
  6630. */
  6631. this.query = "";
  6632. /**
  6633. * @member {number} [SuperMap.SummaryMeshJobParameter.prototype.resolution=100]
  6634. * @description 分辨率(聚合类型为网格面聚合时使用的参数)。
  6635. */
  6636. this.resolution = 100;
  6637. /**
  6638. * @member {number} [SuperMap.SummaryMeshJobParameter.prototype.meshType=0]
  6639. * @description 网格面类型(聚合类型为网格面聚合时使用的参数),取值:0 或 1。
  6640. */
  6641. this.meshType = 0;
  6642. /**
  6643. * @member {SuperMap.StatisticAnalystMode} [SuperMap.SummaryMeshJobParameter.prototype.statisticModes=SuperMap.StatisticAnalystMode.AVERAGE]
  6644. * @description 统计模式。
  6645. */
  6646. this.statisticModes = StatisticAnalystMode.AVERAGE;
  6647. /**
  6648. * @member {number} SuperMap.SummaryMeshJobParameter.prototype.fields
  6649. * @description 权重字段。
  6650. */
  6651. this.fields = "";
  6652. /**
  6653. * @member {SuperMap.SummaryType} [SuperMap.SummaryMeshJobParameter.prototype.type=SuperMap.SummaryType.SUMMARYMESH]
  6654. * @description 聚合类型。
  6655. */
  6656. this.type = SummaryType.SUMMARYMESH;
  6657. /**
  6658. * @member {SuperMap.OutputSetting} [SuperMap.SummaryMeshJobParameter.prototype.output]
  6659. * @description 输出参数设置类。
  6660. */
  6661. this.output = null;
  6662. /**
  6663. * @member {SuperMap.MappingParameters} [SuperMap.SummaryMeshJobParameter.prototype.mappingParameters]
  6664. * @description 分析后结果可视化的参数类。
  6665. */
  6666. this.mappingParameters = null;
  6667. Util.extend(this, options);
  6668. this.CLASS_NAME = "SuperMap.SummaryMeshJobParameter";
  6669. }
  6670. /**
  6671. * @function SuperMap.SummaryMeshJobParameter.destroy
  6672. * @override
  6673. */
  6674. SummaryMeshJobParameter_createClass(SummaryMeshJobParameter, [{
  6675. key: "destroy",
  6676. value: function destroy() {
  6677. this.datasetName = null;
  6678. this.query = null;
  6679. this.resolution = null;
  6680. this.statisticModes = null;
  6681. this.meshType = null;
  6682. this.fields = null;
  6683. this.regionDataset = null;
  6684. this.type = null;
  6685. if (this.output instanceof OutputSetting) {
  6686. this.output.destroy();
  6687. this.output = null;
  6688. }
  6689. if (this.mappingParameters instanceof MappingParameters) {
  6690. this.mappingParameters.destroy();
  6691. this.mappingParameters = null;
  6692. }
  6693. }
  6694. /**
  6695. * @function SuperMap.SummaryMeshJobParameter.toObject
  6696. * @param {Object} summaryMeshJobParameter - 点聚合分析任务参数。
  6697. * @param {Object} tempObj - 目标对象。
  6698. * @description 生成点聚合分析任务对象。
  6699. */
  6700. }], [{
  6701. key: "toObject",
  6702. value: function toObject(summaryMeshJobParameter, tempObj) {
  6703. for (var name in summaryMeshJobParameter) {
  6704. if (name === "datasetName") {
  6705. tempObj['input'] = tempObj['input'] || {};
  6706. tempObj['input'][name] = summaryMeshJobParameter[name];
  6707. continue;
  6708. }
  6709. if (name === "type") {
  6710. tempObj['type'] = summaryMeshJobParameter[name];
  6711. continue;
  6712. }
  6713. if (name === "output") {
  6714. tempObj['output'] = tempObj['output'] || {};
  6715. tempObj['output'] = summaryMeshJobParameter[name];
  6716. continue;
  6717. }
  6718. if (summaryMeshJobParameter.type === 'SUMMARYMESH' && name !== 'regionDataset' || summaryMeshJobParameter.type === 'SUMMARYREGION' && !contains(['meshType', 'resolution', 'query'], name)) {
  6719. tempObj['analyst'] = tempObj['analyst'] || {};
  6720. if (name === 'query' && summaryMeshJobParameter[name]) {
  6721. tempObj['analyst'][name] = summaryMeshJobParameter[name].toBBOX();
  6722. } else {
  6723. tempObj['analyst'][name] = summaryMeshJobParameter[name];
  6724. }
  6725. if (name === 'mappingParameters') {
  6726. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  6727. tempObj['analyst']['mappingParameters'] = summaryMeshJobParameter[name];
  6728. }
  6729. }
  6730. }
  6731. function contains(arr, obj) {
  6732. var i = arr.length;
  6733. while (i--) {
  6734. if (arr[i] === obj) {
  6735. return true;
  6736. }
  6737. }
  6738. return false;
  6739. }
  6740. }
  6741. }]);
  6742. return SummaryMeshJobParameter;
  6743. }();
  6744. SuperMap.SummaryMeshJobParameter = SummaryMeshJobParameter;
  6745. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobParameter.js
  6746. function SummaryRegionJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6747. function SummaryRegionJobParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6748. function SummaryRegionJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  6749. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6750. * This program are made available under the terms of the Apache License, Version 2.0
  6751. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6752. /**
  6753. * @class SuperMap.SummaryRegionJobParameter
  6754. * @category iServer ProcessingService SummaryRegion
  6755. * @classdesc 区域汇总分析任务参数类。
  6756. * @param {Object} options - 参数。
  6757. * @param {string} options.datasetName - 数据集名。
  6758. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  6759. * @param {string} [options.standardFields] - 标准属性字段名称。
  6760. * @param {string} [options.weightedFields] - 权重字段名称。
  6761. * @param {SuperMap.StatisticAnalystMode} [options.standardStatisticModes] - 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  6762. * @param {SuperMap.StatisticAnalystMode} [options.weightedStatisticModes] - 权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  6763. * @param {boolean} [options.sumShape=true] - 是否统计长度或面积。
  6764. * @param {boolean} [options.standardSummaryFields=false] - 是否以标准属字段统计。
  6765. * @param {boolean} [options.weightedSummaryFields=false] - 是否以权重字段统计。
  6766. * @param {number} [options.resolution=100] - 网格大小。
  6767. * @param {number} [options.meshType=0] - 网格面汇总类型。
  6768. * @param {SuperMap.AnalystSizeUnit} [options.meshSizeUnit=SuperMap.AnalystSizeUnit.METER] - 网格大小单位。
  6769. * @param {SuperMap.SummaryType} [options.type=SuperMap.SummaryType.SUMMARYMESH] - 汇总类型。
  6770. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  6771. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  6772. */
  6773. var SummaryRegionJobParameter = /*#__PURE__*/function () {
  6774. function SummaryRegionJobParameter(options) {
  6775. SummaryRegionJobParameter_classCallCheck(this, SummaryRegionJobParameter);
  6776. if (!options) {
  6777. return;
  6778. }
  6779. /**
  6780. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.datasetName
  6781. * @description 数据集名。
  6782. */
  6783. this.datasetName = "";
  6784. /**
  6785. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.regionDataset
  6786. * @description 汇总数据源(多边形汇总时用到的参数)。
  6787. */
  6788. this.regionDataset = "";
  6789. /**
  6790. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.sumShape=true]
  6791. * @description 是否统计长度或面积。
  6792. */
  6793. this.sumShape = true;
  6794. /**
  6795. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.SummaryRegionJobParameter.prototype.query
  6796. * @description 分析范围。
  6797. */
  6798. this.query = "";
  6799. /**
  6800. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.standardSummaryFields=false]
  6801. * @description 是否以标准属字段统计。
  6802. */
  6803. this.standardSummaryFields = false;
  6804. /**
  6805. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.standardFields
  6806. * @description 标准属性字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。standardSummaryFields 为 true 时必填。
  6807. */
  6808. this.standardFields = "";
  6809. /**
  6810. * @member {SuperMap.StatisticAnalystMode} SuperMap.SummaryRegionJobParameter.prototype.standardStatisticModes
  6811. * @description 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  6812. */
  6813. this.standardStatisticModes = "";
  6814. /**
  6815. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.weightedSummaryFields=false]
  6816. * @description 是否以权重字段统计。
  6817. */
  6818. this.weightedSummaryFields = false;
  6819. /**
  6820. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.weightedFields
  6821. * @description 权重字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。weightedSummaryFields 为 true 时必填。
  6822. */
  6823. this.weightedFields = "";
  6824. /**
  6825. * @member {SuperMap.StatisticAnalystMode} SuperMap.SummaryRegionJobParameter.prototype.weightedStatisticModes
  6826. * @description 以权重字段统计的统计模式。权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  6827. */
  6828. this.weightedStatisticModes = "";
  6829. /**
  6830. * @member {number} [SuperMap.SummaryRegionJobParameter.prototype.meshType=0]
  6831. * @description 网格面汇总类型。
  6832. */
  6833. this.meshType = 0;
  6834. /**
  6835. * @member {number} [SuperMap.SummaryRegionJobParameter.prototype.resolution=100]
  6836. * @description 网格大小。
  6837. */
  6838. this.resolution = 100;
  6839. /**
  6840. * @member {SuperMap.AnalystSizeUnit} [SuperMap.SummaryRegionJobParameter.prototype.meshSizeUnit=SuperMap.AnalystSizeUnit.METER]
  6841. * @description 网格大小单位。
  6842. */
  6843. this.meshSizeUnit = AnalystSizeUnit.METER;
  6844. /**
  6845. * @member {SuperMap.SummaryType} [SuperMap.SummaryRegionJobParameter.prototype.type=SuperMap.SummaryType.SUMMARYMESH]
  6846. * @description 汇总类型。
  6847. */
  6848. this.type = SummaryType.SUMMARYMESH;
  6849. /**
  6850. * @member {SuperMap.OutputSetting} SuperMap.SummaryRegionJobParameter.prototype.output
  6851. * @description 输出参数设置类
  6852. */
  6853. this.output = null;
  6854. /**
  6855. * @member {SuperMap.MappingParameters} [SuperMap.SummaryRegionJobParameter.prototype.mappingParameters]
  6856. * @description 分析后结果可视化的参数类。
  6857. */
  6858. this.mappingParameters = null;
  6859. Util.extend(this, options);
  6860. this.CLASS_NAME = "SuperMap.SummaryRegionJobParameter";
  6861. }
  6862. /**
  6863. * @function SuperMap.SummaryRegionJobParameter.prototype.destroy
  6864. * @description 释放资源,将引用资源的属性置空。
  6865. */
  6866. SummaryRegionJobParameter_createClass(SummaryRegionJobParameter, [{
  6867. key: "destroy",
  6868. value: function destroy() {
  6869. this.datasetName = null;
  6870. this.sumShape = null;
  6871. this.regionDataset = null;
  6872. this.query = null;
  6873. this.standardSummaryFields = null;
  6874. this.standardFields = null;
  6875. this.standardStatisticModes = null;
  6876. this.weightedSummaryFields = null;
  6877. this.weightedFields = null;
  6878. this.weightedStatisticModes = null;
  6879. this.meshType = null;
  6880. this.resolution = null;
  6881. this.meshSizeUnit = null;
  6882. this.type = null;
  6883. if (this.output instanceof OutputSetting) {
  6884. this.output.destroy();
  6885. this.output = null;
  6886. }
  6887. if (this.mappingParameters instanceof MappingParameters) {
  6888. this.mappingParameters.destroy();
  6889. this.mappingParameters = null;
  6890. }
  6891. }
  6892. /**
  6893. * @function SuperMap.SummaryRegionJobParameter.toObject
  6894. * @param {Object} summaryRegionJobParameter - 矢量裁剪分析任务参数。
  6895. * @param {Object} tempObj - 目标对象。
  6896. * @description 生成区域汇总分析服务对象。
  6897. */
  6898. }], [{
  6899. key: "toObject",
  6900. value: function toObject(summaryRegionJobParameter, tempObj) {
  6901. for (var name in summaryRegionJobParameter) {
  6902. if (name === "datasetName") {
  6903. tempObj['input'] = tempObj['input'] || {};
  6904. tempObj['input'][name] = summaryRegionJobParameter[name];
  6905. continue;
  6906. }
  6907. if (name === "type") {
  6908. tempObj['type'] = summaryRegionJobParameter[name];
  6909. continue;
  6910. }
  6911. if (name === "type") {
  6912. tempObj['type'] = summaryRegionJobParameter[name];
  6913. continue;
  6914. }
  6915. if (name === "output") {
  6916. tempObj['output'] = tempObj['output'] || {};
  6917. tempObj['output'] = summaryRegionJobParameter[name];
  6918. continue;
  6919. }
  6920. if (summaryRegionJobParameter.type === "SUMMARYREGION" || summaryRegionJobParameter.type === "SUMMARYMESH" && name !== "regionDataset") {
  6921. tempObj['analyst'] = tempObj['analyst'] || {};
  6922. if (name === 'query' && summaryRegionJobParameter[name]) {
  6923. tempObj['analyst'][name] = summaryRegionJobParameter[name].toBBOX();
  6924. } else {
  6925. tempObj['analyst'][name] = summaryRegionJobParameter[name];
  6926. }
  6927. if (name === 'mappingParameters') {
  6928. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  6929. tempObj['analyst']['mappingParameters'] = summaryRegionJobParameter[name];
  6930. }
  6931. }
  6932. }
  6933. }
  6934. }]);
  6935. return SummaryRegionJobParameter;
  6936. }();
  6937. SuperMap.SummaryRegionJobParameter = SummaryRegionJobParameter;
  6938. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobParameter.js
  6939. function OverlayGeoJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6940. function OverlayGeoJobParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6941. function OverlayGeoJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  6942. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6943. * This program are made available under the terms of the Apache License, Version 2.0
  6944. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6945. /**
  6946. * @class SuperMap.OverlayGeoJobParameter
  6947. * @category iServer ProcessingService OverlayAnalyst
  6948. * @classdesc 叠加分析任务参数类。
  6949. * @param {Object} options - 参数。
  6950. * @param {string} options.datasetName - 数据集名。
  6951. * @param {string} options.datasetOverlay - 叠加对象所在的数据集名称。
  6952. * @param {string} options.srcFields - 输入数据需要保留的字段。
  6953. * @param {string} [options.overlayFields] - 叠加数据需要保留的字段。对分析模式为 clip、update、erase 时,此参数无效。
  6954. * @param {string} [options.mode] - 叠加分析模式。
  6955. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  6956. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  6957. */
  6958. var OverlayGeoJobParameter = /*#__PURE__*/function () {
  6959. function OverlayGeoJobParameter(options) {
  6960. OverlayGeoJobParameter_classCallCheck(this, OverlayGeoJobParameter);
  6961. if (!options) {
  6962. return;
  6963. }
  6964. /**
  6965. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.datasetName
  6966. * @description 数据集名。
  6967. */
  6968. this.datasetName = "";
  6969. /**
  6970. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.datasetOverlay
  6971. * @description 叠加对象所在的数据集名称。
  6972. */
  6973. this.datasetOverlay = "";
  6974. /**
  6975. * @member {string} [SuperMap.OverlayGeoJobParameter.prototype.mode]
  6976. * @description 叠加分析模式。
  6977. */
  6978. this.mode = "";
  6979. /**
  6980. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.srcFields
  6981. * @description 输入数据需要保留的字段。
  6982. */
  6983. this.srcFields = "";
  6984. /**
  6985. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.overlayFields
  6986. * @description 叠加数据需要保留的字段,对分析模式为 clip、update、erase 时,此参数无效。
  6987. */
  6988. this.overlayFields = "";
  6989. /**
  6990. * @member {SuperMap.OutputSetting} [SuperMap.OverlayGeoJobParameter.prototype.output]
  6991. * @description 输出参数设置类。
  6992. */
  6993. this.output = null;
  6994. /**
  6995. * @member {SuperMap.MappingParameters} [SuperMap.OverlayGeoJobParameter.prototype.mappingParameters]
  6996. * @description 分析后结果可视化的参数类。
  6997. */
  6998. this.mappingParameters = null;
  6999. Util.extend(this, options);
  7000. this.CLASS_NAME = "SuperMap.OverlayGeoJobParameter";
  7001. }
  7002. /**
  7003. * @function SuperMap.OverlayGeoJobParameter.destroy
  7004. * @override
  7005. */
  7006. OverlayGeoJobParameter_createClass(OverlayGeoJobParameter, [{
  7007. key: "destroy",
  7008. value: function destroy() {
  7009. this.datasetName = null;
  7010. this.datasetOverlay = null;
  7011. this.mode = null;
  7012. this.srcFields = null;
  7013. this.overlayFields = null;
  7014. if (this.output instanceof OutputSetting) {
  7015. this.output.destroy();
  7016. this.output = null;
  7017. }
  7018. if (this.mappingParameters instanceof MappingParameters) {
  7019. this.mappingParameters.destroy();
  7020. this.mappingParameters = null;
  7021. }
  7022. }
  7023. /**
  7024. * @function SuperMap.OverlayGeoJobParameter.toObject
  7025. * @param {Object} OverlayGeoJobParameter - 点聚合分析任务参数。
  7026. * @param {Object} tempObj - 目标对象。
  7027. * @description 生成点聚合分析任务对象。
  7028. */
  7029. }], [{
  7030. key: "toObject",
  7031. value: function toObject(OverlayGeoJobParameter, tempObj) {
  7032. for (var name in OverlayGeoJobParameter) {
  7033. if (name == "datasetName") {
  7034. tempObj['input'] = tempObj['input'] || {};
  7035. tempObj['input'][name] = OverlayGeoJobParameter[name];
  7036. continue;
  7037. }
  7038. if (name === "output") {
  7039. tempObj['output'] = tempObj['output'] || {};
  7040. tempObj['output'] = OverlayGeoJobParameter[name];
  7041. continue;
  7042. }
  7043. tempObj['analyst'] = tempObj['analyst'] || {};
  7044. tempObj['analyst'][name] = OverlayGeoJobParameter[name];
  7045. if (name === 'mappingParameters') {
  7046. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  7047. tempObj['analyst']['mappingParameters'] = OverlayGeoJobParameter[name];
  7048. }
  7049. }
  7050. }
  7051. }]);
  7052. return OverlayGeoJobParameter;
  7053. }();
  7054. SuperMap.OverlayGeoJobParameter = OverlayGeoJobParameter;
  7055. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsParameter.js
  7056. function BuffersAnalystJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7057. function BuffersAnalystJobsParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7058. function BuffersAnalystJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  7059. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7060. * This program are made available under the terms of the Apache License, Version 2.0
  7061. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7062. /**
  7063. * @class SuperMap.BuffersAnalystJobsParameter
  7064. * @category iServer ProcessingService BufferAnalyst
  7065. * @classdesc 缓冲区分析任务参数类。
  7066. * @param {Object} options - 参数。
  7067. * @param {string} options.datasetName - 数据集名。
  7068. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 分析范围(默认为全图范围)。
  7069. * @param {string} [options.distance='15'] - 缓冲距离,或缓冲区半径。
  7070. * @param {string} [options.distanceField='pickup_latitude'] - 缓冲区分析距离字段。
  7071. * @param {SuperMap.AnalystSizeUnit} [options.distanceUnit=SuperMap.AnalystSizeUnit.METER] - 缓冲距离单位单位。
  7072. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  7073. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  7074. */
  7075. var BuffersAnalystJobsParameter = /*#__PURE__*/function () {
  7076. function BuffersAnalystJobsParameter(options) {
  7077. BuffersAnalystJobsParameter_classCallCheck(this, BuffersAnalystJobsParameter);
  7078. /**
  7079. * @member {string} SuperMap.BuffersAnalystJobsParameter.prototype.datasetName
  7080. * @description 数据集名。
  7081. */
  7082. this.datasetName = '';
  7083. /**
  7084. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.BuffersAnalystJobsParameter.prototype.bounds
  7085. * @description 分析范围。
  7086. */
  7087. this.bounds = '';
  7088. /**
  7089. * @member {string} [SuperMap.BuffersAnalystJobsParameter.prototype.distance='15']
  7090. * @description 缓冲距离,或称为缓冲区半径。当缓冲距离字段位空时,此参数有效。
  7091. */
  7092. this.distance = '';
  7093. /**
  7094. * @member {string} [SuperMap.BuffersAnalystJobsParameter.prototype.distanceField='pickup_latitude']
  7095. * @description 缓冲距离字段。
  7096. */
  7097. this.distanceField = '';
  7098. /**
  7099. * @member {SuperMap.AnalystSizeUnit} [SuperMap.BuffersAnalystJobsParameter.prototype.distanceUnit=SuperMap.AnalystSizeUnit.METER]
  7100. * @description 缓冲距离单位。
  7101. */
  7102. this.distanceUnit = AnalystSizeUnit.METER;
  7103. /**
  7104. * @member {string} SuperMap.BuffersAnalystJobsParameter.prototype.dissolveField
  7105. * @description 融合字段,根据字段值对缓冲区结果面对象进行融合。
  7106. */
  7107. this.dissolveField = '';
  7108. /**
  7109. * @member {SuperMap.OutputSetting} [SuperMap.BuffersAnalystJobsParameter.prototype.output]
  7110. * @description 输出参数设置类。
  7111. */
  7112. this.output = null;
  7113. /**
  7114. * @member {SuperMap.MappingParameters} [SuperMap.BuffersAnalystJobsParameter.prototype.mappingParameters]
  7115. * @description 分析后结果可视化的参数类。
  7116. */
  7117. this.mappingParameters = null;
  7118. if (!options) {
  7119. return this;
  7120. }
  7121. Util.extend(this, options);
  7122. this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsParameter';
  7123. }
  7124. /**
  7125. * @function SuperMap.BuffersAnalystJobsParameter.prototype.destroy
  7126. * @description 释放资源,将引用资源的属性置空。
  7127. */
  7128. BuffersAnalystJobsParameter_createClass(BuffersAnalystJobsParameter, [{
  7129. key: "destroy",
  7130. value: function destroy() {
  7131. this.datasetName = null;
  7132. this.bounds = null;
  7133. this.distance = null;
  7134. this.distanceField = null;
  7135. this.distanceUnit = null;
  7136. this.dissolveField = null;
  7137. if (this.output instanceof OutputSetting) {
  7138. this.output.destroy();
  7139. this.output = null;
  7140. }
  7141. if (this.mappingParameters instanceof MappingParameters) {
  7142. this.mappingParameters.destroy();
  7143. this.mappingParameters = null;
  7144. }
  7145. }
  7146. /**
  7147. * @function SuperMap.BuffersAnalystJobsParameter.toObject
  7148. * @param {SuperMap.BuffersAnalystJobsParameter} BuffersAnalystJobsParameter - 缓冲区分析任务参数。
  7149. * @param {Object} tempObj - 目标对象。
  7150. * @description 生成缓冲区分析任务对象。
  7151. */
  7152. }], [{
  7153. key: "toObject",
  7154. value: function toObject(BuffersAnalystJobsParameter, tempObj) {
  7155. for (var name in BuffersAnalystJobsParameter) {
  7156. if (name === 'datasetName') {
  7157. tempObj['input'] = tempObj['input'] || {};
  7158. tempObj['input'][name] = BuffersAnalystJobsParameter[name];
  7159. continue;
  7160. }
  7161. if (name === 'output') {
  7162. tempObj['output'] = tempObj['output'] || {};
  7163. tempObj['output'] = BuffersAnalystJobsParameter[name];
  7164. continue;
  7165. }
  7166. tempObj['analyst'] = tempObj['analyst'] || {};
  7167. if (name === 'bounds' && BuffersAnalystJobsParameter[name]) {
  7168. tempObj['analyst'][name] = BuffersAnalystJobsParameter[name].toBBOX();
  7169. } else {
  7170. tempObj['analyst'][name] = BuffersAnalystJobsParameter[name];
  7171. }
  7172. if (name === 'mappingParameters') {
  7173. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  7174. tempObj['analyst']['mappingParameters'] = BuffersAnalystJobsParameter[name];
  7175. }
  7176. }
  7177. }
  7178. }]);
  7179. return BuffersAnalystJobsParameter;
  7180. }();
  7181. SuperMap.BuffersAnalystJobsParameter = BuffersAnalystJobsParameter;
  7182. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsParameter.js
  7183. function TopologyValidatorJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7184. function TopologyValidatorJobsParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7185. function TopologyValidatorJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  7186. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7187. * This program are made available under the terms of the Apache License, Version 2.0
  7188. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7189. /**
  7190. * @class SuperMap.TopologyValidatorJobsParameter
  7191. * @category iServer ProcessingService TopologyValidator
  7192. * @classdesc 拓扑检查分析任务参数类。
  7193. * @param {Object} options - 必填参数。
  7194. * @param {string} options.datasetName - 数据集名。
  7195. * @param {string} options.datasetTopology -检查对象所在的数据集名称。
  7196. * @param {SuperMap.TopologyValidatorRule} [options.rule=SuperMap.TopologyValidatorRule.REGIONNOOVERLAP] - 拓扑检查规则。
  7197. * @param {string} [options.tolerance] - 容限。
  7198. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  7199. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  7200. */
  7201. var TopologyValidatorJobsParameter = /*#__PURE__*/function () {
  7202. function TopologyValidatorJobsParameter(options) {
  7203. TopologyValidatorJobsParameter_classCallCheck(this, TopologyValidatorJobsParameter);
  7204. if (!options) {
  7205. return;
  7206. }
  7207. /**
  7208. * @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetName
  7209. * @description 数据集名。
  7210. */
  7211. this.datasetName = "";
  7212. /**
  7213. * @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetTopology
  7214. * @description 拓扑检查对象所在的数据集名称。
  7215. */
  7216. this.datasetTopology = "";
  7217. /**
  7218. * @member {string} [SuperMap.TopologyValidatorJobsParameter.prototype.tolerance]
  7219. * @description 容限,指定的拓扑错误检查时使用的容限。
  7220. */
  7221. this.tolerance = "";
  7222. /**
  7223. * @member {SuperMap.TopologyValidatorRule} [SuperMap.TopologyValidatorJobsParameter.prototype.rule=SuperMap.TopologyValidatorRule.REGIONNOOVERLAP]
  7224. * @description 拓扑检查模式。
  7225. */
  7226. this.rule = TopologyValidatorRule.REGIONNOOVERLAP;
  7227. /**
  7228. * @member {SuperMap.OutputSetting} [SuperMap.TopologyValidatorJobsParameter.prototype.output]
  7229. * @description 输出参数设置类。
  7230. */
  7231. this.output = null;
  7232. /**
  7233. * @member {SuperMap.MappingParameters} [SuperMap.TopologyValidatorJobsParameter.prototype.mappingParameters]
  7234. * @description 分析后结果可视化的参数类。
  7235. */
  7236. this.mappingParameters = null;
  7237. Util.extend(this, options);
  7238. this.CLASS_NAME = "SuperMap.TopologyValidatorJobsParameter";
  7239. }
  7240. /**
  7241. * @function SuperMap.TopologyValidatorJobsParameter.prototype.destroy
  7242. * @description 释放资源,将引用资源的属性置空。
  7243. */
  7244. TopologyValidatorJobsParameter_createClass(TopologyValidatorJobsParameter, [{
  7245. key: "destroy",
  7246. value: function destroy() {
  7247. this.datasetName = null;
  7248. this.datasetTopology = null;
  7249. this.tolerance = null;
  7250. this.rule = null;
  7251. if (this.output instanceof OutputSetting) {
  7252. this.output.destroy();
  7253. this.output = null;
  7254. }
  7255. if (this.mappingParameters instanceof MappingParameters) {
  7256. this.mappingParameters.destroy();
  7257. this.mappingParameters = null;
  7258. }
  7259. }
  7260. /**
  7261. * @function SuperMap.TopologyValidatorJobsParameter.toObject
  7262. * @param {Object} TopologyValidatorJobsParameter -拓扑检查分析任务参数。
  7263. * @param {Object} tempObj - 目标对象。
  7264. * @description 生成拓扑检查分析任务对象。
  7265. */
  7266. }], [{
  7267. key: "toObject",
  7268. value: function toObject(TopologyValidatorJobsParameter, tempObj) {
  7269. for (var name in TopologyValidatorJobsParameter) {
  7270. if (name === "datasetName") {
  7271. tempObj['input'] = tempObj['input'] || {};
  7272. tempObj['input'][name] = TopologyValidatorJobsParameter[name];
  7273. continue;
  7274. }
  7275. if (name === "output") {
  7276. tempObj['output'] = tempObj['output'] || {};
  7277. tempObj['output'] = TopologyValidatorJobsParameter[name];
  7278. continue;
  7279. }
  7280. tempObj['analyst'] = tempObj['analyst'] || {};
  7281. tempObj['analyst'][name] = TopologyValidatorJobsParameter[name];
  7282. if (name === 'mappingParameters') {
  7283. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  7284. tempObj['analyst']['mappingParameters'] = TopologyValidatorJobsParameter[name];
  7285. }
  7286. }
  7287. }
  7288. }]);
  7289. return TopologyValidatorJobsParameter;
  7290. }();
  7291. SuperMap.TopologyValidatorJobsParameter = TopologyValidatorJobsParameter;
  7292. ;// CONCATENATED MODULE: ./src/common/iServer/GeoCodingParameter.js
  7293. function GeoCodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7294. function GeoCodingParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7295. function GeoCodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoCodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoCodingParameter_defineProperties(Constructor, staticProps); return Constructor; }
  7296. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7297. * This program are made available under the terms of the Apache License, Version 2.0
  7298. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7299. /**
  7300. * @class SuperMap.GeoCodingParameter
  7301. * @category iServer AddressMatch
  7302. * @classdesc 地理正向匹配参数类。
  7303. * @param {Object} options - 参数。
  7304. * @param {string} options.address - 地点关键词。
  7305. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  7306. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  7307. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  7308. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  7309. * @param {number} [options.maxReturn] - 最大返回结果数。
  7310. */
  7311. var GeoCodingParameter = /*#__PURE__*/function () {
  7312. function GeoCodingParameter(options) {
  7313. GeoCodingParameter_classCallCheck(this, GeoCodingParameter);
  7314. if (options.filters && typeof options.filters === 'string') {
  7315. options.filters = options.filters.split(',');
  7316. }
  7317. /**
  7318. * @member {string} SuperMap.GeoCodingParameter.prototype.address
  7319. * @description 地点关键词。
  7320. */
  7321. this.address = null;
  7322. /**
  7323. * @member {number} [SuperMap.GeoCodingParameter.prototype.fromIndex]
  7324. * @description 设置返回对象的起始索引值。
  7325. */
  7326. this.fromIndex = null;
  7327. /**
  7328. * @member {number} [SuperMap.GeoCodingParameter.prototype.toIndex]
  7329. * @description 设置返回对象的结束索引值。
  7330. */
  7331. this.toIndex = null;
  7332. /**
  7333. * @member {Array.<string>} [SuperMap.GeoCodingParameter.prototype.filters]
  7334. * @description 过滤字段,限定查询区域。
  7335. */
  7336. this.filters = null;
  7337. /**
  7338. * @member {string} [SuperMap.GeoCodingParameter.prototype.prjCoordSys]
  7339. * @description 查询结果的坐标系。
  7340. */
  7341. this.prjCoordSys = null;
  7342. /**
  7343. * @member {number} [SuperMap.GeoCodingParameter.prototype.maxReturn]
  7344. * @description 最大返回结果数。
  7345. */
  7346. this.maxReturn = null;
  7347. Util.extend(this, options);
  7348. }
  7349. /**
  7350. * @function SuperMap.GeoCodingParameter.prototype.destroy
  7351. * @description 释放资源,将引用资源的属性置空。
  7352. */
  7353. GeoCodingParameter_createClass(GeoCodingParameter, [{
  7354. key: "destroy",
  7355. value: function destroy() {
  7356. this.address = null;
  7357. this.fromIndex = null;
  7358. this.toIndex = null;
  7359. this.filters = null;
  7360. this.prjCoordSys = null;
  7361. this.maxReturn = null;
  7362. }
  7363. }]);
  7364. return GeoCodingParameter;
  7365. }();
  7366. SuperMap.GeoCodingParameter = GeoCodingParameter;
  7367. ;// CONCATENATED MODULE: ./src/common/iServer/GeoDecodingParameter.js
  7368. function GeoDecodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7369. function GeoDecodingParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7370. function GeoDecodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoDecodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoDecodingParameter_defineProperties(Constructor, staticProps); return Constructor; }
  7371. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7372. * This program are made available under the terms of the Apache License, Version 2.0
  7373. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7374. /**
  7375. * @class SuperMap.GeoDecodingParameter
  7376. * @category iServer AddressMatch
  7377. * @classdesc 地理反向匹配参数类。
  7378. * @param {Object} options - 参数。
  7379. * @param {number} options.x - 查询位置的横坐标。
  7380. * @param {number} options.y - 查询位置的纵坐标。
  7381. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  7382. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  7383. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  7384. * @param {number} [options.maxReturn] - 最大返回结果数。
  7385. * @param {number} [options.geoDecodingRadius] - 查询半径。
  7386. */
  7387. var GeoDecodingParameter = /*#__PURE__*/function () {
  7388. function GeoDecodingParameter(options) {
  7389. GeoDecodingParameter_classCallCheck(this, GeoDecodingParameter);
  7390. if (options.filters) {
  7391. options.filters = options.filters.split(',');
  7392. }
  7393. /**
  7394. * @member {number} SuperMap.GeoDecodingParameter.prototype.x
  7395. * @description 查询位置的横坐标。
  7396. */
  7397. this.x = null;
  7398. /**
  7399. * @member {number} SuperMap.GeoDecodingParameter.prototype.y
  7400. * @description 查询位置的纵坐标。
  7401. */
  7402. this.y = null;
  7403. /**
  7404. * @member {number} [SuperMap.GeoDecodingParameter.prototype.fromIndex]
  7405. * @description 设置返回对象的起始索引值。
  7406. */
  7407. this.fromIndex = null;
  7408. /**
  7409. * @member {number} [SuperMap.GeoDecodingParameter.prototype.toIndex]
  7410. * @description 设置返回对象的结束索引值。
  7411. */
  7412. this.toIndex = null;
  7413. /**
  7414. * @member {Array.<string>} [SuperMap.GeoDecodingParameter.prototype.filters]
  7415. * @description 过滤字段,限定查询区域。
  7416. */
  7417. this.filters = null;
  7418. /**
  7419. * @member {string} [SuperMap.GeoDecodingParameter.prototype.prjCoordSys]
  7420. * @description 查询结果的坐标系。
  7421. */
  7422. this.prjCoordSys = null;
  7423. /**
  7424. * @member {number} [SuperMap.GeoDecodingParameter.prototype.maxReturn]
  7425. * @description 最大返回结果数。
  7426. */
  7427. this.maxReturn = null;
  7428. /**
  7429. * @member {number} SuperMap.GeoDecodingParameter.prototype.geoDecodingRadius
  7430. * @description 查询半径。
  7431. */
  7432. this.geoDecodingRadius = null;
  7433. Util.extend(this, options);
  7434. }
  7435. /**
  7436. * @function SuperMap.GeoDecodingParameter.prototype.destroy
  7437. * @description 释放资源,将引用资源的属性置空。
  7438. */
  7439. GeoDecodingParameter_createClass(GeoDecodingParameter, [{
  7440. key: "destroy",
  7441. value: function destroy() {
  7442. this.x = null;
  7443. this.y = null;
  7444. this.fromIndex = null;
  7445. this.toIndex = null;
  7446. this.filters = null;
  7447. this.prjCoordSys = null;
  7448. this.maxReturn = null;
  7449. this.geoDecodingRadius = null;
  7450. }
  7451. }]);
  7452. return GeoDecodingParameter;
  7453. }();
  7454. SuperMap.GeoDecodingParameter = GeoDecodingParameter;
  7455. ;// CONCATENATED MODULE: ./src/classic/SuperMap.js
  7456. var SuperMap_SuperMap = window.SuperMap = window.SuperMap || {};
  7457. SuperMap_SuperMap.REST = SuperMap_SuperMap.REST || {};
  7458. ;// CONCATENATED MODULE: external "function(){try{return mapv}catch(e){return {}}}()"
  7459. var external_function_try_return_mapv_catch_e_return_namespaceObject = function(){try{return mapv}catch(e){return {}}}();
  7460. ;// CONCATENATED MODULE: ./src/common/util/MapCalculateUtil.js
  7461. var getMeterPerMapUnit = function getMeterPerMapUnit(mapUnit) {
  7462. var earchRadiusInMeters = 6378137;
  7463. var meterPerMapUnit;
  7464. if (mapUnit === Unit.METER) {
  7465. meterPerMapUnit = 1;
  7466. } else if (mapUnit === Unit.DEGREE) {
  7467. // 每度表示多少米。
  7468. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  7469. } else if (mapUnit === Unit.KILOMETER) {
  7470. meterPerMapUnit = 1.0e-3;
  7471. } else if (mapUnit === Unit.INCH) {
  7472. meterPerMapUnit = 1 / 2.5399999918e-2;
  7473. } else if (mapUnit === Unit.FOOT) {
  7474. meterPerMapUnit = 0.3048;
  7475. } else {
  7476. return meterPerMapUnit;
  7477. }
  7478. return meterPerMapUnit;
  7479. };
  7480. function getWrapNum(x) {
  7481. var includeMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  7482. var includeMin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7483. var range = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [-180, 180];
  7484. var max = range[1],
  7485. min = range[0],
  7486. d = max - min;
  7487. if (x === max && includeMax) {
  7488. return x;
  7489. }
  7490. if (x === min && includeMin) {
  7491. return x;
  7492. }
  7493. var tmp = ((x - min) % d + d) % d;
  7494. if (tmp === 0 && includeMax) {
  7495. return max;
  7496. }
  7497. return ((x - min) % d + d) % d + min;
  7498. }
  7499. function conversionDegree(degrees) {
  7500. var degree = parseInt(degrees);
  7501. var fraction = parseInt((degrees - degree) * 60);
  7502. var second = parseInt(((degrees - degree) * 60 - fraction) * 60);
  7503. fraction = parseInt(fraction / 10) === 0 ? "0".concat(fraction) : fraction;
  7504. second = parseInt(second / 10) === 0 ? "0".concat(second) : second;
  7505. return "".concat(degree, "\xB0").concat(fraction, "'").concat(second);
  7506. }
  7507. ;// CONCATENATED MODULE: ./src/classic/overlay/mapv/MapVRenderer.js
  7508. function MapVRenderer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MapVRenderer_typeof = function _typeof(obj) { return typeof obj; }; } else { MapVRenderer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MapVRenderer_typeof(obj); }
  7509. function MapVRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7510. function MapVRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7511. function MapVRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapVRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapVRenderer_defineProperties(Constructor, staticProps); return Constructor; }
  7512. function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
  7513. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
  7514. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7515. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7516. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  7517. function _possibleConstructorReturn(self, call) { if (call && (MapVRenderer_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7518. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7519. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  7520. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7521. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7522. * This program are made available under the terms of the Apache License, Version 2.0
  7523. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7524. /**
  7525. * @class MapVRenderer
  7526. * @classdesc MapV渲染器。
  7527. * @private
  7528. * @extends {mapv.baiduMapLayer}
  7529. * @param {SuperMap.Map} map - 待渲染的地图。
  7530. * @param {SuperMap.Layer.MapVLayer} layer - 待渲染的图层。
  7531. * @param {Mapv.DataSet} dataSet - 待渲染的数据集,数据所属坐标系要求与 map 保持一致。
  7532. * @param {Object} options - 渲染的参数。
  7533. */
  7534. var MapVBaseLayer = external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer ? external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer.__proto__ : Function;
  7535. var MapVRenderer = /*#__PURE__*/function (_MapVBaseLayer) {
  7536. _inherits(MapVRenderer, _MapVBaseLayer);
  7537. var _super = _createSuper(MapVRenderer);
  7538. function MapVRenderer(map, layer, dataSet, options) {
  7539. var _this;
  7540. MapVRenderer_classCallCheck(this, MapVRenderer);
  7541. _this = _super.call(this, map, dataSet, options);
  7542. if (!MapVBaseLayer) {
  7543. return _possibleConstructorReturn(_this, _assertThisInitialized(_this));
  7544. }
  7545. var self = _assertThisInitialized(_this);
  7546. options = options || {};
  7547. self.init(options);
  7548. self.argCheck(options);
  7549. _this.canvasLayer = layer;
  7550. _this.clickEvent = _this.clickEvent.bind(_assertThisInitialized(_this));
  7551. _this.mousemoveEvent = _this.mousemoveEvent.bind(_assertThisInitialized(_this));
  7552. _this.bindEvent();
  7553. return _this;
  7554. }
  7555. /**
  7556. * @function MapvRenderer.prototype.clickEvent
  7557. * @description 点击事件。
  7558. * @param {Object} e - 触发对象。
  7559. */
  7560. MapVRenderer_createClass(MapVRenderer, [{
  7561. key: "clickEvent",
  7562. value: function clickEvent(e) {
  7563. var pixel = e.xy;
  7564. _get(_getPrototypeOf(MapVRenderer.prototype), "clickEvent", this).call(this, pixel, e);
  7565. }
  7566. /**
  7567. * @function MapvRenderer.prototype.mousemoveEvent
  7568. * @description 鼠标移动事件。
  7569. * @param {Object} e - 触发对象。
  7570. */
  7571. }, {
  7572. key: "mousemoveEvent",
  7573. value: function mousemoveEvent(e) {
  7574. var pixel = e.xy;
  7575. _get(_getPrototypeOf(MapVRenderer.prototype), "mousemoveEvent", this).call(this, pixel, e);
  7576. }
  7577. /**
  7578. * @function MapvRenderer.prototype.bindEvent
  7579. * @description 绑定鼠标移动和鼠标点击事件。
  7580. */
  7581. }, {
  7582. key: "bindEvent",
  7583. value: function bindEvent() {
  7584. var map = this.map;
  7585. if (this.options.methods) {
  7586. if (this.options.methods.click) {
  7587. map.events.on({
  7588. 'click': this.clickEvent
  7589. });
  7590. }
  7591. if (this.options.methods.mousemove) {
  7592. map.events.on({
  7593. 'mousemove': this.mousemoveEvent
  7594. });
  7595. }
  7596. }
  7597. }
  7598. /**
  7599. * @function MapvRenderer.prototype.unbindEvent
  7600. * @description 解绑鼠标移动和鼠标滑动触发的事件。
  7601. */
  7602. }, {
  7603. key: "unbindEvent",
  7604. value: function unbindEvent() {
  7605. var map = this.map;
  7606. if (this.options.methods) {
  7607. if (this.options.methods.click) {
  7608. map.events.un({
  7609. 'click': this.clickEvent
  7610. });
  7611. }
  7612. if (this.options.methods.mousemove) {
  7613. map.events.un({
  7614. 'mousemove': this.mousemoveEvent
  7615. });
  7616. }
  7617. }
  7618. }
  7619. /**
  7620. * @function MapvRenderer.prototype.getContext
  7621. * @description 获取信息。
  7622. */
  7623. }, {
  7624. key: "getContext",
  7625. value: function getContext() {
  7626. return this.canvasLayer && this.canvasLayer.canvasContext;
  7627. }
  7628. /**
  7629. * @function MapvRenderer.prototype.addData
  7630. * @description 追加数据
  7631. * @param {oject} data - 待添加的数据。
  7632. * @param {oject} options - 待添加的数据信息。
  7633. */
  7634. }, {
  7635. key: "addData",
  7636. value: function addData(data, options) {
  7637. var _data = data;
  7638. if (data && data.get) {
  7639. _data = data.get();
  7640. }
  7641. this.dataSet.add(_data);
  7642. this.update({
  7643. options: options
  7644. });
  7645. }
  7646. /**
  7647. * @function MapvRenderer.prototype.updateData
  7648. * @description 更新覆盖原数据。
  7649. * @param {oject} data - 待更新的数据。
  7650. * @param {oject} options - 待更新的数据信息。
  7651. */
  7652. }, {
  7653. key: "setData",
  7654. value: function setData(data, options) {
  7655. var _data = data;
  7656. if (data && data.get) {
  7657. _data = data.get();
  7658. }
  7659. this.dataSet = this.dataSet || new external_function_try_return_mapv_catch_e_return_namespaceObject.DataSet();
  7660. this.dataSet.set(_data);
  7661. this.update({
  7662. options: options
  7663. });
  7664. }
  7665. /**
  7666. * @function MapvRenderer.prototype.getData
  7667. * @description 获取数据。
  7668. */
  7669. }, {
  7670. key: "getData",
  7671. value: function getData() {
  7672. return this.dataSet;
  7673. }
  7674. /**
  7675. * @function MapvRenderer.prototype.removeData
  7676. * @description 删除符合过滤条件的数据。
  7677. * @param {function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  7678. */
  7679. }, {
  7680. key: "removeData",
  7681. value: function removeData(_filter) {
  7682. if (!this.dataSet) {
  7683. return;
  7684. }
  7685. var newData = this.dataSet.get({
  7686. filter: function filter(data) {
  7687. return _filter != null && typeof _filter === "function" ? !_filter(data) : true;
  7688. }
  7689. });
  7690. this.dataSet.set(newData);
  7691. this.update({
  7692. options: null
  7693. });
  7694. }
  7695. /**
  7696. * @function MapvRenderer.prototype.clearData
  7697. * @description 清除数据。
  7698. */
  7699. }, {
  7700. key: "clearData",
  7701. value: function clearData() {
  7702. this.dataSet && this.dataSet.clear();
  7703. this.update({
  7704. options: null
  7705. });
  7706. }
  7707. /**
  7708. * @function MapvRenderer.prototype.render
  7709. * @description 着色。
  7710. * @param {number} time
  7711. */
  7712. }, {
  7713. key: "render",
  7714. value: function render(time) {
  7715. this._canvasUpdate(time);
  7716. }
  7717. /**
  7718. * @function MapvRenderer.prototype.transferToMercator
  7719. * @description 墨卡托坐标为经纬度。
  7720. * @deprecated
  7721. */
  7722. }, {
  7723. key: "transferToMercator",
  7724. value: function transferToMercator() {
  7725. if (this.options.coordType && ["bd09mc", "coordinates_mercator"].indexOf(this.options.coordType) > -1) {
  7726. var data = this.dataSet.get();
  7727. data = this.dataSet.transferCoordinate(data, function (coordinates) {
  7728. var pixel = SuperMap_SuperMap.Projection.transform({
  7729. x: coordinates[0],
  7730. y: coordinates[1]
  7731. }, "EPSG:3857", "EPSG:4326");
  7732. return [pixel.x, pixel.y];
  7733. }, 'coordinates', 'coordinates');
  7734. this.dataSet._set(data);
  7735. }
  7736. }
  7737. }, {
  7738. key: "_canvasUpdate",
  7739. value: function _canvasUpdate(time) {
  7740. if (!this.canvasLayer) {
  7741. return;
  7742. }
  7743. var self = this;
  7744. var animationOptions = self.options.animation;
  7745. var context = this.getContext();
  7746. var map = this.map;
  7747. if (self.isEnabledTime()) {
  7748. if (time === undefined) {
  7749. this.clear(context);
  7750. return;
  7751. }
  7752. if (this.context === '2d') {
  7753. context.save();
  7754. context.globalCompositeOperation = 'destination-out';
  7755. context.fillStyle = 'rgba(0, 0, 0, .1)';
  7756. context.fillRect(0, 0, context.canvas.width, context.canvas.height);
  7757. context.restore();
  7758. }
  7759. } else {
  7760. this.clear(context);
  7761. }
  7762. if (this.context === '2d') {
  7763. for (var key in self.options) {
  7764. context[key] = self.options[key];
  7765. }
  7766. } else {
  7767. context.clear(context.COLOR_BUFFER_BIT);
  7768. }
  7769. if (self.options.minZoom && map.getZoom() < self.options.minZoom || self.options.maxZoom && map.getZoom() > self.options.maxZoom) {
  7770. return;
  7771. }
  7772. var layer = self.canvasLayer;
  7773. var dataGetOptions = {
  7774. fromColumn: 'coordinates',
  7775. transferCoordinate: function transferCoordinate(coordinate) {
  7776. // var coord = layer.transferToMapLatLng({lon: coordinate[0], lat: coordinate[1]});
  7777. var coord = {
  7778. lon: coordinate[0],
  7779. lat: coordinate[1]
  7780. };
  7781. var worldPoint = map.getViewPortPxFromLonLat(coord);
  7782. return [worldPoint.x, worldPoint.y];
  7783. }
  7784. };
  7785. if (time !== undefined) {
  7786. dataGetOptions.filter = function (item) {
  7787. var trails = animationOptions.trails || 10;
  7788. return time && item.time > time - trails && item.time < time;
  7789. };
  7790. }
  7791. var data = self.dataSet.get(dataGetOptions);
  7792. this.processData(data); // 一个像素是多少米
  7793. var zoomUnit = map.getResolution() * getMeterPerMapUnit('DEGREE'); // // 兼容unit为'm'的情况
  7794. if (self.options.unit === 'm') {
  7795. if (self.options.size) {
  7796. self.options._size = self.options.size / zoomUnit;
  7797. }
  7798. if (self.options.width) {
  7799. self.options._width = self.options.width / zoomUnit;
  7800. }
  7801. if (self.options.height) {
  7802. self.options._height = self.options.height / zoomUnit;
  7803. }
  7804. } else {
  7805. self.options._size = self.options.size;
  7806. self.options._height = self.options.height;
  7807. self.options._width = self.options.width;
  7808. }
  7809. var worldPoint = map.getViewPortPxFromLonLat(layer.transferToMapLatLng({
  7810. lon: 0,
  7811. lat: 0
  7812. }));
  7813. this.drawContext(context, data, self.options, worldPoint);
  7814. self.options.updateCallback && self.options.updateCallback(time);
  7815. }
  7816. }, {
  7817. key: "init",
  7818. value: function init(options) {
  7819. var self = this;
  7820. self.options = options;
  7821. this.initDataRange(options);
  7822. this.context = self.options.context || '2d';
  7823. if (self.options.zIndex) {
  7824. this.canvasLayer && this.canvasLayer.setZIndex(self.options.zIndex);
  7825. }
  7826. this.initAnimator();
  7827. }
  7828. /**
  7829. * @function MapvRenderer.prototype.addAnimatorEvent
  7830. * @description 添加动画事件。
  7831. */
  7832. }, {
  7833. key: "addAnimatorEvent",
  7834. value: function addAnimatorEvent() {
  7835. this.map.events.on({
  7836. 'movestart': this.animatorMovestartEvent.bind(this)
  7837. });
  7838. this.map.events.on({
  7839. 'moveend': this.animatorMoveendEvent.bind(this)
  7840. });
  7841. }
  7842. /**
  7843. * @function MapvRenderer.prototype.clear
  7844. * @description 清除环境。
  7845. * @param {Object} context - 当前环境。
  7846. */
  7847. }, {
  7848. key: "clear",
  7849. value: function clear(context) {
  7850. context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  7851. }
  7852. /**
  7853. * @function MapvRenderer.prototype.show
  7854. * @description 展示渲染效果。
  7855. */
  7856. }, {
  7857. key: "show",
  7858. value: function show() {
  7859. this.map.addLayer(this.canvasLayer);
  7860. }
  7861. /**
  7862. * @function MapvRenderer.prototype.hide
  7863. * @description 隐藏渲染效果。
  7864. */
  7865. }, {
  7866. key: "hide",
  7867. value: function hide() {
  7868. this.map.removeLayer(this.canvasLayer);
  7869. }
  7870. /**
  7871. * @function MapvRenderer.prototype.draw
  7872. * @description 渲染绘制。
  7873. */
  7874. }, {
  7875. key: "draw",
  7876. value: function draw() {
  7877. this.canvasLayer.redraw();
  7878. }
  7879. }]);
  7880. return MapVRenderer;
  7881. }(MapVBaseLayer);
  7882. ;// CONCATENATED MODULE: ./src/classic/overlay/MapVLayer.js
  7883. function MapVLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MapVLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { MapVLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MapVLayer_typeof(obj); }
  7884. function MapVLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7885. function MapVLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7886. function MapVLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapVLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapVLayer_defineProperties(Constructor, staticProps); return Constructor; }
  7887. function MapVLayer_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { MapVLayer_get = Reflect.get; } else { MapVLayer_get = function _get(target, property, receiver) { var base = MapVLayer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return MapVLayer_get(target, property, receiver || target); }
  7888. function MapVLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapVLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  7889. function MapVLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MapVLayer_setPrototypeOf(subClass, superClass); }
  7890. function MapVLayer_setPrototypeOf(o, p) { MapVLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapVLayer_setPrototypeOf(o, p); }
  7891. function MapVLayer_createSuper(Derived) { var hasNativeReflectConstruct = MapVLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MapVLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MapVLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MapVLayer_possibleConstructorReturn(this, result); }; }
  7892. function MapVLayer_possibleConstructorReturn(self, call) { if (call && (MapVLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return MapVLayer_assertThisInitialized(self); }
  7893. function MapVLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7894. function MapVLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  7895. function MapVLayer_getPrototypeOf(o) { MapVLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapVLayer_getPrototypeOf(o); }
  7896. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7897. * This program are made available under the terms of the Apache License, Version 2.0
  7898. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7899. /**
  7900. * @class SuperMap.Layer.MapVLayer
  7901. * @category Visualization MapV
  7902. * @classdesc MapV 图层。
  7903. * @extends {SuperMap.Layer}
  7904. * @param {string} name - 图层名。
  7905. * @param {Object} options - 可选参数。
  7906. * @param {Mapv.DataSet} options.dataSet - mapv 的 dataSet 对象。
  7907. * @param {Object} options.options - mapv 绘图风格配置信息。
  7908. */
  7909. var MapVLayer = /*#__PURE__*/function (_SuperMap$Layer) {
  7910. MapVLayer_inherits(MapVLayer, _SuperMap$Layer);
  7911. var _super = MapVLayer_createSuper(MapVLayer);
  7912. function MapVLayer(name, options) {
  7913. var _this;
  7914. MapVLayer_classCallCheck(this, MapVLayer);
  7915. _this = _super.call(this, name, options);
  7916. /**
  7917. * @member {mapv.DataSet} SuperMap.Layer.MapVLayer.prototype.dataSet
  7918. * @description mapv dataset 对象。
  7919. */
  7920. _this.dataSet = null;
  7921. /**
  7922. * @member {Object} SuperMap.Layer.MapVLayer.prototype.options
  7923. * @description mapv 绘图风格配置信息。
  7924. */
  7925. _this.options = null;
  7926. /**
  7927. * @member {boolean} [SuperMap.Layer.MapVLayer.prototype.supported=false]
  7928. * @description 当前浏览器是否支持 canvas 绘制。决定了 MapV 图是否可用,内部判断使用。
  7929. */
  7930. _this.supported = false;
  7931. /**
  7932. * @member {Canvas} SuperMap.Layer.MapVLayer.prototype.canvas
  7933. * @description MapV 图主绘制面板。
  7934. */
  7935. _this.canvas = null;
  7936. /**
  7937. * @private
  7938. * @member {CanvasContext} SuperMap.Layer.MapVLayer.prototype.canvasContext
  7939. * @description MapV 图主绘制对象。
  7940. */
  7941. _this.canvasContext = null;
  7942. if (options) {
  7943. SuperMap_SuperMap.Util.extend(MapVLayer_assertThisInitialized(_this), options);
  7944. } //MapV图要求使用canvas绘制,判断是否支持
  7945. _this.canvas = document.createElement('canvas');
  7946. if (!_this.canvas.getContext) {
  7947. return MapVLayer_possibleConstructorReturn(_this);
  7948. }
  7949. _this.supported = true; //构建绘图面板
  7950. _this.canvas.style.position = 'absolute';
  7951. _this.canvas.style.top = 0 + 'px';
  7952. _this.canvas.style.left = 0 + 'px';
  7953. _this.div.appendChild(_this.canvas);
  7954. var context = _this.options && _this.options.context || '2d';
  7955. _this.canvasContext = _this.canvas.getContext(context);
  7956. var global$2 = typeof window === 'undefined' ? {} : window;
  7957. var devicePixelRatio = _this.devicePixelRatio = global$2.devicePixelRatio || 1;
  7958. if (context == '2d') {
  7959. _this.canvasContext.scale(devicePixelRatio, devicePixelRatio);
  7960. }
  7961. _this.attribution = "© 2018 百度 <a href='https://mapv.baidu.com' target='_blank'>MapV</a> with <span>© <a target='_blank' href='https://iclient.supermap.io' " + "style='color: #08c;text-decoration: none;'>SuperMap iClient</a></span>";
  7962. _this.CLASS_NAME = 'SuperMap.Layer.MapVLayer';
  7963. return _this;
  7964. }
  7965. /**
  7966. * @function SuperMap.Layer.MapVLayer.prototype.destroy
  7967. * @override
  7968. */
  7969. MapVLayer_createClass(MapVLayer, [{
  7970. key: "destroy",
  7971. value: function destroy() {
  7972. if (this.renderer && this.renderer.animator) {
  7973. this.renderer.animator.stop();
  7974. this.renderer.animator = null;
  7975. }
  7976. this.dataSet = null;
  7977. this.options = null;
  7978. this.renderer = null;
  7979. this.supported = null;
  7980. this.canvas = null;
  7981. this.canvasContext = null;
  7982. this.maxWidth = null;
  7983. this.maxHeight = null;
  7984. MapVLayer_get(MapVLayer_getPrototypeOf(MapVLayer.prototype), "destroy", this).call(this);
  7985. }
  7986. /**
  7987. * @function SuperMap.Layer.MapVLayer.prototype.addData
  7988. * @description 追加数据。
  7989. * @param {mapv.DataSet} dataSet - mapv 数据集。
  7990. * @param {Object} options - mapv 绘图参数。
  7991. */
  7992. }, {
  7993. key: "addData",
  7994. value: function addData(dataSet, options) {
  7995. this.renderer && this.renderer.addData(dataSet, options);
  7996. }
  7997. /**
  7998. * @function SuperMap.Layer.MapVLayer.prototype.
  7999. * @description 设置数据。
  8000. * @param {mapv.DataSet} dataSet - mapv 数据集。
  8001. * @param {Object} options - mapv 绘图参数。
  8002. */
  8003. }, {
  8004. key: "setData",
  8005. value: function setData(dataSet, options) {
  8006. this.renderer && this.renderer.setData(dataSet, options);
  8007. }
  8008. /**
  8009. * @function SuperMap.Layer.MapVLayer.prototype.getData
  8010. * @description 获取数据。
  8011. * @returns {mapv.DataSet} - mapv 数据集。
  8012. */
  8013. }, {
  8014. key: "getData",
  8015. value: function getData() {
  8016. if (this.renderer) {
  8017. this.dataSet = this.renderer.getData();
  8018. }
  8019. return this.dataSet;
  8020. }
  8021. /**
  8022. * @function SuperMap.Layer.MapVLayer.prototype.removeData
  8023. * @description 删除符合过滤条件的数据。
  8024. * @param {function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  8025. * @example
  8026. * filter=function(data){
  8027. * if(data.id=="1"){
  8028. * return true
  8029. * }
  8030. * return false;
  8031. * }
  8032. */
  8033. }, {
  8034. key: "removeData",
  8035. value: function removeData(filter) {
  8036. this.renderer && this.renderer.removeData(filter);
  8037. }
  8038. /**
  8039. * @function SuperMap.Layer.MapVLayer.prototype.clearData
  8040. * @description 清除数据
  8041. */
  8042. }, {
  8043. key: "clearData",
  8044. value: function clearData() {
  8045. this.renderer.clearData();
  8046. }
  8047. /**
  8048. * @function SuperMap.Layer.MapVLayer.prototype.setMap
  8049. * @description 图层已经添加到 Map 中。
  8050. * 如果当前浏览器支持 canvas,则开始渲染要素;如果不支持则移除图层。
  8051. * @param {SuperMap.Map} map - 需要绑定的 map 对象。
  8052. */
  8053. }, {
  8054. key: "setMap",
  8055. value: function setMap(map) {
  8056. MapVLayer_get(MapVLayer_getPrototypeOf(MapVLayer.prototype), "setMap", this).call(this, map);
  8057. this.renderer = new MapVRenderer(map, this, this.dataSet, this.options);
  8058. if (!this.supported) {
  8059. this.map.removeLayer(this);
  8060. } else {
  8061. this.redraw();
  8062. }
  8063. }
  8064. /**
  8065. * @function SuperMap.Layer.MapVLayer.prototype.moveTo
  8066. * @description 重置当前 MapV 图层的 div,再一次与 Map 控件保持一致。
  8067. * 修改当前显示范围,当平移或者缩放结束后开始重绘 MapV 图的渲染效果。
  8068. * @param {SuperMap.Bounds} bounds - 图层范围。
  8069. * @param {boolean} [zoomChanged] - 缩放级别是否改变。
  8070. * @param {boolean} [dragging] - 是否拖动。
  8071. */
  8072. }, {
  8073. key: "moveTo",
  8074. value: function moveTo(bounds, zoomChanged, dragging) {
  8075. MapVLayer_get(MapVLayer_getPrototypeOf(MapVLayer.prototype), "moveTo", this).call(this, bounds, zoomChanged, dragging);
  8076. if (!this.supported) {
  8077. return;
  8078. }
  8079. this.zoomChanged = zoomChanged;
  8080. if (!dragging) {
  8081. this.div.style.visibility = 'hidden';
  8082. this.div.style.left = -parseInt(this.map.layerContainerDiv.style.left) + 'px';
  8083. this.div.style.top = -parseInt(this.map.layerContainerDiv.style.top) + 'px';
  8084. /*this.canvas.style.left = this.div.style.left;
  8085. this.canvas.style.top = this.div.style.top;*/
  8086. var size = this.map.getSize();
  8087. this.div.style.width = parseInt(size.w) + 'px';
  8088. this.div.style.height = parseInt(size.h) + 'px';
  8089. this.canvas.width = parseInt(size.w);
  8090. this.canvas.height = parseInt(size.h);
  8091. this.canvas.style.width = this.div.style.width;
  8092. this.canvas.style.height = this.div.style.height;
  8093. this.maxWidth = size.w;
  8094. this.maxHeight = size.h;
  8095. this.div.style.visibility = '';
  8096. if (!zoomChanged) {
  8097. this.renderer && this.renderer.render();
  8098. }
  8099. }
  8100. if (zoomChanged) {
  8101. this.renderer && this.renderer.render();
  8102. }
  8103. }
  8104. /**
  8105. * @function SuperMap.Layer.MapVLayer.prototype.transferToMapLatLng
  8106. * @description 将经纬度转成底图的投影坐标。
  8107. * @param {SuperMap.Lonlat} latLng - 经纬度坐标。
  8108. * @deprecated
  8109. */
  8110. }, {
  8111. key: "transferToMapLatLng",
  8112. value: function transferToMapLatLng(latLng) {
  8113. var source = 'EPSG:4326',
  8114. dest = 'EPSG:4326';
  8115. var unit = this.map.getUnits() || 'degree';
  8116. if (['m', 'meter'].indexOf(unit.toLowerCase()) > -1) {
  8117. dest = 'EPSG:3857';
  8118. }
  8119. return new SuperMap_SuperMap.LonLat(latLng.lon, latLng.lat).transform(source, dest);
  8120. }
  8121. }]);
  8122. return MapVLayer;
  8123. }(SuperMap_SuperMap.Layer);
  8124. SuperMap_SuperMap.Layer.MapVLayer = MapVLayer;
  8125. ;// CONCATENATED MODULE: ./src/classic/overlay/mapv/index.js
  8126. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8127. * This program are made available under the terms of the Apache License, Version 2.0
  8128. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8129. ;// CONCATENATED MODULE: ./src/classic/overlay/index.js
  8130. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8131. * This program are made available under the terms of the Apache License, Version 2.0
  8132. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8133. ;// CONCATENATED MODULE: ./src/common/commontypes/Credential.js
  8134. function Credential_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8135. function Credential_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8136. function Credential_createClass(Constructor, protoProps, staticProps) { if (protoProps) Credential_defineProperties(Constructor.prototype, protoProps); if (staticProps) Credential_defineProperties(Constructor, staticProps); return Constructor; }
  8137. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8138. * This program are made available under the terms of the Apache License, Version 2.0
  8139. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8140. /**
  8141. * @class SuperMap.Credential
  8142. * @category Security
  8143. * @classdesc SuperMap 的安全证书类,其中包括 token 等安全验证信息。</br>
  8144. * 需要使用用户名和密码在:"http://localhost:8090/iserver/services/security/tokens" 下申请 value。</br>
  8145. * 获得形如:"2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.." 的 value。</br>
  8146. * 目前支持的功能包括:地图服务、专题图、量算、查询、公交换乘、空间分析、网络分析,不支持轮询功能。</br>
  8147. * @param {string} value - 访问受安全限制的服务时用于通过安全认证的验证信息。
  8148. * @param {string} [name='token'] - 验证信息前缀,name=value 部分的 name 部分。
  8149. * @example
  8150. * var pixcel = new SuperMap.Credential("valueString","token");
  8151. * pixcel.destroy();
  8152. */
  8153. var Credential = /*#__PURE__*/function () {
  8154. function Credential(value, name) {
  8155. Credential_classCallCheck(this, Credential);
  8156. /**
  8157. * @member {string} SuperMap.Bounds.prototype.value
  8158. * @description 访问受安全限制的服务时用于通过安全认证的验证信息。
  8159. */
  8160. this.value = value ? value : "";
  8161. /**
  8162. * @member {string} [SuperMap.Bounds.prototype.name='token']
  8163. * @description 验证信息前缀,name=value 部分的 name 部分。
  8164. */
  8165. this.name = name ? name : "token";
  8166. this.CLASS_NAME = "SuperMap.Credential";
  8167. }
  8168. /**
  8169. * @function SuperMap.Credential.prototype.getUrlParameters
  8170. * @example
  8171. * var credential = new SuperMap.Credential("valueString","token");
  8172. * //这里 str = "token=valueString";
  8173. * var str = credential.getUrlParameters();
  8174. * @returns {string} 返回安全信息组成的 url 片段。
  8175. */
  8176. Credential_createClass(Credential, [{
  8177. key: "getUrlParameters",
  8178. value: function getUrlParameters() {
  8179. //当需要其他安全信息的时候,则需要return this.name + "=" + this.value + "&" + "...";的形式添加。
  8180. return this.name + "=" + this.value;
  8181. }
  8182. /**
  8183. * @function SuperMap.Bounds.prototype.getValue
  8184. * @description 获取 value。
  8185. * @example
  8186. * var credential = new SuperMap.Credential("2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..","token");
  8187. * //这里 str = "2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..";
  8188. * var str = credential.getValue();
  8189. * @returns {string} 返回 value 字符串,在 iServer 服务下该 value 值即为 token 值。
  8190. */
  8191. }, {
  8192. key: "getValue",
  8193. value: function getValue() {
  8194. return this.value;
  8195. }
  8196. /**
  8197. *
  8198. * @function SuperMap.Credential.prototype.destroy
  8199. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  8200. * @example
  8201. * var credential = new SuperMap.Credential("valueString","token");
  8202. * credential.destroy();
  8203. */
  8204. }, {
  8205. key: "destroy",
  8206. value: function destroy() {
  8207. this.value = null;
  8208. this.name = null;
  8209. }
  8210. }]);
  8211. return Credential;
  8212. }();
  8213. /**
  8214. * @member {SuperMap.Credential} SuperMap.Credential.CREDENTIAL
  8215. * @description 这个对象保存一个安全类的实例,在服务端需要安全验证的时候必须进行设置。
  8216. * @constant
  8217. * @example
  8218. * 代码实例:
  8219. * // 当iServer启用服务安全的时候,下边的代码是必须的。安全证书类能够接收一个value和一个name参数。
  8220. * var value = "(以iServer为例,这里是申请的token值)";
  8221. * var name = "token";
  8222. * // 默认name参数为token,所以当使用iServer服务的时候可以不进行设置。
  8223. * SuperMap.Credential.CREDENTIAL = new SuperMap.Credential(value, name);
  8224. *
  8225. */
  8226. Credential.CREDENTIAL = null;
  8227. SuperMap.Credential = Credential;
  8228. ;// CONCATENATED MODULE: ./src/common/format/Format.js
  8229. function Format_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8230. function Format_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8231. function Format_createClass(Constructor, protoProps, staticProps) { if (protoProps) Format_defineProperties(Constructor.prototype, protoProps); if (staticProps) Format_defineProperties(Constructor, staticProps); return Constructor; }
  8232. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8233. * This program are made available under the terms of the Apache License, Version 2.0
  8234. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8235. /**
  8236. * @class SuperMap.Format
  8237. * @classdesc 读写各种格式的格式类基类。其子类应该包含并实现 read 和 write 方法。
  8238. * @category BaseTypes Format
  8239. * @param {Object} options - 可选参数。
  8240. * @param {boolean} [options.keepData=false] - 如果设置为 true, data 属性会指向被解析的对象(例如 JSON 或 xml 数据对象)。
  8241. * @param {Object} [options.data] - 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  8242. */
  8243. var Format = /*#__PURE__*/function () {
  8244. function Format(options) {
  8245. Format_classCallCheck(this, Format);
  8246. /**
  8247. * @member {Object} SuperMap.Format.prototype.data
  8248. * @description 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  8249. */
  8250. this.data = null;
  8251. /**
  8252. * APIProperty: keepData
  8253. * @member {Object} [SuperMap.Format.prototype.keepData=false]
  8254. * @description 保持最近读到的数据的引用(通过 <data> 属性)。
  8255. */
  8256. this.keepData = false;
  8257. Util.extend(this, options);
  8258. this.options = options;
  8259. this.CLASS_NAME = "SuperMap.Format";
  8260. }
  8261. /**
  8262. * @function SuperMap.Format.prototype.destroy
  8263. * @description 销毁该格式类,释放相关资源。
  8264. */
  8265. Format_createClass(Format, [{
  8266. key: "destroy",
  8267. value: function destroy() {//用来销毁该格式类,释放相关资源
  8268. }
  8269. /**
  8270. * @function SuperMap.Format.prototype.read
  8271. * @description 来从字符串中读取数据。
  8272. * @param {string} data - 读取的数据。
  8273. */
  8274. }, {
  8275. key: "read",
  8276. value: function read(data) {// eslint-disable-line no-unused-vars
  8277. //用来从字符串中读取数据
  8278. }
  8279. /**
  8280. * @function SuperMap.Format.prototype.write
  8281. * @description 将对象写成字符串。
  8282. * @param {Object} object - 可序列化的对象。
  8283. * @returns {string} 对象被写成字符串。
  8284. */
  8285. }, {
  8286. key: "write",
  8287. value: function write(object) {// eslint-disable-line no-unused-vars
  8288. //用来写字符串
  8289. }
  8290. }]);
  8291. return Format;
  8292. }();
  8293. SuperMap.Format = SuperMap.Format || Format;
  8294. ;// CONCATENATED MODULE: ./src/common/format/JSON.js
  8295. function JSON_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { JSON_typeof = function _typeof(obj) { return typeof obj; }; } else { JSON_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return JSON_typeof(obj); }
  8296. function JSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8297. function JSON_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8298. function JSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) JSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) JSON_defineProperties(Constructor, staticProps); return Constructor; }
  8299. function JSON_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) JSON_setPrototypeOf(subClass, superClass); }
  8300. function JSON_setPrototypeOf(o, p) { JSON_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return JSON_setPrototypeOf(o, p); }
  8301. function JSON_createSuper(Derived) { var hasNativeReflectConstruct = JSON_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = JSON_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = JSON_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return JSON_possibleConstructorReturn(this, result); }; }
  8302. function JSON_possibleConstructorReturn(self, call) { if (call && (JSON_typeof(call) === "object" || typeof call === "function")) { return call; } return JSON_assertThisInitialized(self); }
  8303. function JSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8304. function JSON_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  8305. function JSON_getPrototypeOf(o) { JSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return JSON_getPrototypeOf(o); }
  8306. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8307. * This program are made available under the terms of the Apache License, Version 2.0
  8308. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8309. /**
  8310. * @class SuperMap.Format.JSON
  8311. * @classdesc 安全的读写 JSON 的解析类。使用 {@link SuperMap.Format.JSON} 构造函数创建新实例。
  8312. * @category BaseTypes Format
  8313. * @param {Object} [options] - 参数。
  8314. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  8315. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  8316. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  8317. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  8318. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  8319. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  8320. * @extends {SuperMap.Format}
  8321. */
  8322. var JSONFormat = /*#__PURE__*/function (_Format) {
  8323. JSON_inherits(JSONFormat, _Format);
  8324. var _super = JSON_createSuper(JSONFormat);
  8325. function JSONFormat(options) {
  8326. var _this;
  8327. JSON_classCallCheck(this, JSONFormat);
  8328. _this = _super.call(this, options);
  8329. /**
  8330. * @member {string} [SuperMap.Format.JSON.prototype.indent=" "]
  8331. * @description 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  8332. */
  8333. _this.indent = " ";
  8334. /**
  8335. * @member {string} [SuperMap.Format.JSON.prototype.space=" "]
  8336. * @description 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  8337. */
  8338. _this.space = " ";
  8339. /**
  8340. * @member {string} [SuperMap.Format.JSON.prototype.newline="\n"]
  8341. * @description 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  8342. */
  8343. _this.newline = "\n";
  8344. /**
  8345. * @member {integer} [SuperMap.Format.JSON.prototype.level=0]
  8346. * @description 用于格式化输出, 表示的是缩进级别。
  8347. */
  8348. _this.level = 0;
  8349. /**
  8350. * @member {boolean} [SuperMap.Format.JSON.prototype.pretty=false]
  8351. * @description 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  8352. */
  8353. _this.pretty = false;
  8354. /**
  8355. * @member {boolean} SuperMap.Format.JSON.prototype.nativeJSON
  8356. * @description 判断浏览器是否原生支持 JSON 格式数据。
  8357. */
  8358. _this.nativeJSON = function () {
  8359. return !!(window.JSON && typeof JSON.parse === "function" && typeof JSON.stringify === "function");
  8360. }();
  8361. _this.CLASS_NAME = "SuperMap.Format.JSON";
  8362. /**
  8363. * @member SuperMap.Format.JSON.prototype.serialize
  8364. * @description 提供一些类型对象转 JSON 字符串的方法。
  8365. */
  8366. _this.serialize = {
  8367. /**
  8368. * @function SuperMap.Format.JSON.serialize.object
  8369. * @description 把对象转换为 JSON 字符串。
  8370. * @param {Object} object - 可序列化的对象。
  8371. * @returns {string} JSON 字符串。
  8372. */
  8373. 'object': function object(_object) {
  8374. // three special objects that we want to treat differently
  8375. if (_object == null) {
  8376. return "null";
  8377. }
  8378. if (_object.constructor === Date) {
  8379. return this.serialize.date.apply(this, [_object]);
  8380. }
  8381. if (_object.constructor === Array) {
  8382. return this.serialize.array.apply(this, [_object]);
  8383. }
  8384. var pieces = ['{'];
  8385. this.level += 1;
  8386. var key, keyJSON, valueJSON;
  8387. var addComma = false;
  8388. for (key in _object) {
  8389. if (_object.hasOwnProperty(key)) {
  8390. // recursive calls need to allow for sub-classing
  8391. keyJSON = this.write.apply(this, [key, this.pretty]);
  8392. valueJSON = this.write.apply(this, [_object[key], this.pretty]);
  8393. if (keyJSON != null && valueJSON != null) {
  8394. if (addComma) {
  8395. pieces.push(',');
  8396. }
  8397. pieces.push(this.writeNewline(), this.writeIndent(), keyJSON, ':', this.writeSpace(), valueJSON);
  8398. addComma = true;
  8399. }
  8400. }
  8401. }
  8402. this.level -= 1;
  8403. pieces.push(this.writeNewline(), this.writeIndent(), '}');
  8404. return pieces.join('');
  8405. },
  8406. /**
  8407. * @function SuperMap.Format.JSON.serialize.array
  8408. * @description 把数组转换成 JSON 字符串。
  8409. * @param {Array} array - 可序列化的数组。
  8410. * @returns {string} JSON 字符串。
  8411. */
  8412. 'array': function array(_array) {
  8413. var json;
  8414. var pieces = ['['];
  8415. this.level += 1;
  8416. for (var i = 0, len = _array.length; i < len; ++i) {
  8417. // recursive calls need to allow for sub-classing
  8418. json = this.write.apply(this, [_array[i], this.pretty]);
  8419. if (json != null) {
  8420. if (i > 0) {
  8421. pieces.push(',');
  8422. }
  8423. pieces.push(this.writeNewline(), this.writeIndent(), json);
  8424. }
  8425. }
  8426. this.level -= 1;
  8427. pieces.push(this.writeNewline(), this.writeIndent(), ']');
  8428. return pieces.join('');
  8429. },
  8430. /**
  8431. * @function SuperMap.Format.JSON.serialize.string
  8432. * @description 把字符串转换成 JSON 字符串。
  8433. * @param {string} string - 可序列化的字符串。
  8434. * @returns {string} JSON 字符串。
  8435. */
  8436. 'string': function string(_string) {
  8437. // If the string contains no control characters, no quote characters, and no
  8438. // backslash characters, then we can simply slap some quotes around it.
  8439. // Otherwise we must also replace the offending characters with safe
  8440. // sequences.
  8441. var m = {
  8442. '\b': '\\b',
  8443. '\t': '\\t',
  8444. '\n': '\\n',
  8445. '\f': '\\f',
  8446. '\r': '\\r',
  8447. '"': '\\"',
  8448. '\\': '\\\\'
  8449. };
  8450. /*eslint-disable no-control-regex*/
  8451. if (/["\\\x00-\x1f]/.test(_string)) {
  8452. return '"' + _string.replace(/([\x00-\x1f\\"])/g, function (a, b) {
  8453. var c = m[b];
  8454. if (c) {
  8455. return c;
  8456. }
  8457. c = b.charCodeAt();
  8458. return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
  8459. }) + '"';
  8460. }
  8461. return '"' + _string + '"';
  8462. },
  8463. /**
  8464. * @function SuperMap.Format.JSON.serialize.number
  8465. * @description 把数字转换成 JSON 字符串。
  8466. * @param {number} number - 可序列化的数字。
  8467. * @returns {string} JSON 字符串。
  8468. */
  8469. 'number': function number(_number) {
  8470. return isFinite(_number) ? String(_number) : "null";
  8471. },
  8472. /**
  8473. * @function SuperMap.Format.JSON.serialize.boolean
  8474. * @description Transform a boolean into a JSON string.
  8475. * @param {boolean} bool - The boolean to be serialized.
  8476. * @returns {string} A JSON string representing the boolean.
  8477. */
  8478. 'boolean': function boolean(bool) {
  8479. return String(bool);
  8480. },
  8481. /**
  8482. * @function SuperMap.Format.JSON.serialize.object
  8483. * @description 将日期对象转换成 JSON 字符串。
  8484. * @param {Date} date - 可序列化的日期对象。
  8485. * @returns {string} JSON 字符串。
  8486. */
  8487. 'date': function date(_date) {
  8488. function format(number) {
  8489. // Format integers to have at least two digits.
  8490. return number < 10 ? '0' + number : number;
  8491. }
  8492. return '"' + _date.getFullYear() + '-' + format(_date.getMonth() + 1) + '-' + format(_date.getDate()) + 'T' + format(_date.getHours()) + ':' + format(_date.getMinutes()) + ':' + format(_date.getSeconds()) + '"';
  8493. }
  8494. };
  8495. return _this;
  8496. }
  8497. /**
  8498. * @function SuperMap.Format.JSON.prototype.read
  8499. * @description 将一个符合 JSON 结构的字符串进行解析。
  8500. * @param {string} json - 符合 JSON 结构的字符串。
  8501. * @param {function} filter - 过滤方法,最终结果的每一个键值对都会调用该过滤方法,并在对应的值的位置替换成该方法返回的值。
  8502. * @returns {Object} 对象,数组,字符串或数字。
  8503. */
  8504. JSON_createClass(JSONFormat, [{
  8505. key: "read",
  8506. value: function read(json, filter) {
  8507. var object;
  8508. if (this.nativeJSON) {
  8509. try {
  8510. object = JSON.parse(json, filter);
  8511. } catch (e) {// Fall through if the regexp test fails.
  8512. }
  8513. }
  8514. if (this.keepData) {
  8515. this.data = object;
  8516. }
  8517. return object;
  8518. }
  8519. /**
  8520. * @function SuperMap.Format.JSON.prototype.write
  8521. * @description 序列化一个对象到一个符合 JSON 格式的字符串。
  8522. * @param {(object|string|Array|number|boolean)} value - 需要被序列化的对象,数组,字符串,数字,布尔值。
  8523. * @param {boolean} [pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  8524. * @returns {string} 符合 JSON 格式的字符串。
  8525. *
  8526. */
  8527. }, {
  8528. key: "write",
  8529. value: function write(value, pretty) {
  8530. this.pretty = !!pretty;
  8531. var json = null;
  8532. var type = JSON_typeof(value);
  8533. if (this.serialize[type]) {
  8534. try {
  8535. json = !this.pretty && this.nativeJSON ? JSON.stringify(value) : this.serialize[type].apply(this, [value]);
  8536. } catch (err) {//SuperMap.Console.error("Trouble serializing: " + err);
  8537. }
  8538. }
  8539. return json;
  8540. }
  8541. /**
  8542. * @function SuperMap.Format.JSON.prototype.writeIndent
  8543. * @description 根据缩进级别输出一个缩进字符串。
  8544. * @private
  8545. * @returns {string} 一个适当的缩进字符串。
  8546. */
  8547. }, {
  8548. key: "writeIndent",
  8549. value: function writeIndent() {
  8550. var pieces = [];
  8551. if (this.pretty) {
  8552. for (var i = 0; i < this.level; ++i) {
  8553. pieces.push(this.indent);
  8554. }
  8555. }
  8556. return pieces.join('');
  8557. }
  8558. /**
  8559. * @function SuperMap.Format.JSON.prototype.writeNewline
  8560. * @description 在格式化输出模式情况下输出代表新一行的字符串。
  8561. * @private
  8562. * @returns {string} 代表新的一行的字符串。
  8563. */
  8564. }, {
  8565. key: "writeNewline",
  8566. value: function writeNewline() {
  8567. return this.pretty ? this.newline : '';
  8568. }
  8569. /**
  8570. * @function SuperMap.Format.JSON.prototype.writeSpace
  8571. * @private
  8572. * @description 在格式化输出模式情况下输出一个代表空格的字符串。
  8573. * @returns {string} 一个空格。
  8574. */
  8575. }, {
  8576. key: "writeSpace",
  8577. value: function writeSpace() {
  8578. return this.pretty ? this.space : '';
  8579. }
  8580. }]);
  8581. return JSONFormat;
  8582. }(Format);
  8583. SuperMap.Format.JSON = JSONFormat;
  8584. ;// CONCATENATED MODULE: ./src/common/iServer/CommonServiceBase.js
  8585. function CommonServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8586. function CommonServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8587. function CommonServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  8588. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8589. * This program are made available under the terms of the Apache License, Version 2.0
  8590. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8591. /**
  8592. * @class SuperMap.CommonServiceBase
  8593. * @category iServer
  8594. * @classdesc 对接 iServer 各种服务的 Service 的基类。
  8595. * @param {string} url - 服务地址。
  8596. * @param {Object} options - 参数。
  8597. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  8598. * @param {string} [options.proxy] - 服务代理地址。
  8599. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  8600. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  8601. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  8602. * @param {Object} [options.headers] - 请求头。
  8603. */
  8604. var CommonServiceBase = /*#__PURE__*/function () {
  8605. function CommonServiceBase(url, options) {
  8606. CommonServiceBase_classCallCheck(this, CommonServiceBase);
  8607. var me = this;
  8608. this.EVENT_TYPES = ["processCompleted", "processFailed"];
  8609. this.events = null;
  8610. this.eventListeners = null;
  8611. this.url = null;
  8612. this.urls = null;
  8613. this.proxy = null;
  8614. this.serverType = null;
  8615. this.index = null;
  8616. this.length = null;
  8617. this.options = null;
  8618. this.totalTimes = null;
  8619. this.POLLING_TIMES = 3;
  8620. this._processSuccess = null;
  8621. this._processFailed = null;
  8622. this.isInTheSameDomain = null;
  8623. this.withCredentials = false;
  8624. if (Util.isArray(url)) {
  8625. me.urls = url;
  8626. me.length = url.length;
  8627. me.totalTimes = me.length;
  8628. if (me.length === 1) {
  8629. me.url = url[0];
  8630. } else {
  8631. me.index = parseInt(Math.random() * me.length);
  8632. me.url = url[me.index];
  8633. }
  8634. } else {
  8635. me.totalTimes = 1;
  8636. me.url = url;
  8637. }
  8638. if (Util.isArray(url) && !me.isServiceSupportPolling()) {
  8639. me.url = url[0];
  8640. me.totalTimes = 1;
  8641. }
  8642. me.serverType = me.serverType || ServerType.ISERVER;
  8643. options = options || {};
  8644. this.crossOrigin = options.crossOrigin;
  8645. this.headers = options.headers;
  8646. Util.extend(this, options);
  8647. me.isInTheSameDomain = Util.isInTheSameDomain(me.url);
  8648. me.events = new Events(me, null, me.EVENT_TYPES, true);
  8649. if (me.eventListeners instanceof Object) {
  8650. me.events.on(me.eventListeners);
  8651. }
  8652. this.CLASS_NAME = "SuperMap.CommonServiceBase";
  8653. }
  8654. /**
  8655. * @function SuperMap.CommonServiceBase.prototype.destroy
  8656. * @description 释放资源,将引用的资源属性置空。
  8657. */
  8658. CommonServiceBase_createClass(CommonServiceBase, [{
  8659. key: "destroy",
  8660. value: function destroy() {
  8661. var me = this;
  8662. if (Util.isArray(me.urls)) {
  8663. me.urls = null;
  8664. me.index = null;
  8665. me.length = null;
  8666. me.totalTimes = null;
  8667. }
  8668. me.url = null;
  8669. me.options = null;
  8670. me._processSuccess = null;
  8671. me._processFailed = null;
  8672. me.isInTheSameDomain = null;
  8673. me.EVENT_TYPES = null;
  8674. if (me.events) {
  8675. me.events.destroy();
  8676. me.events = null;
  8677. }
  8678. if (me.eventListeners) {
  8679. me.eventListeners = null;
  8680. }
  8681. }
  8682. /**
  8683. * @function SuperMap.CommonServiceBase.prototype.request
  8684. * @description: 该方法用于向服务发送请求。
  8685. * @param {Object} options - 参数。
  8686. * @param {string} [options.method='GET'] - 请求方式,包括 "GET","POST","PUT","DELETE"。
  8687. * @param {string} [options.url] - 发送请求的地址。
  8688. * @param {Object} [options.params] - 作为查询字符串添加到 URL 中的一组键值对,此参数只适用于 GET 方式发送的请求。
  8689. * @param {string} [options.data] - 发送到服务器的数据。
  8690. * @param {function} options.success - 请求成功后的回调函数。
  8691. * @param {function} options.failure - 请求失败后的回调函数。
  8692. * @param {Object} [options.scope] - 如果回调函数是对象的一个公共方法,设定该对象的范围。
  8693. * @param {boolean} [options.isInTheSameDomain] - 请求是否在当前域中。
  8694. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  8695. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  8696. * @param {Object} [options.headers] - 请求头。
  8697. */
  8698. }, {
  8699. key: "request",
  8700. value: function request(options) {
  8701. var me = this;
  8702. options.url = options.url || me.url;
  8703. options.proxy = options.proxy || me.proxy;
  8704. options.withCredentials = options.withCredentials != undefined ? options.withCredentials : me.withCredentials;
  8705. options.crossOrigin = options.crossOrigin != undefined ? options.crossOrigin : me.crossOrigin;
  8706. options.headers = options.headers || me.headers;
  8707. options.isInTheSameDomain = me.isInTheSameDomain; //为url添加安全认证信息片段
  8708. var credential = this.getCredential(options.url);
  8709. if (credential) {
  8710. options.url = Util.urlAppend(options.url, credential.getUrlParameters());
  8711. }
  8712. me.calculatePollingTimes();
  8713. me._processSuccess = options.success;
  8714. me._processFailed = options.failure;
  8715. options.scope = me;
  8716. options.success = me.getUrlCompleted;
  8717. options.failure = me.getUrlFailed;
  8718. me.options = options;
  8719. me._commit(me.options);
  8720. }
  8721. /**
  8722. * @function SuperMap.CommonServiceBase.prototype.getCredential
  8723. * @description 获取凭据信息
  8724. * @param {string} url - 服务地址。
  8725. * @returns {SuperMap.Credential} 凭据信息对象。
  8726. */
  8727. }, {
  8728. key: "getCredential",
  8729. value: function getCredential(url) {
  8730. var keyUrl = url,
  8731. credential,
  8732. value;
  8733. switch (this.serverType) {
  8734. case ServerType.IPORTAL:
  8735. value = SecurityManager.getToken(keyUrl);
  8736. credential = value ? new Credential(value, "token") : null;
  8737. if (!credential) {
  8738. value = SecurityManager.getKey(keyUrl);
  8739. credential = value ? new Credential(value, "key") : null;
  8740. }
  8741. break;
  8742. case ServerType.ONLINE:
  8743. value = SecurityManager.getKey(keyUrl);
  8744. credential = value ? new Credential(value, "key") : null;
  8745. break;
  8746. default:
  8747. //iServer or others
  8748. value = SecurityManager.getToken(keyUrl);
  8749. credential = value ? new Credential(value, "token") : null;
  8750. break;
  8751. }
  8752. return credential;
  8753. }
  8754. /**
  8755. * @function SuperMap.CommonServiceBase.prototype.getUrlCompleted
  8756. * @description 请求成功后执行此方法。
  8757. * @param {Object} result - 服务器返回的结果对象。
  8758. */
  8759. }, {
  8760. key: "getUrlCompleted",
  8761. value: function getUrlCompleted(result) {
  8762. var me = this;
  8763. me._processSuccess(result);
  8764. }
  8765. /**
  8766. * @function SuperMap.CommonServiceBase.prototype.getUrlFailed
  8767. * @description 请求失败后执行此方法。
  8768. * @param {Object} result - 服务器返回的结果对象。
  8769. */
  8770. }, {
  8771. key: "getUrlFailed",
  8772. value: function getUrlFailed(result) {
  8773. var me = this;
  8774. if (me.totalTimes > 0) {
  8775. me.totalTimes--;
  8776. me.ajaxPolling();
  8777. } else {
  8778. me._processFailed(result);
  8779. }
  8780. }
  8781. /**
  8782. *
  8783. * @function SuperMap.CommonServiceBase.prototype.ajaxPolling
  8784. * @description 请求失败后,如果剩余请求失败次数不为 0,重新获取 URL 发送请求
  8785. */
  8786. }, {
  8787. key: "ajaxPolling",
  8788. value: function ajaxPolling() {
  8789. var me = this,
  8790. url = me.options.url,
  8791. re = /^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;
  8792. me.index = parseInt(Math.random() * me.length);
  8793. me.url = me.urls[me.index];
  8794. url = url.replace(re, re.exec(me.url)[0]);
  8795. me.options.url = url;
  8796. me.options.isInTheSameDomain = Util.isInTheSameDomain(url);
  8797. me._commit(me.options);
  8798. }
  8799. /**
  8800. * @function SuperMap.CommonServiceBase.prototype.calculatePollingTimes
  8801. * @description 计算剩余请求失败执行次数。
  8802. */
  8803. }, {
  8804. key: "calculatePollingTimes",
  8805. value: function calculatePollingTimes() {
  8806. var me = this;
  8807. if (me.times) {
  8808. if (me.totalTimes > me.POLLING_TIMES) {
  8809. if (me.times > me.POLLING_TIMES) {
  8810. me.totalTimes = me.POLLING_TIMES;
  8811. } else {
  8812. me.totalTimes = me.times;
  8813. }
  8814. } else {
  8815. if (me.times < me.totalTimes) {
  8816. me.totalTimes = me.times;
  8817. }
  8818. }
  8819. } else {
  8820. if (me.totalTimes > me.POLLING_TIMES) {
  8821. me.totalTimes = me.POLLING_TIMES;
  8822. }
  8823. }
  8824. me.totalTimes--;
  8825. }
  8826. /**
  8827. * @function SuperMap.CommonServiceBase.prototype.isServiceSupportPolling
  8828. * @description 判断服务是否支持轮询。
  8829. */
  8830. }, {
  8831. key: "isServiceSupportPolling",
  8832. value: function isServiceSupportPolling() {
  8833. var me = this;
  8834. return !(me.CLASS_NAME === "SuperMap.REST.ThemeService" || me.CLASS_NAME === "SuperMap.REST.EditFeaturesService");
  8835. }
  8836. /**
  8837. * @function SuperMap.CommonServiceBase.prototype.serviceProcessCompleted
  8838. * @description 状态完成,执行此方法。
  8839. * @param {Object} result - 服务器返回的结果对象。
  8840. */
  8841. }, {
  8842. key: "serviceProcessCompleted",
  8843. value: function serviceProcessCompleted(result) {
  8844. result = Util.transformResult(result);
  8845. this.events.triggerEvent("processCompleted", {
  8846. result: result
  8847. });
  8848. }
  8849. /**
  8850. * @function SuperMap.CommonServiceBase.prototype.serviceProcessFailed
  8851. * @description 状态失败,执行此方法。
  8852. * @param {Object} result - 服务器返回的结果对象。
  8853. */
  8854. }, {
  8855. key: "serviceProcessFailed",
  8856. value: function serviceProcessFailed(result) {
  8857. result = Util.transformResult(result);
  8858. var error = result.error || result;
  8859. this.events.triggerEvent("processFailed", {
  8860. error: error
  8861. });
  8862. }
  8863. }, {
  8864. key: "_commit",
  8865. value: function _commit(options) {
  8866. if (options.method === "POST" || options.method === "PUT") {
  8867. if (options.params) {
  8868. options.url = Util.urlAppend(options.url, Util.getParameterString(options.params || {}));
  8869. }
  8870. options.params = options.data;
  8871. }
  8872. FetchRequest.commit(options.method, options.url, options.params, {
  8873. headers: options.headers,
  8874. withCredentials: options.withCredentials,
  8875. crossOrigin: options.crossOrigin,
  8876. timeout: options.async ? 0 : null,
  8877. proxy: options.proxy
  8878. }).then(function (response) {
  8879. if (response.text) {
  8880. return response.text();
  8881. }
  8882. if (response.json) {
  8883. return response.json();
  8884. }
  8885. return response;
  8886. }).then(function (text) {
  8887. var result = text;
  8888. if (typeof text === "string") {
  8889. result = new JSONFormat().read(text);
  8890. }
  8891. if (!result || result.error || result.code >= 300 && result.code !== 304) {
  8892. if (result && result.error) {
  8893. result = {
  8894. error: result.error
  8895. };
  8896. } else {
  8897. result = {
  8898. error: result
  8899. };
  8900. }
  8901. }
  8902. if (result.error) {
  8903. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  8904. failure(result);
  8905. } else {
  8906. result.succeed = result.succeed == undefined ? true : result.succeed;
  8907. var success = options.scope ? FunctionExt.bind(options.success, options.scope) : options.success;
  8908. success(result);
  8909. }
  8910. })["catch"](function (e) {
  8911. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  8912. failure(e);
  8913. });
  8914. }
  8915. }]);
  8916. return CommonServiceBase;
  8917. }();
  8918. SuperMap.CommonServiceBase = CommonServiceBase;
  8919. /**
  8920. * 服务器请求回调函数
  8921. * @callback RequestCallback
  8922. * @example
  8923. * var requestCallback = function (serviceResult){
  8924. * console.log(serviceResult.result);
  8925. * }
  8926. * new QueryService(url).queryByBounds(param, requestCallback);
  8927. * @param {Object} serviceResult
  8928. * @param {Object} serviceResult.result 服务器返回结果。
  8929. * @param {Object} serviceResult.object 发布应用程序事件的对象。
  8930. * @param {Object} serviceResult.type 事件类型。
  8931. * @param {Object} serviceResult.element 接受浏览器事件的 DOM 节点。
  8932. */
  8933. ;// CONCATENATED MODULE: ./src/common/iServer/AddressMatchService.js
  8934. function AddressMatchService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { AddressMatchService_typeof = function _typeof(obj) { return typeof obj; }; } else { AddressMatchService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return AddressMatchService_typeof(obj); }
  8935. function AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8936. function AddressMatchService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8937. function AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AddressMatchService_defineProperties(Constructor, staticProps); return Constructor; }
  8938. function AddressMatchService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { AddressMatchService_get = Reflect.get; } else { AddressMatchService_get = function _get(target, property, receiver) { var base = AddressMatchService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return AddressMatchService_get(target, property, receiver || target); }
  8939. function AddressMatchService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AddressMatchService_getPrototypeOf(object); if (object === null) break; } return object; }
  8940. function AddressMatchService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) AddressMatchService_setPrototypeOf(subClass, superClass); }
  8941. function AddressMatchService_setPrototypeOf(o, p) { AddressMatchService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AddressMatchService_setPrototypeOf(o, p); }
  8942. function AddressMatchService_createSuper(Derived) { var hasNativeReflectConstruct = AddressMatchService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = AddressMatchService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = AddressMatchService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return AddressMatchService_possibleConstructorReturn(this, result); }; }
  8943. function AddressMatchService_possibleConstructorReturn(self, call) { if (call && (AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } return AddressMatchService_assertThisInitialized(self); }
  8944. function AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8945. function AddressMatchService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  8946. function AddressMatchService_getPrototypeOf(o) { AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AddressMatchService_getPrototypeOf(o); }
  8947. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8948. * This program are made available under the terms of the Apache License, Version 2.0
  8949. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8950. /**
  8951. * @class SuperMap.AddressMatchService
  8952. * @category iServer AddressMatch
  8953. * @classdesc 地址匹配服务,包括正向匹配和反向匹配。
  8954. * @param {string} url - 地址匹配服务地址。
  8955. * @param {Object} options - 参数。
  8956. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  8957. * @param {Object} [options.headers] - 请求头。
  8958. */
  8959. var AddressMatchService_AddressMatchService = /*#__PURE__*/function (_CommonServiceBase) {
  8960. AddressMatchService_inherits(AddressMatchService, _CommonServiceBase);
  8961. var _super = AddressMatchService_createSuper(AddressMatchService);
  8962. function AddressMatchService(url, options) {
  8963. var _this;
  8964. AddressMatchService_classCallCheck(this, AddressMatchService);
  8965. _this = _super.call(this, url, options);
  8966. _this.options = options || {};
  8967. _this.CLASS_NAME = 'SuperMap.AddressMatchService';
  8968. return _this;
  8969. }
  8970. /**
  8971. * @function SuperMap.AddressMatchService.prototype.destroy
  8972. * @override
  8973. */
  8974. AddressMatchService_createClass(AddressMatchService, [{
  8975. key: "destroy",
  8976. value: function destroy() {
  8977. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "destroy", this).call(this);
  8978. }
  8979. /**
  8980. * @function SuperMap.AddressMatchService.prototype.code
  8981. * @param {string} url - 正向地址匹配服务地址。
  8982. * @param {SuperMap.GeoCodingParameter} params - 正向地址匹配服务参数。
  8983. */
  8984. }, {
  8985. key: "code",
  8986. value: function code(url, params) {
  8987. if (!(params instanceof GeoCodingParameter)) {
  8988. return;
  8989. }
  8990. this.processAsync(url, params);
  8991. }
  8992. /**
  8993. * @function SuperMap.AddressMatchService.prototype.decode
  8994. * @param {string} url - 反向地址匹配服务地址。
  8995. * @param {SuperMap.GeoDecodingParameter} params - 反向地址匹配服务参数。
  8996. */
  8997. }, {
  8998. key: "decode",
  8999. value: function decode(url, params) {
  9000. if (!(params instanceof GeoDecodingParameter)) {
  9001. return;
  9002. }
  9003. this.processAsync(url, params);
  9004. }
  9005. /**
  9006. * @function SuperMap.AddressMatchService.prototype.processAsync
  9007. * @description 负责将客户端的动态分段服务参数传递到服务端。
  9008. * @param {string} url - 服务地址。
  9009. * @param {Object} params - 参数。
  9010. */
  9011. }, {
  9012. key: "processAsync",
  9013. value: function processAsync(url, params) {
  9014. this.request({
  9015. method: 'GET',
  9016. url: url,
  9017. params: params,
  9018. scope: this,
  9019. success: this.serviceProcessCompleted,
  9020. failure: this.serviceProcessFailed
  9021. });
  9022. }
  9023. /**
  9024. * @function SuperMap.AddressMatchService.prototype.serviceProcessCompleted
  9025. * @param {Object} result - 服务器返回的结果对象。
  9026. * @description 服务流程是否完成
  9027. */
  9028. }, {
  9029. key: "serviceProcessCompleted",
  9030. value: function serviceProcessCompleted(result) {
  9031. if (result.succeed) {
  9032. delete result.succeed;
  9033. }
  9034. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessCompleted", this).call(this, result);
  9035. }
  9036. /**
  9037. * @function SuperMap.AddressMatchService.prototype.serviceProcessCompleted
  9038. * @param {Object} result - 服务器返回的结果对象。
  9039. * @description 服务流程是否失败
  9040. */
  9041. }, {
  9042. key: "serviceProcessFailed",
  9043. value: function serviceProcessFailed(result) {
  9044. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessFailed", this).call(this, result);
  9045. }
  9046. }]);
  9047. return AddressMatchService;
  9048. }(CommonServiceBase);
  9049. SuperMap.AddressMatchService = AddressMatchService_AddressMatchService;
  9050. ;// CONCATENATED MODULE: ./src/classic/services/AddressMatchService.js
  9051. function services_AddressMatchService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_AddressMatchService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_AddressMatchService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_AddressMatchService_typeof(obj); }
  9052. function services_AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9053. function services_AddressMatchService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9054. function services_AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_AddressMatchService_defineProperties(Constructor, staticProps); return Constructor; }
  9055. function services_AddressMatchService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) services_AddressMatchService_setPrototypeOf(subClass, superClass); }
  9056. function services_AddressMatchService_setPrototypeOf(o, p) { services_AddressMatchService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_AddressMatchService_setPrototypeOf(o, p); }
  9057. function services_AddressMatchService_createSuper(Derived) { var hasNativeReflectConstruct = services_AddressMatchService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_AddressMatchService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_AddressMatchService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_AddressMatchService_possibleConstructorReturn(this, result); }; }
  9058. function services_AddressMatchService_possibleConstructorReturn(self, call) { if (call && (services_AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_AddressMatchService_assertThisInitialized(self); }
  9059. function services_AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9060. function services_AddressMatchService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9061. function services_AddressMatchService_getPrototypeOf(o) { services_AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_AddressMatchService_getPrototypeOf(o); }
  9062. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9063. * This program are made available under the terms of the Apache License, Version 2.0
  9064. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9065. /**
  9066. * @class SuperMap.REST.AddressMatchService
  9067. * @category iServer AddressMatch
  9068. * @classdesc 地址匹配服务,包括正向匹配和反向匹配。
  9069. * @extends {SuperMap.CommonServiceBase}
  9070. * @param {string} url - 服务地址。
  9071. * @param {Object} options - 参数。
  9072. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  9073. * @param {Object} [options.headers] - 请求头。
  9074. */
  9075. var AddressMatchService = /*#__PURE__*/function (_CommonServiceBase) {
  9076. services_AddressMatchService_inherits(AddressMatchService, _CommonServiceBase);
  9077. var _super = services_AddressMatchService_createSuper(AddressMatchService);
  9078. function AddressMatchService(url, options) {
  9079. var _this;
  9080. services_AddressMatchService_classCallCheck(this, AddressMatchService);
  9081. _this = _super.call(this, url, options);
  9082. _this.CLASS_NAME = "SuperMap.REST.AddressMatchService";
  9083. return _this;
  9084. }
  9085. /**
  9086. * @function SuperMap.REST.AddressMatchService.prototype.code
  9087. * @description 正向匹配。
  9088. * @param {SuperMap.GeoCodingParameter} params - 正向匹配参数。
  9089. * @param {RequestCallback} callback - 回调函数。
  9090. */
  9091. services_AddressMatchService_createClass(AddressMatchService, [{
  9092. key: "code",
  9093. value: function code(params, callback) {
  9094. var me = this;
  9095. var addressMatchService = new AddressMatchService_AddressMatchService(me.url, {
  9096. headers: me.headers,
  9097. proxy: me.proxy,
  9098. withCredentials: me.withCredentials,
  9099. crossOrigin: me.crossOrigin,
  9100. serverType: me.serverType,
  9101. eventListeners: {
  9102. scope: me,
  9103. processCompleted: callback,
  9104. processFailed: callback
  9105. }
  9106. });
  9107. addressMatchService.code(me.url + '/geocoding', params);
  9108. }
  9109. /**
  9110. * @function SuperMap.REST.AddressMatchService.prototype.decode
  9111. * @description 反向匹配。
  9112. * @param {SuperMap.GeoDecodingParameter} params - 反向匹配参数。
  9113. * @param {RequestCallback} callback - 回调函数。
  9114. */
  9115. }, {
  9116. key: "decode",
  9117. value: function decode(params, callback) {
  9118. var me = this;
  9119. var addressMatchService = new AddressMatchService_AddressMatchService(me.url, {
  9120. headers: me.headers,
  9121. proxy: me.proxy,
  9122. withCredentials: me.withCredentials,
  9123. crossOrigin: me.crossOrigin,
  9124. serverType: me.serverType,
  9125. eventListeners: {
  9126. scope: me,
  9127. processCompleted: callback,
  9128. processFailed: callback
  9129. }
  9130. });
  9131. addressMatchService.decode(me.url + '/geodecoding', params);
  9132. }
  9133. }]);
  9134. return AddressMatchService;
  9135. }(CommonServiceBase);
  9136. SuperMap_SuperMap.REST.AddressMatchService = AddressMatchService;
  9137. ;// CONCATENATED MODULE: ./src/common/iServer/ProcessingServiceBase.js
  9138. function ProcessingServiceBase_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ProcessingServiceBase_typeof = function _typeof(obj) { return typeof obj; }; } else { ProcessingServiceBase_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ProcessingServiceBase_typeof(obj); }
  9139. function ProcessingServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9140. function ProcessingServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9141. function ProcessingServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  9142. function ProcessingServiceBase_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ProcessingServiceBase_get = Reflect.get; } else { ProcessingServiceBase_get = function _get(target, property, receiver) { var base = ProcessingServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ProcessingServiceBase_get(target, property, receiver || target); }
  9143. function ProcessingServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ProcessingServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  9144. function ProcessingServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ProcessingServiceBase_setPrototypeOf(subClass, superClass); }
  9145. function ProcessingServiceBase_setPrototypeOf(o, p) { ProcessingServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingServiceBase_setPrototypeOf(o, p); }
  9146. function ProcessingServiceBase_createSuper(Derived) { var hasNativeReflectConstruct = ProcessingServiceBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ProcessingServiceBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ProcessingServiceBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ProcessingServiceBase_possibleConstructorReturn(this, result); }; }
  9147. function ProcessingServiceBase_possibleConstructorReturn(self, call) { if (call && (ProcessingServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return ProcessingServiceBase_assertThisInitialized(self); }
  9148. function ProcessingServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9149. function ProcessingServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9150. function ProcessingServiceBase_getPrototypeOf(o) { ProcessingServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingServiceBase_getPrototypeOf(o); }
  9151. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9152. * This program are made available under the terms of the Apache License, Version 2.0
  9153. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9154. /**
  9155. * @class SuperMap.ProcessingServiceBase
  9156. * @category iServer ProcessingService
  9157. * @classdesc 分布式分析服务基类
  9158. * @extends {SuperMap.CommonServiceBase}
  9159. * @param {string} url - 分布式分析服务地址。
  9160. * @param {Object} options - 参数。
  9161. * @param {SuperMap.Events} options.events - 处理所有事件的对象。
  9162. * @param {number} options.index - 服务访问地址在数组中的位置。
  9163. * @param {number} options.length - 服务访问地址数组长度。
  9164. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  9165. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  9166. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  9167. * @param {Object} [options.headers] - 请求头。
  9168. */
  9169. var ProcessingServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  9170. ProcessingServiceBase_inherits(ProcessingServiceBase, _CommonServiceBase);
  9171. var _super = ProcessingServiceBase_createSuper(ProcessingServiceBase);
  9172. function ProcessingServiceBase(url, options) {
  9173. var _this;
  9174. ProcessingServiceBase_classCallCheck(this, ProcessingServiceBase);
  9175. options = options || {};
  9176. /*
  9177. * Constant: EVENT_TYPES
  9178. * {Array.<string>}
  9179. * 此类支持的事件类型
  9180. * - *processCompleted* 创建成功后触发的事件。
  9181. * - *processFailed* 创建失败后触发的事件 。
  9182. * - *processRunning* 创建过程的整个阶段都会触发的事件,用于获取创建过程的状态 。
  9183. */
  9184. options.EVENT_TYPES = ["processCompleted", "processFailed", "processRunning"];
  9185. _this = _super.call(this, url, options);
  9186. _this.CLASS_NAME = "SuperMap.ProcessingServiceBase";
  9187. return _this;
  9188. }
  9189. /**
  9190. * @function SuperMap.ProcessingServiceBase.prototype.destroy
  9191. * @override
  9192. */
  9193. ProcessingServiceBase_createClass(ProcessingServiceBase, [{
  9194. key: "destroy",
  9195. value: function destroy() {
  9196. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "destroy", this).call(this);
  9197. }
  9198. /**
  9199. * @function SuperMap.ProcessingServiceBase.prototype.getJobs
  9200. * @description 获取分布式分析任务。
  9201. * @param {string} url - 资源地址。
  9202. */
  9203. }, {
  9204. key: "getJobs",
  9205. value: function getJobs(url) {
  9206. var me = this;
  9207. FetchRequest.get(me._processUrl(url), null, {
  9208. proxy: me.proxy
  9209. }).then(function (response) {
  9210. return response.json();
  9211. }).then(function (result) {
  9212. me.events.triggerEvent("processCompleted", {
  9213. result: result
  9214. });
  9215. })["catch"](function (e) {
  9216. me.eventListeners.processFailed({
  9217. error: e
  9218. });
  9219. });
  9220. }
  9221. /**
  9222. * @function SuperMap.ProcessingServiceBase.prototype.addJob
  9223. * @description 添加分布式分析任务。
  9224. * @param {string} url - 资源根地址。
  9225. * @param {Object} params - 创建一个空间分析的请求参数。
  9226. * @param {string} paramType - 请求参数类型。
  9227. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  9228. */
  9229. }, {
  9230. key: "addJob",
  9231. value: function addJob(url, params, paramType, seconds) {
  9232. var me = this,
  9233. parameterObject = null;
  9234. if (params && params instanceof paramType) {
  9235. parameterObject = new Object();
  9236. paramType.toObject(params, parameterObject);
  9237. }
  9238. var headers = Object.assign({
  9239. 'Content-Type': 'application/x-www-form-urlencoded'
  9240. }, me.headers || {});
  9241. var options = {
  9242. proxy: me.proxy,
  9243. headers: headers,
  9244. withCredentials: me.withCredentials,
  9245. crossOrigin: me.crossOrigin,
  9246. isInTheSameDomain: me.isInTheSameDomain
  9247. };
  9248. FetchRequest.post(me._processUrl(url), JSON.stringify(parameterObject), options).then(function (response) {
  9249. return response.json();
  9250. }).then(function (result) {
  9251. if (result.succeed) {
  9252. me.serviceProcessCompleted(result, seconds);
  9253. } else {
  9254. me.serviceProcessFailed(result);
  9255. }
  9256. })["catch"](function (e) {
  9257. me.serviceProcessFailed({
  9258. error: e
  9259. });
  9260. });
  9261. }
  9262. }, {
  9263. key: "serviceProcessCompleted",
  9264. value: function serviceProcessCompleted(result, seconds) {
  9265. result = Util.transformResult(result);
  9266. seconds = seconds || 1000;
  9267. var me = this;
  9268. if (result) {
  9269. var id = setInterval(function () {
  9270. FetchRequest.get(me._processUrl(result.newResourceLocation), {
  9271. _t: new Date().getTime()
  9272. }).then(function (response) {
  9273. return response.json();
  9274. }).then(function (job) {
  9275. me.events.triggerEvent("processRunning", {
  9276. id: job.id,
  9277. state: job.state
  9278. });
  9279. if (job.state.runState === 'LOST' || job.state.runState === 'KILLED' || job.state.runState === 'FAILED') {
  9280. clearInterval(id);
  9281. me.events.triggerEvent("processFailed", {
  9282. error: job.state.errorMsg,
  9283. state: job.state.runState
  9284. });
  9285. }
  9286. if (job.state.runState === 'FINISHED' && job.setting.serviceInfo) {
  9287. clearInterval(id);
  9288. me.events.triggerEvent("processCompleted", {
  9289. result: job
  9290. });
  9291. }
  9292. })["catch"](function (e) {
  9293. clearInterval(id);
  9294. me.events.triggerEvent("processFailed", {
  9295. error: e
  9296. });
  9297. });
  9298. }, seconds);
  9299. }
  9300. }
  9301. }, {
  9302. key: "serviceProcessFailed",
  9303. value: function serviceProcessFailed(result) {
  9304. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "serviceProcessFailed", this).call(this, result);
  9305. }
  9306. }, {
  9307. key: "_processUrl",
  9308. value: function _processUrl(url) {
  9309. if (SecurityManager.getToken(url)) {
  9310. url = Util.urlAppend(url, 'token=' + SecurityManager.getToken(url));
  9311. }
  9312. return url;
  9313. }
  9314. }]);
  9315. return ProcessingServiceBase;
  9316. }(CommonServiceBase);
  9317. SuperMap.ProcessingServiceBase = ProcessingServiceBase;
  9318. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobsService.js
  9319. function KernelDensityJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { KernelDensityJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { KernelDensityJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return KernelDensityJobsService_typeof(obj); }
  9320. function KernelDensityJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9321. function KernelDensityJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9322. function KernelDensityJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  9323. function KernelDensityJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { KernelDensityJobsService_get = Reflect.get; } else { KernelDensityJobsService_get = function _get(target, property, receiver) { var base = KernelDensityJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return KernelDensityJobsService_get(target, property, receiver || target); }
  9324. function KernelDensityJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = KernelDensityJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  9325. function KernelDensityJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) KernelDensityJobsService_setPrototypeOf(subClass, superClass); }
  9326. function KernelDensityJobsService_setPrototypeOf(o, p) { KernelDensityJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return KernelDensityJobsService_setPrototypeOf(o, p); }
  9327. function KernelDensityJobsService_createSuper(Derived) { var hasNativeReflectConstruct = KernelDensityJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = KernelDensityJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = KernelDensityJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return KernelDensityJobsService_possibleConstructorReturn(this, result); }; }
  9328. function KernelDensityJobsService_possibleConstructorReturn(self, call) { if (call && (KernelDensityJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return KernelDensityJobsService_assertThisInitialized(self); }
  9329. function KernelDensityJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9330. function KernelDensityJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9331. function KernelDensityJobsService_getPrototypeOf(o) { KernelDensityJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return KernelDensityJobsService_getPrototypeOf(o); }
  9332. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9333. * This program are made available under the terms of the Apache License, Version 2.0
  9334. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9335. /**
  9336. * @class SuperMap.KernelDensityJobsService
  9337. * @category iServer ProcessingService DensityAnalyst
  9338. * @classdesc 核密度分析服务类
  9339. * @extends {SuperMap.ProcessingServiceBase}
  9340. * @param {string} url -核密度分析服务地址。
  9341. * @param {Object} options - 交互服务时所需可选参数。
  9342. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  9343. * @param {Object} [options.headers] - 请求头。
  9344. */
  9345. var KernelDensityJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  9346. KernelDensityJobsService_inherits(KernelDensityJobsService, _ProcessingServiceBas);
  9347. var _super = KernelDensityJobsService_createSuper(KernelDensityJobsService);
  9348. function KernelDensityJobsService(url, options) {
  9349. var _this;
  9350. KernelDensityJobsService_classCallCheck(this, KernelDensityJobsService);
  9351. _this = _super.call(this, url, options);
  9352. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/density');
  9353. _this.CLASS_NAME = "SuperMap.KernelDensityJobsService";
  9354. return _this;
  9355. }
  9356. /**
  9357. * @function SuperMap.KernelDensityJobsService.prototype.destroy
  9358. * @override
  9359. */
  9360. KernelDensityJobsService_createClass(KernelDensityJobsService, [{
  9361. key: "destroy",
  9362. value: function destroy() {
  9363. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "destroy", this).call(this);
  9364. }
  9365. /**
  9366. * @function SuperMap.KernelDensityJobsService.prototype.getKernelDensityJobs
  9367. * @description 获取核密度分析任务
  9368. */
  9369. }, {
  9370. key: "getKernelDensityJobs",
  9371. value: function getKernelDensityJobs() {
  9372. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, this.url);
  9373. }
  9374. /**
  9375. * @function SuperMap.KernelDensityJobsService.prototype.getKernelDensityJobs
  9376. * @description 获取指定id的核密度分析服务
  9377. * @param {string} id - 指定要获取数据的id
  9378. */
  9379. }, {
  9380. key: "getKernelDensityJob",
  9381. value: function getKernelDensityJob(id) {
  9382. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  9383. }
  9384. /**
  9385. * @function SuperMap.KernelDensityJobsService.prototype.addKernelDensityJob
  9386. * @description 新建核密度分析服务
  9387. * @param {SuperMap.KernelDensityJobParameter} params - 创建一个空间分析的请求参数。
  9388. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  9389. */
  9390. }, {
  9391. key: "addKernelDensityJob",
  9392. value: function addKernelDensityJob(params, seconds) {
  9393. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "addJob", this).call(this, this.url, params, KernelDensityJobParameter, seconds);
  9394. }
  9395. }]);
  9396. return KernelDensityJobsService;
  9397. }(ProcessingServiceBase);
  9398. SuperMap.KernelDensityJobsService = KernelDensityJobsService;
  9399. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsService.js
  9400. function SingleObjectQueryJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SingleObjectQueryJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SingleObjectQueryJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SingleObjectQueryJobsService_typeof(obj); }
  9401. function SingleObjectQueryJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9402. function SingleObjectQueryJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9403. function SingleObjectQueryJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  9404. function SingleObjectQueryJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SingleObjectQueryJobsService_get = Reflect.get; } else { SingleObjectQueryJobsService_get = function _get(target, property, receiver) { var base = SingleObjectQueryJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SingleObjectQueryJobsService_get(target, property, receiver || target); }
  9405. function SingleObjectQueryJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SingleObjectQueryJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  9406. function SingleObjectQueryJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SingleObjectQueryJobsService_setPrototypeOf(subClass, superClass); }
  9407. function SingleObjectQueryJobsService_setPrototypeOf(o, p) { SingleObjectQueryJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SingleObjectQueryJobsService_setPrototypeOf(o, p); }
  9408. function SingleObjectQueryJobsService_createSuper(Derived) { var hasNativeReflectConstruct = SingleObjectQueryJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SingleObjectQueryJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SingleObjectQueryJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SingleObjectQueryJobsService_possibleConstructorReturn(this, result); }; }
  9409. function SingleObjectQueryJobsService_possibleConstructorReturn(self, call) { if (call && (SingleObjectQueryJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SingleObjectQueryJobsService_assertThisInitialized(self); }
  9410. function SingleObjectQueryJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9411. function SingleObjectQueryJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9412. function SingleObjectQueryJobsService_getPrototypeOf(o) { SingleObjectQueryJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SingleObjectQueryJobsService_getPrototypeOf(o); }
  9413. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9414. * This program are made available under the terms of the Apache License, Version 2.0
  9415. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9416. /**
  9417. * @class SuperMap.SingleObjectQueryJobsService
  9418. * @category iServer ProcessingService Query
  9419. * @classdesc 单对象查询分析服务类
  9420. * @extends {SuperMap.ProcessingServiceBase}
  9421. * @param {string} url - 单对象空间查询分析服务地址。
  9422. * @param {Object} options - 参数。
  9423. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  9424. * @param {Object} [options.headers] - 请求头。
  9425. */
  9426. var SingleObjectQueryJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  9427. SingleObjectQueryJobsService_inherits(SingleObjectQueryJobsService, _ProcessingServiceBas);
  9428. var _super = SingleObjectQueryJobsService_createSuper(SingleObjectQueryJobsService);
  9429. function SingleObjectQueryJobsService(url, options) {
  9430. var _this;
  9431. SingleObjectQueryJobsService_classCallCheck(this, SingleObjectQueryJobsService);
  9432. _this = _super.call(this, url, options);
  9433. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/query');
  9434. _this.CLASS_NAME = 'SuperMap.SingleObjectQueryJobsService';
  9435. return _this;
  9436. }
  9437. /**
  9438. *@override
  9439. */
  9440. SingleObjectQueryJobsService_createClass(SingleObjectQueryJobsService, [{
  9441. key: "destroy",
  9442. value: function destroy() {
  9443. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "destroy", this).call(this);
  9444. }
  9445. /**
  9446. * @function SuperMap.SingleObjectQueryJobsService.protitype.getQueryJobs
  9447. * @description 获取单对象空间查询分析所有任务
  9448. */
  9449. }, {
  9450. key: "getQueryJobs",
  9451. value: function getQueryJobs() {
  9452. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, this.url);
  9453. }
  9454. /**
  9455. * @function SuperMap.KernelDensityJobsService.protitype.getQueryJob
  9456. * @description 获取指定id的单对象空间查询分析服务
  9457. * @param {string} id - 指定要获取数据的id
  9458. */
  9459. }, {
  9460. key: "getQueryJob",
  9461. value: function getQueryJob(id) {
  9462. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  9463. }
  9464. /**
  9465. * @function SuperMap.SingleObjectQueryJobsService.protitype.addQueryJob
  9466. * @description 新建单对象空间查询分析服务
  9467. * @param {SuperMap.SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
  9468. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  9469. */
  9470. }, {
  9471. key: "addQueryJob",
  9472. value: function addQueryJob(params, seconds) {
  9473. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "addJob", this).call(this, this.url, params, SingleObjectQueryJobsParameter, seconds);
  9474. }
  9475. }]);
  9476. return SingleObjectQueryJobsService;
  9477. }(ProcessingServiceBase);
  9478. SuperMap.SingleObjectQueryJobsService = SingleObjectQueryJobsService;
  9479. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobsService.js
  9480. function SummaryMeshJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SummaryMeshJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SummaryMeshJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SummaryMeshJobsService_typeof(obj); }
  9481. function SummaryMeshJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9482. function SummaryMeshJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9483. function SummaryMeshJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  9484. function SummaryMeshJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryMeshJobsService_get = Reflect.get; } else { SummaryMeshJobsService_get = function _get(target, property, receiver) { var base = SummaryMeshJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SummaryMeshJobsService_get(target, property, receiver || target); }
  9485. function SummaryMeshJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryMeshJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  9486. function SummaryMeshJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SummaryMeshJobsService_setPrototypeOf(subClass, superClass); }
  9487. function SummaryMeshJobsService_setPrototypeOf(o, p) { SummaryMeshJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryMeshJobsService_setPrototypeOf(o, p); }
  9488. function SummaryMeshJobsService_createSuper(Derived) { var hasNativeReflectConstruct = SummaryMeshJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SummaryMeshJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SummaryMeshJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SummaryMeshJobsService_possibleConstructorReturn(this, result); }; }
  9489. function SummaryMeshJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryMeshJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryMeshJobsService_assertThisInitialized(self); }
  9490. function SummaryMeshJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9491. function SummaryMeshJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9492. function SummaryMeshJobsService_getPrototypeOf(o) { SummaryMeshJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryMeshJobsService_getPrototypeOf(o); }
  9493. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9494. * This program are made available under the terms of the Apache License, Version 2.0
  9495. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9496. /**
  9497. * @class SuperMap.SummaryMeshJobsService
  9498. * @category iServer ProcessingService AggregatePoints
  9499. * @classdesc 点聚合分析任务类。
  9500. * @param {string} url -点聚合分析任务地址。
  9501. * @param {Object} options - 参数。
  9502. * @param {SuperMap.Events} options.events - 处理所有事件的对象。<br>
  9503. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  9504. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  9505. * @param {number} options.index - 服务访问地址在数组中的位置。<br>
  9506. * @param {number} options.length - 服务访问地址数组长度。
  9507. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  9508. * @param {Object} [options.headers] - 请求头。
  9509. */
  9510. var SummaryMeshJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  9511. SummaryMeshJobsService_inherits(SummaryMeshJobsService, _ProcessingServiceBas);
  9512. var _super = SummaryMeshJobsService_createSuper(SummaryMeshJobsService);
  9513. function SummaryMeshJobsService(url, options) {
  9514. var _this;
  9515. SummaryMeshJobsService_classCallCheck(this, SummaryMeshJobsService);
  9516. _this = _super.call(this, url, options);
  9517. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/aggregatepoints');
  9518. _this.CLASS_NAME = 'SuperMap.SummaryMeshJobsService';
  9519. return _this;
  9520. }
  9521. /**
  9522. * @override
  9523. */
  9524. SummaryMeshJobsService_createClass(SummaryMeshJobsService, [{
  9525. key: "destroy",
  9526. value: function destroy() {
  9527. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "destroy", this).call(this);
  9528. }
  9529. /**
  9530. * @function SuperMap.SummaryMeshJobsService.prototype.getSummaryMeshJobs
  9531. * @description 获取点聚合分析任务
  9532. */
  9533. }, {
  9534. key: "getSummaryMeshJobs",
  9535. value: function getSummaryMeshJobs() {
  9536. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, this.url);
  9537. }
  9538. /**
  9539. * @function SuperMap.SummaryMeshJobsService.prototype.getSummaryMeshJob
  9540. * @description 获取指定ip的点聚合分析任务
  9541. * @param {string} id - 指定要获取数据的id
  9542. */
  9543. }, {
  9544. key: "getSummaryMeshJob",
  9545. value: function getSummaryMeshJob(id) {
  9546. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  9547. }
  9548. /**
  9549. * @function SuperMap.SummaryMeshJobsService.prototype.addSummaryMeshJob
  9550. * @description 新建点聚合分析服务
  9551. * @param {SuperMap.SummaryMeshJobParameter} params - 创建一个空间分析的请求参数。
  9552. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  9553. */
  9554. }, {
  9555. key: "addSummaryMeshJob",
  9556. value: function addSummaryMeshJob(params, seconds) {
  9557. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryMeshJobParameter, seconds);
  9558. }
  9559. }]);
  9560. return SummaryMeshJobsService;
  9561. }(ProcessingServiceBase);
  9562. SuperMap.SummaryMeshJobsService = SummaryMeshJobsService;
  9563. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobsService.js
  9564. function SummaryRegionJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SummaryRegionJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SummaryRegionJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SummaryRegionJobsService_typeof(obj); }
  9565. function SummaryRegionJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9566. function SummaryRegionJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9567. function SummaryRegionJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  9568. function SummaryRegionJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryRegionJobsService_get = Reflect.get; } else { SummaryRegionJobsService_get = function _get(target, property, receiver) { var base = SummaryRegionJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SummaryRegionJobsService_get(target, property, receiver || target); }
  9569. function SummaryRegionJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryRegionJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  9570. function SummaryRegionJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SummaryRegionJobsService_setPrototypeOf(subClass, superClass); }
  9571. function SummaryRegionJobsService_setPrototypeOf(o, p) { SummaryRegionJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryRegionJobsService_setPrototypeOf(o, p); }
  9572. function SummaryRegionJobsService_createSuper(Derived) { var hasNativeReflectConstruct = SummaryRegionJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SummaryRegionJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SummaryRegionJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SummaryRegionJobsService_possibleConstructorReturn(this, result); }; }
  9573. function SummaryRegionJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryRegionJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryRegionJobsService_assertThisInitialized(self); }
  9574. function SummaryRegionJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9575. function SummaryRegionJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9576. function SummaryRegionJobsService_getPrototypeOf(o) { SummaryRegionJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryRegionJobsService_getPrototypeOf(o); }
  9577. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9578. * This program are made available under the terms of the Apache License, Version 2.0
  9579. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9580. /**
  9581. * @class SuperMap.SummaryRegionJobsService
  9582. * @category iServer ProcessingService SummaryRegion
  9583. * @classdesc 区域汇总分析服务类
  9584. * @extends {SuperMap.ProcessingServiceBase}
  9585. * @param {string} url - 区域汇总分析服务地址。
  9586. * @param {Object} options - 参数。
  9587. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  9588. * @param {Object} [options.headers] - 请求头。
  9589. */
  9590. var SummaryRegionJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  9591. SummaryRegionJobsService_inherits(SummaryRegionJobsService, _ProcessingServiceBas);
  9592. var _super = SummaryRegionJobsService_createSuper(SummaryRegionJobsService);
  9593. function SummaryRegionJobsService(url, options) {
  9594. var _this;
  9595. SummaryRegionJobsService_classCallCheck(this, SummaryRegionJobsService);
  9596. _this = _super.call(this, url, options);
  9597. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/summaryregion');
  9598. _this.CLASS_NAME = 'SuperMap.SummaryRegionJobsService';
  9599. return _this;
  9600. }
  9601. /**
  9602. *@override
  9603. */
  9604. SummaryRegionJobsService_createClass(SummaryRegionJobsService, [{
  9605. key: "destroy",
  9606. value: function destroy() {
  9607. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "destroy", this).call(this);
  9608. }
  9609. /**
  9610. * @function SuperMap.SummaryRegionJobsService.prototype.getSummaryRegionJobs
  9611. * @description 获取区域汇总分析任务集合。
  9612. */
  9613. }, {
  9614. key: "getSummaryRegionJobs",
  9615. value: function getSummaryRegionJobs() {
  9616. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, this.url);
  9617. }
  9618. /**
  9619. * @function SuperMap.SummaryRegionJobsService.prototype.getSummaryRegionJob
  9620. * @description 获取指定id的区域汇总分析任务。
  9621. * @param {string} id -要获取区域汇总分析任务的id
  9622. */
  9623. }, {
  9624. key: "getSummaryRegionJob",
  9625. value: function getSummaryRegionJob(id) {
  9626. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  9627. }
  9628. /**
  9629. * @function SuperMap.SummaryRegionJobsService.prototype.addSummaryRegionJob
  9630. * @description 新建区域汇总任务。
  9631. * @param {SuperMap.SummaryRegionJobParameter} params - 创建一个区域汇总任务的请求参数。
  9632. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  9633. */
  9634. }, {
  9635. key: "addSummaryRegionJob",
  9636. value: function addSummaryRegionJob(params, seconds) {
  9637. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryRegionJobParameter, seconds);
  9638. }
  9639. }]);
  9640. return SummaryRegionJobsService;
  9641. }(ProcessingServiceBase);
  9642. SuperMap.SummaryRegionJobsService = SummaryRegionJobsService;
  9643. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsParameter.js
  9644. function VectorClipJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9645. function VectorClipJobsParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9646. function VectorClipJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  9647. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9648. * This program are made available under the terms of the Apache License, Version 2.0
  9649. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9650. /**
  9651. * @class SuperMap.VectorClipJobsParameter
  9652. * @category iServer ProcessingService VectorClip
  9653. * @classdesc 矢量裁剪分析任务参数类。
  9654. * @param {Object} options - 参数。
  9655. * @param {string} options.datasetName - 数据集名。
  9656. * @param {string} options.datasetOverlay - 裁剪对象数据集。
  9657. * @param {SuperMap.ClipAnalystMode} [options.mode=SuperMap.ClipAnalystMode.CLIP] - 裁剪分析模式。
  9658. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  9659. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  9660. */
  9661. var VectorClipJobsParameter = /*#__PURE__*/function () {
  9662. function VectorClipJobsParameter(options) {
  9663. VectorClipJobsParameter_classCallCheck(this, VectorClipJobsParameter);
  9664. options = options || {};
  9665. /**
  9666. * @member {string} SuperMap.VectorClipJobsParameter.prototype.datasetName
  9667. * @description 数据集名。
  9668. */
  9669. this.datasetName = "";
  9670. /**
  9671. * @member {string} SuperMap.VectorClipJobsParameter.prototype.datasetOverlay
  9672. * @description 裁剪对象数据集。
  9673. */
  9674. this.datasetVectorClip = "";
  9675. /**
  9676. * @member {string} SuperMap.VectorClipJobsParameter.prototype.geometryClip
  9677. * @description 裁剪几何对象。
  9678. */
  9679. this.geometryClip = "";
  9680. /**
  9681. * @member {SuperMap.ClipAnalystMode} [SuperMap.VectorClipJobsParameter.prototype.mode=ClipAnalystMode.CLIP]
  9682. * @description 裁剪分析模式 。
  9683. */
  9684. this.mode = ClipAnalystMode.CLIP;
  9685. /**
  9686. * @member {SuperMap.OutputSetting} SuperMap.VectorClipJobsParameter.prototype.output
  9687. * @description 输出参数设置类。
  9688. */
  9689. this.output = null;
  9690. /**
  9691. * @member {SuperMap.MappingParameters} [SuperMap.VectorClipJobsParameter.prototype.mappingParameters]
  9692. * @description 分析后结果可视化的参数类。
  9693. */
  9694. this.mappingParameters = null;
  9695. Util.extend(this, options);
  9696. this.CLASS_NAME = "SuperMap.VectorClipJobsParameter";
  9697. }
  9698. /**
  9699. * @function SuperMap.VectorClipJobsParameter.prototype.destroy
  9700. * @description 释放资源,将引用资源的属性置空。
  9701. */
  9702. VectorClipJobsParameter_createClass(VectorClipJobsParameter, [{
  9703. key: "destroy",
  9704. value: function destroy() {
  9705. this.datasetName = null;
  9706. this.datasetVectorClip = null;
  9707. this.geometryClip = null;
  9708. this.mode = null;
  9709. if (this.output instanceof OutputSetting) {
  9710. this.output.destroy();
  9711. this.output = null;
  9712. }
  9713. if (this.mappingParameters instanceof MappingParameters) {
  9714. this.mappingParameters.destroy();
  9715. this.mappingParameters = null;
  9716. }
  9717. }
  9718. /**
  9719. * @function SuperMap.VectorClipJobsParameter.toObject
  9720. * @param {Object} vectorClipJobsParameter - 区域汇总分析服务参数。
  9721. * @param {Object} tempObj - 目标对象。
  9722. * @description 矢量裁剪分析任务对象。
  9723. */
  9724. }], [{
  9725. key: "toObject",
  9726. value: function toObject(vectorClipJobsParameter, tempObj) {
  9727. for (var name in vectorClipJobsParameter) {
  9728. if (name === "datasetName") {
  9729. tempObj['input'] = tempObj['input'] || {};
  9730. tempObj['input'][name] = vectorClipJobsParameter[name];
  9731. continue;
  9732. }
  9733. if (name === "output") {
  9734. tempObj['output'] = tempObj['output'] || {};
  9735. tempObj['output'] = vectorClipJobsParameter[name];
  9736. continue;
  9737. }
  9738. tempObj['analyst'] = tempObj['analyst'] || {};
  9739. tempObj['analyst'][name] = vectorClipJobsParameter[name];
  9740. if (name === 'mappingParameters') {
  9741. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  9742. tempObj['analyst']['mappingParameters'] = vectorClipJobsParameter[name];
  9743. }
  9744. }
  9745. }
  9746. }]);
  9747. return VectorClipJobsParameter;
  9748. }();
  9749. SuperMap.VectorClipJobsParameter = VectorClipJobsParameter;
  9750. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsService.js
  9751. function VectorClipJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { VectorClipJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { VectorClipJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return VectorClipJobsService_typeof(obj); }
  9752. function VectorClipJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9753. function VectorClipJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9754. function VectorClipJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  9755. function VectorClipJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { VectorClipJobsService_get = Reflect.get; } else { VectorClipJobsService_get = function _get(target, property, receiver) { var base = VectorClipJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return VectorClipJobsService_get(target, property, receiver || target); }
  9756. function VectorClipJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = VectorClipJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  9757. function VectorClipJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) VectorClipJobsService_setPrototypeOf(subClass, superClass); }
  9758. function VectorClipJobsService_setPrototypeOf(o, p) { VectorClipJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return VectorClipJobsService_setPrototypeOf(o, p); }
  9759. function VectorClipJobsService_createSuper(Derived) { var hasNativeReflectConstruct = VectorClipJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = VectorClipJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = VectorClipJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return VectorClipJobsService_possibleConstructorReturn(this, result); }; }
  9760. function VectorClipJobsService_possibleConstructorReturn(self, call) { if (call && (VectorClipJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return VectorClipJobsService_assertThisInitialized(self); }
  9761. function VectorClipJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9762. function VectorClipJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9763. function VectorClipJobsService_getPrototypeOf(o) { VectorClipJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorClipJobsService_getPrototypeOf(o); }
  9764. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9765. * This program are made available under the terms of the Apache License, Version 2.0
  9766. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9767. /**
  9768. * @class SuperMap.VectorClipJobsService
  9769. * @category iServer ProcessingService VectorClip
  9770. * @classdesc 矢量裁剪分析服务类
  9771. * @extends {SuperMap.ProcessingServiceBase}
  9772. * @param {string} url -矢量裁剪分析服务地址。
  9773. * @param {Object} options - 交互服务时所需可选参数。
  9774. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  9775. * @param {Object} [options.headers] - 请求头。
  9776. */
  9777. var VectorClipJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  9778. VectorClipJobsService_inherits(VectorClipJobsService, _ProcessingServiceBas);
  9779. var _super = VectorClipJobsService_createSuper(VectorClipJobsService);
  9780. function VectorClipJobsService(url, options) {
  9781. var _this;
  9782. VectorClipJobsService_classCallCheck(this, VectorClipJobsService);
  9783. _this = _super.call(this, url, options);
  9784. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/vectorclip');
  9785. _this.CLASS_NAME = 'SuperMap.VectorClipJobsService';
  9786. return _this;
  9787. }
  9788. /**
  9789. *@override
  9790. */
  9791. VectorClipJobsService_createClass(VectorClipJobsService, [{
  9792. key: "destroy",
  9793. value: function destroy() {
  9794. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "destroy", this).call(this);
  9795. }
  9796. /**
  9797. * @function SuperMap.VectorClipJobsService.protitype.getVectorClipJobs
  9798. * @description 获取矢量裁剪分析所有任务
  9799. */
  9800. }, {
  9801. key: "getVectorClipJobs",
  9802. value: function getVectorClipJobs() {
  9803. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, this.url);
  9804. }
  9805. /**
  9806. * @function SuperMap.KernelDensityJobsService.protitype.getVectorClipJob
  9807. * @description 获取指定id的矢量裁剪分析服务
  9808. * @param {string} id - 指定要获取数据的id
  9809. */
  9810. }, {
  9811. key: "getVectorClipJob",
  9812. value: function getVectorClipJob(id) {
  9813. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  9814. }
  9815. /**
  9816. * @function SuperMap.VectorClipJobsService.protitype.addVectorClipJob
  9817. * @description 新建矢量裁剪分析服务
  9818. * @param {SuperMap.VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  9819. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  9820. */
  9821. }, {
  9822. key: "addVectorClipJob",
  9823. value: function addVectorClipJob(params, seconds) {
  9824. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "addJob", this).call(this, this.url, params, VectorClipJobsParameter, seconds);
  9825. }
  9826. }]);
  9827. return VectorClipJobsService;
  9828. }(ProcessingServiceBase);
  9829. SuperMap.VectorClipJobsService = VectorClipJobsService;
  9830. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobsService.js
  9831. function OverlayGeoJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { OverlayGeoJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { OverlayGeoJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return OverlayGeoJobsService_typeof(obj); }
  9832. function OverlayGeoJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9833. function OverlayGeoJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9834. function OverlayGeoJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  9835. function OverlayGeoJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { OverlayGeoJobsService_get = Reflect.get; } else { OverlayGeoJobsService_get = function _get(target, property, receiver) { var base = OverlayGeoJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return OverlayGeoJobsService_get(target, property, receiver || target); }
  9836. function OverlayGeoJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayGeoJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  9837. function OverlayGeoJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) OverlayGeoJobsService_setPrototypeOf(subClass, superClass); }
  9838. function OverlayGeoJobsService_setPrototypeOf(o, p) { OverlayGeoJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayGeoJobsService_setPrototypeOf(o, p); }
  9839. function OverlayGeoJobsService_createSuper(Derived) { var hasNativeReflectConstruct = OverlayGeoJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = OverlayGeoJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = OverlayGeoJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return OverlayGeoJobsService_possibleConstructorReturn(this, result); }; }
  9840. function OverlayGeoJobsService_possibleConstructorReturn(self, call) { if (call && (OverlayGeoJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return OverlayGeoJobsService_assertThisInitialized(self); }
  9841. function OverlayGeoJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9842. function OverlayGeoJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9843. function OverlayGeoJobsService_getPrototypeOf(o) { OverlayGeoJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayGeoJobsService_getPrototypeOf(o); }
  9844. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9845. * This program are made available under the terms of the Apache License, Version 2.0
  9846. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9847. /**
  9848. * @class SuperMap.OverlayGeoJobsService
  9849. * @category iServer ProcessingService OverlayAnalyst
  9850. * @classdesc 叠加分析任务类。
  9851. * @param {string} url - 叠加分析任务地址。
  9852. * @param {Object} options - 参数。
  9853. * @param {SuperMap.Events} options.events - 处理所有事件的对象。
  9854. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  9855. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  9856. * @param {number} options.index - 服务访问地址在数组中的位置。
  9857. * @param {number} options.length - 服务访问地址数组长度。
  9858. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  9859. * @param {Object} [options.headers] - 请求头。
  9860. */
  9861. var OverlayGeoJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  9862. OverlayGeoJobsService_inherits(OverlayGeoJobsService, _ProcessingServiceBas);
  9863. var _super = OverlayGeoJobsService_createSuper(OverlayGeoJobsService);
  9864. function OverlayGeoJobsService(url, options) {
  9865. var _this;
  9866. OverlayGeoJobsService_classCallCheck(this, OverlayGeoJobsService);
  9867. _this = _super.call(this, url, options);
  9868. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/overlay');
  9869. _this.CLASS_NAME = 'SuperMap.OverlayGeoJobsService';
  9870. return _this;
  9871. }
  9872. /**
  9873. * @override
  9874. */
  9875. OverlayGeoJobsService_createClass(OverlayGeoJobsService, [{
  9876. key: "destroy",
  9877. value: function destroy() {
  9878. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "destroy", this).call(this);
  9879. }
  9880. /**
  9881. * @function SuperMap.OverlayGeoJobsService.prototype.getOverlayGeoJobs
  9882. * @description 获取叠加分析任务
  9883. */
  9884. }, {
  9885. key: "getOverlayGeoJobs",
  9886. value: function getOverlayGeoJobs() {
  9887. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, this.url);
  9888. }
  9889. /**
  9890. * @function SuperMap.OverlayGeoJobsService.prototype.getOverlayGeoJob
  9891. * @description 获取指定id的叠加分析任务
  9892. * @param {string} id - 指定要获取数据的id
  9893. */
  9894. }, {
  9895. key: "getOverlayGeoJob",
  9896. value: function getOverlayGeoJob(id) {
  9897. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  9898. }
  9899. /**
  9900. * @function SuperMap.OverlayGeoJobsService.prototype.addOverlayGeoJob
  9901. * @description 新建点叠加析服务
  9902. * @param {SuperMap.OverlayGeoJobParameter} params - 创建一个叠加分析的请求参数。
  9903. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  9904. */
  9905. }, {
  9906. key: "addOverlayGeoJob",
  9907. value: function addOverlayGeoJob(params, seconds) {
  9908. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "addJob", this).call(this, this.url, params, OverlayGeoJobParameter, seconds);
  9909. }
  9910. }]);
  9911. return OverlayGeoJobsService;
  9912. }(ProcessingServiceBase);
  9913. SuperMap.OverlayGeoJobsService = OverlayGeoJobsService;
  9914. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsService.js
  9915. function BuffersAnalystJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { BuffersAnalystJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { BuffersAnalystJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return BuffersAnalystJobsService_typeof(obj); }
  9916. function BuffersAnalystJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9917. function BuffersAnalystJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9918. function BuffersAnalystJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  9919. function BuffersAnalystJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { BuffersAnalystJobsService_get = Reflect.get; } else { BuffersAnalystJobsService_get = function _get(target, property, receiver) { var base = BuffersAnalystJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return BuffersAnalystJobsService_get(target, property, receiver || target); }
  9920. function BuffersAnalystJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BuffersAnalystJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  9921. function BuffersAnalystJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) BuffersAnalystJobsService_setPrototypeOf(subClass, superClass); }
  9922. function BuffersAnalystJobsService_setPrototypeOf(o, p) { BuffersAnalystJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BuffersAnalystJobsService_setPrototypeOf(o, p); }
  9923. function BuffersAnalystJobsService_createSuper(Derived) { var hasNativeReflectConstruct = BuffersAnalystJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = BuffersAnalystJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = BuffersAnalystJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return BuffersAnalystJobsService_possibleConstructorReturn(this, result); }; }
  9924. function BuffersAnalystJobsService_possibleConstructorReturn(self, call) { if (call && (BuffersAnalystJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return BuffersAnalystJobsService_assertThisInitialized(self); }
  9925. function BuffersAnalystJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9926. function BuffersAnalystJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9927. function BuffersAnalystJobsService_getPrototypeOf(o) { BuffersAnalystJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BuffersAnalystJobsService_getPrototypeOf(o); }
  9928. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9929. * This program are made available under the terms of the Apache License, Version 2.0
  9930. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9931. /**
  9932. * @class SuperMap.BuffersAnalystJobsService
  9933. * @category iServer ProcessingService BufferAnalyst
  9934. * @classdesc 缓冲区分析服务类
  9935. * @extends {SuperMap.ProcessingServiceBase}
  9936. * @param {string} url - 服务地址。
  9937. * @param {Object} options - 参数。
  9938. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  9939. * @param {Object} [options.headers] - 请求头。
  9940. */
  9941. var BuffersAnalystJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  9942. BuffersAnalystJobsService_inherits(BuffersAnalystJobsService, _ProcessingServiceBas);
  9943. var _super = BuffersAnalystJobsService_createSuper(BuffersAnalystJobsService);
  9944. function BuffersAnalystJobsService(url, options) {
  9945. var _this;
  9946. BuffersAnalystJobsService_classCallCheck(this, BuffersAnalystJobsService);
  9947. _this = _super.call(this, url, options);
  9948. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/buffers');
  9949. _this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsService';
  9950. return _this;
  9951. }
  9952. /**
  9953. *@override
  9954. */
  9955. BuffersAnalystJobsService_createClass(BuffersAnalystJobsService, [{
  9956. key: "destroy",
  9957. value: function destroy() {
  9958. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "destroy", this).call(this);
  9959. }
  9960. /**
  9961. * @function SuperMap.BuffersAnalystJobsService.prototype.getBufferJobs
  9962. * @description 获取缓冲区分析所有任务
  9963. */
  9964. }, {
  9965. key: "getBuffersJobs",
  9966. value: function getBuffersJobs() {
  9967. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, this.url);
  9968. }
  9969. /**
  9970. * @function SuperMap.BuffersAnalystJobsService.prototype.getBufferJob
  9971. * @description 获取指定id的缓冲区分析服务
  9972. * @param {string} id - 指定要获取数据的id。
  9973. */
  9974. }, {
  9975. key: "getBuffersJob",
  9976. value: function getBuffersJob(id) {
  9977. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  9978. }
  9979. /**
  9980. * @function SuperMap.BuffersAnalystJobsService.prototype.addBufferJob
  9981. * @description 新建缓冲区分析服务
  9982. * @param {SuperMap.BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  9983. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  9984. */
  9985. }, {
  9986. key: "addBuffersJob",
  9987. value: function addBuffersJob(params, seconds) {
  9988. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "addJob", this).call(this, this.url, params, BuffersAnalystJobsParameter, seconds);
  9989. }
  9990. }]);
  9991. return BuffersAnalystJobsService;
  9992. }(ProcessingServiceBase);
  9993. SuperMap.BuffersAnalystJobsService = BuffersAnalystJobsService;
  9994. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsService.js
  9995. function TopologyValidatorJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TopologyValidatorJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { TopologyValidatorJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TopologyValidatorJobsService_typeof(obj); }
  9996. function TopologyValidatorJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9997. function TopologyValidatorJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9998. function TopologyValidatorJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  9999. function TopologyValidatorJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TopologyValidatorJobsService_get = Reflect.get; } else { TopologyValidatorJobsService_get = function _get(target, property, receiver) { var base = TopologyValidatorJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return TopologyValidatorJobsService_get(target, property, receiver || target); }
  10000. function TopologyValidatorJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TopologyValidatorJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  10001. function TopologyValidatorJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) TopologyValidatorJobsService_setPrototypeOf(subClass, superClass); }
  10002. function TopologyValidatorJobsService_setPrototypeOf(o, p) { TopologyValidatorJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TopologyValidatorJobsService_setPrototypeOf(o, p); }
  10003. function TopologyValidatorJobsService_createSuper(Derived) { var hasNativeReflectConstruct = TopologyValidatorJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TopologyValidatorJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TopologyValidatorJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TopologyValidatorJobsService_possibleConstructorReturn(this, result); }; }
  10004. function TopologyValidatorJobsService_possibleConstructorReturn(self, call) { if (call && (TopologyValidatorJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return TopologyValidatorJobsService_assertThisInitialized(self); }
  10005. function TopologyValidatorJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  10006. function TopologyValidatorJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  10007. function TopologyValidatorJobsService_getPrototypeOf(o) { TopologyValidatorJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TopologyValidatorJobsService_getPrototypeOf(o); }
  10008. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  10009. * This program are made available under the terms of the Apache License, Version 2.0
  10010. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10011. /**
  10012. * @class SuperMap.TopologyValidatorJobsService
  10013. * @category iServer ProcessingService TopologyValidator
  10014. * @classdesc 拓扑检查分析服务类
  10015. * @extends {SuperMap.ProcessingServiceBase}
  10016. * @param {string} url - 拓扑检查分析服务地址。
  10017. * @param {Object} options - 参数。
  10018. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  10019. * @param {Object} [options.headers] - 请求头。
  10020. */
  10021. var TopologyValidatorJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  10022. TopologyValidatorJobsService_inherits(TopologyValidatorJobsService, _ProcessingServiceBas);
  10023. var _super = TopologyValidatorJobsService_createSuper(TopologyValidatorJobsService);
  10024. function TopologyValidatorJobsService(url, options) {
  10025. var _this;
  10026. TopologyValidatorJobsService_classCallCheck(this, TopologyValidatorJobsService);
  10027. _this = _super.call(this, url, options);
  10028. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/topologyvalidator');
  10029. _this.CLASS_NAME = "SuperMap.TopologyValidatorJobsService";
  10030. return _this;
  10031. }
  10032. /**
  10033. *@override
  10034. */
  10035. TopologyValidatorJobsService_createClass(TopologyValidatorJobsService, [{
  10036. key: "destroy",
  10037. value: function destroy() {
  10038. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "destroy", this).call(this);
  10039. }
  10040. /**
  10041. * @function SuperMap.TopologyValidatorJobsService.protitype.getTopologyValidatorJobs
  10042. * @description 获取拓扑检查分析所有任务
  10043. */
  10044. }, {
  10045. key: "getTopologyValidatorJobs",
  10046. value: function getTopologyValidatorJobs() {
  10047. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, this.url);
  10048. }
  10049. /**
  10050. * @function SuperMap.TopologyValidatorJobsService.protitype.getTopologyValidatorJob
  10051. * @description 获取指定id的拓扑检查分析服务
  10052. * @param {string} id - 指定要获取数据的id
  10053. */
  10054. }, {
  10055. key: "getTopologyValidatorJob",
  10056. value: function getTopologyValidatorJob(id) {
  10057. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  10058. }
  10059. /**
  10060. * @function SuperMap.TopologyValidatorJobsService.protitype.addTopologyValidatorJob
  10061. * @description 新建拓扑检查分析服务
  10062. * @param {SuperMap.TopologyValidatorJobsParameter} params - 创建一个空间分析的请求参数。
  10063. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  10064. */
  10065. }, {
  10066. key: "addTopologyValidatorJob",
  10067. value: function addTopologyValidatorJob(params, seconds) {
  10068. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "addJob", this).call(this, this.url, params, TopologyValidatorJobsParameter, seconds);
  10069. }
  10070. }]);
  10071. return TopologyValidatorJobsService;
  10072. }(ProcessingServiceBase);
  10073. SuperMap.TopologyValidatorJobsService = TopologyValidatorJobsService;
  10074. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsService.js
  10075. function SummaryAttributesJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SummaryAttributesJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SummaryAttributesJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SummaryAttributesJobsService_typeof(obj); }
  10076. function SummaryAttributesJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10077. function SummaryAttributesJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  10078. function SummaryAttributesJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  10079. function SummaryAttributesJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryAttributesJobsService_get = Reflect.get; } else { SummaryAttributesJobsService_get = function _get(target, property, receiver) { var base = SummaryAttributesJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SummaryAttributesJobsService_get(target, property, receiver || target); }
  10080. function SummaryAttributesJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryAttributesJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  10081. function SummaryAttributesJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SummaryAttributesJobsService_setPrototypeOf(subClass, superClass); }
  10082. function SummaryAttributesJobsService_setPrototypeOf(o, p) { SummaryAttributesJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryAttributesJobsService_setPrototypeOf(o, p); }
  10083. function SummaryAttributesJobsService_createSuper(Derived) { var hasNativeReflectConstruct = SummaryAttributesJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SummaryAttributesJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SummaryAttributesJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SummaryAttributesJobsService_possibleConstructorReturn(this, result); }; }
  10084. function SummaryAttributesJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryAttributesJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryAttributesJobsService_assertThisInitialized(self); }
  10085. function SummaryAttributesJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  10086. function SummaryAttributesJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  10087. function SummaryAttributesJobsService_getPrototypeOf(o) { SummaryAttributesJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryAttributesJobsService_getPrototypeOf(o); }
  10088. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  10089. * This program are made available under the terms of the Apache License, Version 2.0
  10090. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10091. /**
  10092. * @class SuperMap.SummaryAttributesJobsService
  10093. * @category iServer ProcessingService SummaryAttributes
  10094. * @classdesc 属性汇总分析服务类
  10095. * @extends {SuperMap.ProcessingServiceBase}
  10096. * @param {string} url - 汇总统计分析服务地址。
  10097. * @param {Object} options - 参数。
  10098. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  10099. * @param {Object} [options.headers] - 请求头。
  10100. */
  10101. var SummaryAttributesJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  10102. SummaryAttributesJobsService_inherits(SummaryAttributesJobsService, _ProcessingServiceBas);
  10103. var _super = SummaryAttributesJobsService_createSuper(SummaryAttributesJobsService);
  10104. function SummaryAttributesJobsService(url, options) {
  10105. var _this;
  10106. SummaryAttributesJobsService_classCallCheck(this, SummaryAttributesJobsService);
  10107. _this = _super.call(this, url, options);
  10108. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/summaryattributes');
  10109. _this.CLASS_NAME = "SuperMap.SummaryAttributesJobsService";
  10110. return _this;
  10111. }
  10112. /**
  10113. *@override
  10114. */
  10115. SummaryAttributesJobsService_createClass(SummaryAttributesJobsService, [{
  10116. key: "destroy",
  10117. value: function destroy() {
  10118. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "destroy", this).call(this);
  10119. }
  10120. /**
  10121. * @function SuperMap.SummaryAttributesJobsService.protitype.getSummaryAttributesJobs
  10122. * @description 获取属性汇总分析所有任务
  10123. */
  10124. }, {
  10125. key: "getSummaryAttributesJobs",
  10126. value: function getSummaryAttributesJobs() {
  10127. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, this.url);
  10128. }
  10129. /**
  10130. * @function SuperMap.SummaryAttributesJobsService.protitype.getSummaryAttributesJob
  10131. * @description 获取指定id的属性汇总分析服务
  10132. * @param {string} id - 指定要获取数据的id
  10133. */
  10134. }, {
  10135. key: "getSummaryAttributesJob",
  10136. value: function getSummaryAttributesJob(id) {
  10137. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  10138. }
  10139. /**
  10140. * @function SuperMap.SummaryAttributesJobsService.protitype.addSummaryAttributesJob
  10141. * @description 新建属性汇总分析服务
  10142. * @param {SuperMap.SummaryAttributesJobsParameter} params - 创建一个空间分析的请求参数。
  10143. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  10144. */
  10145. }, {
  10146. key: "addSummaryAttributesJob",
  10147. value: function addSummaryAttributesJob(params, seconds) {
  10148. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryAttributesJobsParameter, seconds);
  10149. }
  10150. }]);
  10151. return SummaryAttributesJobsService;
  10152. }(ProcessingServiceBase);
  10153. SuperMap.SummaryAttributesJobsService = SummaryAttributesJobsService;
  10154. ;// CONCATENATED MODULE: ./src/classic/services/ProcessingService.js
  10155. function ProcessingService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ProcessingService_typeof = function _typeof(obj) { return typeof obj; }; } else { ProcessingService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ProcessingService_typeof(obj); }
  10156. function ProcessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10157. function ProcessingService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  10158. function ProcessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingService_defineProperties(Constructor, staticProps); return Constructor; }
  10159. function ProcessingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ProcessingService_setPrototypeOf(subClass, superClass); }
  10160. function ProcessingService_setPrototypeOf(o, p) { ProcessingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingService_setPrototypeOf(o, p); }
  10161. function ProcessingService_createSuper(Derived) { var hasNativeReflectConstruct = ProcessingService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ProcessingService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ProcessingService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ProcessingService_possibleConstructorReturn(this, result); }; }
  10162. function ProcessingService_possibleConstructorReturn(self, call) { if (call && (ProcessingService_typeof(call) === "object" || typeof call === "function")) { return call; } return ProcessingService_assertThisInitialized(self); }
  10163. function ProcessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  10164. function ProcessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  10165. function ProcessingService_getPrototypeOf(o) { ProcessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingService_getPrototypeOf(o); }
  10166. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  10167. * This program are made available under the terms of the Apache License, Version 2.0
  10168. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10169. /**
  10170. * @class SuperMap.REST.ProcessingService
  10171. * @category iServer ProcessingService
  10172. * @classdesc 分布式分析相关服务类。
  10173. * @augments SuperMap.CommonServiceBase
  10174. * @example
  10175. * 用法:
  10176. * new SuperMap.REST.ProcessingService(url,options)
  10177. * .getKernelDensityJobs(function(result){
  10178. * //doSomething
  10179. * })
  10180. * @param {string} url - 分布式分析服务地址。
  10181. * @param {Object} options - 可选参数。
  10182. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  10183. * @param {Object} [options.headers] - 请求头。
  10184. */
  10185. var ProcessingService = /*#__PURE__*/function (_CommonServiceBase) {
  10186. ProcessingService_inherits(ProcessingService, _CommonServiceBase);
  10187. var _super = ProcessingService_createSuper(ProcessingService);
  10188. function ProcessingService(url, options) {
  10189. var _this;
  10190. ProcessingService_classCallCheck(this, ProcessingService);
  10191. _this = _super.call(this, url, options);
  10192. _this.kernelDensityJobs = {};
  10193. _this.summaryMeshJobs = {};
  10194. _this.queryJobs = {};
  10195. _this.summaryRegionJobs = {};
  10196. _this.vectorClipJobs = {};
  10197. _this.overlayGeoJobs = {};
  10198. _this.buffersJobs = {};
  10199. _this.topologyValidatorJobs = {};
  10200. _this.summaryAttributesJobs = {};
  10201. return _this;
  10202. }
  10203. /**
  10204. * @function SuperMap.REST.ProcessingService.prototype.getKernelDensityJobs
  10205. * @description 获取密度分析的列表。
  10206. * @param {function} callback - 请求结果的回调函数。
  10207. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10208. */
  10209. ProcessingService_createClass(ProcessingService, [{
  10210. key: "getKernelDensityJobs",
  10211. value: function getKernelDensityJobs(callback, resultFormat) {
  10212. var me = this,
  10213. format = me._processFormat(resultFormat);
  10214. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  10215. headers: me.headers,
  10216. proxy: me.proxy,
  10217. withCredentials: me.withCredentials,
  10218. crossOrigin: me.crossOrigin,
  10219. serverType: me.serverType,
  10220. eventListeners: {
  10221. scope: me,
  10222. processCompleted: callback,
  10223. processFailed: callback
  10224. },
  10225. format: format
  10226. });
  10227. kernelDensityJobsService.getKernelDensityJobs();
  10228. }
  10229. /**
  10230. * @function SuperMap.REST.ProcessingService.prototype.getKernelDensityJob
  10231. * @description 获取某一个密度分析。
  10232. * @param {string} id - 空间分析的 id。
  10233. * @param {function} callback - 请求结果的回调函数。
  10234. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10235. */
  10236. }, {
  10237. key: "getKernelDensityJob",
  10238. value: function getKernelDensityJob(id, callback, resultFormat) {
  10239. var me = this,
  10240. format = me._processFormat(resultFormat);
  10241. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  10242. headers: me.headers,
  10243. proxy: me.proxy,
  10244. withCredentials: me.withCredentials,
  10245. crossOrigin: me.crossOrigin,
  10246. serverType: me.serverType,
  10247. eventListeners: {
  10248. scope: me,
  10249. processCompleted: callback,
  10250. processFailed: callback
  10251. },
  10252. format: format
  10253. });
  10254. kernelDensityJobsService.getKernelDensityJob(id);
  10255. }
  10256. /**
  10257. * @function SuperMap.REST.ProcessingService.prototype.addKernelDensityJob
  10258. * @description 新建一个密度分析。
  10259. * @param {SuperMap.KernelDensityJobParameter} params - 创建一个空间分析的请求参数。
  10260. * @param {function} callback - 请求结果的回调函数。
  10261. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  10262. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10263. */
  10264. }, {
  10265. key: "addKernelDensityJob",
  10266. value: function addKernelDensityJob(params, callback, seconds, resultFormat) {
  10267. var me = this,
  10268. format = me._processFormat(resultFormat);
  10269. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  10270. headers: me.headers,
  10271. proxy: me.proxy,
  10272. withCredentials: me.withCredentials,
  10273. crossOrigin: me.crossOrigin,
  10274. eventListeners: {
  10275. scope: me,
  10276. processCompleted: callback,
  10277. processFailed: callback,
  10278. processRunning: function processRunning(job) {
  10279. me.kernelDensityJobs[job.id] = job.state;
  10280. }
  10281. },
  10282. format: format
  10283. });
  10284. kernelDensityJobsService.addKernelDensityJob(params, seconds);
  10285. }
  10286. /**
  10287. * @function SuperMap.REST.ProcessingService.prototype.getKernelDensityJobState
  10288. * @description 获取密度分析的状态。
  10289. * @param {string} id - 密度分析的 id。
  10290. * @returns {Object} - 密度分析的状态。
  10291. */
  10292. }, {
  10293. key: "getKernelDensityJobState",
  10294. value: function getKernelDensityJobState(id) {
  10295. return this.kernelDensityJobs[id];
  10296. }
  10297. /**
  10298. * @function SuperMap.REST.ProcessingService.prototype.getSummaryMeshJobs
  10299. * @description 获取点聚合分析的列表。
  10300. * @param {function} callback - 请求结果的回调函数。
  10301. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10302. */
  10303. }, {
  10304. key: "getSummaryMeshJobs",
  10305. value: function getSummaryMeshJobs(callback, resultFormat) {
  10306. var me = this,
  10307. format = me._processFormat(resultFormat);
  10308. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  10309. headers: me.headers,
  10310. proxy: me.proxy,
  10311. withCredentials: me.withCredentials,
  10312. crossOrigin: me.crossOrigin,
  10313. serverType: me.serverType,
  10314. eventListeners: {
  10315. scope: me,
  10316. processCompleted: callback,
  10317. processFailed: callback
  10318. },
  10319. format: format
  10320. });
  10321. summaryMeshJobsService.getSummaryMeshJobs();
  10322. }
  10323. /**
  10324. * @function SuperMap.REST.ProcessingService.prototype.getSummaryMeshJob
  10325. * @description 获取某一个点聚合分析。
  10326. * @param {string} id - 空间分析的 id。
  10327. * @param {function} callback - 请求结果的回调函数。
  10328. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10329. */
  10330. }, {
  10331. key: "getSummaryMeshJob",
  10332. value: function getSummaryMeshJob(id, callback, resultFormat) {
  10333. var me = this,
  10334. format = me._processFormat(resultFormat);
  10335. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  10336. headers: me.headers,
  10337. proxy: me.proxy,
  10338. withCredentials: me.withCredentials,
  10339. crossOrigin: me.crossOrigin,
  10340. serverType: me.serverType,
  10341. eventListeners: {
  10342. scope: me,
  10343. processCompleted: callback,
  10344. processFailed: callback
  10345. },
  10346. format: format
  10347. });
  10348. summaryMeshJobsService.getSummaryMeshJob(id);
  10349. }
  10350. /**
  10351. * @function SuperMap.REST.ProcessingService.prototype.addSummaryMeshJob
  10352. * @description 新建一个点聚合分析。
  10353. * @param {SuperMap.SummaryMeshJobParameter} params - 点聚合分析任务参数类。
  10354. * @param {function} callback - 请求结果的回调函数。
  10355. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  10356. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10357. */
  10358. }, {
  10359. key: "addSummaryMeshJob",
  10360. value: function addSummaryMeshJob(params, callback, seconds, resultFormat) {
  10361. var me = this,
  10362. format = me._processFormat(resultFormat);
  10363. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  10364. headers: me.headers,
  10365. proxy: me.proxy,
  10366. withCredentials: me.withCredentials,
  10367. crossOrigin: me.crossOrigin,
  10368. eventListeners: {
  10369. scope: me,
  10370. processCompleted: callback,
  10371. processFailed: callback,
  10372. processRunning: function processRunning(job) {
  10373. me.summaryMeshJobs[job.id] = job.state;
  10374. }
  10375. },
  10376. format: format
  10377. });
  10378. summaryMeshJobsService.addSummaryMeshJob(params, seconds);
  10379. }
  10380. /**
  10381. * @function SuperMap.REST.ProcessingService.prototype.getSummaryMeshJobState
  10382. * @description 获取点聚合分析的状态。
  10383. * @param {string} id - 点聚合分析的 id。
  10384. * @returns {Object} 点聚合分析的状态。
  10385. */
  10386. }, {
  10387. key: "getSummaryMeshJobState",
  10388. value: function getSummaryMeshJobState(id) {
  10389. return this.summaryMeshJobs[id];
  10390. }
  10391. /**
  10392. * @function SuperMap.REST.ProcessingService.prototype.getQueryJobs
  10393. * @description 获取单对象查询分析的列表。
  10394. * @param {function} callback - 请求结果的回调函数。
  10395. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10396. */
  10397. }, {
  10398. key: "getQueryJobs",
  10399. value: function getQueryJobs(callback, resultFormat) {
  10400. var me = this,
  10401. format = me._processFormat(resultFormat);
  10402. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  10403. headers: me.headers,
  10404. proxy: me.proxy,
  10405. withCredentials: me.withCredentials,
  10406. crossOrigin: me.crossOrigin,
  10407. serverType: me.serverType,
  10408. eventListeners: {
  10409. scope: me,
  10410. processCompleted: callback,
  10411. processFailed: callback
  10412. },
  10413. format: format
  10414. });
  10415. singleObjectQueryJobsService.getQueryJobs();
  10416. }
  10417. /**
  10418. * @function SuperMap.REST.ProcessingService.prototype.getQueryJob
  10419. * @description 获取某一个单对象查询分析。
  10420. * @param {string} id - 空间分析的 id。
  10421. * @param {function} callback - 请求结果的回调函数。
  10422. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10423. */
  10424. }, {
  10425. key: "getQueryJob",
  10426. value: function getQueryJob(id, callback, resultFormat) {
  10427. var me = this,
  10428. format = me._processFormat(resultFormat);
  10429. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  10430. headers: me.headers,
  10431. proxy: me.proxy,
  10432. withCredentials: me.withCredentials,
  10433. crossOrigin: me.crossOrigin,
  10434. serverType: me.serverType,
  10435. eventListeners: {
  10436. scope: me,
  10437. processCompleted: callback,
  10438. processFailed: callback
  10439. },
  10440. format: format
  10441. });
  10442. singleObjectQueryJobsService.getQueryJob(id);
  10443. }
  10444. /**
  10445. * @function SuperMap.REST.ProcessingService.prototype.addQueryJob
  10446. * @description 新建一个单对象查询分析。
  10447. * @param {SuperMap.SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
  10448. * @param {function} callback - 请求结果的回调函数。
  10449. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  10450. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10451. */
  10452. }, {
  10453. key: "addQueryJob",
  10454. value: function addQueryJob(params, callback, seconds, resultFormat) {
  10455. var me = this,
  10456. param = me._processParams(params),
  10457. format = me._processFormat(resultFormat);
  10458. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  10459. headers: me.headers,
  10460. proxy: me.proxy,
  10461. withCredentials: me.withCredentials,
  10462. crossOrigin: me.crossOrigin,
  10463. eventListeners: {
  10464. scope: me,
  10465. processCompleted: callback,
  10466. processFailed: callback,
  10467. processRunning: function processRunning(job) {
  10468. me.queryJobs[job.id] = job.state;
  10469. }
  10470. },
  10471. format: format
  10472. });
  10473. singleObjectQueryJobsService.addQueryJob(param, seconds);
  10474. }
  10475. /**
  10476. * @function SuperMap.REST.ProcessingService.prototype.getQueryJobState
  10477. * @description 获取单对象查询分析的状态。
  10478. * @param {string} id - 单对象查询分析的 id。
  10479. * @returns {Object} 单对象查询分析的状态
  10480. */
  10481. }, {
  10482. key: "getQueryJobState",
  10483. value: function getQueryJobState(id) {
  10484. return this.queryJobs[id];
  10485. }
  10486. /**
  10487. * @function SuperMap.REST.ProcessingService.prototype.getSummaryRegionJobs
  10488. * @description 获取区域汇总分析的列表。
  10489. * @param {function} callback - 请求结果的回调函数。
  10490. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10491. */
  10492. }, {
  10493. key: "getSummaryRegionJobs",
  10494. value: function getSummaryRegionJobs(callback, resultFormat) {
  10495. var me = this,
  10496. format = me._processFormat(resultFormat);
  10497. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  10498. proxy: me.proxy,
  10499. headers: me.headers,
  10500. withCredentials: me.withCredentials,
  10501. crossOrigin: me.crossOrigin,
  10502. serverType: me.serverType,
  10503. eventListeners: {
  10504. scope: me,
  10505. processCompleted: callback,
  10506. processFailed: callback
  10507. },
  10508. format: format
  10509. });
  10510. summaryRegionJobsService.getSummaryRegionJobs();
  10511. }
  10512. /**
  10513. * @function SuperMap.REST.ProcessingService.prototype.getSummaryRegionJob
  10514. * @description 获取某一个区域汇总分析。
  10515. * @param {string} id - 区域汇总分析的 id。
  10516. * @param {function} callback - 请求结果的回调函数。
  10517. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10518. */
  10519. }, {
  10520. key: "getSummaryRegionJob",
  10521. value: function getSummaryRegionJob(id, callback, resultFormat) {
  10522. var me = this,
  10523. format = me._processFormat(resultFormat);
  10524. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  10525. proxy: me.proxy,
  10526. withCredentials: me.withCredentials,
  10527. crossOrigin: me.crossOrigin,
  10528. headers: me.headers,
  10529. serverType: me.serverType,
  10530. eventListeners: {
  10531. scope: me,
  10532. processCompleted: callback,
  10533. processFailed: callback
  10534. },
  10535. format: format
  10536. });
  10537. summaryRegionJobsService.getSummaryRegionJob(id);
  10538. }
  10539. /**
  10540. * @function SuperMap.REST.ProcessingService.prototype.addSummaryRegionJob
  10541. * @description 新建一个区域汇总分析。
  10542. * @param {SuperMap.SummaryRegionJobParameter} params -创建一个区域汇总分析的请求参数。
  10543. * @param {function} callback - 请求结果的回调函数。
  10544. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  10545. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10546. */
  10547. }, {
  10548. key: "addSummaryRegionJob",
  10549. value: function addSummaryRegionJob(params, callback, seconds, resultFormat) {
  10550. var me = this,
  10551. format = me._processFormat(resultFormat);
  10552. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  10553. proxy: me.proxy,
  10554. withCredentials: me.withCredentials,
  10555. crossOrigin: me.crossOrigin,
  10556. headers: me.headers,
  10557. eventListeners: {
  10558. scope: me,
  10559. processCompleted: callback,
  10560. processFailed: callback,
  10561. processRunning: function processRunning(job) {
  10562. me.summaryRegionJobs[job.id] = job.state;
  10563. }
  10564. },
  10565. format: format
  10566. });
  10567. summaryRegionJobsService.addSummaryRegionJob(params, seconds);
  10568. }
  10569. /**
  10570. * @function SuperMap.REST.ProcessingService.prototype.getSummaryRegionJobState
  10571. * @description 获取区域汇总分析的状态。
  10572. * @param {string} id - 区域汇总分析的 id。
  10573. * @returns {Object} 区域汇总分析的状态。
  10574. */
  10575. }, {
  10576. key: "getSummaryRegionJobState",
  10577. value: function getSummaryRegionJobState(id) {
  10578. return this.summaryRegionJobs[id];
  10579. }
  10580. /**
  10581. * @function SuperMap.REST.ProcessingService.prototype.getVectorClipJobs
  10582. * @description 获取矢量裁剪分析的列表。
  10583. * @param {function} callback - 请求结果的回调函数。
  10584. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10585. */
  10586. }, {
  10587. key: "getVectorClipJobs",
  10588. value: function getVectorClipJobs(callback, resultFormat) {
  10589. var me = this,
  10590. format = me._processFormat(resultFormat);
  10591. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  10592. proxy: me.proxy,
  10593. withCredentials: me.withCredentials,
  10594. crossOrigin: me.crossOrigin,
  10595. headers: me.headers,
  10596. serverType: me.serverType,
  10597. eventListeners: {
  10598. scope: me,
  10599. processCompleted: callback,
  10600. processFailed: callback
  10601. },
  10602. format: format
  10603. });
  10604. vectorClipJobsService.getVectorClipJobs();
  10605. }
  10606. /**
  10607. * @function SuperMap.REST.ProcessingService.prototype.getVectorClipJob
  10608. * @description 获取某一个矢量裁剪分析。
  10609. * @param {string} id - 空间分析的 id。
  10610. * @param {function} callback - 请求结果的回调函数。
  10611. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10612. */
  10613. }, {
  10614. key: "getVectorClipJob",
  10615. value: function getVectorClipJob(id, callback, resultFormat) {
  10616. var me = this,
  10617. format = me._processFormat(resultFormat);
  10618. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  10619. proxy: me.proxy,
  10620. withCredentials: me.withCredentials,
  10621. crossOrigin: me.crossOrigin,
  10622. headers: me.headers,
  10623. serverType: me.serverType,
  10624. eventListeners: {
  10625. scope: me,
  10626. processCompleted: callback,
  10627. processFailed: callback
  10628. },
  10629. format: format
  10630. });
  10631. vectorClipJobsService.getVectorClipJob(id);
  10632. }
  10633. /**
  10634. * @function SuperMap.REST.ProcessingService.prototype.addVectorClipJob
  10635. * @description 新建一个矢量裁剪分析。
  10636. * @param {SuperMap.VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  10637. * @param {function} callback - 请求结果的回调函数。
  10638. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  10639. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10640. */
  10641. }, {
  10642. key: "addVectorClipJob",
  10643. value: function addVectorClipJob(params, callback, seconds, resultFormat) {
  10644. var me = this,
  10645. param = me._processParams(params),
  10646. format = me._processFormat(resultFormat);
  10647. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  10648. proxy: me.proxy,
  10649. withCredentials: me.withCredentials,
  10650. crossOrigin: me.crossOrigin,
  10651. headers: me.headers,
  10652. serverType: me.serverType,
  10653. eventListeners: {
  10654. scope: me,
  10655. processCompleted: callback,
  10656. processFailed: callback,
  10657. processRunning: function processRunning(job) {
  10658. me.vectorClipJobs[job.id] = job.state;
  10659. }
  10660. },
  10661. format: format
  10662. });
  10663. vectorClipJobsService.addVectorClipJob(param, seconds);
  10664. }
  10665. /**
  10666. * @function SuperMap.REST.ProcessingService.prototype.getVectorClipJobState
  10667. * @description 获取矢量裁剪分析的状态。
  10668. * @param {string} id - 矢量裁剪分析的 id。
  10669. * @returns {Object} 矢量裁剪分析的状态。
  10670. */
  10671. }, {
  10672. key: "getVectorClipJobState",
  10673. value: function getVectorClipJobState(id) {
  10674. return this.vectorClipJobs[id];
  10675. }
  10676. /**
  10677. * @function SuperMap.REST.ProcessingService.prototype.getOverlayGeoJobs
  10678. * @description 获取叠加分析的列表。
  10679. * @param {function} callback - 请求结果的回调函数。
  10680. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10681. */
  10682. }, {
  10683. key: "getOverlayGeoJobs",
  10684. value: function getOverlayGeoJobs(callback, resultFormat) {
  10685. var me = this,
  10686. format = me._processFormat(resultFormat);
  10687. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  10688. proxy: me.proxy,
  10689. withCredentials: me.withCredentials,
  10690. crossOrigin: me.crossOrigin,
  10691. headers: me.headers,
  10692. serverType: me.serverType,
  10693. eventListeners: {
  10694. scope: me,
  10695. processCompleted: callback,
  10696. processFailed: callback
  10697. },
  10698. format: format
  10699. });
  10700. overlayGeoJobsService.getOverlayGeoJobs();
  10701. }
  10702. /**
  10703. * @function SuperMap.REST.ProcessingService.prototype.getOverlayGeoJob
  10704. * @description 获取某一个叠加分析。
  10705. * @param {string} id - 空间分析的 id。
  10706. * @param {function} callback - 请求结果的回调函数。
  10707. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10708. */
  10709. }, {
  10710. key: "getOverlayGeoJob",
  10711. value: function getOverlayGeoJob(id, callback, resultFormat) {
  10712. var me = this,
  10713. format = me._processFormat(resultFormat);
  10714. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  10715. proxy: me.proxy,
  10716. withCredentials: me.withCredentials,
  10717. crossOrigin: me.crossOrigin,
  10718. headers: me.headers,
  10719. serverType: me.serverType,
  10720. eventListeners: {
  10721. scope: me,
  10722. processCompleted: callback,
  10723. processFailed: callback
  10724. },
  10725. format: format
  10726. });
  10727. overlayGeoJobsService.getOverlayGeoJob(id);
  10728. }
  10729. /**
  10730. * @function SuperMap.REST.ProcessingService.prototype.addOverlayGeoJob
  10731. * @description 新建一个叠加分析。
  10732. * @param {SuperMap.OverlayGeoJobParameter} params - 创建一个空间分析的请求参数。
  10733. * @param {function} callback - 请求结果的回调函数。
  10734. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  10735. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10736. */
  10737. }, {
  10738. key: "addOverlayGeoJob",
  10739. value: function addOverlayGeoJob(params, callback, seconds, resultFormat) {
  10740. var me = this,
  10741. format = me._processFormat(resultFormat);
  10742. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  10743. proxy: me.proxy,
  10744. withCredentials: me.withCredentials,
  10745. crossOrigin: me.crossOrigin,
  10746. headers: me.headers,
  10747. serverType: me.serverType,
  10748. eventListeners: {
  10749. scope: me,
  10750. processCompleted: callback,
  10751. processFailed: callback,
  10752. processRunning: function processRunning(job) {
  10753. me.overlayGeoJobs[job.id] = job.state;
  10754. }
  10755. },
  10756. format: format
  10757. });
  10758. overlayGeoJobsService.addOverlayGeoJob(params, seconds);
  10759. }
  10760. /**
  10761. * @function SuperMap.REST.ProcessingService.prototype.getoverlayGeoJobState
  10762. * @description 获取叠加分析的状态。
  10763. * @param {string} id - 叠加分析的 id。
  10764. * @returns {Object} 叠加分析的状态。
  10765. */
  10766. }, {
  10767. key: "getoverlayGeoJobState",
  10768. value: function getoverlayGeoJobState(id) {
  10769. return this.overlayGeoJobs[id];
  10770. }
  10771. /**
  10772. * @function SuperMap.REST.ProcessingService.prototype.getBuffersJobs
  10773. * @description 获取缓冲区分析的列表。
  10774. * @param {function} callback - 请求结果的回调函数。
  10775. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10776. */
  10777. }, {
  10778. key: "getBuffersJobs",
  10779. value: function getBuffersJobs(callback, resultFormat) {
  10780. var me = this,
  10781. format = me._processFormat(resultFormat);
  10782. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  10783. proxy: me.proxy,
  10784. withCredentials: me.withCredentials,
  10785. crossOrigin: me.crossOrigin,
  10786. headers: me.headers,
  10787. serverType: me.serverType,
  10788. eventListeners: {
  10789. scope: me,
  10790. processCompleted: callback,
  10791. processFailed: callback
  10792. },
  10793. format: format
  10794. });
  10795. buffersAnalystJobsService.getBuffersJobs();
  10796. }
  10797. /**
  10798. * @function SuperMap.REST.ProcessingService.prototype.getBuffersJob
  10799. * @description 获取某一个缓冲区分析。
  10800. * @param {string} id - 空间分析的 id。
  10801. * @param {function} callback - 请求结果的回调函数。
  10802. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10803. */
  10804. }, {
  10805. key: "getBuffersJob",
  10806. value: function getBuffersJob(id, callback, resultFormat) {
  10807. var me = this,
  10808. format = me._processFormat(resultFormat);
  10809. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  10810. proxy: me.proxy,
  10811. withCredentials: me.withCredentials,
  10812. crossOrigin: me.crossOrigin,
  10813. headers: me.headers,
  10814. serverType: me.serverType,
  10815. eventListeners: {
  10816. scope: me,
  10817. processCompleted: callback,
  10818. processFailed: callback
  10819. },
  10820. format: format
  10821. });
  10822. buffersAnalystJobsService.getBuffersJob(id);
  10823. }
  10824. /**
  10825. * @function SuperMap.REST.ProcessingService.prototype.addBuffersJob
  10826. * @description 新建一个缓冲区分析。
  10827. * @param {SuperMap.BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  10828. * @param {function} callback - 请求结果的回调函数。
  10829. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  10830. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10831. */
  10832. }, {
  10833. key: "addBuffersJob",
  10834. value: function addBuffersJob(params, callback, seconds, resultFormat) {
  10835. var me = this,
  10836. format = me._processFormat(resultFormat);
  10837. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  10838. proxy: me.proxy,
  10839. withCredentials: me.withCredentials,
  10840. crossOrigin: me.crossOrigin,
  10841. headers: me.headers,
  10842. serverType: me.serverType,
  10843. eventListeners: {
  10844. scope: me,
  10845. processCompleted: callback,
  10846. processFailed: callback,
  10847. processRunning: function processRunning(job) {
  10848. me.buffersJobs[job.id] = job.state;
  10849. }
  10850. },
  10851. format: format
  10852. });
  10853. buffersAnalystJobsService.addBuffersJob(params, seconds);
  10854. }
  10855. /**
  10856. * @function SuperMap.REST.ProcessingService.prototype.getBuffersJobState
  10857. * @description 获取缓冲区分析的状态。
  10858. * @param {string} id - 缓冲区分析的 id。
  10859. * @returns {Object} 缓冲区分析的状态。
  10860. */
  10861. }, {
  10862. key: "getBuffersJobState",
  10863. value: function getBuffersJobState(id) {
  10864. return this.buffersJobs[id];
  10865. }
  10866. /**
  10867. * @function SuperMap.REST.ProcessingService.prototype.getTopologyValidatorJobs
  10868. * @description 获取拓扑检查分析的列表。
  10869. * @param {function} callback - 请求结果的回调函数。
  10870. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10871. */
  10872. }, {
  10873. key: "getTopologyValidatorJobs",
  10874. value: function getTopologyValidatorJobs(callback, resultFormat) {
  10875. var me = this,
  10876. format = me._processFormat(resultFormat);
  10877. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  10878. proxy: me.proxy,
  10879. withCredentials: me.withCredentials,
  10880. crossOrigin: me.crossOrigin,
  10881. headers: me.headers,
  10882. serverType: me.serverType,
  10883. eventListeners: {
  10884. scope: me,
  10885. processCompleted: callback,
  10886. processFailed: callback
  10887. },
  10888. format: format
  10889. });
  10890. topologyValidatorJobsService.getTopologyValidatorJobs();
  10891. }
  10892. /**
  10893. * @function SuperMap.REST.ProcessingService.prototype.getTopologyValidatorJob
  10894. * @description 获取某一个拓扑检查分析。
  10895. * @param {string} id - 空间分析的 id。
  10896. * @param {function} callback - 请求结果的回调函数。
  10897. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10898. */
  10899. }, {
  10900. key: "getTopologyValidatorJob",
  10901. value: function getTopologyValidatorJob(id, callback, resultFormat) {
  10902. var me = this,
  10903. format = me._processFormat(resultFormat);
  10904. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  10905. proxy: me.proxy,
  10906. withCredentials: me.withCredentials,
  10907. crossOrigin: me.crossOrigin,
  10908. headers: me.headers,
  10909. serverType: me.serverType,
  10910. eventListeners: {
  10911. scope: me,
  10912. processCompleted: callback,
  10913. processFailed: callback
  10914. },
  10915. format: format
  10916. });
  10917. topologyValidatorJobsService.getTopologyValidatorJob(id);
  10918. }
  10919. /**
  10920. * @function SuperMap.REST.ProcessingService.prototype.addTopologyValidatorJob
  10921. * @description 新建一个拓扑检查分析。
  10922. * @param {SuperMap.TopologyValidatorJobsParameter} params - 创建一个空间分析的请求参数。
  10923. * @param {function} callback - 请求结果的回调函数。
  10924. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  10925. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10926. */
  10927. }, {
  10928. key: "addTopologyValidatorJob",
  10929. value: function addTopologyValidatorJob(params, callback, seconds, resultFormat) {
  10930. var me = this,
  10931. format = me._processFormat(resultFormat);
  10932. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  10933. proxy: me.proxy,
  10934. withCredentials: me.withCredentials,
  10935. crossOrigin: me.crossOrigin,
  10936. headers: me.headers,
  10937. serverType: me.serverType,
  10938. eventListeners: {
  10939. scope: me,
  10940. processCompleted: callback,
  10941. processFailed: callback,
  10942. processRunning: function processRunning(job) {
  10943. me.topologyValidatorJobs[job.id] = job.state;
  10944. }
  10945. },
  10946. format: format
  10947. });
  10948. topologyValidatorJobsService.addTopologyValidatorJob(params, seconds);
  10949. }
  10950. /**
  10951. * @function SuperMap.REST.ProcessingService.prototype.getTopologyValidatorJobState
  10952. * @description 获取拓扑检查分析的状态。
  10953. * @param {string} id - 拓扑检查分析的 id。
  10954. * @returns {Object} 拓扑检查分析的状态。
  10955. */
  10956. }, {
  10957. key: "getTopologyValidatorJobState",
  10958. value: function getTopologyValidatorJobState(id) {
  10959. return this.topologyValidatorJobs[id];
  10960. }
  10961. /**
  10962. * @function SuperMap.REST.ProcessingService.prototype.getSummaryAttributesJobs
  10963. * @description 获取属性汇总分析的列表。
  10964. * @param {function} callback - 请求结果的回调函数。
  10965. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10966. */
  10967. }, {
  10968. key: "getSummaryAttributesJobs",
  10969. value: function getSummaryAttributesJobs(callback, resultFormat) {
  10970. var me = this,
  10971. format = me._processFormat(resultFormat);
  10972. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  10973. proxy: me.proxy,
  10974. withCredentials: me.withCredentials,
  10975. crossOrigin: me.crossOrigin,
  10976. headers: me.headers,
  10977. serverType: me.serverType,
  10978. eventListeners: {
  10979. scope: me,
  10980. processCompleted: callback,
  10981. processFailed: callback
  10982. },
  10983. format: format
  10984. });
  10985. summaryAttributesJobsService.getSummaryAttributesJobs();
  10986. }
  10987. /**
  10988. * @function SuperMap.REST.ProcessingService.prototype.getSummaryAttributesJob
  10989. * @description 获取某一个属性汇总分析。
  10990. * @param {string} id - 空间分析的 id。
  10991. * @param {function} callback - 请求结果的回调函数。
  10992. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  10993. */
  10994. }, {
  10995. key: "getSummaryAttributesJob",
  10996. value: function getSummaryAttributesJob(id, callback, resultFormat) {
  10997. var me = this,
  10998. format = me._processFormat(resultFormat);
  10999. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  11000. proxy: me.proxy,
  11001. withCredentials: me.withCredentials,
  11002. crossOrigin: me.crossOrigin,
  11003. headers: me.headers,
  11004. serverType: me.serverType,
  11005. eventListeners: {
  11006. scope: me,
  11007. processCompleted: callback,
  11008. processFailed: callback
  11009. },
  11010. format: format
  11011. });
  11012. summaryAttributesJobsService.getSummaryAttributesJob(id);
  11013. }
  11014. /**
  11015. * @function SuperMap.REST.ProcessingService.prototype.addSummaryAttributesJob
  11016. * @description 新建一个属性汇总分析。
  11017. * @param {SuperMap.SummaryAttributesJobsParameter} params - 创建一个空间分析的请求参数。
  11018. * @param {function} callback - 请求结果的回调函数。
  11019. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  11020. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  11021. */
  11022. }, {
  11023. key: "addSummaryAttributesJob",
  11024. value: function addSummaryAttributesJob(params, callback, seconds, resultFormat) {
  11025. var me = this,
  11026. format = me._processFormat(resultFormat);
  11027. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  11028. proxy: me.proxy,
  11029. withCredentials: me.withCredentials,
  11030. crossOrigin: me.crossOrigin,
  11031. headers: me.headers,
  11032. serverType: me.serverType,
  11033. eventListeners: {
  11034. scope: me,
  11035. processCompleted: callback,
  11036. processFailed: callback,
  11037. processRunning: function processRunning(job) {
  11038. me.summaryAttributesJobs[job.id] = job.state;
  11039. }
  11040. },
  11041. format: format
  11042. });
  11043. summaryAttributesJobsService.addSummaryAttributesJob(params, seconds);
  11044. }
  11045. /**
  11046. * @function SuperMap.REST.ProcessingService.prototype.getSummaryAttributesJobState
  11047. * @description 获取属性汇总分析的状态。
  11048. * @param {string} id - 属性汇总分析的 id。
  11049. * @returns {Object} 属性汇总分析的状态。
  11050. */
  11051. }, {
  11052. key: "getSummaryAttributesJobState",
  11053. value: function getSummaryAttributesJobState(id) {
  11054. return this.summaryAttributesJobs[id];
  11055. }
  11056. }, {
  11057. key: "_processFormat",
  11058. value: function _processFormat(resultFormat) {
  11059. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  11060. }
  11061. }, {
  11062. key: "_processParams",
  11063. value: function _processParams(params) {
  11064. if (!params) {
  11065. return {};
  11066. }
  11067. if (params.geometryQuery) {
  11068. params.geometryQuery = this._convertPatams(params.geometryQuery);
  11069. }
  11070. if (params.geometryClip) {
  11071. params.geometryClip = this._convertPatams(params.geometryClip);
  11072. }
  11073. return params;
  11074. }
  11075. }, {
  11076. key: "_convertPatams",
  11077. value: function _convertPatams(points) {
  11078. var geometryParam = {};
  11079. if (points.length < 1) {
  11080. geometryParam = "";
  11081. } else {
  11082. var results = [];
  11083. for (var i = 0; i < points.length; i++) {
  11084. var point = {};
  11085. point.x = points[i].x;
  11086. point.y = points[i].y;
  11087. results.push(point);
  11088. }
  11089. geometryParam.type = "REGION";
  11090. geometryParam.points = results;
  11091. }
  11092. return geometryParam;
  11093. }
  11094. }]);
  11095. return ProcessingService;
  11096. }(CommonServiceBase);
  11097. SuperMap_SuperMap.REST.ProcessingService = ProcessingService;
  11098. ;// CONCATENATED MODULE: ./src/classic/services/index.js
  11099. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11100. * This program are made available under the terms of the Apache License, Version 2.0
  11101. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11102. ;// CONCATENATED MODULE: ./src/classic/index.js
  11103. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11104. * This program are made available under the terms of the Apache License, Version 2.0
  11105. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11106. }();
  11107. /******/ })()
  11108. ;